-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
134 lines (128 loc) · 3.57 KB
/
flake.nix
File metadata and controls
134 lines (128 loc) · 3.57 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-25.11";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:nixos/nixos-hardware";
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.darwin.follows = "";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
pwndbg = {
url = "github:pwndbg/pwndbg";
inputs.nixpkgs.follows = "nixpkgs";
};
copyparty = {
url = "github:9001/copyparty";
inputs.nixpkgs.follows = "nixpkgs";
};
winapps = {
url = "github:winapps-org/winapps";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
nixpkgs-stable,
home-manager,
nixos-hardware,
nix-index-database,
agenix,
rust-overlay,
copyparty,
winapps,
...
}@inputs:
let
user = "filipe";
userFullName = "Filipe Ligeiro Silva";
mkHost =
hostname:
{
system ? "x86_64-linux",
headless ? false,
extraModules ? [ ],
extraArgs ? { },
}:
nixpkgs.lib.nixosSystem {
modules = [
./hosts/${hostname}/configuration.nix
home-manager.nixosModules.home-manager
nix-index-database.nixosModules.nix-index
agenix.nixosModules.default
copyparty.nixosModules.default
{
system.stateVersion = "23.11";
networking.hostName = hostname;
nixpkgs = {
hostPlatform = system;
overlays = [
(final: _prev: {
stable = import nixpkgs-stable {
inherit (final) system config;
};
})
rust-overlay.overlays.default
copyparty.overlays.default
];
};
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
environment.systemPackages = [ agenix.packages.${system}.default ];
age.identityPaths = [ "/home/${user}/.ssh/id_ed25519" ];
}
]
++ extraModules;
specialArgs = {
inherit
inputs
headless
user
userFullName
;
}
// extraArgs;
};
in
{
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt;
nixosConfigurations = {
Y540 = mkHost "Y540" {
extraModules = [ nixos-hardware.nixosModules.lenovo-legion-y530-15ich ];
};
T490 = mkHost "T490" {
extraModules = [ nixos-hardware.nixosModules.lenovo-thinkpad-t490 ];
};
N100 = mkHost "N100" {
headless = true;
extraArgs = {
dataPool = rec {
name = "data";
location = "/mnt/${name}";
drives = [
"/dev/disk/by-id/ata-ST8000VN004-3CP101_WRQ01QF2"
"/dev/disk/by-id/ata-ST8000VN004-3CP101_WWZ3T73R"
];
};
};
extraModules = [ copyparty.nixosModules.default ];
};
};
};
}