Compare commits

...

15 commits

Author SHA1 Message Date
Bruno BELANYI 777e2f2c1f WIP: add note about 'iwd'
Some checks failed
ci/woodpecker/push/check Pipeline failed
2024-11-28 22:01:38 +00:00
Bruno BELANYI 6a959611c7 WIP: even more directories? Maybe?
Some checks failed
ci/woodpecker/push/check Pipeline failed
2024-11-28 22:00:58 +00:00
Bruno BELANYI 2c1a7d16c7 WIP: add notes for missing persistence/backup
Some checks failed
ci/woodpecker/push/check Pipeline failed
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 21:56:30 +00:00
Bruno BELANYI 95a42b4339 nixos: services: vikunja: persist data 2024-11-28 21:53:26 +00:00
Bruno BELANYI a2581f4e89 nixos: services: transmission: persist data 2024-11-28 21:51:17 +00:00
Bruno BELANYI 84f5a89c31 nixos: services: tandoor-recipes: persist data 2024-11-28 21:51:17 +00:00
Bruno BELANYI 4938148255 nixos: services: sabnzbd: persist data 2024-11-28 21:51:17 +00:00
Bruno BELANYI f87ac5cb05 nixos: services: rss-bridge: persist data 2024-11-28 21:51:17 +00:00
Bruno BELANYI 71facb854e nixos: services: quassel: persist data 2024-11-28 21:51:17 +00:00
Bruno BELANYI dd3dc6e044 nixos: services: podgrab: persist data 2024-11-28 21:51:17 +00:00
Bruno BELANYI 33437c715f nixos: services: pyload: persist data 2024-11-28 21:51:17 +00:00
Bruno BELANYI 5c916f9cfb nixos: services: postgresql-backup: persist data 2024-11-28 21:51:17 +00:00
Bruno BELANYI dd713103a2 nixos: services: postgresql: persist data 2024-11-28 21:51:17 +00:00
Bruno BELANYI 4ed5355218 nixos: services: pirate: persist data 2024-11-28 21:51:17 +00:00
Bruno BELANYI 7b7a0ff031 nixos: services: pdf-edit: persist data 2024-11-28 21:51:17 +00:00
22 changed files with 90 additions and 0 deletions

View file

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

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

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

View file

@ -54,6 +54,10 @@ in
}; };
}; };
my.system.persist.directories = [
"/var/lib/${systemd.services.stirling-pdf.serviceConfig.StateDirectory}"
];
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,11 @@ in
}; };
}; };
my.system.persist.directories = [
cfg.downloadDirectory
"/var/lib/${config.systemd.services.pyload.StateDirectory}"
];
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,16 @@ let
enable = true; enable = true;
group = "media"; 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: { mkRedirection = service: {

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 # 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,10 @@ in
]; ];
}; };
my.system.persist.directories = [
config.services.vikunja.settings.files.basepath
];
# 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
}; };
} }

View file

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

View file

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