diff --git a/lib/colmenaSystem.nix b/lib/colmenaSystem.nix index fa8ad22a..f08e2221 100644 --- a/lib/colmenaSystem.nix +++ b/lib/colmenaSystem.nix @@ -19,19 +19,6 @@ in imports = nixos-modules - ++ [ - { - # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. - nix.registry.nixpkgs.flake = nixpkgs; - nix.channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead. - - # but NIX_PATH is still used by many useful tools, so we set it to the same value as the one used by this flake. - # Make `nix repl ''` use the same nixpkgs as the one used by this flake. - environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}"; - nix.settings.nix-path = nixpkgs.lib.mkForce "nixpkgs=/etc/nix/inputs/nixpkgs"; - environment.sessionVariables.NIX_PATH = nixpkgs.lib.mkForce "nixpkgs=/etc/nix/inputs/nixpkgs"; - } - ] ++ ( if (home-module != null) then [ diff --git a/lib/nixosSystem.nix b/lib/nixosSystem.nix index ef7f7f68..0e2aee24 100644 --- a/lib/nixosSystem.nix +++ b/lib/nixosSystem.nix @@ -14,18 +14,6 @@ in modules = nixos-modules ++ [ - { - # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. - nix.registry.nixpkgs.flake = nixpkgs; - nix.channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead. - - # but NIX_PATH is still used by many useful tools, so we set it to the same value as the one used by this flake. - # Make `nix repl ''` use the same nixpkgs as the one used by this flake. - environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}"; - nix.settings.nix-path = nixpkgs.lib.mkForce "nixpkgs=/etc/nix/inputs/nixpkgs"; - environment.sessionVariables.NIX_PATH = nixpkgs.lib.mkForce "nixpkgs=/etc/nix/inputs/nixpkgs"; - } - nixos-generators.nixosModules.all-formats { # formatConfigs.iso = {config, ...}: {}; diff --git a/modules/nixos/base/nix.nix b/modules/nixos/base/nix.nix new file mode 100644 index 00000000..1afb6bec --- /dev/null +++ b/modules/nixos/base/nix.nix @@ -0,0 +1,11 @@ +{lib, nixpkgs, ...}: { + # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. + nix.registry.nixpkgs.flake = nixpkgs; + nix.channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead. + + # but NIX_PATH is still used by many useful tools, so we set it to the same value as the one used by this flake. + # Make `nix repl ''` use the same nixpkgs as the one used by this flake. + environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}"; + # https://github.com/NixOS/nix/issues/9574 + nix.settings.nix-path = lib.mkForce "nixpkgs=/etc/nix/inputs/nixpkgs"; +}