diff --git a/user/home.nix b/user/home.nix index c384c60..271ceee 100644 --- a/user/home.nix +++ b/user/home.nix @@ -44,6 +44,7 @@ inputs.nix-index-database.hmModules.nix-index ../settings ./powerplay-led-idle.nix + ./rm-target.nix ]; my = import ./variables.nix // { @@ -169,30 +170,6 @@ exec nicotine ''; - systemd.user.services.rm-target = { - Unit = { - Description = "Remove directories named 'target'"; - }; - Service = { - Type = "oneshot"; - ExecStart = pkgs.writeShellScript "rm-target" '' - sudo ${pkgs.fd}/bin/fd -td -u '^\.?target$' "$HOME" -x rm -vrf -- - ''; - }; - }; - systemd.user.timers.rm-target = { - Unit = { - Description = "Remove directories named 'target'"; - }; - Timer = { - OnCalendar = "weekly"; - Unit = "rm-target.service"; - }; - Install = { - WantedBy = [ "timers.target" ]; - }; - }; - # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage # when a new Home Manager release introduces backwards diff --git a/user/rm-target.nix b/user/rm-target.nix new file mode 100644 index 0000000..93c6058 --- /dev/null +++ b/user/rm-target.nix @@ -0,0 +1,26 @@ +{ pkgs, lib, ... }: +{ + systemd.user.services.rm-target = { + Unit = { + Description = "Remove directories named 'target'"; + }; + Service = { + Type = "oneshot"; + ExecStart = pkgs.writeShellScript "rm-target" '' + sudo ${pkgs.fd}/bin/fd -td -u '^\.?target$' "$HOME" -x rm -vrf -- + ''; + }; + }; + systemd.user.timers.rm-target = { + Unit = { + Description = "Remove directories named 'target'"; + }; + Timer = { + OnCalendar = "weekly"; + Unit = "rm-target.service"; + }; + Install = { + WantedBy = [ "timers.target" ]; + }; + }; +}