Having the ‘flake.nix’ file:
{
description = "My first flake!";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager/master";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {self, nixpkgs, home-manager, ... }:
let
lib = nixpkgs.lib;
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
nixosConfigurations = {
nixbox-stable-01 = lib.nixosSystem {
inherit system;
modules = [
./configuration.nix
# adding new file here causes problem
./graphical.nix
./host-nixbox-stable-01.nix
];
};
};
homeConfigurations = {
chris = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ ./home.nix ];
};
};
};
}
Executing the command
sudo nixos-rebuild switch --flake .
works fine, until I add a new file to the modules section in nixosConfigurations. I then get the error
error: getting status of '/nix/store/jwjl7ivjcfiv7jw8rq2hb5nadywgdxi7-source/graphical.nix': No such file or directory
Any suggestions on what I’m doing wrong here?
Thanks!