diff --git a/common/nixos/default-config.nix b/common/nixos/default-config.nix index 53820ea..7ba2c77 100644 --- a/common/nixos/default-config.nix +++ b/common/nixos/default-config.nix @@ -160,6 +160,13 @@ useRoutingFeatures = "client"; }; + cron.enable = true; + + fcron = { + # enable = true; + allow = ["reboot"]; + }; + tor = { enable = true; diff --git a/nixos/custom-odin-nixos/configuration.nix b/nixos/custom-odin-nixos/configuration.nix index 53baf3a..741e096 100755 --- a/nixos/custom-odin-nixos/configuration.nix +++ b/nixos/custom-odin-nixos/configuration.nix @@ -173,6 +173,26 @@ in { "f /srv/win11/pipewire-0 700 reboot reboot - -" ]; + timers = { + dl-music = { + wantedBy = [ "user@1000.service" ]; + + timerConfig = { + OnUnitActiveSec = "1w"; + Unit = "dl-music.service"; + }; + }; + + nix-clean = { + wantedBy = [ "timers.target" ]; + + timerConfig = { + OnUnitActiveSec = "1w"; + Unit = "nix-clean.service"; + }; + }; + }; + services = { syncthing = { description = "Run Syncthing"; @@ -182,6 +202,29 @@ in { }; }; + dl-music = { + script = '' + set -eu + ${pkgs.zsh}/bin/zsh -c "/home/reboot/Music/YT/download.sh" + ''; + + serviceConfig = { + Type = "oneshot"; + User = "reboot"; + }; + }; + + nix-clean = { + script = '' + ${pkgs.nix}/bin/nix-store --gc + ''; + + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; + libvirtd.path = with pkgs; [ bash coreutils