From 5b7093dde0203bdd9526f9eadf4d078f218651ec Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Mon, 18 Mar 2024 15:19:43 +0100 Subject: [PATCH] Rename service and see if it works now --- nixos/hosts/shodan/auto-mount.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/nixos/hosts/shodan/auto-mount.nix b/nixos/hosts/shodan/auto-mount.nix index 15ad8a3..3901309 100644 --- a/nixos/hosts/shodan/auto-mount.nix +++ b/nixos/hosts/shodan/auto-mount.nix @@ -16,17 +16,14 @@ KERNEL=="nvme0n1p9|nvme0n1p1[0-9]", ACTION=="add", RUN+="${pkgs.systemd}/bin/systemctl start --no-block external-drive-mount@%k.service" KERNEL=="nvme0n1p9|nvme0n1p1[0-9]", ACTION=="remove", RUN+="${pkgs.systemd}/bin/systemctl stop --no-block external-drive-mount@%k.service" ''; - systemd.services.auto-mount = { + systemd.services."external-drive-mount@" = { enable = true; description = "Mount External Drive on %i"; - unitConfig = { - }; serviceConfig = { Type = "oneshot"; + RemainAfterExit = true; ExecStart = "/run/current-system/sw/bin/automount add %i"; ExecStop = "/run/current-system/sw/bin/automount remove %i"; - RemainAfterExit = true; }; - wantedBy = ["multi-user.target"]; }; }