about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-01-22 22:17:22 +0900
committersefidel <contact@sefidel.net>2022-01-22 22:17:22 +0900
commit220dde08b73ed0091fed2b5b5cefd59708366376 (patch)
treeae5ca3eb0bf264840fa433e34736a331682751c5
parent059b86f0e04f52b38331ab58b32092ecf6ef616c (diff)
downloadnixrc-220dde08b73ed0091fed2b5b5cefd59708366376.tar.gz
nixrc-220dde08b73ed0091fed2b5b5cefd59708366376.zip
flakes: pin registry and nix path
-rw-r--r--flake.lock54
-rw-r--r--flake.nix16
-rw-r--r--home/alpha/boopy.nix2
-rw-r--r--home/default.nix4
-rw-r--r--lib/home_configurations_as_packages.nix2
-rw-r--r--lib/nixos_configurations_as_packages.nix2
-rw-r--r--nixos/default.nix4
-rw-r--r--nixos/modules/flake.nix25
-rw-r--r--packages/default.nix2
9 files changed, 85 insertions, 26 deletions
diff --git a/flake.lock b/flake.lock
index 76d59e6..d116f27 100644
--- a/flake.lock
+++ b/flake.lock
@@ -5,7 +5,7 @@
         "flake-compat": "flake-compat",
         "flake-utils": "flake-utils",
         "nixpkgs": [
-          "nixpkgs"
+          "unstable-small"
         ]
       },
       "locked": {
@@ -87,7 +87,7 @@
     "home-manager": {
       "inputs": {
         "nixpkgs": [
-          "nixpkgs"
+          "unstable-small"
         ]
       },
       "locked": {
@@ -124,7 +124,7 @@
       "inputs": {
         "flake-utils": "flake-utils_3",
         "nixpkgs": [
-          "nixpkgs"
+          "unstable-small"
         ]
       },
       "locked": {
@@ -143,18 +143,18 @@
         "type": "github"
       }
     },
-    "nixpkgs": {
+    "nixpkgs-2111": {
       "locked": {
-        "lastModified": 1642780375,
-        "narHash": "sha256-1ahlRezQxn0NYUsRBcgUi6/jcE8wHrcqUXUlxBxbB0Q=",
+        "lastModified": 1642707142,
+        "narHash": "sha256-BzH6xhnkn52yF4+A8C8slWFQRMInS5VYlzrH/rN1bnA=",
         "owner": "nixos",
         "repo": "nixpkgs",
-        "rev": "a636af22955a8b556f65492ee37d6cc395fcfbd6",
+        "rev": "6f07605b6916abee5435ea1145a7541299a87c1b",
         "type": "github"
       },
       "original": {
         "owner": "nixos",
-        "ref": "nixos-unstable-small",
+        "ref": "nixos-21.11",
         "repo": "nixpkgs",
         "type": "github"
       }
@@ -182,16 +182,18 @@
         "home-manager": "home-manager",
         "master": "master",
         "neovim": "neovim",
-        "nixpkgs": "nixpkgs",
+        "nixpkgs-2111": "nixpkgs-2111",
         "phocus": "phocus",
         "sops-nix": "sops-nix",
+        "unstable": "unstable",
+        "unstable-small": "unstable-small",
         "wallpapers": "wallpapers"
       }
     },
     "sops-nix": {
       "inputs": {
         "nixpkgs": [
-          "nixpkgs"
+          "unstable-small"
         ]
       },
       "locked": {
@@ -208,6 +210,38 @@
         "type": "github"
       }
     },
+    "unstable": {
+      "locked": {
+        "lastModified": 1642635915,
+        "narHash": "sha256-vabPA32j81xBO5m3+qXndWp5aqepe+vu96Wkd9UnngM=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "6d8215281b2f87a5af9ed7425a26ac575da0438f",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "ref": "nixos-unstable",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "unstable-small": {
+      "locked": {
+        "lastModified": 1642819963,
+        "narHash": "sha256-pfd+ZKHj88jHtnRbLP/+uj3qNUjrkrQGRp9w3YKDzeQ=",
+        "owner": "nixos",
+        "repo": "nixpkgs",
+        "rev": "6631973f4502938ccfc75fe8b9d0a3259080d82d",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nixos",
+        "ref": "nixos-unstable-small",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
     "wallpapers": {
       "flake": false,
       "locked": {
diff --git a/flake.nix b/flake.nix
index 92ae9d9..940ffb6 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,30 +3,32 @@
 
   inputs = {
     # Flake inputs
-    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
+    unstable.url = "github:nixos/nixpkgs/nixos-unstable";
+    unstable-small.url = "github:nixos/nixpkgs/nixos-unstable-small";
+    nixpkgs-2111.url = "github:nixos/nixpkgs/nixos-21.11";
     master.url = "github:nixos/nixpkgs/master";
 
     home-manager.url = "github:nix-community/home-manager";
-    home-manager.inputs.nixpkgs.follows = "nixpkgs";
+    home-manager.inputs.nixpkgs.follows = "unstable-small";
 
     flake-utils.url = "github:numtide/flake-utils";
-    flake-utils.inputs.nixpkgs.follows = "nixpkgs";
+    flake-utils.inputs.nixpkgs.follows = "unstable-small";
 
     sops-nix.url = "github:Mic92/sops-nix";
-    sops-nix.inputs.nixpkgs.follows = "nixpkgs";
+    sops-nix.inputs.nixpkgs.follows = "unstable-small";
 
     neovim.url = "github:neovim/neovim?dir=contrib";
-    neovim.inputs.nixpkgs.follows = "nixpkgs";
+    neovim.inputs.nixpkgs.follows = "unstable-small";
 
     # https://github.com/NixOS/nix/pull/5342
     chaotic-nixpkgs.url = "git+https://git.sr.ht/~boppy/chaotic-nixpkgs?ref=main";
-    chaotic-nixpkgs.inputs.nixpkgs.follows = "nixpkgs";
+    chaotic-nixpkgs.inputs.nixpkgs.follows = "unstable-small";
 
     phocus = { url = "git+https://git.sr.ht/~boppy/phocus"; flake = false; };
     wallpapers = { url = "git+https://git.sr.ht/~boppy/wall?ref=main"; flake = false; };
   };
 
-  outputs = { self, nixpkgs, flake-utils, sops-nix, ... } @ inputs:
+  outputs = { self, ... } @ inputs:
     {
 
       nixosConfigurations = import ./nixos inputs;
diff --git a/home/alpha/boopy.nix b/home/alpha/boopy.nix
index 237eb11..d301409 100644
--- a/home/alpha/boopy.nix
+++ b/home/alpha/boopy.nix
@@ -1,4 +1,4 @@
-{ pkgs, nixpkgs, self, ... }:
+{ pkgs, ... }:
 
 {
   config = {
diff --git a/home/default.nix b/home/default.nix
index 0b213ae..f9cb94a 100644
--- a/home/default.nix
+++ b/home/default.nix
@@ -1,11 +1,11 @@
-{ self, nixpkgs, ... } @ inputs:
+{ self, unstable-small, ... } @ inputs:
 
 {
   "boopy@alpha" = self.lib.mkHome {
     username = "boopy";
     hostname = "alpha";
     system = "x86_64-linux";
-    pkgs = import nixpkgs { system = "x86_64-linux"; overlays = with inputs; [ chaotic-nixpkgs.overlay ]; };
+    pkgs = import unstable-small { system = "x86_64-linux"; overlays = with inputs; [ chaotic-nixpkgs.overlay ]; };
 
     extraModules = [
       ./profiles
diff --git a/lib/home_configurations_as_packages.nix b/lib/home_configurations_as_packages.nix
index 41fd7b4..2f6aa18 100644
--- a/lib/home_configurations_as_packages.nix
+++ b/lib/home_configurations_as_packages.nix
@@ -1,7 +1,7 @@
 { self, ... } @ inputs:
 
 let
-  pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
+  pkgs = import inputs.unstable-small { system = "x86_64-linux"; };
 
   inherit (pkgs.lib) genAttrs mapAttrs';
 
diff --git a/lib/nixos_configurations_as_packages.nix b/lib/nixos_configurations_as_packages.nix
index f257c6d..c761c3d 100644
--- a/lib/nixos_configurations_as_packages.nix
+++ b/lib/nixos_configurations_as_packages.nix
@@ -1,7 +1,7 @@
 { self, ... } @ inputs:
 
 let
-  pkgs = import inputs.nixpkgs { system = "x86_64-linux"; };
+  pkgs = import inputs.unstable-small { system = "x86_64-linux"; };
 
   inherit (pkgs.lib) genAttrs mapAttrs';
 
diff --git a/nixos/default.nix b/nixos/default.nix
index edf3622..dd1dd18 100644
--- a/nixos/default.nix
+++ b/nixos/default.nix
@@ -1,9 +1,9 @@
-{ self, nixpkgs, ... } @ inputs:
+{ self, unstable-small, ... } @ inputs:
 
 {
   alpha = self.lib.mkSystem {
     name = "alpha";
-    nixpkgs = nixpkgs;
+    nixpkgs = unstable-small;
     overlays = with inputs; [ chaotic-nixpkgs.overlay ];
     extraModules = [
       inputs.sops-nix.nixosModules.sops
diff --git a/nixos/modules/flake.nix b/nixos/modules/flake.nix
index a88f9d0..7dc405b 100644
--- a/nixos/modules/flake.nix
+++ b/nixos/modules/flake.nix
@@ -1,5 +1,11 @@
-{ config, pkgs, lib, ... }:
+{ config, pkgs, unstable, unstable-small, nixpkgs-2111, lib, ... }:
 
+let
+  base = "/etc/nixpkgs/channels";
+  nixpkgsPath = "${base}/nixpkgs";
+  nixpkgsUnstablePath = "${base}/nixpkgsUnstable";
+  nixpkgs2111Path = "${base}/nixpkgs2111";
+in
 {
   options.nix.flakes.enable = lib.mkEnableOption "nix flakes";
 
@@ -7,6 +13,23 @@
     nix = {
       package = pkgs.nixUnstable;
       experimentalFeatures = "nix-command flakes";
+
+      registry.nixpkgs.flake = unstable-small;
+      registry.nixpkgsUnstable.flake = unstable;
+      registry.nixpkgs2111.flake = nixpkgs-2111;
+
+      nixPath = [
+        "nixpkgs=${nixpkgsPath}"
+        "nixpkgsUnstable=${nixpkgsUnstablePath}"
+        "nixpkgs2111=${nixpkgs2111Path}"
+        "/nix/var/nix/profiles/per-user/root/channels"
+      ];
     };
+
+    systemd.tmpfiles.rules = [
+      "L+ ${nixpkgsPath}         - - - - ${unstable-small}"
+      "L+ ${nixpkgsUnstablePath} - - - - ${unstable}"
+      "L+ ${nixpkgs2111Path} - - - - ${nixpkgs-2111}"
+    ];
   };
 }
diff --git a/packages/default.nix b/packages/default.nix
index 6fdb89a..b908fc7 100644
--- a/packages/default.nix
+++ b/packages/default.nix
@@ -1,6 +1,6 @@
 { self, neovim, ... } @ inputs:
 let
-  pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux;
+  pkgs = inputs.unstable-small.legacyPackages.x86_64-linux;
 in
 {
   "neovim" = neovim.packages.x86_64-linux.neovim;