-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
139 lines (130 loc) · 3.69 KB
/
flake.nix
File metadata and controls
139 lines (130 loc) · 3.69 KB
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{
description = "NixOS configuration";
# use a released version
inputs = {
nixpkgs.url = "nixpkgs/nixos-25.11";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
nixos-sbc = {
url = "github:nakato/nixos-sbc/main";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs-unstable";
proxy-in-anger.url = "git+https://tangled.org/directxman12.dev/proxy-in-anger?ref=main";
proxy-in-anger.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, nixos-hardware, nixpkgs-unstable, lanzaboote, nixos-sbc, proxy-in-anger, ... }@attrs:
let
system = "x86_64-linux";
overlays = {
unstable-with-sway = final: prev: {
unstable = import nixpkgs-unstable {
system = "${prev.system}";
config.allowUnfreePredicate = final.config.allowUnfreePredicate ;
# overlay for using unstable-sway in sway-and-friends
overlays = [ attrs.nixpkgs-wayland.overlay ];
};
};
unstable-only = final: prev: {
unstable = import nixpkgs-unstable {
system = "${prev.system}";
config.allowUnfreePredicate = final.config.allowUnfreePredicate;
};
};
};
mkSystem = {
name,
modules ? [],
extra ? {},
cfg ? {},
unstable ? false,
}: (if unstable then nixpkgs-unstable else nixpkgs).lib.nixosSystem {
inherit system;
modules = [
./modules/utils/allowedUnfree-polyfill.nix
./modules/common
./modules/user-facing
./modules/servers
./modules/cache
./shared-modules/serving
./shared-modules/kanidm
./shared-modules/copyparty
./systems/${name}
({ config, ... }: { config.local.unstable = unstable; })
({ ... }: { networking.hostName = name; })
({ config, pkgs, lib, ... }: {
config.nixpkgs.overlays = lib.mkMerge [
(lib.mkIf config.local.userFacing [ overlays.unstable-with-sway ])
(lib.mkIf (!config.local.userFacing) [ overlays.unstable-only ])
[
# TODO: is there a better way to do this? maybe the overlays output?
(final: prev: {
proxy-in-anger = proxy-in-anger.packages.${prev.stdenv.hostPlatform.system}.default;
})
]
];
})
({ ... }: cfg)
] ++ modules;
} // extra;
in rec {
# yasamin
nixosConfigurations.yasamin = mkSystem {
name = "yasamin";
modules = [
nixos-hardware.nixosModules.lenovo-thinkpad-x1-9th-gen
];
cfg = {
local.userFacing = true;
};
};
nixosConfigurations.yasamin-print = nixosConfigurations.yasamin // {
modules = nixpkgs.lib.mkAfter [
({ pkgs, ... }: {
services.printing.enable = true;
# enable wifi printing
services.avahi = {
enable = true;
nssmdns = true;
openFirewall = true;
};
})
];
};
# music.devices
nixosConfigurations.music = mkSystem {
name = "music";
cfg = {
local.userFacing = false;
local.networking = "systemd";
local.cache.enable = true;
};
};
# sanctuary-router
nixosConfigurations.sanctuary-router = mkSystem {
name = "sanctuary-router";
unstable = true;
modules = [
nixos-sbc.nixosModules.default
nixos-sbc.nixosModules.boards.bananapi.bpir4
nixos-sbc.nixosModules.cache
./modules/router
];
cfg = {
local.userFacing = false;
local.uefi = false;
local.networking = "systemd";
local.cache.enable = true;
};
};
nixosModules.default.imports = [
./shared-modules/serving
./shared-modules/kanidm
./shared-modules/copyparty
];
};
}