mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 23:11:34 +01:00
Rename the namespace of the system-modules
This commit is contained in:
parent
61f32cb7ea
commit
06623cd93a
34 changed files with 162 additions and 153 deletions
|
|
@ -1,15 +1,16 @@
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
inherit (config) myConfig;
|
inherit (config.custom) services;
|
||||||
inherit (config.myConfig.tailscale) caddyServe;
|
inherit (config.custom.services.tailscale) caddyServe;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
|
|
||||||
myConfig = {
|
custom = {
|
||||||
boot.loader.systemdBoot.enable = true;
|
boot.loader.systemdBoot.enable = true;
|
||||||
sops.enable = true;
|
sops.enable = true;
|
||||||
|
|
||||||
|
services = {
|
||||||
tailscale = {
|
tailscale = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
|
|
@ -23,15 +24,15 @@ in
|
||||||
caddyServe = {
|
caddyServe = {
|
||||||
nextcloud = {
|
nextcloud = {
|
||||||
subdomain = "cloud";
|
subdomain = "cloud";
|
||||||
inherit (myConfig.nextcloud) port;
|
inherit (services.nextcloud) port;
|
||||||
};
|
};
|
||||||
actualbudget = {
|
actualbudget = {
|
||||||
subdomain = "budget";
|
subdomain = "budget";
|
||||||
inherit (myConfig.actualbudget) port;
|
inherit (services.actualbudget) port;
|
||||||
};
|
};
|
||||||
forgejo = {
|
forgejo = {
|
||||||
subdomain = "git";
|
subdomain = "git";
|
||||||
inherit (myConfig.forgejo) port;
|
inherit (services.forgejo) port;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -58,4 +59,5 @@ in
|
||||||
backups.enable = true;
|
backups.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,11 @@
|
||||||
system.stateVersion = "24.11";
|
system.stateVersion = "24.11";
|
||||||
networking.domain = "sprouted.cloud";
|
networking.domain = "sprouted.cloud";
|
||||||
|
|
||||||
myConfig = {
|
custom = {
|
||||||
boot.loader.grub.enable = true;
|
boot.loader.grub.enable = true;
|
||||||
sops.enable = true;
|
sops.enable = true;
|
||||||
|
|
||||||
|
services = {
|
||||||
tailscale = {
|
tailscale = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
|
|
@ -27,11 +28,12 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts."docs.${config.networking.domain}".extraConfig = ''
|
virtualHosts."docs.${config.networking.domain}".extraConfig = ''
|
||||||
reverse_proxy localhost:${toString config.myConfig.hedgedoc.port}
|
reverse_proxy localhost:${toString config.custom.services.hedgedoc.port}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
myConfig = {
|
custom = {
|
||||||
|
sops.enable = true;
|
||||||
boot = {
|
boot = {
|
||||||
loader.systemdBoot.enable = true;
|
loader.systemdBoot.enable = true;
|
||||||
silent = true;
|
silent = true;
|
||||||
|
|
@ -23,12 +24,12 @@
|
||||||
dm.tuigreet.enable = true;
|
dm.tuigreet.enable = true;
|
||||||
de.hyprland.enable = true;
|
de.hyprland.enable = true;
|
||||||
|
|
||||||
|
virtualisation.enable = true;
|
||||||
|
|
||||||
|
services = {
|
||||||
wlan.enable = true;
|
wlan.enable = true;
|
||||||
bluetooth.enable = true;
|
bluetooth.enable = true;
|
||||||
|
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
virtualisation.enable = true;
|
|
||||||
sops.enable = true;
|
|
||||||
gc.enable = true;
|
gc.enable = true;
|
||||||
geoclue.enable = true;
|
geoclue.enable = true;
|
||||||
tailscale = {
|
tailscale = {
|
||||||
|
|
@ -40,4 +41,5 @@
|
||||||
deviceId = "Q4YPD3V-GXZPHSN-PT5X4PU-FBG4GX2-IASBX75-7NYMG75-4EJHBMZ-4WGDDAP";
|
deviceId = "Q4YPD3V-GXZPHSN-PT5X4PU-FBG4GX2-IASBX75-7NYMG75-4EJHBMZ-4WGDDAP";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
myConfig = {
|
custom = {
|
||||||
|
sops.enable = true;
|
||||||
boot = {
|
boot = {
|
||||||
loader.systemdBoot.enable = true;
|
loader.systemdBoot.enable = true;
|
||||||
silent = true;
|
silent = true;
|
||||||
|
|
@ -23,9 +24,10 @@
|
||||||
dm.tuigreet.enable = true;
|
dm.tuigreet.enable = true;
|
||||||
de.hyprland.enable = true;
|
de.hyprland.enable = true;
|
||||||
|
|
||||||
sound.enable = true;
|
|
||||||
virtualisation.enable = true;
|
virtualisation.enable = true;
|
||||||
sops.enable = true;
|
|
||||||
|
services = {
|
||||||
|
sound.enable = true;
|
||||||
gc.enable = true;
|
gc.enable = true;
|
||||||
geoclue.enable = true;
|
geoclue.enable = true;
|
||||||
tailscale = {
|
tailscale = {
|
||||||
|
|
@ -36,7 +38,8 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
deviceId = "FAJS5WM-UAWGW2U-FXCGPSP-VAUOTGM-XUKSEES-D66PMCJ-WBODJLV-XTNCRA7";
|
deviceId = "FAJS5WM-UAWGW2U-FXCGPSP-VAUOTGM-XUKSEES-D66PMCJ-WBODJLV-XTNCRA7";
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
steam.enable = true;
|
programs.steam.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
}@moduleArgs:
|
}@moduleArgs:
|
||||||
{
|
{
|
||||||
options.myConfig.de.hyprland.enable = lib.mkEnableOption "" // {
|
options.myConfig.de.hyprland.enable = lib.mkEnableOption "" // {
|
||||||
default = moduleArgs.osConfig.myConfig.de.hyprland.enable or false;
|
default = moduleArgs.osConfig.custom.de.hyprland.enable or false;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.de.hyprland.enable {
|
config = lib.mkIf config.myConfig.de.hyprland.enable {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{ config, lib, ... }@moduleArgs:
|
{ config, lib, ... }@moduleArgs:
|
||||||
{
|
{
|
||||||
options.myConfig.tailscale.enable = lib.mkEnableOption "" // {
|
options.myConfig.tailscale.enable = lib.mkEnableOption "" // {
|
||||||
default = moduleArgs.osConfig.myConfig.tailscale.enable or false;
|
default = moduleArgs.osConfig.custom.services.tailscale.enable or false;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.tailscale.enable {
|
config = lib.mkIf config.myConfig.tailscale.enable {
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ let
|
||||||
user = config.users.users.actual.name;
|
user = config.users.users.actual.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.actualbudget.backups.enable = lib.mkEnableOption "";
|
options.custom.services.actualbudget.backups.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.actualbudget.backups.enable {
|
config = lib.mkIf config.custom.services.actualbudget.backups.enable {
|
||||||
security.polkit = {
|
security.polkit = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig =
|
extraConfig =
|
||||||
|
|
@ -28,7 +28,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
myConfig.resticBackup.actual = {
|
custom.services.resticBackup.actual = {
|
||||||
inherit user;
|
inherit user;
|
||||||
healthchecks.enable = true;
|
healthchecks.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.myConfig.actualbudget;
|
cfg = config.custom.services.actualbudget;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.actualbudget = {
|
options.custom.services.actualbudget = {
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
subdomain = lib.mkOption {
|
subdomain = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
options.myConfig.bluetooth.enable = lib.mkEnableOption "";
|
options.custom.services.bluetooth.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.bluetooth.enable {
|
config = lib.mkIf config.custom.services.bluetooth.enable {
|
||||||
hardware = {
|
hardware = {
|
||||||
bluetooth = {
|
bluetooth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
options.myConfig.boot.loader.grub.enable = lib.mkEnableOption "";
|
options.custom.boot.loader.grub.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.boot.loader.grub.enable {
|
config = lib.mkIf config.custom.boot.loader.grub.enable {
|
||||||
boot = {
|
boot = {
|
||||||
tmp.cleanOnBoot = true;
|
tmp.cleanOnBoot = true;
|
||||||
loader.grub.enable = true;
|
loader.grub.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
options.myConfig.boot.loader.systemdBoot.enable = lib.mkEnableOption "";
|
options.custom.boot.loader.systemdBoot.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.boot.loader.systemdBoot.enable {
|
config = lib.mkIf config.custom.boot.loader.systemdBoot.enable {
|
||||||
boot = {
|
boot = {
|
||||||
tmp.cleanOnBoot = true;
|
tmp.cleanOnBoot = true;
|
||||||
loader = {
|
loader = {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
options.myConfig.boot.silent = lib.mkEnableOption "";
|
options.custom.boot.silent = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.boot.silent {
|
config = lib.mkIf config.custom.boot.silent {
|
||||||
boot = {
|
boot = {
|
||||||
loader.timeout = 0;
|
loader.timeout = 0;
|
||||||
kernelParams = [
|
kernelParams = [
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.myConfig.crowdsec;
|
cfg = config.custom.services.crowdsec;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ inputs.crowdsec.nixosModules.crowdsec ];
|
imports = [ inputs.crowdsec.nixosModules.crowdsec ];
|
||||||
|
|
||||||
options.myConfig.crowdsec = {
|
options.custom.services.crowdsec = {
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
apiPort = lib.mkOption {
|
apiPort = lib.mkOption {
|
||||||
type = lib.types.port;
|
type = lib.types.port;
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.myConfig.crowdsec;
|
cfg = config.custom.services.crowdsec;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ inputs.crowdsec.nixosModules.crowdsec-firewall-bouncer ];
|
imports = [ inputs.crowdsec.nixosModules.crowdsec-firewall-bouncer ];
|
||||||
|
|
||||||
options.myConfig.crowdsec.firewallBouncer.enable = lib.mkEnableOption "";
|
options.custom.services.crowdsec.firewallBouncer.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf cfg.firewallBouncer.enable {
|
config = lib.mkIf cfg.firewallBouncer.enable {
|
||||||
services.crowdsec-firewall-bouncer = {
|
services.crowdsec-firewall-bouncer = {
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.myConfig.de.hyprland.enable = lib.mkEnableOption "";
|
options.custom.de.hyprland.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.de.hyprland.enable {
|
config = lib.mkIf config.custom.de.hyprland.enable {
|
||||||
programs.hyprland.enable = true;
|
programs.hyprland.enable = true;
|
||||||
|
|
||||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.myConfig.dm.tuigreet.enable = lib.mkEnableOption "";
|
options.custom.dm.tuigreet.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.dm.tuigreet.enable {
|
config = lib.mkIf config.custom.dm.tuigreet.enable {
|
||||||
services.greetd = {
|
services.greetd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.myConfig.forgejo;
|
cfg = config.custom.services.forgejo;
|
||||||
|
|
||||||
user = config.users.users.forgejo.name;
|
user = config.users.users.forgejo.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.forgejo = {
|
options.custom.services.forgejo = {
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
subdomain = lib.mkOption {
|
subdomain = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
options.myConfig.gc.enable = lib.mkEnableOption "";
|
options.custom.services.gc.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.gc.enable {
|
config = lib.mkIf config.custom.services.gc.enable {
|
||||||
programs.nh = {
|
programs.nh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
clean = {
|
clean = {
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
options.myConfig.geoclue.enable = lib.mkEnableOption "";
|
options.custom.services.geoclue.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.geoclue.enable {
|
config = lib.mkIf config.custom.services.geoclue.enable {
|
||||||
services.geoclue2 = {
|
services.geoclue2 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ let
|
||||||
user = config.users.users.hedgedoc.name;
|
user = config.users.users.hedgedoc.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.hedgedoc.backups.enable = lib.mkEnableOption "";
|
options.custom.services.hedgedoc.backups.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.hedgedoc.backups.enable {
|
config = lib.mkIf config.custom.services.hedgedoc.backups.enable {
|
||||||
security.polkit = {
|
security.polkit = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig =
|
extraConfig =
|
||||||
|
|
@ -28,7 +28,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
myConfig.resticBackup.hedgedoc = {
|
custom.services.resticBackup.hedgedoc = {
|
||||||
inherit user;
|
inherit user;
|
||||||
healthchecks.enable = true;
|
healthchecks.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,14 +5,14 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.myConfig.hedgedoc;
|
cfg = config.custom.services.hedgedoc;
|
||||||
|
|
||||||
user = config.users.users.hedgedoc.name;
|
user = config.users.users.hedgedoc.name;
|
||||||
|
|
||||||
manage_users = "CMD_CONFIG_FILE=/run/hedgedoc/config.json NODE_ENV=production ${lib.getExe' pkgs.hedgedoc "manage_users"}";
|
manage_users = "CMD_CONFIG_FILE=/run/hedgedoc/config.json NODE_ENV=production ${lib.getExe' pkgs.hedgedoc "manage_users"}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.hedgedoc = {
|
options.custom.services.hedgedoc = {
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
subdomain = lib.mkOption {
|
subdomain = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
|
|
|
||||||
|
|
@ -5,16 +5,16 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.myConfig.nextcloud;
|
cfg = config.custom.services.nextcloud;
|
||||||
|
|
||||||
dataDir = config.services.nextcloud.home;
|
dataDir = config.services.nextcloud.home;
|
||||||
user = config.users.users.nextcloud.name;
|
user = config.users.users.nextcloud.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.nextcloud.backups.enable = lib.mkEnableOption "";
|
options.custom.services.nextcloud.backups.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf cfg.backups.enable {
|
config = lib.mkIf cfg.backups.enable {
|
||||||
myConfig.resticBackup.nextcloud = {
|
custom.services.resticBackup.nextcloud = {
|
||||||
inherit user;
|
inherit user;
|
||||||
healthchecks.enable = true;
|
healthchecks.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.myConfig.nextcloud;
|
cfg = config.custom.services.nextcloud;
|
||||||
|
|
||||||
user = config.users.users.nextcloud.name;
|
user = config.users.users.nextcloud.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.nextcloud = {
|
options.custom.services.nextcloud = {
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
subdomain = lib.mkOption {
|
subdomain = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
options.myConfig.printing.enable = lib.mkEnableOption "";
|
options.custom.services.printing.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.printing.enable {
|
config = lib.mkIf config.custom.services.printing.enable {
|
||||||
services = {
|
services = {
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
avahi = {
|
avahi = {
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
backupServices = lib.filterAttrs (_: value: value.enable) config.myConfig.resticBackup;
|
backupServices = lib.filterAttrs (_: value: value.enable) config.custom.services.resticBackup;
|
||||||
|
|
||||||
healthchecksEnable = (lib.filterAttrs (_: value: value.healthchecks.enable) backupServices) != { };
|
healthchecksEnable = (lib.filterAttrs (_: value: value.healthchecks.enable) backupServices) != { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.resticBackup = lib.mkOption {
|
options.custom.services.resticBackup = lib.mkOption {
|
||||||
type = lib.types.attrsOf (
|
type = lib.types.attrsOf (
|
||||||
lib.types.submodule {
|
lib.types.submodule {
|
||||||
options = {
|
options = {
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@
|
||||||
{
|
{
|
||||||
imports = [ inputs.sops-nix.nixosModules.sops ];
|
imports = [ inputs.sops-nix.nixosModules.sops ];
|
||||||
|
|
||||||
options.myConfig.sops.enable = lib.mkEnableOption "";
|
options.custom.sops.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.sops.enable {
|
config = lib.mkIf config.custom.sops.enable {
|
||||||
sops = {
|
sops = {
|
||||||
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||||
defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
|
defaultSopsFile = "${self}/hosts/${config.networking.hostName}/secrets.yaml";
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
{
|
{
|
||||||
options.myConfig.sound.enable = lib.mkEnableOption "";
|
options.custom.services.sound.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.sound.enable {
|
config = lib.mkIf config.custom.services.sound.enable {
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services = {
|
services = {
|
||||||
pulseaudio.enable = false;
|
pulseaudio.enable = false;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.myConfig.steam.enable = lib.mkEnableOption "";
|
options.custom.programs.steam.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.steam.enable {
|
config = lib.mkIf config.custom.programs.steam.enable {
|
||||||
programs = {
|
programs = {
|
||||||
steam.enable = true;
|
steam.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.myConfig.syncthing;
|
cfg = config.custom.services.syncthing;
|
||||||
|
|
||||||
user = config.users.users.syncthing.name;
|
user = config.users.users.syncthing.name;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.syncthing.backups.enable = lib.mkEnableOption "";
|
options.custom.services.syncthing.backups.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf cfg.backups.enable {
|
config = lib.mkIf cfg.backups.enable {
|
||||||
assertions = [
|
assertions = [
|
||||||
|
|
@ -37,7 +37,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
myConfig.resticBackup.syncthing = {
|
custom.services.resticBackup.syncthing = {
|
||||||
inherit user;
|
inherit user;
|
||||||
healthchecks.enable = true;
|
healthchecks.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.myConfig.syncthing;
|
cfg = config.custom.services.syncthing;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.syncthing = {
|
options.custom.services.syncthing = {
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
isServer = lib.mkEnableOption "";
|
isServer = lib.mkEnableOption "";
|
||||||
deviceId = lib.mkOption {
|
deviceId = lib.mkOption {
|
||||||
|
|
@ -32,10 +32,10 @@ in
|
||||||
devices =
|
devices =
|
||||||
self.nixosConfigurations
|
self.nixosConfigurations
|
||||||
|> lib.filterAttrs (name: _: name != config.networking.hostName)
|
|> lib.filterAttrs (name: _: name != config.networking.hostName)
|
||||||
|> lib.filterAttrs (_: value: value.config.myConfig.syncthing.enable)
|
|> lib.filterAttrs (_: value: value.config.custom.services.syncthing.enable)
|
||||||
|> lib.mapAttrs (
|
|> lib.mapAttrs (
|
||||||
name: value: {
|
name: value: {
|
||||||
id = value.config.myConfig.syncthing.deviceId;
|
id = value.config.custom.services.syncthing.deviceId;
|
||||||
addresses = [ "tcp://${name}.${value.config.networking.domain}:22000" ];
|
addresses = [ "tcp://${name}.${value.config.networking.domain}:22000" ];
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
nodes = config.myConfig.tailscale.caddyServe |> lib.filterAttrs (_: value: value.enable);
|
nodes = config.custom.services.tailscale.caddyServe |> lib.filterAttrs (_: value: value.enable);
|
||||||
|
|
||||||
caddy-tailscale = pkgs.caddy.withPlugins {
|
caddy-tailscale = pkgs.caddy.withPlugins {
|
||||||
plugins = [ "github.com/tailscale/caddy-tailscale@v0.0.0-20250207163903-69a970c84556" ];
|
plugins = [ "github.com/tailscale/caddy-tailscale@v0.0.0-20250207163903-69a970c84556" ];
|
||||||
|
|
@ -13,7 +13,7 @@ let
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.tailscale.caddyServe = lib.mkOption {
|
options.custom.services.tailscale.caddyServe = lib.mkOption {
|
||||||
type = lib.types.attrsOf (
|
type = lib.types.attrsOf (
|
||||||
lib.types.submodule (
|
lib.types.submodule (
|
||||||
{ name, ... }:
|
{ name, ... }:
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cfg = config.myConfig.tailscale;
|
cfg = config.custom.services.tailscale;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.tailscale = {
|
options.custom.services.tailscale = {
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
subdomain = lib.mkOption {
|
subdomain = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
options.myConfig.virtualisation.enable = lib.mkEnableOption "";
|
options.custom.virtualisation.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.virtualisation.enable {
|
config = lib.mkIf config.custom.virtualisation.enable {
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
programs.virt-manager.enable = true;
|
programs.virt-manager.enable = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,9 @@ let
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.myConfig.wlan.enable = lib.mkEnableOption "";
|
options.custom.services.wlan.enable = lib.mkEnableOption "";
|
||||||
|
|
||||||
config = lib.mkIf config.myConfig.wlan.enable (
|
config = lib.mkIf config.custom.services.wlan.enable (
|
||||||
lib.mkMerge [
|
lib.mkMerge [
|
||||||
{
|
{
|
||||||
networking.wireless.iwd = {
|
networking.wireless.iwd = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue