Files
NixOsConfig/pkgs/switch-system/default.nix
T
2026-10-12 18:15:38 +03:00

22 lines
532 B
Nix
Executable File

# 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;
};
}