Getting error "does not provide attribute" when following your book
t1endat opened this issue · comments
I'm trying go through your tutorial about enabling Flakes in NixOS, and unfortunately, i get this error when try to run command : sudo nixos-rebuild switch
Error details:
error: flake 'path:/etc/nixos' does not provide attribute 'packages.x86_64-linux.nixosConfigurations."nixos".config.system.build.nixos-rebuild', 'legacyPackages.x86_64-linux.nixosConfigurations."nixos".config.system.build.nixos-rebuild' or 'nixosConfigurations."nixos".config.system.build.nixos-rebuild'
I'm not trying to change anything beyond your instructions to avoid errors, what am I missing?
So do you have /etc/nixos/configuration.nix
and /etc/nixos/flake.nix
on your NixOS host, and what're their contents?
I just figure out the solution based on your comment, instead run sudo nixos-rebuild switch
, i have to run sudo nixos-rebuild switch --flake /etc/nixos#nixos-test
Oh got it, your hostname isn't nixos-test
, I overlooked that.
Fixed, thanks for your feedback!