From 2b0f329a5669b710f5fdc26b441a7684b80ea8ae Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Tue, 2 Jun 2026 16:40:33 +0300 Subject: [PATCH] migrate systemd units and timers over to fedora --- .config/systemd/user/git-auto-sync.service | 6 ++ .config/systemd/user/git-auto-sync.timer | 10 ++++ hosts/configuration.nix | 1 - modules/systemd.nix | 68 ---------------------- 4 files changed, 16 insertions(+), 69 deletions(-) create mode 100644 .config/systemd/user/git-auto-sync.service create mode 100644 .config/systemd/user/git-auto-sync.timer delete mode 100644 modules/systemd.nix diff --git a/.config/systemd/user/git-auto-sync.service b/.config/systemd/user/git-auto-sync.service new file mode 100644 index 0000000..9f5014e --- /dev/null +++ b/.config/systemd/user/git-auto-sync.service @@ -0,0 +1,6 @@ +[Unit] +Description=Automated Git Sync Service + +[Service] +Type=oneshot +ExecStart=%h/scripts/git-auto-sync.sh diff --git a/.config/systemd/user/git-auto-sync.timer b/.config/systemd/user/git-auto-sync.timer new file mode 100644 index 0000000..05ab6b2 --- /dev/null +++ b/.config/systemd/user/git-auto-sync.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Automated Git Sync Timer + +[Timer] +OnBootSec=5m +OnUnitActiveSec=5m +Unit=git-auto-sync.service + +[Install] +WantedBy=timers.target diff --git a/hosts/configuration.nix b/hosts/configuration.nix index fc93465..f34119e 100644 --- a/hosts/configuration.nix +++ b/hosts/configuration.nix @@ -8,7 +8,6 @@ ../modules/development.nix ../modules/gaming.nix ../modules/secrets.nix - ../modules/systemd.nix inputs.home-manager.nixosModules.default ]; diff --git a/modules/systemd.nix b/modules/systemd.nix deleted file mode 100644 index 59c6113..0000000 --- a/modules/systemd.nix +++ /dev/null @@ -1,68 +0,0 @@ -{ config, pkgs, ... }: { - - systemd.timers."git-auto-sync" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnBootSec = "5m"; - OnUnitActiveSec = "5m"; - Unit = "git-auto-sync.service"; - }; - }; - - systemd.services."git-auto-sync" = { - script = "$HOME/scripts/git-auto-sync.sh"; - path = [ - pkgs.git - pkgs.gh - pkgs.keychain - pkgs.openssh - ]; - serviceConfig = { Type = "oneshot"; User = "kyren"; }; - }; - - ########################################################################### - - systemd.timers."k-sleep-tracker" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnBootSec = "1m"; - OnUnitActiveSec = "1m"; - Unit = "k-sleep-tracker.service"; - }; - }; - - systemd.services."k-sleep-tracker" = { - script = "$HOME/projects/k/bin/k tracker sleep"; - serviceConfig = { Type = "oneshot"; User = "kyren"; }; - }; - - ########################################################################### - - # systemd.timers."git-auto-mirror" = { - # wantedBy = [ "timers.target" ]; - # timerConfig = { - # OnBootSec = "1m"; - # OnUnitActiveSec = "5h"; - # Unit = "git-auto-mirror.service"; - # }; - # }; - - sops.secrets.gitea-sync-token = { owner = "kyren"; }; - sops.secrets.github-mirror-token = { owner = "kyren"; }; - systemd.services."git-auto-mirror" = { - script = "python $HOME/scripts/gitea.py"; - path = [ - (pkgs.python312.withPackages (pypkgs: [ - pypkgs.matplotlib - pypkgs.pandas - pypkgs.pygithub - ])) - ]; - environment = { - GITEA_TOKEN_FILE = config.sops.secrets.gitea-sync-token.path; - GITHUB_TOKEN_FILE = config.sops.secrets.github-mirror-token.path; - }; - serviceConfig = { Type = "oneshot"; User = "kyren"; }; - }; - -}