ryan4yin / nixos-and-flakes-book

:hammer_and_wrench: :heart: Want to know NixOS & Flakes in detail? Looking for a beginner-friendly tutorial? Then you've come to the right place! 想要学习使用 NixOS 与 Flakes 吗?在寻找一份新手友好的教程?那你可来对地方了!

Home Page:https://nixos-and-flakes.thiscute.world

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Following the section on home-manager, and getting into problems

henrik-ch opened this issue · comments

Firstly, thank you for the fanstastic resource, super helpful for anyone who wants to get into running nixos.

I have arrived at the https://nixos-and-flakes.thiscute.world/nixos-with-flakes/start-using-home-manager page.

My setup isn't 100% the same as yours, but hopefully not so different that it matters a great deal.

Firstly I attach the working files - with no home manager - it is commented out from the flake.nix
my_working_files.tar.gz

Then I attach the non-working files - with the home.nix added - and the flake.nix home-manager part no longer commented out.
my_not_working_files.tar.gz

This is the result when building the non-working flake version:

[henrik@nixos:/etc/nixos]$ sudo nixos-rebuild switch
building the system configuration...
trace: warning: lib.modules.defaultPriority is deprecated, please use lib.modules.defaultOverridePriority instead.
error: builder for '/nix/store/fxp01cvac4c8lwd11b3acrcyibk6qcwm-options.json.drv' failed with exit code 1;
       last 5 log lines:
       > Traceback (most recent call last):
       >   File "/nix/store/4b5nzglksisqssvhh8xpq2fcv7n6xcc0-docbookify-options-json.py", line 66, in <module>
       >     class Renderer(mistune.renderers.BaseRenderer):
       >                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       > AttributeError: module 'mistune.renderers' has no attribute 'BaseRenderer'
       For full logs, run 'nix log /nix/store/fxp01cvac4c8lwd11b3acrcyibk6qcwm-options.json.drv'.
error: 1 dependencies of derivation '/nix/store/gyzd1iqc6qa3nffpfx16a08l6rypj6qn-options-db.xml.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jyc243yxzyk40px7qs9y7g8f35vgsgkp-nmd-documents.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mps59nkvj9qn0qq4jlm2dfv4gf75pzwh-manual-combined.drv' failed to build
error: 1 dependencies of derivation '/nix/store/afxgajx4cqhvy3hkrx3c3511rcn4wb4k-man-pages.drv' failed to build
error: 1 dependencies of derivation '/nix/store/hqyj6p36k4kxiygx6p9i5vy1whxrjyaj-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/nj2jv8lvlmfm6wj4840ikw44nh2facqh-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/1smd8k6l9my7q152n6hgwwqd87icm1mm-user-environment.drv' failed to build
error: 1 dependencies of derivation '/nix/store/m8516f1fg2cpn08ls7j975kn0nminhml-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/cwpi9j1q1s3i9prf4ryqrr5xp3ijmm0l-nixos-system-nixos-23.11.20231024.8efd5d1.drv' failed to build

It seems to be an issue with the home-manager switch, but I am not sure how I can delve deeper into this - can I somehow build the home-manager part separately and try to debug it, or any other advice or suggestions that you may have would be greatly appreciated.

[henrik@nixos:/etc/nixos]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.59, NixOS, 23.11 (Tapir), 23.11.20231024.8efd5d1`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.17.1`
 - channels(root): `"home-manager-23.05.tar.gz, nixos-23.05"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Tried a different version, that also didn't work - not including the home.nix file.

same or similar error message.

also_not_working_files.tar.gz

henrik@nixos:/etc/nixos]$ sudo nixos-rebuild switch
building the system configuration...
trace: warning: lib.modules.defaultPriority is deprecated, please use lib.modules.defaultOverridePriority instead.
error: builder for '/nix/store/fxp01cvac4c8lwd11b3acrcyibk6qcwm-options.json.drv' failed with exit code 1;
       last 5 log lines:
       > Traceback (most recent call last):
       >   File "/nix/store/4b5nzglksisqssvhh8xpq2fcv7n6xcc0-docbookify-options-json.py", line 66, in <module>
       >     class Renderer(mistune.renderers.BaseRenderer):
       >                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       > AttributeError: module 'mistune.renderers' has no attribute 'BaseRenderer'
       For full logs, run 'nix log /nix/store/fxp01cvac4c8lwd11b3acrcyibk6qcwm-options.json.drv'.
error: 1 dependencies of derivation '/nix/store/gyzd1iqc6qa3nffpfx16a08l6rypj6qn-options-db.xml.drv' failed to build
error: 1 dependencies of derivation '/nix/store/jyc243yxzyk40px7qs9y7g8f35vgsgkp-nmd-documents.drv' failed to build
error: 1 dependencies of derivation '/nix/store/mps59nkvj9qn0qq4jlm2dfv4gf75pzwh-manual-combined.drv' failed to build
error: 1 dependencies of derivation '/nix/store/afxgajx4cqhvy3hkrx3c3511rcn4wb4k-man-pages.drv' failed to build
error: 1 dependencies of derivation '/nix/store/vdyh6wdqvv2f644w242sb971b0s5vsqm-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/a3ngakv1vj4m3v4k1s00458ww2i7l132-home-manager-generation.drv' failed to build
error: 1 dependencies of derivation '/nix/store/k2qgpa37mdpmhjfssd5ickpni6s2vs5l-unit-home-manager-henrik.service.drv' failed to build
error: 1 dependencies of derivation '/nix/store/pxh15s9vjkgx25m6dsry9s2kh59dsj59-system-units.drv' failed to build
error: 1 dependencies of derivation '/nix/store/m1rmsy923by9s077fdn050xq3zzix46f-etc.drv' failed to build
error: 1 dependencies of derivation '/nix/store/sgyvhm0w1wccmfznrvabyhs5jzp4c3m5-nixos-system-nixos-23.11.20231024.8efd5d1.drv' failed to build

[henrik@nixos:/etc/nixos]$ 

Found this github issue - and it solved my issue:
NixOS/nixpkgs#256705

The mistake I did was in the flake.nix file.

I originally put:
home-manager.url = "github:nix-community/home-manager/release-23.05";

and when I changed it to
home-manager.url = "github:nix-community/home-manager/master";

that solved the problem.