Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J1cugeLkfFLZMpiztQ8TyN
22 lines
532 B
Nix
22 lines
532 B
Nix
# Rebuild this machine from the flake (nh when present, else nixos-rebuild).
|
|
# nh and nixos-rebuild are taken from the system PATH on purpose.
|
|
{
|
|
lib,
|
|
writeShellApplication,
|
|
coreutils,
|
|
git,
|
|
}:
|
|
writeShellApplication {
|
|
name = "switch-system";
|
|
runtimeInputs = [
|
|
coreutils
|
|
git
|
|
];
|
|
text = builtins.readFile ./switch-system.sh;
|
|
meta = {
|
|
description = "Rebuild and switch this NixOS machine from its flake (nh os / nixos-rebuild)";
|
|
mainProgram = "switch-system";
|
|
platforms = lib.platforms.linux;
|
|
};
|
|
}
|