Compare commits
2 Commits
343ce80661
...
23d05a3e5d
Author | SHA1 | Date | |
---|---|---|---|
23d05a3e5d | |||
059aaa760b |
@ -112,6 +112,7 @@
|
||||
};
|
||||
in {
|
||||
inherit (pkgs)
|
||||
clerie-system-upgrade
|
||||
chromium-incognito
|
||||
iot-data
|
||||
nix-remove-result-links
|
||||
@ -119,7 +120,6 @@
|
||||
nixfiles-auto-install
|
||||
nixfiles-generate-backup-secrets
|
||||
nixfiles-generate-config
|
||||
nixfiles-system-upgrade
|
||||
nixfiles-updated-inputs
|
||||
nixfiles-update-ssh-host-keys
|
||||
update-from-hydra
|
||||
|
@ -35,7 +35,7 @@ in
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = pkgs.nixfiles-system-upgrade + "/bin/nixfiles-system-upgrade --no-confirm${optionalString cfg.allowReboot " --allow-reboot"}${optionalString (config.clerie.monitoring.enable) " --node-exporter-metrics-path /var/lib/prometheus-node-exporter/textfiles/nixfiles-system-upgrade.prom"}";
|
||||
ExecStart = pkgs.clerie-system-upgrade + "/bin/clerie-system-upgrade --no-confirm${optionalString cfg.allowReboot " --allow-reboot"}${optionalString (config.clerie.monitoring.enable) " --node-exporter-metrics-path /var/lib/prometheus-node-exporter/textfiles/clerie-system-upgrade.prom"}";
|
||||
};
|
||||
};
|
||||
systemd.timers.clerie-system-auto-upgrade = mkIf cfg.autoUpgrade {
|
||||
@ -47,7 +47,7 @@ in
|
||||
after = [ "network-online.target" ];
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
nixfiles-system-upgrade
|
||||
clerie-system-upgrade
|
||||
];
|
||||
};
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
pkgs.writeShellApplication {
|
||||
name = "nixfiles-system-upgrade";
|
||||
text = builtins.readFile ./nixfiles-system-upgrade.sh;
|
||||
name = "clerie-system-upgrade";
|
||||
text = builtins.readFile ./clerie-system-upgrade.sh;
|
||||
runtimeInputs = with pkgs; [
|
||||
curl
|
||||
jq
|
@ -55,7 +55,7 @@ echo "Set as boot target"
|
||||
|
||||
if [[ -n "$NODE_EXPORTER_METRICS_PATH" ]]; then
|
||||
echo "Write monitoring check data"
|
||||
echo "nixfiles_system_upgrade_last_check $(date +%s)" > "$NODE_EXPORTER_METRICS_PATH"
|
||||
echo "clerie_system_upgrade_last_check $(date +%s)" > "$NODE_EXPORTER_METRICS_PATH"
|
||||
fi
|
||||
|
||||
BOOTED_SYSTEM_KERNEL="$(readlink /run/booted-system/{initrd,kernel,kernel-modules})"
|
@ -3,7 +3,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
xgit() {
|
||||
git -c "user.name=Flake Update Bot" -c "user.email=flake-update-bot@clerie.de" "$@"
|
||||
git -c "user.name=Flake Update Bot" -c "user.email=flake-update-bot@clerie.de" -c "core.pager=cat" "$@"
|
||||
}
|
||||
|
||||
NOW="$(date --utc +%Y-%m-%d-%H-%M)"
|
||||
@ -25,8 +25,19 @@ nix flake lock --update-input nixpkgs
|
||||
|
||||
echo "[!] Commit changes"
|
||||
xgit add flake.lock
|
||||
|
||||
xgit commit -m "Update nixpkgs ${NOW}" || true
|
||||
|
||||
xgit diff --name-status origin/updated-inputs "${UPDATE_BRANCH}"
|
||||
|
||||
echo "[!] biep"
|
||||
if xgit diff --quiet origin/updated-inputs "${UPDATE_BRANCH}"
|
||||
then
|
||||
echo "[!] Nothing changed, removing branch"
|
||||
xgit branch -D "${UPDATE_BRANCH}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "[!] Publish ${UPDATE_BRANCH}"
|
||||
xgit push --set-upstream origin "${UPDATE_BRANCH}"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
final: prev: {
|
||||
clerie-system-upgrade = final.callPackage ./clerie-system-upgrade/clerie-system-upgrade.nix {};
|
||||
chromium-incognito = final.callPackage ./chromium-incognito {};
|
||||
iot-data = final.python3.pkgs.callPackage ./iot-data {};
|
||||
nix-remove-result-links = final.callPackage ./nix-remove-result-links {};
|
||||
@ -6,7 +7,6 @@ final: prev: {
|
||||
nixfiles-auto-install = final.callPackage ./nixfiles/nixfiles-auto-install.nix {};
|
||||
nixfiles-generate-backup-secrets = final.callPackage ./nixfiles/nixfiles-generate-backup-secrets.nix {};
|
||||
nixfiles-generate-config = final.callPackage ./nixfiles/nixfiles-generate-config.nix {};
|
||||
nixfiles-system-upgrade = final.callPackage ./nixfiles/nixfiles-system-upgrade.nix {};
|
||||
nixfiles-updated-inputs = final.callPackage ./nixfiles/nixfiles-updated-inputs.nix {};
|
||||
nixfiles-update-ssh-host-keys = final.callPackage ./nixfiles/nixfiles-update-ssh-host-keys.nix {};
|
||||
update-from-hydra = final.callPackage ./update-from-hydra {};
|
||||
|
Loading…
Reference in New Issue
Block a user