Skip to content

Commit

Permalink
feat!: remove nixpkgs syncing from blahaj
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelroses committed Nov 21, 2024
1 parent b2cc10d commit 97110f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 52 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 14 additions & 49 deletions modules/nixos/services/selfhosted/blahaj.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
lib,
pkgs,
config,
inputs',
...
Expand Down Expand Up @@ -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;
};
};
};
Expand Down

0 comments on commit 97110f2

Please sign in to comment.