feat: disable nix channel

This commit is contained in:
Ryan Yin
2023-12-13 11:57:59 +08:00
parent 393338a23d
commit ca8f0dc166
3 changed files with 7 additions and 11 deletions

View File

@@ -23,9 +23,7 @@ in
{ {
# make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake.
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
# make `nix repl '<nixpkgs>'` use the same nixpkgs as the one used by this flake. nix.channel.enable = false; # disable nix-channel, we use flakes instead.
environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}";
nix.nixPath = ["/etc/nix/inputs"];
} }
] ++ (if (home-module != null) then [ ] ++ (if (home-module != null) then [
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager

View File

@@ -14,14 +14,15 @@ in
modules = modules =
darwin-modules darwin-modules
++ [ ++ [
{ ({lib, ...}: {
# make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake.
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
# make `nix repl '<nixpkgs>'` use the same nixpkgs as the one used by this flake.
environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}"; environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}";
nix.nixPath = ["/etc/nix/inputs"]; # make `nix repl '<nixpkgs>'` use the same nixpkgs as the one used by this flake.
} # discard all the default paths, and only use the one from this flake.
nix.nixPath = lib.mkForce ["/etc/nix/inputs"];
})
home-manager.darwinModules.home-manager home-manager.darwinModules.home-manager
{ {

View File

@@ -17,10 +17,7 @@ in
{ {
# make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake. # make `nix run nixpkgs#nixpkgs` use the same nixpkgs as the one used by this flake.
nix.registry.nixpkgs.flake = nixpkgs; nix.registry.nixpkgs.flake = nixpkgs;
nix.channel.enable = false; # disable nix-channel, we use flakes instead.
# make `nix repl '<nixpkgs>'` use the same nixpkgs as the one used by this flake.
environment.etc."nix/inputs/nixpkgs".source = "${nixpkgs}";
nix.nixPath = ["/etc/nix/inputs"];
} }
nixos-generators.nixosModules.all-formats nixos-generators.nixosModules.all-formats