add serviceMountDeps
This commit is contained in:
parent
9a45c808fd
commit
f3fe629666
@ -112,6 +112,12 @@
|
||||
data_dir = services_dir + "/owntracks";
|
||||
};
|
||||
};
|
||||
|
||||
serviceMountDeps = serviceName: dirs: {
|
||||
systemd.services.${serviceName} = {
|
||||
unitConfig.RequiresMountsFor = dirs;
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style;
|
||||
@ -123,6 +129,7 @@
|
||||
eth_interface
|
||||
service_configs
|
||||
inputs
|
||||
serviceMountDeps
|
||||
;
|
||||
};
|
||||
modules =
|
||||
|
||||
@ -2,9 +2,14 @@
|
||||
config,
|
||||
service_configs,
|
||||
username,
|
||||
serviceMountDeps,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(serviceMountDeps "gitea" [ config.services.gitea.stateDir ])
|
||||
];
|
||||
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
appName = "Simon Gardling's Gitea instance";
|
||||
|
||||
@ -3,9 +3,14 @@
|
||||
pkgs,
|
||||
config,
|
||||
username,
|
||||
serviceMountDeps,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(serviceMountDeps "immich" [ config.services.immich.mediaLocation ])
|
||||
];
|
||||
|
||||
services.immich = {
|
||||
enable = true;
|
||||
mediaLocation = service_configs.immich.dir;
|
||||
|
||||
@ -3,9 +3,17 @@
|
||||
config,
|
||||
service_configs,
|
||||
username,
|
||||
serviceMountDeps,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(serviceMountDeps "jellyfin" [
|
||||
config.services.jellyfin.dataDir
|
||||
config.services.jellyfin.cacheDir
|
||||
])
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
jellyfin
|
||||
jellyfin-web
|
||||
@ -37,6 +45,7 @@
|
||||
"video"
|
||||
"render"
|
||||
service_configs.torrent_group
|
||||
"media"
|
||||
];
|
||||
|
||||
users.users.${username}.extraGroups = [
|
||||
|
||||
@ -4,9 +4,16 @@
|
||||
lib,
|
||||
username,
|
||||
config,
|
||||
serviceMountDeps,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(serviceMountDeps "minecraft-server-${service_configs.minecraft.server_name}" [
|
||||
"${service_configs.minecraft.parent_dir}/${service_configs.minecraft.server_name}"
|
||||
])
|
||||
];
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeScriptBin "mc-console" ''
|
||||
#!/bin/sh
|
||||
|
||||
@ -3,9 +3,14 @@
|
||||
config,
|
||||
username,
|
||||
service_configs,
|
||||
serviceMountDeps,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(serviceMountDeps "postgresql" [ config.services.postgresql.dataDir ])
|
||||
];
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
package = pkgs.postgresql_16;
|
||||
|
||||
@ -4,9 +4,17 @@
|
||||
service_configs,
|
||||
username,
|
||||
lib,
|
||||
serviceMountDeps,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(serviceMountDeps "qbittorrent" [
|
||||
service_configs.torrent.SavePath
|
||||
service_configs.torrent.TempPath
|
||||
])
|
||||
];
|
||||
|
||||
# network namespace that is proxied through mullvad
|
||||
vpnNamespaces.wg = {
|
||||
portMappings = [
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user