mirror of
https://github.com/Swarsel/.dotfiles.git
synced 2025-12-06 00:57:22 +01:00
feat: add globals system
This commit is contained in:
parent
6cac368378
commit
2aa5e0095c
31 changed files with 833 additions and 528 deletions
75
modules/nixos/common/globals.nix
Normal file
75
modules/nixos/common/globals.nix
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{ lib, options, ... }:
|
||||
let
|
||||
inherit (lib)
|
||||
mkOption
|
||||
types
|
||||
;
|
||||
|
||||
in
|
||||
{
|
||||
options = {
|
||||
globals = mkOption {
|
||||
default = { };
|
||||
type = types.submodule {
|
||||
options = {
|
||||
root = {
|
||||
hashedPassword = mkOption {
|
||||
type = types.str;
|
||||
description = "My root user's password hash.";
|
||||
};
|
||||
};
|
||||
|
||||
myuser = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
description = "My unix username.";
|
||||
};
|
||||
hashedPassword = mkOption {
|
||||
type = types.str;
|
||||
description = "My unix password hash.";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
services = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.submodule {
|
||||
options = {
|
||||
domain = mkOption {
|
||||
type = types.str;
|
||||
description = "The domain under which this service can be reached";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
domains = {
|
||||
me = mkOption {
|
||||
type = types.str;
|
||||
description = "My main domain.";
|
||||
};
|
||||
|
||||
personal = mkOption {
|
||||
type = types.str;
|
||||
description = "My personal domain.";
|
||||
};
|
||||
};
|
||||
|
||||
macs = mkOption {
|
||||
default = { };
|
||||
type = types.attrsOf types.str;
|
||||
description = "Known MAC addresses for external devices.";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
_globalsDefs = mkOption {
|
||||
type = types.unspecified;
|
||||
default = options.globals.definitions;
|
||||
readOnly = true;
|
||||
internal = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue