diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/secrets.nix | 2 | ||||
| -rw-r--r-- | modules/secrets.yaml (renamed from modules/secrets.yml) | 0 | ||||
| -rw-r--r-- | modules/timers.nix | 68 |
3 files changed, 69 insertions, 1 deletions
diff --git a/modules/secrets.nix b/modules/secrets.nix index df1e9f0..7cb1e22 100644 --- a/modules/secrets.nix +++ b/modules/secrets.nix @@ -2,7 +2,7 @@ sops = { defaultSopsFile = ./secrets.yaml; - age.sshKeyPaths = [ "/home/kyren/.ssh/id_ed25519" ]; + age.sshKeyPaths = [ "/home/kyren/.ssh/sops_id_ed25519" ]; }; } diff --git a/modules/secrets.yml b/modules/secrets.yaml index b3d2e72..b3d2e72 100644 --- a/modules/secrets.yml +++ b/modules/secrets.yaml diff --git a/modules/timers.nix b/modules/timers.nix new file mode 100644 index 0000000..9c6f4a4 --- /dev/null +++ b/modules/timers.nix @@ -0,0 +1,68 @@ +{ 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"; }; + }; + +} |
