System/machines/oracles/automation.nix

32 lines
794 B
Nix
Raw Normal View History

2023-05-13 17:24:13 -04:00
{ config, lib, pkgs, inputs, ... }:
let
repo-updater = pkgs.writeShellScriptBin "repo-updater"
(builtins.readFile ../../scripts/gitea/update-repo.sh);
in {
# Setup hosts for gitea automation
networking.hosts = { "100.99.69.14" = [ "git.stranger.systems" ]; };
# Automate updating rust utility flake
systemd.services."rust-util-update" = {
environment = {
XDG_RUNTIME_DIR = "/tmp";
HOME = "/home/nathan";
};
path = with pkgs; [
git
inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.nurl
jq
curl
openssh
bash
];
script = ''
env
${repo-updater}/bin/repo-updater gitea@git.stranger.systems:nix/Rust.git trunk
'';
serviceConfig = {
Type = "oneshot";
User = "nathan";
};
};
}