-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
128 lines (124 loc) · 3.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
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
{
description = "Flake for building and deploying Raspberry Pi devices and bufflehead";
inputs = {
nixpkgs = {
# unstable¬
# url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.0.tar.gz";
# stable¬
url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
determinate = {
url = "https://flakehub.com/f/DeterminateSystems/determinate/0.1";
};
deploy-rs = {
url = "github:serokell/deploy-rs";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ self
, determinate
, nixpkgs
, home-manager
, deploy-rs
,
}: rec {
opts = ({ config, pkgs, lib, ... }:
{
options = with lib; with types; {
hostname = mkOption { type = str; };
# default is bash
# FIXME: for some reason I can't set this in common.nix
shell = mkOption { type = str; };
};
config = { };
});
nixosConfigurations = {
bufflehead = nixpkgs.lib.nixosSystem {
modules = [
./bufflehead.nix
determinate.nixosModules.default
];
};
zero2w = nixpkgs.lib.nixosSystem {
modules = [
opts
{
hostname = "nemo";
shell = "bash";
}
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
./common.nix
./zero2w.nix
];
};
zeroCool2w = nixpkgs.lib.nixosSystem {
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
./common.nix
./zeroCool2w.nix
];
};
pi3Bplus = nixpkgs.lib.nixosSystem {
modules = [
opts
{
hostname = "nintendo";
shell = "zsh";
}
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
./common.nix
./pi3Bplus.nix
];
};
pi4B = nixpkgs.lib.nixosSystem {
modules = [
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
./common.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.rjpc = import ./home.nix;
}
./pi4B.nix
];
};
};
deploy = {
user = "root";
nodes = {
bufflehead = {
hostname = "bufflehead";
profiles.system.path =
deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.bufflehead;
};
zero2w = {
hostname = "nemo";
profiles.system.path =
deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.zero2w;
};
zeroCool2w = {
hostname = "zerocool";
profiles.system.path =
deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.zeroCool2w;
};
pi3Bplus = {
hostname = "nintendo";
profiles.system.path =
deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.pi3Bplus;
};
pi4B = {
hostname = "madison";
profiles.system.path =
deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.pi4B;
};
};
};
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
};
}