diff options
author | zimbatm <zimbatm@zimbatm.com> | 2018-10-09 23:10:45 +0200 |
---|---|---|
committer | zimbatm <zimbatm@zimbatm.com> | 2018-10-16 11:12:36 +0200 |
commit | 187534454271910dcc023a9b0a0c27e9e79ecade (patch) | |
tree | f85579c48fa87348bb6b344d24132219f102b682 /nixos/modules/installer/tools/tools.nix | |
parent | b7a07313cc72219964b93e47c36fffeed314a351 (diff) | |
download | nixlib-187534454271910dcc023a9b0a0c27e9e79ecade.tar nixlib-187534454271910dcc023a9b0a0c27e9e79ecade.tar.gz nixlib-187534454271910dcc023a9b0a0c27e9e79ecade.tar.bz2 nixlib-187534454271910dcc023a9b0a0c27e9e79ecade.tar.lz nixlib-187534454271910dcc023a9b0a0c27e9e79ecade.tar.xz nixlib-187534454271910dcc023a9b0a0c27e9e79ecade.tar.zst nixlib-187534454271910dcc023a9b0a0c27e9e79ecade.zip |
nixos-*: init as package
Move all the nixos-* scripts from the nixos distribution as real packages in the pkgs/ package set. This allows non-nixos users to run the script as well. For example, deploying a remote machine with: nixos-rebuild --target-host root@hostname --build-host root@hostname
Diffstat (limited to 'nixos/modules/installer/tools/tools.nix')
-rw-r--r-- | nixos/modules/installer/tools/tools.nix | 86 |
1 files changed, 22 insertions, 64 deletions
diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index af0a3a2fcc88..6d9ebf750825 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -6,77 +6,35 @@ with lib; let - makeProg = args: pkgs.substituteAll (args // { - dir = "bin"; - isExecutable = true; - }); - - nixos-build-vms = makeProg { - name = "nixos-build-vms"; - src = ./nixos-build-vms/nixos-build-vms.sh; - }; - - nixos-install = makeProg { - name = "nixos-install"; - src = ./nixos-install.sh; - nix = config.nix.package.out; - path = makeBinPath [ nixos-enter ]; - }; - - nixos-rebuild = - let fallback = import ./nix-fallback-paths.nix; in - makeProg { - name = "nixos-rebuild"; - src = ./nixos-rebuild.sh; - nix = config.nix.package.out; - nix_x86_64_linux = fallback.x86_64-linux; - nix_i686_linux = fallback.i686-linux; - }; - - nixos-generate-config = makeProg { - name = "nixos-generate-config"; - src = ./nixos-generate-config.pl; - path = [ pkgs.btrfs-progs ]; - perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl"; - inherit (config.system.nixos) release; - }; - - nixos-option = makeProg { - name = "nixos-option"; - src = ./nixos-option.sh; - }; - - nixos-version = makeProg { - name = "nixos-version"; - src = ./nixos-version.sh; - inherit (config.system.nixos) version codeName revision; - }; - - nixos-enter = makeProg { - name = "nixos-enter"; - src = ./nixos-enter.sh; - }; - + nixos-build-vms = pkgs.nixos-build-vms; + nixos-enter = pkgs.nixos-enter; + nixos-generate-config = pkgs.nixos-generate-config.override { inherit (config.system.nixos) release; }; + nixos-install = pkgs.nixos-install.override { nix = config.nix.package; }; + nixos-option = pkgs.nixos-option; + nixos-rebuild = pkgs.nixos-rebuild.override { nix = config.nix.package; }; + nixos-version = pkgs.nixos-version.override { inherit (config.system.nixos) version codeName revision; }; in { - config = { + environment.systemPackages = [ + nixos-build-vms + nixos-enter + nixos-generate-config + nixos-install + nixos-option + nixos-rebuild + nixos-version + ]; - environment.systemPackages = - [ nixos-build-vms - nixos-install - nixos-rebuild + system.build = { + inherit + nixos-enter nixos-generate-config + nixos-install nixos-option - nixos-version - nixos-enter - ]; - - system.build = { - inherit nixos-install nixos-generate-config nixos-option nixos-rebuild nixos-enter; + nixos-rebuild + ; }; - }; - } |