Skip to content

Commit

Permalink
nix-gc: set service type to oneshot
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninja3047 authored and rycee committed Jul 30, 2024
1 parent db40fea commit d34aaf7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/services/nix-gc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/modules/services/nix-gc/expected.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[Service]
ExecStart=/nix/store/00000000000000000000000000000000-nix-gc
Type=oneshot

[Unit]
Description=Nix Garbage Collector

0 comments on commit d34aaf7

Please sign in to comment.