diff --git a/git/gitea.nix b/git/gitea.nix index 56f938e..e4a6c73 100644 --- a/git/gitea.nix +++ b/git/gitea.nix @@ -3,6 +3,12 @@ let cfg = config.services.userdata; in { + fileSystems = lib.mkIf cfg.useBinds { + "/var/lib/gitea" = { + device = "/volumes/${cfg.gitea.location}/gitea"; + options = [ "bind" ]; + }; + }; services = { gitea = { enable = cfg.gitea.enable; diff --git a/mailserver/system/mailserver.nix b/mailserver/system/mailserver.nix index bd269e0..d97e102 100644 --- a/mailserver/system/mailserver.nix +++ b/mailserver/system/mailserver.nix @@ -13,6 +13,17 @@ in }) ]; + fileSystems = lib.mkIf cfg.useBinds { + "/var/vmail" = { + device = "/volumes/${cfg.email.location}/vmail"; + options = [ "bind" ]; + }; + "/var/sieve" = { + device = "/volumes/${cfg.email.location}/sieve"; + options = [ "bind" ]; + }; + }; + users.users = { virtualMail = { isNormalUser = false; @@ -32,7 +43,7 @@ in sieveScript = '' require ["fileinto", "mailbox"]; if header :contains "Chat-Version" "1.0" - { + { fileinto :create "DeltaChat"; stop; } @@ -46,7 +57,7 @@ in sieveScript = '' require ["fileinto", "mailbox"]; if header :contains "Chat-Version" "1.0" - { + { fileinto :create "DeltaChat"; stop; } diff --git a/nextcloud/nextcloud.nix b/nextcloud/nextcloud.nix index fda7afd..5bebca0 100644 --- a/nextcloud/nextcloud.nix +++ b/nextcloud/nextcloud.nix @@ -1,8 +1,14 @@ -{ pkgs, config, ... }: +{ pkgs, lib, config, ... }: let cfg = config.services.userdata; in { + fileSystems = lib.mkIf cfg.useBinds { + "/var/lib/nextcloud" = { + device = "/volumes/${cfg.nextcloud.location}/nextcloud"; + options = [ "bind" ]; + }; + }; services.nextcloud = { enable = cfg.nextcloud.enable; package = pkgs.nextcloud23; diff --git a/passmgr/bitwarden.nix b/passmgr/bitwarden.nix index 0a3ff6c..2c85cd5 100644 --- a/passmgr/bitwarden.nix +++ b/passmgr/bitwarden.nix @@ -3,6 +3,16 @@ let cfg = config.services.userdata; in { + fileSystems = lib.mkIf cfg.useBinds { + "/var/lib/bitwarden" = { + device = "/volumes/${cfg.bitwarden.location}/bitwarden"; + options = [ "bind" ]; + }; + "/var/lib/bitwarden_rs" = { + device = "/volumes/${cfg.bitwarden.location}/bitwarden_rs"; + options = [ "bind" ]; + }; + }; services.vaultwarden = { enable = cfg.bitwarden.enable; dbBackend = "sqlite"; diff --git a/social/pleroma.nix b/social/pleroma.nix index 9ffb88c..47ce827 100644 --- a/social/pleroma.nix +++ b/social/pleroma.nix @@ -3,6 +3,16 @@ let cfg = config.services.userdata; in { + fileSystems = lib.mkIf cfg.useBinds { + "/var/lib/pleroma" = { + device = "/volumes/${cfg.pleroma.location}/pleroma"; + options = [ "bind" ]; + }; + "/var/lib/postgresql" = { + device = "/volumes/${cfg.pleroma.location}/postgresql"; + options = [ "bind" ]; + }; + }; services = { pleroma = { enable = cfg.pleroma.enable; diff --git a/variables.nix b/variables.nix index a1f2c22..6651999 100644 --- a/variables.nix +++ b/variables.nix @@ -23,15 +23,19 @@ in }; bitwarden = { enable = lib.attrsets.attrByPath [ "bitwarden" "enable" ] false jsonData; + location = lib.attrsets.attrByPath [ "bitwarden" "location" ] "sda1" jsonData; }; gitea = { enable = lib.attrsets.attrByPath [ "gitea" "enable" ] false jsonData; + location = lib.attrsets.attrByPath [ "gitea" "location" ] "sda1" jsonData; }; nextcloud = { enable = lib.attrsets.attrByPath [ "nextcloud" "enable" ] false jsonData; + location = lib.attrsets.attrByPath [ "nextcloud" "location" ] "sda1" jsonData; }; pleroma = { enable = lib.attrsets.attrByPath [ "pleroma" "enable" ] false jsonData; + location = lib.attrsets.attrByPath [ "pleroma" "location" ] "sda1" jsonData; }; jitsi = { enable = lib.attrsets.attrByPath [ "jitsi" "enable" ] false jsonData; @@ -44,7 +48,11 @@ in rootKeys = lib.attrsets.attrByPath [ "ssh" "rootKeys" ] [ "" ] jsonData; passwordAuthentication = lib.attrsets.attrByPath [ "ssh" "passwordAuthentication" ] true jsonData; }; + email = { + location = lib.attrsets.attrByPath [ "email" "location" ] "sda1" jsonData; + }; users = lib.attrsets.attrByPath [ "users" ] [ ] jsonData; volumes = lib.attrsets.attrByPath [ "volumes" ] [ ] jsonData; + useBinds = lib.attrsets.attrByPath [ "useBinds" ] false jsonData; }; }