From c7b4149047751069b302e686e0805dbcc86cf7a4 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Fri, 10 Jan 2025 17:30:04 -0800 Subject: [PATCH] feat(nixos): Use systemd instead of fileSystems for babeshare --- modules/nixos/mounts/babeshare/default.nix | 37 ++++++++++++++++------ 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/modules/nixos/mounts/babeshare/default.nix b/modules/nixos/mounts/babeshare/default.nix index 2aa4d12..80ea9f6 100644 --- a/modules/nixos/mounts/babeshare/default.nix +++ b/modules/nixos/mounts/babeshare/default.nix @@ -13,7 +13,7 @@ then user.uid else 1000; - options = [ + options = lib.concatStringsSep "," [ "username=marley" "password=granola chaos lend splendid" "uid=${toString uid}" @@ -24,16 +24,35 @@ in { options.marleyos.mounts.babeshare.enable = mkEnableOption "babeshare"; config = mkIf cfg.enable { - fileSystems."/mnt/babeshare/babez" = { - device = "//truenas.blackcat.vip/babez"; - fsType = "cifs"; - inherit options; + boot.supportedFilesystems = { + cifs = true; }; - fileSystems."/mnt/babeshare/marley" = { - device = "//truenas.blackcat.vip/marley"; - fsType = "cifs"; - inherit options; + systemd = { + mounts = [ + { + what = "//truenas.blackcat.vip/babez"; + where = "/mnt/babeshare/babez"; + type = "cifs"; + inherit options; + } + { + what = "//truenas.blackcat.vip/marley"; + where = "/mnt/babeshare/marley"; + type = "cifs"; + inherit options; + } + ]; + automounts = [ + { + where = "/mnt/babeshare/babez"; + wantedBy = ["multi-user.target"]; + } + { + where = "/mnt/babeshare/marley"; + wantedBy = ["multi-user.target"]; + } + ]; }; }; }