refactor
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
factsOption = lib.mkOption {
|
||||
type = lib.types.submodule {
|
||||
freeformType = lib.types.attrsOf lib.types.anything;
|
||||
};
|
||||
default = { };
|
||||
};
|
||||
in
|
||||
{
|
||||
options.facts = factsOption;
|
||||
|
||||
config = {
|
||||
facts = {
|
||||
account = rec {
|
||||
name = "kiri";
|
||||
realName = "Jelle Spreeuwenberg";
|
||||
homeDirectory = "/home/${name}";
|
||||
nixosConfigurationPath = "${homeDirectory}/.config/nixos";
|
||||
|
||||
emails = {
|
||||
personal = {
|
||||
address = "mail@jelles.net";
|
||||
primary = true;
|
||||
type = "mxrouting";
|
||||
};
|
||||
old = {
|
||||
address = "mail@jellespreeuwenberg.nl";
|
||||
type = "mxrouting";
|
||||
};
|
||||
uni = {
|
||||
address = "j.spreeuwenberg@student.tue.nl";
|
||||
type = "office365";
|
||||
};
|
||||
work = {
|
||||
address = "jelle.spreeuwenberg@yookr.org";
|
||||
type = "office365";
|
||||
};
|
||||
};
|
||||
|
||||
primaryEmail = emails.personal;
|
||||
};
|
||||
|
||||
services = {
|
||||
actual = {
|
||||
domain = "finance.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 3000;
|
||||
url = "https://finance.jelles.net";
|
||||
};
|
||||
gitea = {
|
||||
domain = "git.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 3001;
|
||||
url = "https://git.jelles.net/";
|
||||
};
|
||||
radicale = {
|
||||
domain = "radicale.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 5232;
|
||||
url = "https://radicale.jelles.net/";
|
||||
};
|
||||
vaultwarden = {
|
||||
domain = "vault.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 8100;
|
||||
url = "https://vault.jelles.net";
|
||||
};
|
||||
};
|
||||
|
||||
theme = import ./capabilities/_theme.nix;
|
||||
};
|
||||
|
||||
flake.modules.nixos.facts = { lib, ... }: {
|
||||
options.facts = factsOption;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.facts =
|
||||
{
|
||||
lib,
|
||||
osConfig ? { },
|
||||
...
|
||||
}:
|
||||
{
|
||||
options.facts = factsOption;
|
||||
|
||||
config.facts = lib.optionalAttrs (osConfig ? facts) {
|
||||
inherit (osConfig.facts)
|
||||
account
|
||||
machine
|
||||
machines
|
||||
services
|
||||
theme
|
||||
;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user