nix: always set registry.nixpkgs
authorJulien Moutinho <julm+julm-nix@sourcephile.fr>
Wed, 1 May 2024 17:53:26 +0000 (19:53 +0200)
committerJulien Moutinho <julm+julm-nix@sourcephile.fr>
Wed, 1 May 2024 17:53:26 +0000 (19:53 +0200)
nixos/profiles/builder.nix
nixos/profiles/system.nix

index 3c7375c7418a0d09eb0c2c28f3af3f16e5bf8d31..5b3ecd01fbcfa3ff16c16d8a837e12a09bee87c0 100644 (file)
@@ -2,17 +2,6 @@
 {
   nix.settings.experimental-features = [ "nix-command" "flakes" "repl-flake" ];
   #nix.registry.self.flake = inputs.self;
-  # Pin the rev to the revision of the public Nixpkgs that the system was built from.
-  # This is the version which will be locked by flakes using flake:nixpkgs
-  nix.registry.nixpkgs = {
-    from = { id = "nixpkgs"; type = "indirect"; };
-    to = {
-      owner = "NixOS";
-      repo = "nixpkgs";
-      inherit (inputs.nixpkgs) rev;
-      type = "github";
-    };
-  };
   nix.nixPath = [
     "nixpkgs=${inputs.nixpkgs}"
   ];
index b987a3460e2f4484a8847e8d2c072df19eaec097..446c483fea66169492974cb49fe8cbb145adb5f7 100644 (file)
@@ -36,7 +36,18 @@ with lib;
     gc.dates = mkDefault "weekly";
     gc.options = mkDefault "--delete-older-than 7d";
     nixPath = mkForce [ ];
+    # Pin the rev to the revision of the public Nixpkgs that the system was built from.
+    # This is the version which will be locked by flakes using flake:nixpkgs
     #registry.nixpkgs = mkDefault { flake = inputs.nixpkgs; };
+    registry.nixpkgs = {
+      from = { id = "nixpkgs"; type = "indirect"; };
+      to = {
+        owner = "NixOS";
+        repo = "nixpkgs";
+        inherit (inputs.nixpkgs) rev;
+        type = "github";
+      };
+    };
     package = pkgs.nixFlakes;
     settings.experimental-features = [ "nix-command" "flakes" "repl-flake" ];
   };