-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
102 lines (97 loc) · 2.71 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
catppuccin.url = "github:catppuccin/nix";
manix = {
url = "github:nix-community/manix";
inputs.nixpkgs.follows = "nixpkgs";
};
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
ags = {
url = "github:Aylur/ags";
inputs.nixpkgs.follows = "nixpkgs";
};
vhap-compose-update = {
url = "git+https://foxlab.dev/vanutp/vhap-compose-update";
inputs.nixpkgs.follows = "nixpkgs";
};
pyproject-nix = {
url = "github:nix-community/pyproject.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
flake-utils,
pyproject-nix,
...
} @ inputs: let
mkSystem = import ./utils/mkSystem.nix inputs;
# https://stackoverflow.com/a/54505212
recursiveMerge = with builtins;
attrList: let
f = attrPath:
zipAttrsWith (
n: values:
if tail values == []
then head values
else if all isList values
then unique (concatLists values)
else if all isAttrs values
then f (attrPath ++ [n]) values
else last values
);
in
f [] attrList;
mkSystems = hostnames: recursiveMerge (map (hostname: mkSystem hostname) hostnames);
in
(mkSystems [
"dull-vessel"
"servers/sfer"
"servers/p1"
"servers/proxyfriend"
"servers/embassy"
"servers/collective"
])
// flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
pkgs-unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
packagesArgs = {inherit pkgs pkgs-unstable inputs;};
in {
formatter = pkgs.alejandra;
packages = import ./packages packagesArgs;
devShells.vhap = (import ./packages/vhap/pyproject.nix packagesArgs).shell;
});
}