cleanup more nix code
This commit is contained in:
parent
3b7c72f326
commit
6b9fffb022
54 changed files with 49 additions and 96 deletions
12
machines/atlas.nix
Normal file
12
machines/atlas.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
machines.atlas = {
|
||||
arch = "x86_64-linux";
|
||||
|
||||
nixosModule.lab = {
|
||||
storage = {
|
||||
osDisk = "/dev/sda";
|
||||
dataPartition = "/dev/nvme0n1p1";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
41
machines/default.nix
Normal file
41
machines/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{ lib, ... }:
|
||||
let
|
||||
machineOpts = { config, ... }: {
|
||||
options = {
|
||||
arch = lib.mkOption {
|
||||
default = null;
|
||||
type = with lib.types; nullOr str;
|
||||
description = ''
|
||||
CPU architecture of this machine.
|
||||
'';
|
||||
};
|
||||
|
||||
isRaspberryPi = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
};
|
||||
|
||||
nixosModule = lib.mkOption {
|
||||
default = { ... }: { };
|
||||
type = lib.types.anything;
|
||||
description = ''
|
||||
Customized configuration for this machine in the form of a NixOS module.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./warwick.nix
|
||||
./atlas.nix
|
||||
./jefke.nix
|
||||
./lewis.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
machines = lib.mkOption {
|
||||
type = with lib.types; attrsOf (submodule machineOpts);
|
||||
};
|
||||
};
|
||||
}
|
14
machines/jefke.nix
Normal file
14
machines/jefke.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
machines.jefke = {
|
||||
arch = "x86_64-linux";
|
||||
|
||||
nixosModule.lab = {
|
||||
storage = {
|
||||
osDisk = "/dev/sda";
|
||||
dataPartition = "/dev/nvme0n1p1";
|
||||
};
|
||||
|
||||
k3s.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
15
machines/lewis.nix
Normal file
15
machines/lewis.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
machines.lewis = {
|
||||
arch = "x86_64-linux";
|
||||
|
||||
nixosModule.lab = {
|
||||
backups.enable = true;
|
||||
data-sharing.enable = true;
|
||||
|
||||
storage = {
|
||||
osDisk = "/dev/sda";
|
||||
dataPartition = "/dev/nvme0n1p1";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
10
machines/warwick.nix
Normal file
10
machines/warwick.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
machines.warwick = {
|
||||
arch = "aarch64-linux";
|
||||
isRaspberryPi = true;
|
||||
|
||||
nixosModule = {
|
||||
lab.monitoring.server.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
Reference in a new issue