Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system.copySystemConfiguration is not supported with flakes #40

Closed
R0b0ty opened this issue Jul 30, 2023 · 3 comments
Closed

system.copySystemConfiguration is not supported with flakes #40

R0b0ty opened this issue Jul 30, 2023 · 3 comments

Comments

@R0b0ty
Copy link

R0b0ty commented Jul 30, 2023

First of all, thank you for sharing this with the community, especially a total NixOS beginner like me.

I'm running nix (Nix) 2.13.3, Stable. I believe I followed the instructions pertaining to the Minimal version, but obtained a Failed assertions error, as shown below. You'll note that I modified the various, required files to include my personal info (as stated in the instructions). I must have done something wrong, however. Also note that I did not have Home Manager enabled prior to following these instructions (don't know if that plays a role in the error). Can you please help?

nix-config on  master [+] 
❯ git status
On branch master

No commits yet

Changes to be committed:
  (use "git rm --cached <file>..." to unstage)
	new file:   flake.lock
	new file:   flake.nix
	new file:   home-manager/home.nix
	new file:   nixos/configuration.nix
	new file:   nixos/hardware-configuration.nix


nix-config on  master [+] 
❯ sudo nixos-rebuild switch --flake .#fastnix
warning: Git tree '/home/r0b0ty/Projects/nix-config' is dirty
building the system configuration...
warning: Git tree '/home/r0b0ty/Projects/nix-config' is dirty
error:
       Failed assertions:
       - system.copySystemConfiguration is not supported with flakes
(use '--show-trace' to show detailed location information)
@Misterio77
Copy link
Owner

Hi! Thanks for your kind words, I'm glad that this project is useful to you :D

So, the problem is your config has a system.copySystemConfiguration = true somewhere. This option is not compatible with flakes, as it relies on NIXOS_PATH, which is impure. Just set it to false (the default) and it should work :)

If you have a specific use-case that requires this feature, let me know and I can perhaps point you to an equivalent that works with flakes.

Cheers

@R0b0ty
Copy link
Author

R0b0ty commented Jul 31, 2023

You were spot on, thanks! I got a perfect rebuild after commenting that line out.

As I mentioned in the beginning, I didn't have Home Manager installed and configured, so I had to go to the Home Manager Manual. I figured that since your sample flake.nix file included a homeConfigurations section, and a mention of it was in the instructions, that it was expected. Maybe other noobs like me would benefit from mentioning the link above. Apart from that, everything was just great. Once again, thank you very much for sharing!

@Misterio77
Copy link
Owner

Hey! Marking this as completed it's been addressed (a shell command is provided on the readme for getting home-manager). If anyone else faces this, do feel free to comment or reopen :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants