blob: 7dc405bc0867975a83684c81dc9c35505f95afe0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
{ 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";
config = lib.mkIf config.nix.flakes.enable {
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}"
];
};
}
|