From 97110f29157dc4754acdca7bd993b1bc580e7c9c Mon Sep 17 00:00:00 2001 From: isabel Date: Thu, 21 Nov 2024 22:26:47 +0000 Subject: [PATCH] feat!: remove nixpkgs syncing from blahaj --- flake.lock | 6 +- modules/nixos/services/selfhosted/blahaj.nix | 63 +++++--------------- 2 files changed, 17 insertions(+), 52 deletions(-) diff --git a/flake.lock b/flake.lock index d8f5271c5..b291846e9 100644 --- a/flake.lock +++ b/flake.lock @@ -100,11 +100,11 @@ ] }, "locked": { - "lastModified": 1732204220, - "narHash": "sha256-aaFMCE8oc1XNb1BmDaCz87cc44mGsPIWksn5ZzsdAXY=", + "lastModified": 1732226460, + "narHash": "sha256-G95Dlb1Q3sNYoI4LDBCiPW/zFVN2gIpHNDi7ecJme68=", "owner": "isabelroses", "repo": "beapkgs", - "rev": "68219e45a35c581b75673c6561313394fb387128", + "rev": "7e02206f811eac3449db0c1a3b02fa9f9e609129", "type": "github" }, "original": { diff --git a/modules/nixos/services/selfhosted/blahaj.nix b/modules/nixos/services/selfhosted/blahaj.nix index e33fbc180..b90b32c06 100644 --- a/modules/nixos/services/selfhosted/blahaj.nix +++ b/modules/nixos/services/selfhosted/blahaj.nix @@ -1,6 +1,5 @@ { lib, - pkgs, config, inputs', ... @@ -28,54 +27,20 @@ in }; }; - systemd = { - timers."blahaj-nixpkgs" = { - wantedBy = [ "timers.target" ]; - timerConfig = { - OnBootSec = "30m"; - OnUnitActiveSec = "30m"; - Unit = "blahaj-nixpkgs.service"; - }; - }; - - services = { - blahaj = { - description = "blahaj"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - - serviceConfig = { - Type = "simple"; - User = "blahaj"; - Group = "blahaj"; - ReadWritePaths = [ "/srv/storage/blahaj/nixpkgs" ]; - EnvironmentFile = config.age.secrets.blahaj-env.path; - ExecStart = getExe inputs'.beapkgs.packages.blahaj; - Restart = "always"; - } // template.systemd; - }; - - "blahaj-nixpkgs" = { - description = "blahaj update nixpkgs"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - - script = - let - cmd = "${getExe pkgs.git} -c safe.directory=/srv/storage/blahaj/nixpkgs -C /srv/storage/blahaj/nixpkgs"; - in - '' - ${cmd} fetch origin - ${cmd} pull origin master --rebase - ''; - - serviceConfig = { - Type = "oneshot"; - User = "blahaj"; - Group = "blahaj"; - ReadWritePaths = [ "/srv/storage/blahaj/nixpkgs" ]; - } // template.systemd; - }; + systemd.services = { + blahaj = { + description = "blahaj"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + Type = "simple"; + User = "blahaj"; + Group = "blahaj"; + EnvironmentFile = config.age.secrets.blahaj-env.path; + ExecStart = getExe inputs'.beapkgs.packages.blahaj; + Restart = "always"; + } // template.systemd; }; }; };