mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-06-08 18:09:06 +02:00
Refactoring of the machines
This commit is contained in:
parent
4841bdf10f
commit
b9f3d8f46c
5 changed files with 97 additions and 11 deletions
43
lib/luj.nix
Normal file
43
lib/luj.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
lib: with lib; let
|
||||
modules = [
|
||||
{
|
||||
options.machines = mkOption {
|
||||
description = "My machines";
|
||||
type = with types; attrsOf (submodule ({ name, ... }: {
|
||||
freeformType = attrs;
|
||||
options = {
|
||||
hostname = mkOption {
|
||||
description = "The machine's hostname";
|
||||
type = str;
|
||||
default = name;
|
||||
readOnly = true;
|
||||
};
|
||||
};
|
||||
}));
|
||||
default = {};
|
||||
};
|
||||
|
||||
config = {
|
||||
_module.freeformType = with types; attrs;
|
||||
|
||||
domain = "julienmalka.me";
|
||||
|
||||
machines = {
|
||||
lisa = {
|
||||
arch = "x86_64-linux";
|
||||
};
|
||||
newton = {
|
||||
arch = "x86_64-linux";
|
||||
};
|
||||
macintosh = {
|
||||
arch = "x86_64-linux";
|
||||
};
|
||||
lambda = {
|
||||
arch = "aarch64-linux";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
in (evalModules { inherit modules; }).config
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue