diff options
author | sefidel <contact@sefidel.net> | 2022-01-22 22:17:22 +0900 |
---|---|---|
committer | sefidel <contact@sefidel.net> | 2022-01-22 22:17:22 +0900 |
commit | 220dde08b73ed0091fed2b5b5cefd59708366376 (patch) | |
tree | ae5ca3eb0bf264840fa433e34736a331682751c5 /nixos/modules/flake.nix | |
parent | 059b86f0e04f52b38331ab58b32092ecf6ef616c (diff) | |
download | nixrc-220dde08b73ed0091fed2b5b5cefd59708366376.tar.gz nixrc-220dde08b73ed0091fed2b5b5cefd59708366376.zip |
flakes: pin registry and nix path
Diffstat (limited to 'nixos/modules/flake.nix')
-rw-r--r-- | nixos/modules/flake.nix | 25 |
1 files changed, 24 insertions, 1 deletions
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}" + ]; }; } |