Compare commits

...

24 commits

Author SHA1 Message Date
Bruno BELANYI 5563a1718f WIP: add notes for missing persistence/backup
Some checks failed
ci/woodpecker/push/check Pipeline failed
TODO:
* Look at for more inspiration https://github.com/nix-community/impermanence/pull/108
* Do home-manager
* Common files https://github.com/nix-community/impermanence/issues/10
2024-11-28 20:19:49 +00:00
Bruno BELANYI 8147670f48 nixos: services: quassel: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 5d60031018 nixos: services: pirate: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 235b7b7a02 nixos: services: monitoring: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI b5cb3ccbb7 nixos: services: nginx: persist SSL certificates 2024-11-28 20:19:49 +00:00
Bruno BELANYI 6ad3677621 nixos: services: transmission: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI dff50c1b56 nixos: services: sabnzbd: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI f5169f5fae nixos: services: rss-bridge: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 66c05a1388 nixos: services: podgrab: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 192482d816 nixos: services: nextcloud: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 28e9efd254 nixos: services: navidrome: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 88bb795cc5 nixos: services: lohr: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 7ce456d603 nixos: services: jellyfin: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 7a2c1eb473 nixos: services: indexers: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 1320cfbcb0 nixos: services: postgresql: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI d0da754a65 nixos: services: postgresql-backup: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 2fe4dc1c80 nixos: services: paperless: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI b891b6c131 nixos: services: matrix: persist data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 04a6af9a89 nixos: services: forgejo: persist repositories 2024-11-28 20:19:49 +00:00
Bruno BELANYI d37139ee0f nixos: services: gitea: persist repositories 2024-11-28 20:19:49 +00:00
Bruno BELANYI 1510142e29 nixos: services: calibre-web: persist library 2024-11-28 20:19:49 +00:00
Bruno BELANYI 0013102716 nixos: services: blog: persist website data 2024-11-28 20:19:49 +00:00
Bruno BELANYI 990ff82250 nixos: services: ssh-server: persist host keys 2024-11-28 20:19:49 +00:00
Bruno BELANYI b2190162c4 nixos: hardware: networking persist connections 2024-11-28 20:19:49 +00:00
42 changed files with 161 additions and 0 deletions

View file

@ -22,6 +22,11 @@ in
config = lib.mkMerge [ config = lib.mkMerge [
(lib.mkIf cfg.wireless.enable { (lib.mkIf cfg.wireless.enable {
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
# Persist NetworkManager files
my.system.persist.directories = [
"/etc/NetworkManager/system-connections"
];
}) })
]; ];
} }

View file

@ -69,6 +69,8 @@ in
}; };
}; };
# FIXME: persistence?
# NOTE: unfortunately aria2 does not log connection failures for fail2ban # NOTE: unfortunately aria2 does not log connection failures for fail2ban
}; };
} }

View file

@ -34,6 +34,8 @@ in
}; };
}; };
# FIXME: persistence?
services.fail2ban.jails = { services.fail2ban.jails = {
audiobookshelf = '' audiobookshelf = ''
enabled = true enabled = true

View file

@ -41,5 +41,12 @@ in
# Those are all subdomains, no problem # Those are all subdomains, no problem
my.services.nginx.virtualHosts = hostsInfo; 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 = { services.fail2ban.jails = {
calibre-web = '' calibre-web = ''
enabled = true enabled = true

View file

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

View file

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

View file

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

View file

@ -33,5 +33,7 @@ in
bantime = "10m"; bantime = "10m";
}; };
}; };
# FIXME: persistence?
}; };
} }

View file

@ -28,6 +28,8 @@ in
}; };
}; };
# FIXME: persistence?
# NOTE: unfortunately flood does not log connection failures for fail2ban # 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 = { services.fail2ban.jails = {
forgejo = '' forgejo = ''
enabled = true 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 = { services.fail2ban.jails = {
gitea = '' gitea = ''
enabled = true enabled = true

View file

@ -37,6 +37,9 @@ in
useACMEHost = config.networking.domain; useACMEHost = config.networking.domain;
}; };
# FIXME: backup
# FIXME: persistence
# NOTE: unfortunately grocy does not log connection failures for fail2ban # NOTE: unfortunately grocy does not log connection failures for fail2ban
}; };
} }

View file

@ -33,6 +33,10 @@ in
port = jackettPort; port = jackettPort;
}; };
}; };
my.system.persist.directories = [
config.services.jackett.dataDir
];
}) })
(lib.mkIf cfg.nzbhydra.enable { (lib.mkIf cfg.nzbhydra.enable {
@ -45,6 +49,10 @@ in
port = nzbhydraPort; port = nzbhydraPort;
}; };
}; };
my.system.persist.directories = [
config.services.nzbhydra2.dataDir
];
}) })
(lib.mkIf cfg.prowlarr.enable { (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 = { services.fail2ban.jails = {
prowlarr = '' prowlarr = ''
enabled = true enabled = true

View file

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

View file

@ -36,6 +36,8 @@ in
}; };
}; };
# FIXME: persistence?
services.fail2ban.jails = { services.fail2ban.jails = {
komga = '' komga = ''
enabled = true 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 config.services.matrix-synapse.dataDir
]; ];
}; };
my.system.persist.directories = [
config.services.matrix-synapse.dataDir
];
}; };
} }

View file

@ -72,6 +72,9 @@ in
}; };
}; };
# FIXME: backup
# FIXME: persistence
services.fail2ban.jails = { services.fail2ban.jails = {
mealie = '' mealie = ''
enabled = true enabled = true

View file

@ -49,6 +49,9 @@ in
}; };
}; };
# FIXME: backup
# FIXME: persistence
services.fail2ban.jails = { services.fail2ban.jails = {
miniflux = '' miniflux = ''
enabled = true enabled = true

View file

@ -130,5 +130,10 @@ in
inherit (cfg.grafana) port; 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 = { services.fail2ban.jails = {
navidrome = '' navidrome = ''
enabled = true 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 = { services.fail2ban.jails = {
nextcloud = '' nextcloud = ''
enabled = true 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 config.services.paperless.mediaDir
]; ];
}; };
my.system.persist.directories = [
config.services.paperless-ng.dataDir
config.services.paperless-ng.mediaDir
];
}; };
} }

View file

@ -54,6 +54,8 @@ in
}; };
}; };
# FIXME: persistence?
services.fail2ban.jails = { services.fail2ban.jails = {
stirling-pdf = '' stirling-pdf = ''
enabled = true enabled = true

View file

@ -51,5 +51,10 @@ in
inherit (cfg) port; 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") (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 # Taken from the manual
(lib.mkIf cfg.upgradeScript { (lib.mkIf cfg.upgradeScript {
environment.systemPackages = environment.systemPackages =

View file

@ -53,6 +53,9 @@ in
}; };
}; };
# FIXME: backup
# FIXME: persistence
services.fail2ban.jails = { services.fail2ban.jails = {
pyload = '' pyload = ''
enabled = true enabled = true

View file

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

View file

@ -22,5 +22,9 @@ in
forceSSL = true; forceSSL = true;
useACMEHost = config.networking.domain; 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 = { services.fail2ban.jails = {
sabnzbd = '' sabnzbd = ''
enabled = true enabled = true

View file

@ -19,6 +19,11 @@ let
enable = true; enable = true;
group = "media"; group = "media";
}; };
# Thankfully those old style services all define users with homes
my.system.persist.directories = [
config.users.user.${service}.home
];
}; };
mkRedirection = service: { 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 systemConfig.services.openssh.hostKeys;
# Opens the relevant UDP ports. # Opens the relevant UDP ports.
programs.mosh.enable = true; programs.mosh.enable = true;
}; };

View file

@ -83,6 +83,9 @@ in
}; };
}; };
# FIXME: backup
# FIXME: persistence
# NOTE: unfortunately tandoor-recipes does not log connection failures for fail2ban # NOTE: unfortunately tandoor-recipes does not log connection failures for fail2ban
}; };
} }

View file

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

View file

@ -100,6 +100,8 @@ in
]; ];
}; };
# FIXME: persistence
# NOTE: unfortunately vikunja does not log connection failures for fail2ban # 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; port = cfg.rpcPort;
}; };
}; };
# FIXME: persistence
}; };
} }