Compare commits

...

36 commits

Author SHA1 Message Date
Bruno BELANYI 4cfe0a7846 WIP: add note about 'iwd'
Some checks failed
ci/woodpecker/push/check Pipeline failed
2024-11-28 22:05:28 +00:00
Bruno BELANYI b31ecd0250 WIP: even more directories? Maybe? 2024-11-28 22:05:28 +00:00
Bruno BELANYI 044ad20349 WIP: add notes for missing persistence/backup
TODO:
* Do home-manager
* Look at for more inspiration github.com:nix-community/impermanence/pull/108
* Common files github.com:nix-community/impermanence/issues/10
* Useful config: github.com:chayleaf/dotfiles/blob/f77271b249e0c08368573c22a5c34f0737d3a766/system/modules/impermanence.nix
2024-11-28 22:05:27 +00:00
Bruno BELANYI 0a251fa775 nixos: services: vikunja: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI bc8758dd95 nixos: services: transmission: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI cc42b3f3d8 nixos: services: tandoor-recipes: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI feccb7ba2b nixos: services: sabnzbd: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 93729ccfa7 nixos: services: rss-bridge: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI e77e65201c nixos: services: quassel: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI e55308b596 nixos: services: pyload: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 07737b5076 nixos: services: postgresql-backup: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 8b67a1da8e nixos: services: postgresql: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 52399cbb3e nixos: services: podgrab: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 2ba35fd5e0 nixos: services: pirate: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 3653918237 nixos: services: pdf-edit: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 89a43e8bad nixos: services: paperless: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI ed1a5b4924 nixos: services: nextcloud: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI f581ef7113 nixos: services: nginx: persist SSL certificates 2024-11-28 22:05:27 +00:00
Bruno BELANYI dbb6b38eba nixos: services: navidrome: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI cb0f8e91a0 nixos: services: monitoring: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI d0b926251d nixos: services: mealie: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI dbc919e3d8 nixos: services: matrix: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 19c4586073 nixos: services: lohr: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI c07d3f4c0b nixos: services: komga: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 79274dac40 nixos: services: jellyfin: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI dc0d753625 nixos: services: indexers: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 72ffc1c25a nixos: services: grocy: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 88f8f8a6cd nixos: services: gitea: persist repositories 2024-11-28 22:05:27 +00:00
Bruno BELANYI 8c5ada0d6d nixos: services: forgejo: persist repositories 2024-11-28 22:05:27 +00:00
Bruno BELANYI 0ac6fef308 nixos: services: flood: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 34592cfd52 nixos: services: fail2ban: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 075a52f8db nixos: services: calibre-web: persist library 2024-11-28 22:05:27 +00:00
Bruno BELANYI f2b5290df7 nixos: services: blog: persist website data 2024-11-28 22:05:27 +00:00
Bruno BELANYI e74aceee24 nixos: services: audiobookshelf: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 110aef16e4 nixos: services: aria: persist data 2024-11-28 22:05:27 +00:00
Bruno BELANYI 5efdd891db nixos: services: ssh-server: persist host keys 2024-11-28 22:05:27 +00:00
43 changed files with 207 additions and 0 deletions

View file

@ -23,6 +23,8 @@ in
(lib.mkIf cfg.wireless.enable {
networking.networkmanager.enable = true;
# IWD needs persistence if enabled
# Persist NetworkManager files
my.system.persist.files = [
"/var/lib/NetworkManager/secret_key"

View file

@ -69,6 +69,11 @@ in
};
};
my.system.persist.directories = [
cfg.downloadDir
config.users.users.aria2.home
];
# NOTE: unfortunately aria2 does not log connection failures for fail2ban
};
}

View file

@ -34,6 +34,10 @@ in
};
};
my.system.persist.directories = [
"/var/lib/${config.services.audiobookshelf.dataDir}"
];
services.fail2ban.jails = {
audiobookshelf = ''
enabled = true

View file

@ -41,5 +41,12 @@ in
# Those are all subdomains, no problem
my.services.nginx.virtualHosts = hostsInfo;
my.system.persist.directories = [
"/var/www/blog"
"/var/www/cv"
"/var/www/dev"
"/var/www/key"
];
};
}

View file

@ -53,6 +53,11 @@ in
];
};
my.system.persist.directories = [
"/var/lib/${config.services.calibre-web.dataDir}"
cfg.libraryPath
];
services.fail2ban.jails = {
calibre-web = ''
enabled = true

View file

@ -39,5 +39,7 @@ in
extraGroups = [ "docker" ]; # Give access to the daemon
};
users.groups.drone-runner-docker = { };
# FIXME: persistence?
};
}

View file

@ -63,5 +63,7 @@ in
group = "drone-runner-exec";
};
users.groups.drone-runner-exec = { };
# FIXME: persistence?
};
}

View file

@ -50,5 +50,7 @@ in
inherit (cfg) port;
};
};
# FIXME: persistence?
};
}

View file

@ -33,5 +33,9 @@ in
bantime = "10m";
};
};
my.system.persist.directories = [
"/var/lib/${config.systemd.services.fail2ban.serviceConfig.StateDirectory}"
];
};
}

View file

@ -28,6 +28,10 @@ in
};
};
my.system.persist.directories = [
"/var/lib/${config.systemd.services.flood.serviceConfig.StateDirectory}"
];
# NOTE: unfortunately flood does not log connection failures for fail2ban
};
}

View file

@ -147,6 +147,11 @@ in
];
};
my.system.persist.directories = [
config.services.forgejo.lfs.contentDir
config.services.forgejo.repositoryRoot
];
services.fail2ban.jails = {
forgejo = ''
enabled = true

View file

@ -131,6 +131,11 @@ in
];
};
my.system.persist.directories = [
config.services.gitea.lfs.contentDir
config.services.gitea.repositoryRoot
];
services.fail2ban.jails = {
gitea = ''
enabled = true

View file

@ -37,6 +37,16 @@ in
useACMEHost = config.networking.domain;
};
my.services.backup = {
paths = [
config.services.grocy.dataDir
];
};
my.system.persist.directories = [
config.services.grocy.dataDir
];
# NOTE: unfortunately grocy does not log connection failures for fail2ban
};
}

View file

@ -33,6 +33,10 @@ in
port = jackettPort;
};
};
my.system.persist.directories = [
config.services.jackett.dataDir
];
})
(lib.mkIf cfg.nzbhydra.enable {
@ -45,6 +49,10 @@ in
port = nzbhydraPort;
};
};
my.system.persist.directories = [
config.services.nzbhydra2.dataDir
];
})
(lib.mkIf cfg.prowlarr.enable {
@ -58,6 +66,10 @@ in
};
};
my.system.persist.directories = [
"/var/lib/${config.systemd.services.prowlarr.serviceConfig.StateDirectory}"
];
services.fail2ban.jails = {
prowlarr = ''
enabled = true

View file

@ -38,6 +38,10 @@ in
};
};
my.system.persist.directories = [
"/var/lib/${config.systemd.services.jellyfin.serviceConfig.StateDirectory}"
];
services.fail2ban.jails = {
jellyfin = ''
enabled = true

View file

@ -36,6 +36,10 @@ in
};
};
my.system.persist.directories = [
config.services.komga.stateDir
];
services.fail2ban.jails = {
komga = ''
enabled = true

View file

@ -107,5 +107,9 @@ in
};
};
};
my.system.persist.directories = [
"/var/lib/${config.systemd.services.lohr.serviceConfig.StateDirectory}"
];
};
}

View file

@ -214,5 +214,9 @@ in
config.services.matrix-synapse.dataDir
];
};
my.system.persist.directories = [
config.services.matrix-synapse.dataDir
];
};
}

View file

@ -72,6 +72,16 @@ in
};
};
my.services.backup = {
paths = [
"/var/lib/${config.systemd.services.mealie.serviceConfig.StateDirectory}"
];
};
my.system.persist.directories = [
"/var/lib/${config.systemd.services.mealie.serviceConfig.StateDirectory}"
];
services.fail2ban.jails = {
mealie = ''
enabled = true

View file

@ -130,5 +130,10 @@ in
inherit (cfg.grafana) port;
};
};
my.system.persist.directories = [
config.services.grafana.dataDir
"/var/lib/${config.services.prometheus.stateDir}"
];
};
}

View file

@ -53,6 +53,10 @@ in
};
};
my.system.persist.directories = [
"/var/lib/${config.systemd.services.navidrome.serviceConfig.StateDirectory}"
];
services.fail2ban.jails = {
navidrome = ''
enabled = true

View file

@ -46,5 +46,7 @@ in
];
};
};
# FIXME: persistence?
};
}

View file

@ -92,6 +92,11 @@ in
];
};
my.system.persist.directories = [
config.services.nextcloud.home
config.services.nextcloud.datadir
];
services.fail2ban.jails = {
nextcloud = ''
enabled = true

View file

@ -486,5 +486,9 @@ in
}
];
};
my.system.persist.directories = [
config.users.user.acme.home
];
};
}

View file

@ -146,5 +146,10 @@ in
config.services.paperless.mediaDir
];
};
my.system.persist.directories = [
config.services.paperless-ng.dataDir
config.services.paperless-ng.mediaDir
];
};
}

View file

@ -54,6 +54,10 @@ in
};
};
my.system.persist.directories = [
"/var/lib/${config.systemd.services.stirling-pdf.serviceConfig.StateDirectory}"
];
services.fail2ban.jails = {
stirling-pdf = ''
enabled = true

View file

@ -51,5 +51,10 @@ in
inherit (cfg) port;
};
};
my.system.persist.directories = [
config.systemd.services.podgrab.environment.CONFIG
config.systemd.services.podgrab.environment.DATA
];
};
}

View file

@ -24,5 +24,9 @@ in
(config.services.postgresqlBackup.location + "/*.prev.sql.gz")
];
};
my.system.persist.directories = [
config.services.postgresqlBackup.location
];
};
}

View file

@ -18,6 +18,13 @@ in
};
})
# Only persist directory if the actual service is enabled
(lib.mkIf config.services.postgresql.enable {
my.system.persist.directories = [
config.services.postgresql.dataDir
];
})
# Taken from the manual
(lib.mkIf cfg.upgradeScript {
environment.systemPackages =

View file

@ -53,6 +53,11 @@ in
};
};
my.system.persist.directories = [
cfg.downloadDirectory
"/var/lib/${config.systemd.services.pyload.StateDirectory}"
];
services.fail2ban.jails = {
pyload = ''
enabled = true

View file

@ -46,5 +46,9 @@ in
# Because Quassel does not use the socket, I simply trust its connection
authentication = "host quassel quassel localhost trust";
};
my.system.persist.directories = [
config.services.quassel.dataDir
];
};
}

View file

@ -22,5 +22,9 @@ in
forceSSL = true;
useACMEHost = config.networking.domain;
};
my.system.persist.directories = [
config.services.rss-bridge.dataDir
];
};
}

View file

@ -24,6 +24,10 @@ in
};
};
my.system.persist.files = [
config.services.sabnzbd.configFile
];
services.fail2ban.jails = {
sabnzbd = ''
enabled = true

View file

@ -19,6 +19,16 @@ let
enable = true;
group = "media";
};
my.system.persist.directories =
let
# Bazarr breaks the mold unfortunately
dataDir =
if service != "bazarr"
then config.services.${service}.dataDir
else config.users.user.${service}.home;
in
[ dataDir ];
};
mkRedirection = service: {

View file

@ -20,6 +20,13 @@ in
};
};
# Persist SSH keys
my.system.persist.files =
let
pubAndPrivKey = key: [ key.path "${key.path}.pub" ];
in
lib.concatMap pubAndPrivKey config.services.openssh.hostKeys;
# Opens the relevant UDP ports.
programs.mosh.enable = true;
};

View file

@ -83,6 +83,19 @@ in
};
};
my.services.backup = {
paths = [
"/var/lib/${config.systemd.services.tandoor-recipes.StateDirectory}"
config.systemd.services.tandoor-recipes.environment.MEDIA_ROOT
];
};
my.system.persist.directories = [
"/var/lib/${config.systemd.services.tandoor-recipes.StateDirectory}"
config.systemd.services.tandoor-recipes.environment.MEDIA_ROOT
];
# NOTE: unfortunately tandoor-recipes does not log connection failures for fail2ban
};
}

View file

@ -91,6 +91,10 @@ in
allowedUDPPorts = [ cfg.peerPort ];
};
my.system.persist.directories = [
config.services.transmission.home
];
# NOTE: unfortunately transmission does not log connection failures for fail2ban
};
}

View file

@ -100,6 +100,10 @@ in
];
};
my.system.persist.directories = [
config.services.vikunja.settings.files.basepath
];
# NOTE: unfortunately vikunja does not log connection failures for fail2ban
};
}

View file

@ -38,5 +38,7 @@ in
];
};
};
# FIXME: persistence?
};
}

View file

@ -62,5 +62,7 @@ in
];
};
};
# FIXME: persistence?
};
}

View file

@ -61,5 +61,7 @@ in
port = cfg.rpcPort;
};
};
# FIXME: persistence
};
}

View file

@ -58,6 +58,10 @@ in
"/var/log" # Logs
"/var/lib/nixos" # UID/GID maps
"/var/lib/systemd/coredump" # Coredumps
"/var/lib/systemd" # FIXME: needed?
"/var/spool" # FIXME: needed?
"/var/tmp" # FIXME: needed?
]
++ cfg.directories
;

View file

@ -65,5 +65,7 @@ in
# Allow resolution of '.local' addresses
nssmdns4 = true;
};
# FIXME: persistence?
};
}