-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
87 lines (77 loc) · 2.3 KB
/
flake.nix
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
inputs.nur.url = "github:nix-community/NUR";
inputs.nur-repo-override.url = "git+file:///home/ilya/nur-repository";
inputs.mozilla.url = "github:mozilla/nixpkgs-mozilla";
outputs = inputs: let
inherit (inputs.nixpkgs) lib;
hosts = [
{
hostname = "asus-x421da";
system = "x86_64-linux";
}
{
hostname = "ms-7c94";
system = "x86_64-linux";
}
{
hostname = "beelink-ser5";
system = "x86_64-linux";
}
];
forAllSystems = f: lib.genAttrs (lib.unique (map (host: host.system) hosts)) f;
forAllHosts = f: lib.listToAttrs (map (host: lib.nameValuePair host.hostname (f host)) hosts);
in (inputs: let
inherit (inputs) lib;
pkgs = forAllSystems (system: import inputs.nixpkgs.${system} {
inherit system;
config = {
allowUnfree = true;
oraclejdk.accept_license = true;
joypixels.acceptLicense = true;
};
overlays = [
(self: super: {
nur = import inputs.nur {
nurpkgs = super;
pkgs = super;
repoOverrides = {
ilya-fedin = import inputs.nur-repo-override {};
};
};
})
inputs.mozilla.overlays.firefox
];
});
in {
nixosConfigurations = forAllHosts ({ hostname, system }: lib.${system}.nixosSystem {
inherit system;
pkgs = pkgs.${system};
modules = [ ./configuration.nix ];
specialArgs = { inherit inputs system hostname; };
});
legacyPackages = pkgs;
}) (inputs // rec {
nixpkgs = forAllSystems (system: (import inputs.nixpkgs {
inherit system;
overlays = [];
}).applyPatches {
name = "nixpkgs";
src = inputs.nixpkgs;
patches = [ ./allow-no-password.patch ];
});
lib = forAllSystems (system: ((import (nixpkgs.${system} + "/flake.nix")).outputs {
self = nixpkgs.${system};
}).lib);
nur-no-pkgs = forAllSystems (system: import inputs.nur {
nurpkgs = import nixpkgs.${system} {
inherit system;
overlays = [];
};
repoOverrides = {
ilya-fedin = import inputs.nur-repo-override {};
};
});
});
}