refactor: schema
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
{
|
||||
cursor = {
|
||||
name = "phinger-cursors-light";
|
||||
packagePath = [ "phinger-cursors" ];
|
||||
size = 24;
|
||||
};
|
||||
|
||||
kanagawa = {
|
||||
displayName = "Kanagawa Wave";
|
||||
name = "kanagawa-wave";
|
||||
gtkThemeName = "Kanagawa-BL-LB";
|
||||
iconThemeName = "Kanagawa";
|
||||
owner = "Fausto-Korpsvart";
|
||||
repo = "Kanagawa-GKT-Theme";
|
||||
rev = "55ca4ba249eba21f861b9866b71ab41bb8930318";
|
||||
hash = "sha256-UdMoMx2DoovcxSp/zBZ3PRv/Qpj+prd0uPm1gmdak2E=";
|
||||
version = "unstable-2025-10-23";
|
||||
|
||||
palette = {
|
||||
background = "#1F1F28";
|
||||
foreground = "#DCD7BA";
|
||||
secondaryBackground = "#16161D";
|
||||
border = "#2A2A37";
|
||||
selectionBackground = "#2D4F67";
|
||||
selectionForeground = "#C8C093";
|
||||
url = "#72A7BC";
|
||||
cursor = "#C8C093";
|
||||
muted = "#727169";
|
||||
|
||||
accents = {
|
||||
blue = "#7E9CD8";
|
||||
green = "#98BB6C";
|
||||
magenta = "#D27E99";
|
||||
orange = "#FFA066";
|
||||
purple = "#957FB8";
|
||||
red = "#E82424";
|
||||
yellow = "#E6C384";
|
||||
cyan = "#7AA89F";
|
||||
};
|
||||
|
||||
niri.border = {
|
||||
active = "#7E9CD8";
|
||||
inactive = "#54546D";
|
||||
urgent = "#E82424";
|
||||
};
|
||||
|
||||
terminal = {
|
||||
color0 = "#16161D";
|
||||
color1 = "#C34043";
|
||||
color2 = "#76946A";
|
||||
color3 = "#C0A36E";
|
||||
color4 = "#7E9CD8";
|
||||
color5 = "#957FB8";
|
||||
color6 = "#6A9589";
|
||||
color7 = "#C8C093";
|
||||
color8 = "#727169";
|
||||
color9 = "#E82424";
|
||||
color10 = "#98BB6C";
|
||||
color11 = "#E6C384";
|
||||
color12 = "#7FB4CA";
|
||||
color13 = "#938AA9";
|
||||
color14 = "#7AA89F";
|
||||
color15 = "#DCD7BA";
|
||||
color16 = "#FFA066";
|
||||
color17 = "#FF5D62";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -16,7 +16,7 @@ in
|
||||
{
|
||||
imports = [ homeModules.browser-vivaldi ];
|
||||
|
||||
meta.desktop.browserCommand = lib.getExe (vivaldiPackage pkgs);
|
||||
facts.desktop.browserCommand = lib.getExe (vivaldiPackage pkgs);
|
||||
home.sessionVariables.BROWSER = lib.getExe (vivaldiPackage pkgs);
|
||||
xdg.mimeApps.defaultApplicationPackages = [ (vivaldiPackage pkgs) ];
|
||||
};
|
||||
@@ -32,7 +32,6 @@ in
|
||||
{
|
||||
imports = [ homeModules.file-manager-nautilus ];
|
||||
|
||||
meta.desktop.fileManagerCommand = lib.getExe (nautilusPackage pkgs);
|
||||
xdg.mimeApps.defaultApplicationPackages = [ (nautilusPackage pkgs) ];
|
||||
};
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ in
|
||||
...
|
||||
}:
|
||||
let
|
||||
machine = osConfig.meta.machine;
|
||||
machine = osConfig.facts.machine;
|
||||
allowedSignersFile = "${config.xdg.configHome}/git/allowed_signers";
|
||||
|
||||
mkScope =
|
||||
@@ -19,6 +19,7 @@ in
|
||||
email = account.emails.${scope}.address;
|
||||
key = lib.attrByPath [ scope ] null machine.sshKeys;
|
||||
hasSigningKey = key != null;
|
||||
privateKeyPath = key.privateKeyPath or "~/.ssh/id_${scope}";
|
||||
in
|
||||
{
|
||||
allowedSigners = lib.optional hasSigningKey "${email} ${key.publicKey}";
|
||||
@@ -28,7 +29,7 @@ in
|
||||
inherit email;
|
||||
}
|
||||
// lib.optionalAttrs hasSigningKey {
|
||||
signingKey = "${key.privateKeyPath}.pub";
|
||||
signingKey = "${privateKeyPath}.pub";
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs hasSigningKey {
|
||||
|
||||
@@ -160,8 +160,8 @@ in
|
||||
# Hostname/ConfigDir needed for nixd
|
||||
nixdExtras = {
|
||||
nixpkgs = "import ${pkgs.path} {}";
|
||||
nixos_options = ''(builtins.getFlake "path://${account.nixosConfigurationPath}").nixosConfigurations.${osConfig.meta.machine.name}.options'';
|
||||
home_manager_options = ''(builtins.getFlake "path://${account.nixosConfigurationPath}").nixosConfigurations.${osConfig.meta.machine.name}.options.home-manager.users.type.getSubOptions []'';
|
||||
nixos_options = ''(builtins.getFlake "path://${account.nixosConfigurationPath}").nixosConfigurations.${osConfig.facts.machine.name}.options'';
|
||||
home_manager_options = ''(builtins.getFlake "path://${account.nixosConfigurationPath}").nixosConfigurations.${osConfig.facts.machine.name}.options.home-manager.users.type.getSubOptions []'';
|
||||
};
|
||||
|
||||
themeSetup = import ./_kanagawa-theme.nix {
|
||||
|
||||
@@ -28,7 +28,7 @@ let
|
||||
text = lib.concatStringsSep "\n" [
|
||||
"# shellcheck disable=SC2016"
|
||||
"cd ${lib.escapeShellArg workdir}"
|
||||
"exec ${lib.escapeShellArg config.meta.desktop.terminalCommand} ${argString}"
|
||||
"exec ${lib.escapeShellArg config.facts.desktop.terminalCommand} ${argString}"
|
||||
];
|
||||
};
|
||||
in
|
||||
|
||||
@@ -51,6 +51,7 @@ in
|
||||
repo
|
||||
;
|
||||
};
|
||||
machine = osConfig.facts.machine;
|
||||
in
|
||||
{
|
||||
home = {
|
||||
@@ -70,27 +71,34 @@ in
|
||||
programs.niri.settings = {
|
||||
outputs = lib.mapAttrs (
|
||||
_: display:
|
||||
let
|
||||
scale = display.scale or null;
|
||||
width = display.width or null;
|
||||
height = display.height or null;
|
||||
refresh = display.refresh or null;
|
||||
in
|
||||
{
|
||||
position = {
|
||||
inherit (display) x y;
|
||||
x = display.x or 0;
|
||||
y = display.y or 0;
|
||||
};
|
||||
}
|
||||
// lib.optionalAttrs (display.primary or false) {
|
||||
"focus-at-startup" = true;
|
||||
}
|
||||
// lib.optionalAttrs (display.scale != null) {
|
||||
inherit (display) scale;
|
||||
// lib.optionalAttrs (scale != null) {
|
||||
inherit scale;
|
||||
}
|
||||
// lib.optionalAttrs (display.width != null && display.height != null && display.refresh != null) {
|
||||
// lib.optionalAttrs (width != null && height != null && refresh != null) {
|
||||
mode = {
|
||||
inherit (display)
|
||||
inherit
|
||||
width
|
||||
height
|
||||
refresh
|
||||
;
|
||||
};
|
||||
}
|
||||
) osConfig.meta.machine.displays;
|
||||
) (machine.displays or { });
|
||||
|
||||
environment.DISPLAY = ":0";
|
||||
spawn-at-startup = [
|
||||
@@ -156,9 +164,9 @@ in
|
||||
};
|
||||
|
||||
binds = import ./_bindings.nix {
|
||||
browserCommand = config.meta.desktop.browserCommand;
|
||||
launcherCommand = config.meta.desktop.launcherCommand;
|
||||
terminalCommand = config.meta.desktop.terminalCommand;
|
||||
browserCommand = config.facts.desktop.browserCommand;
|
||||
launcherCommand = config.facts.desktop.launcherCommand;
|
||||
terminalCommand = config.facts.desktop.terminalCommand;
|
||||
shortcutCommands = shortcuts.commands;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -71,7 +71,7 @@ in
|
||||
terminalCommand = lib.getExe pkgs.xdg-terminal-exec;
|
||||
};
|
||||
settings =
|
||||
if baseSettings == { } || !osConfig.meta.machine.portable then
|
||||
if baseSettings == { } || !(osConfig.facts.machine.portable or false) then
|
||||
baseSettings
|
||||
else
|
||||
mkPortableSettings baseSettings;
|
||||
|
||||
@@ -5,31 +5,23 @@
|
||||
let
|
||||
repo = config.repo;
|
||||
account = repo.account;
|
||||
homeModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
flake.modules.homeManager.pinentry =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
meta.pinentry.package = pkgs.pinentry-gnome3;
|
||||
};
|
||||
|
||||
flake.modules.homeManager.passwords =
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
pinentryPackage = pkgs.pinentry-gnome3;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
homeModules.pinentry
|
||||
];
|
||||
|
||||
programs.rbw = {
|
||||
enable = true;
|
||||
settings = {
|
||||
base_url = repo.services.vaultwarden.url;
|
||||
email = account.primaryEmail.address;
|
||||
pinentry = config.meta.pinentry.package;
|
||||
pinentry = pinentryPackage;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -17,7 +17,7 @@ in
|
||||
mkOffice365Account =
|
||||
{
|
||||
address,
|
||||
primary,
|
||||
primary ? false,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -37,7 +37,7 @@ in
|
||||
mkMxrouteAccount =
|
||||
{
|
||||
address,
|
||||
primary,
|
||||
primary ? false,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
@@ -5,6 +5,13 @@ let
|
||||
service = repo.services.actual;
|
||||
in
|
||||
{
|
||||
repo.services.actual = {
|
||||
domain = "finance.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 3000;
|
||||
url = "https://finance.jelles.net";
|
||||
};
|
||||
|
||||
flake.modules.nixos.actual =
|
||||
{ lib, ... }:
|
||||
lib.mkMerge [
|
||||
|
||||
@@ -5,6 +5,13 @@ let
|
||||
service = repo.services.gitea;
|
||||
in
|
||||
{
|
||||
repo.services.gitea = {
|
||||
domain = "git.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 3001;
|
||||
url = "https://git.jelles.net/";
|
||||
};
|
||||
|
||||
flake.modules.nixos.gitea =
|
||||
{ lib, ... }:
|
||||
lib.mkMerge [
|
||||
|
||||
@@ -3,8 +3,8 @@ let
|
||||
account = config.repo.account;
|
||||
personalPublicKeys =
|
||||
machines:
|
||||
map (machine: machine.sshKeys.personal.publicKey) (
|
||||
lib.filter (machine: machine.sshKeys ? personal) (builtins.attrValues machines)
|
||||
map (machine: (machine.sshKeys or { }).personal.publicKey) (
|
||||
lib.filter (machine: (machine.sshKeys or { }) ? personal) (builtins.attrValues machines)
|
||||
);
|
||||
in
|
||||
{
|
||||
|
||||
@@ -5,6 +5,13 @@ let
|
||||
service = repo.services.radicale;
|
||||
in
|
||||
{
|
||||
repo.services.radicale = {
|
||||
domain = "radicale.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 5232;
|
||||
url = "https://radicale.jelles.net/";
|
||||
};
|
||||
|
||||
flake.modules.nixos.radicale =
|
||||
{ lib, ... }:
|
||||
lib.mkMerge [
|
||||
|
||||
@@ -5,6 +5,13 @@ let
|
||||
service = repo.services.vaultwarden;
|
||||
in
|
||||
{
|
||||
repo.services.vaultwarden = {
|
||||
domain = "vault.jelles.net";
|
||||
host = "127.0.0.1";
|
||||
port = 8100;
|
||||
url = "https://vault.jelles.net";
|
||||
};
|
||||
|
||||
flake.modules.nixos.vaultwarden =
|
||||
{ lib, ... }:
|
||||
lib.mkMerge [
|
||||
|
||||
@@ -5,21 +5,26 @@
|
||||
}:
|
||||
let
|
||||
syncMachines = lib.listToAttrs (
|
||||
lib.concatMap (
|
||||
machine:
|
||||
lib.optional (machine.syncthingId != null) (
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (
|
||||
machineName: machine:
|
||||
let
|
||||
name = "${config.repo.account.name}@${machine.name}";
|
||||
syncthingId = machine.syncthingId or null;
|
||||
in
|
||||
lib.optional (syncthingId != null) (
|
||||
let
|
||||
name = "${config.repo.account.name}@${machineName}";
|
||||
in
|
||||
{
|
||||
inherit name;
|
||||
value = {
|
||||
inherit name;
|
||||
id = machine.syncthingId;
|
||||
id = syncthingId;
|
||||
};
|
||||
}
|
||||
)
|
||||
) (builtins.attrValues config.repo.machines)
|
||||
) config.repo.machines
|
||||
)
|
||||
);
|
||||
|
||||
syncPhones = {
|
||||
|
||||
@@ -175,7 +175,7 @@ in
|
||||
{
|
||||
imports = [ config.flake.modules.homeManager.terminal-foot ];
|
||||
|
||||
meta.desktop.terminalCommand = lib.getExe pkgs.foot;
|
||||
facts.desktop.terminalCommand = lib.getExe pkgs.foot;
|
||||
|
||||
xdg.terminal-exec = {
|
||||
enable = true;
|
||||
@@ -188,7 +188,7 @@ in
|
||||
{
|
||||
imports = [ config.flake.modules.homeManager.terminal-kitty ];
|
||||
|
||||
meta.desktop.terminalCommand = lib.getExe (kittySingleInstance pkgs);
|
||||
facts.desktop.terminalCommand = lib.getExe (kittySingleInstance pkgs);
|
||||
|
||||
xdg.terminal-exec = {
|
||||
enable = true;
|
||||
|
||||
@@ -8,6 +8,8 @@ let
|
||||
hmModules = config.flake.modules.homeManager;
|
||||
in
|
||||
{
|
||||
repo.theme = import ./_theme.nix;
|
||||
|
||||
flake.modules.nixos.theme =
|
||||
{
|
||||
pkgs,
|
||||
|
||||
@@ -73,6 +73,6 @@ in
|
||||
];
|
||||
};
|
||||
|
||||
meta.desktop.launcherCommand = lib.getExe config.programs.vicinae.package;
|
||||
facts.desktop.launcherCommand = lib.getExe config.programs.vicinae.package;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -35,6 +35,6 @@ in
|
||||
{
|
||||
imports = [ homeModules.walker-base ];
|
||||
|
||||
meta.desktop.launcherCommand = lib.getExe config.programs.walker.package;
|
||||
facts.desktop.launcherCommand = lib.getExe config.programs.walker.package;
|
||||
};
|
||||
}
|
||||
|
||||
+5
-100
@@ -1,8 +1,11 @@
|
||||
{
|
||||
repo = {
|
||||
account = {
|
||||
account = rec {
|
||||
name = "kiri";
|
||||
realName = "Jelle Spreeuwenberg";
|
||||
homeDirectory = "/home/${name}";
|
||||
nixosConfigurationPath = "${homeDirectory}/.config/nixos";
|
||||
|
||||
emails = {
|
||||
personal = {
|
||||
address = "mail@jelles.net";
|
||||
@@ -22,106 +25,8 @@
|
||||
type = "office365";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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 = {
|
||||
cursor = {
|
||||
name = "phinger-cursors-light";
|
||||
packagePath = [ "phinger-cursors" ];
|
||||
size = 24;
|
||||
};
|
||||
|
||||
kanagawa = {
|
||||
displayName = "Kanagawa Wave";
|
||||
name = "kanagawa-wave";
|
||||
gtkThemeName = "Kanagawa-BL-LB";
|
||||
iconThemeName = "Kanagawa";
|
||||
owner = "Fausto-Korpsvart";
|
||||
repo = "Kanagawa-GKT-Theme";
|
||||
rev = "55ca4ba249eba21f861b9866b71ab41bb8930318";
|
||||
hash = "sha256-UdMoMx2DoovcxSp/zBZ3PRv/Qpj+prd0uPm1gmdak2E=";
|
||||
version = "unstable-2025-10-23";
|
||||
|
||||
palette = {
|
||||
background = "#1F1F28";
|
||||
foreground = "#DCD7BA";
|
||||
secondaryBackground = "#16161D";
|
||||
border = "#2A2A37";
|
||||
selectionBackground = "#2D4F67";
|
||||
selectionForeground = "#C8C093";
|
||||
url = "#72A7BC";
|
||||
cursor = "#C8C093";
|
||||
muted = "#727169";
|
||||
|
||||
accents = {
|
||||
blue = "#7E9CD8";
|
||||
green = "#98BB6C";
|
||||
magenta = "#D27E99";
|
||||
orange = "#FFA066";
|
||||
purple = "#957FB8";
|
||||
red = "#E82424";
|
||||
yellow = "#E6C384";
|
||||
cyan = "#7AA89F";
|
||||
};
|
||||
|
||||
niri.border = {
|
||||
active = "#7E9CD8";
|
||||
inactive = "#54546D";
|
||||
urgent = "#E82424";
|
||||
};
|
||||
|
||||
terminal = {
|
||||
color0 = "#16161D";
|
||||
color1 = "#C34043";
|
||||
color2 = "#76946A";
|
||||
color3 = "#C0A36E";
|
||||
color4 = "#7E9CD8";
|
||||
color5 = "#957FB8";
|
||||
color6 = "#6A9589";
|
||||
color7 = "#C8C093";
|
||||
color8 = "#727169";
|
||||
color9 = "#E82424";
|
||||
color10 = "#98BB6C";
|
||||
color11 = "#E6C384";
|
||||
color12 = "#7FB4CA";
|
||||
color13 = "#938AA9";
|
||||
color14 = "#7AA89F";
|
||||
color15 = "#DCD7BA";
|
||||
color16 = "#FFA066";
|
||||
color17 = "#FF5D62";
|
||||
};
|
||||
};
|
||||
};
|
||||
primaryEmail = emails.personal;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
systems = [ "x86_64-linux" ];
|
||||
|
||||
flake.nixosConfigurations = builtins.mapAttrs (
|
||||
_: machine:
|
||||
name: machine:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [ (config.repo.helpers.mkHost machine) ];
|
||||
modules = [ (config.repo.helpers.mkHost name machine) ];
|
||||
}
|
||||
) config.repo.machines;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ in
|
||||
syncthingId = "NNRNQKZ-OWPHSVA-B6KKBHE-SDYLSTV-7SVHGPR-NEWLKPL-4MWNJG4-G5FHUAI";
|
||||
|
||||
stateVersion = "24.05";
|
||||
hmStateVersion = "24.05";
|
||||
};
|
||||
|
||||
flake.modules.nixos.orion =
|
||||
|
||||
@@ -16,7 +16,6 @@ in
|
||||
syncthingId = "6HBAKXB-DB3B4H2-BODCAXF-KD23H5W-6X5LGLC-ZJHZHLG-7U7YMGO-BB6IXQ3";
|
||||
|
||||
stateVersion = "24.05";
|
||||
hmStateVersion = "24.05";
|
||||
|
||||
displays = {
|
||||
"LG Electronics LG ULTRAGEAR 103NTYT8R290" = {
|
||||
|
||||
@@ -28,7 +28,6 @@ in
|
||||
};
|
||||
|
||||
stateVersion = "24.05";
|
||||
hmStateVersion = "24.05";
|
||||
};
|
||||
|
||||
flake.modules.nixos.zenith =
|
||||
|
||||
+16
-13
@@ -37,26 +37,35 @@ let
|
||||
};
|
||||
|
||||
mkHost =
|
||||
machine:
|
||||
name: machine:
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
account = config.repo.account;
|
||||
accountHome = account.homeDirectory or "/home/${account.name}";
|
||||
normalizedMachine = machine // {
|
||||
inherit name;
|
||||
displays = machine.displays or { };
|
||||
hmStateVersion = machine.hmStateVersion or machine.stateVersion;
|
||||
portable = machine.portable or false;
|
||||
sshKeys = machine.sshKeys or { };
|
||||
syncthingId = machine.syncthingId or null;
|
||||
};
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
nixosModules.${machine.name}
|
||||
nixosModules.${name}
|
||||
];
|
||||
|
||||
meta.machine = machine;
|
||||
facts.machine = normalizedMachine;
|
||||
|
||||
networking.hostName = machine.name;
|
||||
networking.hostName = name;
|
||||
system.stateVersion = machine.stateVersion;
|
||||
|
||||
programs.zsh.enable = true;
|
||||
|
||||
users.users.${account.name} = {
|
||||
isNormalUser = true;
|
||||
home = account.homeDirectory;
|
||||
home = accountHome;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"networkmanager"
|
||||
@@ -67,19 +76,13 @@ let
|
||||
home-manager.users.${account.name} = {
|
||||
home = {
|
||||
username = account.name;
|
||||
homeDirectory = account.homeDirectory;
|
||||
stateVersion = machine.hmStateVersion;
|
||||
homeDirectory = accountHome;
|
||||
stateVersion = normalizedMachine.hmStateVersion;
|
||||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
options.repo.helpers = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.raw;
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
};
|
||||
|
||||
config.repo.helpers = {
|
||||
inherit
|
||||
mkCaddyReverseProxy
|
||||
|
||||
+19
-207
@@ -1,221 +1,33 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
emailProviderType = lib.types.enum [
|
||||
"mxrouting"
|
||||
"office365"
|
||||
];
|
||||
|
||||
emailType = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
address = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
primary = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
type = lib.mkOption {
|
||||
type = emailProviderType;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
sshKeyType = lib.types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
options = {
|
||||
publicKey = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
privateKeyPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "~/.ssh/id_${name}";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
accountType = lib.types.submodule (
|
||||
{ config, ... }:
|
||||
{
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
realName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
homeDirectory = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/home/${config.name}";
|
||||
};
|
||||
|
||||
nixosConfigurationPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "${config.homeDirectory}/.config/nixos";
|
||||
};
|
||||
|
||||
emails = lib.mkOption {
|
||||
type = lib.types.attrsOf emailType;
|
||||
default = { };
|
||||
};
|
||||
|
||||
primaryEmail = lib.mkOption {
|
||||
type = lib.types.nullOr emailType;
|
||||
description = "Derived primary email entry for this user.";
|
||||
default =
|
||||
let
|
||||
emails = builtins.attrValues config.emails;
|
||||
in
|
||||
lib.findFirst (email: email.primary) null emails;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
displayType = lib.types.submodule (
|
||||
{ ... }:
|
||||
{
|
||||
options = {
|
||||
primary = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
x = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
};
|
||||
|
||||
y = lib.mkOption {
|
||||
type = lib.types.int;
|
||||
default = 0;
|
||||
};
|
||||
|
||||
scale = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.float;
|
||||
default = null;
|
||||
};
|
||||
|
||||
width = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
|
||||
height = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.int;
|
||||
default = null;
|
||||
};
|
||||
|
||||
refresh = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.float;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
machineType = lib.types.submodule (
|
||||
{ name, config, ... }:
|
||||
{
|
||||
options = {
|
||||
name = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = name;
|
||||
};
|
||||
|
||||
stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
hmStateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = config.stateVersion;
|
||||
};
|
||||
|
||||
displays = lib.mkOption {
|
||||
type = lib.types.attrsOf displayType;
|
||||
default = { };
|
||||
};
|
||||
|
||||
sshKeys = lib.mkOption {
|
||||
type = lib.types.attrsOf sshKeyType;
|
||||
default = { };
|
||||
};
|
||||
|
||||
syncthingId = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
};
|
||||
|
||||
portable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
{
|
||||
options.repo = {
|
||||
account = lib.mkOption {
|
||||
type = accountType;
|
||||
};
|
||||
options.repo = lib.mkOption {
|
||||
type = lib.types.submodule {
|
||||
freeformType = lib.types.attrsOf lib.types.anything;
|
||||
|
||||
machines = lib.mkOption {
|
||||
type = lib.types.attrsOf machineType;
|
||||
options.helpers = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.raw;
|
||||
default = { };
|
||||
internal = true;
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
};
|
||||
|
||||
services = lib.mkOption {
|
||||
type = lib.types.raw;
|
||||
default = { };
|
||||
};
|
||||
|
||||
theme = lib.mkOption {
|
||||
type = lib.types.raw;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config.flake.modules.nixos.meta =
|
||||
{ ... }:
|
||||
config.flake.modules.nixos.facts =
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.meta.machine = lib.mkOption {
|
||||
type = machineType;
|
||||
options.facts.machine = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
config.flake.modules.homeManager.meta =
|
||||
{ ... }:
|
||||
config.flake.modules.homeManager.facts =
|
||||
{ lib, ... }:
|
||||
{
|
||||
options.meta.desktop.browserCommand = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
options.meta.desktop.fileManagerCommand = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
options.meta.desktop.terminalCommand = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
options.meta.desktop.launcherCommand = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
};
|
||||
|
||||
options.meta.pinentry.package = lib.mkOption {
|
||||
type = lib.types.package;
|
||||
options.facts.desktop = lib.mkOption {
|
||||
type = lib.types.attrsOf lib.types.anything;
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ in
|
||||
{
|
||||
flake.modules.nixos.host-base = {
|
||||
imports = [
|
||||
nixosModules.meta
|
||||
nixosModules.facts
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
nixosModules.nix
|
||||
nixosModules.locale-nl
|
||||
@@ -22,7 +22,7 @@ in
|
||||
backupFileExtension = "bak";
|
||||
extraSpecialArgs = { inherit inputs; };
|
||||
sharedModules = [
|
||||
hmModules.meta
|
||||
hmModules.facts
|
||||
hmModules.syncthing
|
||||
hmModules.shell
|
||||
hmModules.neovim
|
||||
|
||||
Reference in New Issue
Block a user