Revert "Merge pull request #48122 from zimbatm/pkg-nixos-rebuild"

This reverts commit 10addad603, reversing
changes made to 7786575c6c.

NixOS scripts should be kept in the NixOS source tree, not in
pkgs. Moving them around is just confusing and creates unnecessary
code/history churn.
This commit is contained in:
Eelco Dolstra 2018-10-16 20:25:44 +02:00
parent 887bf77621
commit b6bac6c144
No known key found for this signature in database
GPG Key ID: 8170B4726D7198DE
20 changed files with 69 additions and 115 deletions

View File

@ -1 +0,0 @@
Koi

View File

@ -98,9 +98,6 @@ rec {
# The current nixpkgs version number as string.
release = lib.strings.fileContents ../.version;
# Note: the first letter is bumped on every release. It's an animal.
codeName = lib.strings.fileContents ../.codeName;
# The current nixpkgs version suffix as string.
versionSuffix =
let suffixFile = ../.version-suffix;

View File

@ -6,35 +6,77 @@
with lib;
let
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; };
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;
};
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
nixos-generate-config
nixos-option
nixos-version
nixos-enter
];
system.build = {
inherit
nixos-enter
nixos-generate-config
nixos-install
nixos-option
nixos-rebuild
;
inherit nixos-install nixos-generate-config nixos-option nixos-rebuild nixos-enter;
};
};
}

View File

@ -43,7 +43,6 @@ in
nixos.codeName = mkOption {
readOnly = true;
type = types.str;
default = lib.trivial.codeName;
description = "The NixOS release code name (e.g. <literal>Emu</literal>).";
};
@ -80,6 +79,9 @@ in
version = mkDefault (cfg.release + cfg.versionSuffix);
revision = mkIf (pathIsDirectory gitRepo) (mkDefault gitCommitId);
versionSuffix = mkIf (pathIsDirectory gitRepo) (mkDefault (".git." + gitCommitId));
# Note: the first letter is bumped on every release. It's an animal.
codeName = "Koi";
};
# Generate /etc/os-release. See

View File

@ -1,7 +0,0 @@
{ substituteAll }:
substituteAll {
name = "nixos-build-vms";
dir = "bin";
isExecutable = true;
src = ./nixos-build-vms.sh;
}

View File

@ -1,7 +0,0 @@
{ substituteAll }:
substituteAll {
name = "nixos-enter";
dir = "bin";
isExecutable = true;
src = ./nixos-enter.sh;
}

View File

@ -1,16 +0,0 @@
{ substituteAll
, btrfs-progs
, perl
, perlPackages
, lib
, release ? lib.trivial.release
}:
substituteAll {
name = "nixos-generate-config";
dir = "bin";
isExecutable = true;
src = ./nixos-generate-config.pl;
path = [ btrfs-progs ];
perl = "${perl}/bin/perl -I${perlPackages.FileSlurp}/lib/perl5/site_perl";
inherit release;
}

View File

@ -1,13 +0,0 @@
{ substituteAll
, lib
, nix
, nixos-enter
}:
substituteAll {
name = "nixos-install";
dir = "bin";
isExecutable = true;
src = ./nixos-install.sh;
nix = nix.out;
path = lib.makeBinPath [ nixos-enter ];
}

View File

@ -1,7 +0,0 @@
{ substituteAll }:
substituteAll {
name = "nixos-option";
dir = "bin";
isExecutable = true;
src = ./nixos-option.sh;
}

View File

@ -1,13 +0,0 @@
{ substituteAll, nix }:
let
fallback = import ./nix-fallback-paths.nix;
in
substituteAll {
name = "nixos-rebuild";
dir = "bin";
isExecutable = true;
src = ./nixos-rebuild.sh;
nix = nix.out;
nix_x86_64_linux = fallback.x86_64-linux;
nix_i686_linux = fallback.i686-linux;
}

View File

@ -1,13 +0,0 @@
{ substituteAll
, lib
, version ? lib.trivial.version
, codeName ? "unknown"
, revision ? lib.trivial.revisionWithDefault "master"
}:
substituteAll {
name = "nixos-version";
dir = "bin";
isExecutable = true;
src = ./nixos-version.sh;
inherit version codeName revision;
}

View File

@ -21955,16 +21955,6 @@ with pkgs;
nixStable
nixUnstable;
# NixOS tools
nixos-build-vms = callPackage ../tools/nixos/nixos-build-vms { };
nixos-enter = callPackage ../tools/nixos/nixos-enter { };
nixos-generate-config = callPackage ../tools/nixos/nixos-generate-config { };
nixos-install = callPackage ../tools/nixos/nixos-install { };
nixos-option = callPackage ../tools/nixos/nixos-option { };
nixos-rebuild = callPackage ../tools/nixos/nixos-rebuild { };
nixos-version = callPackage ../tools/nixos/nixos-version { };
nixops = callPackage ../tools/package-management/nixops { };
nixopsUnstable = lowPrio (callPackage ../tools/package-management/nixops/unstable.nix { });