I’m still new to NixOS and am getting used to everything. I have a laptop and desktop both running NixOS but they have slightly different configs, at the moment, mostly nvidia vs intel specific changes.
I ran sudo ln -s ~/nixos-config/ /etc/nixos
I have my configuration.nix, flake.lock, flake.nix, and my system specific file defiant-configuration.nix in ~/nixos-config and I have setup a git repo.
When I run nixos-rebuild build --flake . I get the following error,
error: getting status of '/nix/store/lkw0z9fjb39zxv1dvim38qj2zkqd6s76-source/defiant-configuration.nix': No such file or directory
If I remove the symlink and put everything back in /etc/nixos however everything seems to work fine and if alternatively I use an absolute path in my flake.nix file and run with --impure, it also seems to work fine. I suppose I could run --impure, however I am concerned that is not best practice. Is there something I am missing here to accomplish this properly?
My flake.nix (it only includes the one machine for now)
{
description = "Nixos config flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, ... }@inputs: {
nixosConfigurations.defiant = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
modules = [
./configuration.nix
./defiant-configuration.nix
];
};
};
}