Open h7x4 opened 2 years ago
Hi,
As far as I know, the path /manifest.json
is not copied to Home Manager's generated environment (a link farm of binaries, libraries, etc.) by default.
If we need to add restrictions to the content of the generated environment, then we would become dependent on the implementation details of nix profile
🙁.
Should the nix profile
cli check for the existence of this file before linking or should it be done by the users of nix profile
?
I think the first behavior makes more sense.
I recommend crosslinking this issue on the Nix tracker and providing a reproduction case.
@h7x4ABk3g Did you find a workaround to this?
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.
* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.
Is there an existing issue for this?
Issue description
My configuration is set up with a nix flake outputting all NixOS configurations, and home-manager embedded into the configurations through the home-manager NixOS module.
Upon adding some new packages to
home.packages
, I encountered this problem:Error output
``` warning: the following units failed: home-manager-h7x4.service × home-manager-h7x4.service - Home Manager environment for h7x4 Loaded: loaded (/etc/systemd/system/home-manager-h7x4.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2022-04-12 01:59:36 CEST; 17ms ago Process: 992009 ExecStart=/nix/store/kcqdnwk2lhg4mgbg5jcr1mjqwrnr4cpl-hm-setup-env /nix/store/70aqrydgrq2k7ksxv9nf7ai7izaz00dd-home-manager-generation (code=exited, status=1/FAILURE) Main PID: 992009 (code=exited, status=1/FAILURE) IP: 534B in, 309B out CPU: 149ms Apr 12 01:59:36 kasei hm-activate-h7x4[992200]: Perhaps there is a conflict with a package that was installed using Apr 12 01:59:36 kasei hm-activate-h7x4[992200]: 'nix-env -i'? Try running Apr 12 01:59:36 kasei hm-activate-h7x4[992200]: nix-env -q Apr 12 01:59:36 kasei hm-activate-h7x4[992200]: and if there is a conflicting package you can remove it with Apr 12 01:59:36 kasei hm-activate-h7x4[992200]: nix-env -e {package name} Apr 12 01:59:36 kasei hm-activate-h7x4[992200]: Then try activating your Home Manager configuration again. Apr 12 01:59:36 kasei systemd[1]: home-manager-h7x4.service: Main process exited, code=exited, status=1/FAILURE Apr 12 01:59:36 kasei systemd[1]: home-manager-h7x4.service: Failed with result 'exit-code'. Apr 12 01:59:36 kasei systemd[1]: Failed to start Home Manager environment for h7x4. Apr 12 01:59:36 kasei systemd[1]: home-manager-h7x4.service: Consumed 149ms CPU time, received 534B IP traffic, sent 309B IP traffic. warning: error(s) occurred while switching to the new configuration ```After messing around with nix-env and nix profile, i found the offending package to be
synapse-admin
. It exports a file calledmanifest.json
directly into the nix-profile root, which makes thenix profile
command crash with this error:I assume it confused
manifest.json
withmanifest.nix
.I was also unable to remove the package directly from the config and do a rebuild. I had to rollback to a generation without the package, and then do a rebuild.
Admittedly, I've found out that this is not the way to use the
synapse-admin
package, and its output should rather be mounted as the contents of a webserver. However, I think the error message should be improved. Or maybe it could be noted in some troubleshooting manual? I don't really know if this is the responsibility of home-manager or the nix tool, but I'm posting it here since it was the home-manager systemd service that failed.Maintainer CC
@rycee
System information