wip(home): refactor home modules *WILL NOT BUILD*

This commit is contained in:
ooks-io 2024-06-04 21:19:35 +12:00
parent 2033810429
commit 6a591ecbf7
115 changed files with 1028 additions and 791 deletions

View file

@ -19,6 +19,16 @@ in
default = "zsh";
description = "The login shell of the primary user";
};
gitName = mkOption {
type = types.str;
default = "ooks-io";
description = "Github username of admin";
};
gitEmail = mkOption {
type = types.str;
default = "ooks@protonmail.com";
description = "Github email of admin";
};
sshKey = mkOption {
type = types.str;
default = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBn3ff3HaZHIyH4K13k8Mwqu/o7jIABJ8rANK+r2PfJk";

View file

@ -4,5 +4,6 @@
./gpu
./features
./common.nix
./monitors.nix
];
}

View file

@ -0,0 +1,62 @@
{ lib, config, ... }:
let
inherit (lib) mkOption types;
cfg = config.ooknet.host.hardware.monitors;
in
{
options.ooknet.host.hardware.monitors = mkOption {
type = types.listOf (types.submodule {
options = {
name = mkOption {
type = types.str;
example = "DP-1";
};
primary = mkOption {
type = types.bool;
default = false;
};
width = mkOption {
type = types.int;
example = 1920;
};
height = mkOption {
type = types.int;
example = 1080;
};
refreshRate = mkOption {
type = types.int;
default = 60;
};
x = mkOption {
type = types.int;
default = 0;
};
y = mkOption {
type = types.int;
default = 0;
};
transform = mkOption {
type = types.int;
default = 0;
};
enabled = mkOption {
type = types.bool;
default = true;
};
workspace = mkOption {
type = types.nullOr types.str;
default = null;
};
};
});
default = [ ];
};
config = {
assertions = [{
assertion = ((lib.length cfg) != 0) ->
((lib.length (lib.filter (m: m.primary) cfg)) == 1);
message = "Exactly one monitor must be set to primary.";
}];
};
}