Skip to content

Instantly share code, notes, and snippets.

@bew
Created April 11, 2020 19:22
Show Gist options
  • Select an option

  • Save bew/88d76f93d564ccdcc9cbefed09f0c227 to your computer and use it in GitHub Desktop.

Select an option

Save bew/88d76f93d564ccdcc9cbefed09f0c227 to your computer and use it in GitHub Desktop.
Nix derivation that makes the nixos install tools available on any Nix-enabled system
let
nixos-expr = builtins.fetchTarball {
url = "https://nixos.org/channels/nixos-20.03-small/nixexprs.tar.xz";
sha256 = "1a5d5qpmakyvqzn99x7p5lc4114mynk9wpz4mrzbixmmp4njxz75";
};
nixos = import "${nixos-expr}/nixos" { configuration = {}; };
nixos-install-tools = with nixos.config.system.build; [
nixos-generate-config
nixos-install
nixos-enter
manual.manpages
];
nixpkgs = import "${nixos-expr}/nixpkgs" {};
pkgs = nixpkgs.pkgs;
in nixpkgs.stdenv.mkDerivation {
name = "nixos-install-tools";
buildInputs = [ pkgs.nix ] ++ nixos-install-tools;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment