Files
NixOsConfig/pkgs/switch-system/default.nix
T

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