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