From d34aaf7b3b4c98f2aefe0429b8946f2bcd36a59a Mon Sep 17 00:00:00 2001 From: Ninja3047 <1284324+Ninja3047@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:45:50 -0400 Subject: [PATCH] nix-gc: set service type to oneshot --- modules/services/nix-gc.nix | 1 + tests/modules/services/nix-gc/expected.service | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/services/nix-gc.nix b/modules/services/nix-gc.nix index 0f4772046..fe7e46698 100644 --- a/modules/services/nix-gc.nix +++ b/modules/services/nix-gc.nix @@ -110,6 +110,7 @@ in { systemd.user.services.nix-gc = { Unit = { Description = "Nix Garbage Collector"; }; Service = { + Type = "oneshot"; ExecStart = toString (pkgs.writeShellScript "nix-gc" '' exec "${nixPackage}/bin/nix-collect-garbage ${ lib.optionalString (cfg.options != null) cfg.options diff --git a/tests/modules/services/nix-gc/expected.service b/tests/modules/services/nix-gc/expected.service index 73c0355ce..47bca9895 100644 --- a/tests/modules/services/nix-gc/expected.service +++ b/tests/modules/services/nix-gc/expected.service @@ -1,5 +1,6 @@ [Service] ExecStart=/nix/store/00000000000000000000000000000000-nix-gc +Type=oneshot [Unit] Description=Nix Garbage Collector