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"]; }; }