pkgs/nixfiles: Add helper script to trigger system upgrades
This commit is contained in:
10
pkgs/nixfiles/nixfiles-trigger-system-upgrade.nix
Normal file
10
pkgs/nixfiles/nixfiles-trigger-system-upgrade.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
pkgs.writeShellApplication {
|
||||
name = "nixfiles-trigger-system-upgrade";
|
||||
text = builtins.readFile ./nixfiles-trigger-system-upgrade.sh;
|
||||
runtimeInputs = with pkgs; [
|
||||
pssh
|
||||
];
|
||||
}
|
||||
|
||||
5
pkgs/nixfiles/nixfiles-trigger-system-upgrade.sh
Executable file
5
pkgs/nixfiles/nixfiles-trigger-system-upgrade.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
TARGETS="$(nix --extra-experimental-features "nix-command flakes" eval --raw ".#nixosConfigurations" --apply "nixosConfigurations: builtins.concatStringsSep \"\\n\" (builtins.attrValues (builtins.mapAttrs (name: host: host.config.networking.fqdn) nixosConfigurations))")"
|
||||
|
||||
pssh -h <(echo "${TARGETS}") -i -- sudo systemctl start clerie-system-auto-upgrade.service --no-block
|
||||
Reference in New Issue
Block a user