2024-01-25 14:12:00 +00:00
|
|
|
{ callPackage
|
|
|
|
, substituteAll
|
2021-01-17 00:15:33 +00:00
|
|
|
, runtimeShell
|
|
|
|
, coreutils
|
|
|
|
, gnused
|
|
|
|
, gnugrep
|
2023-10-09 19:29:22 +00:00
|
|
|
, jq
|
|
|
|
, util-linux
|
2021-01-17 00:15:33 +00:00
|
|
|
, nix
|
|
|
|
, lib
|
2022-03-30 09:31:56 +00:00
|
|
|
, nixosTests
|
2023-08-22 20:05:09 +00:00
|
|
|
, installShellFiles
|
2021-01-17 00:15:33 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
fallback = import ./../../../../nixos/modules/installer/tools/nix-fallback-paths.nix;
|
|
|
|
in
|
|
|
|
substituteAll {
|
|
|
|
name = "nixos-rebuild";
|
|
|
|
src = ./nixos-rebuild.sh;
|
|
|
|
dir = "bin";
|
|
|
|
isExecutable = true;
|
|
|
|
inherit runtimeShell nix;
|
|
|
|
nix_x86_64_linux = fallback.x86_64-linux;
|
|
|
|
nix_i686_linux = fallback.i686-linux;
|
2021-05-20 23:08:51 +00:00
|
|
|
nix_aarch64_linux = fallback.aarch64-linux;
|
2023-10-09 19:29:22 +00:00
|
|
|
path = lib.makeBinPath [ coreutils gnused gnugrep jq util-linux ];
|
2023-08-22 20:05:09 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
postInstall = ''
|
|
|
|
installManPage ${./nixos-rebuild.8}
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
installShellCompletion \
|
|
|
|
--bash ${./_nixos-rebuild}
|
2023-08-22 20:05:09 +00:00
|
|
|
'';
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
# run some a simple installer tests to make sure nixos-rebuild still works for them
|
|
|
|
passthru.tests = {
|
2023-11-16 04:20:00 +00:00
|
|
|
install-bootloader = nixosTests.nixos-rebuild-install-bootloader;
|
2024-01-25 14:12:00 +00:00
|
|
|
repl = callPackage ./test/repl.nix {};
|
2023-01-20 10:41:00 +00:00
|
|
|
simple-installer = nixosTests.installer.simple;
|
|
|
|
specialisations = nixosTests.nixos-rebuild-specialisations;
|
2024-01-25 14:12:00 +00:00
|
|
|
target-host = nixosTests.nixos-rebuild-target-host;
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Rebuild your NixOS configuration and switch to it, on local hosts and remote.";
|
|
|
|
homepage = "https://github.com/NixOS/nixpkgs/tree/master/pkgs/os-specific/linux/nixos-rebuild";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.Profpatsch ];
|
|
|
|
mainProgram = "nixos-rebuild";
|
|
|
|
};
|
2021-01-17 00:15:33 +00:00
|
|
|
}
|