-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
138 lines (122 loc) · 3.45 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
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
{
description = "Workstation flake";
inputs = {
# Pins for system packages
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixos-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixpkgs-wordpress.url = "github:NixOS/nixpkgs";
neovim-flake.url = "github:johnalotoski/neovim-flake";
# Pins for user packages
nixpkgs-user.url = "github:NixOS/nixpkgs/nixos-24.11";
nixos-user-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-user-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# System inputs
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
nix.url = "github:NixOS/nix/2.25-maintenance";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# Misc sw inputs
capkgs.url = "github:input-output-hk/capkgs";
cardano-node = {
url = "github:input-output-hk/cardano-node/10.1.3";
flake = false;
};
};
outputs = {
self,
nixpkgs,
...
}: let
system = "x86_64-linux";
localOverlay = import ./nix/overlay.nix self;
overlays = [localOverlay];
baseModules = [(_: {nixpkgs.overlays = overlays;})];
in {
nixosConfigurations = {
# Machines: `nixos-rebuild [switch|boot|...] [-L] [-v] [--flake .#$MACHINE]`
# -----
nixos-serval = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit self;};
modules =
baseModules
++ [
./machines/machine-serval.nix
];
};
nixos-g76 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit self;};
modules =
baseModules
++ [
./machines/machine-g76.nix
];
};
nixos-p71 = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit self;};
modules =
baseModules
++ [
./machines/machine-p71.nix
];
};
# Machine vms for testing: `nixos-rebuild build-vm [-L] [-v] [--flake .#$MACHINE]`
# -----
nixos-serval-vm = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit self;};
modules =
baseModules
++ [
./machines/machine-serval.nix
./modules/build-vm.nix
];
};
nixos-g76-vm = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit self;};
modules =
baseModules
++ [
./machines/machine-g76.nix
./modules/build-vm.nix
];
};
nixos-p71-vm = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit self;};
modules =
baseModules
++ [
./machines/machine-p71.nix
./modules/build-vm.nix
];
};
# ISOs:
# Build: `nix build [-L] [-v] .#nixosConfigurations.$ISO.config.system.build.isoImage`
# Copy to USB: `dd if=$(fd -e iso . result/iso) of=/dev/sda status=progress`
# -----
airgapped = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit self;};
modules =
baseModules
++ [
./iso/airgapped.nix
];
};
};
};
}