mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-13 13:15:30 +03:00
nixos/installer: replace substituteAll with replaceVarsWith for tools
This commit is contained in:
parent
b9ea481784
commit
dc0e094b33
1 changed files with 21 additions and 17 deletions
|
@ -4,7 +4,7 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
makeProg = args: pkgs.substituteAll (args // {
|
makeProg = args: pkgs.replaceVarsWith (args // {
|
||||||
dir = "bin";
|
dir = "bin";
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
|
@ -18,18 +18,21 @@ let
|
||||||
nixos-generate-config = makeProg {
|
nixos-generate-config = makeProg {
|
||||||
name = "nixos-generate-config";
|
name = "nixos-generate-config";
|
||||||
src = ./nixos-generate-config.pl;
|
src = ./nixos-generate-config.pl;
|
||||||
|
replacements = {
|
||||||
perl = "${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl";
|
perl = "${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl";
|
||||||
hostPlatformSystem = pkgs.stdenv.hostPlatform.system;
|
hostPlatformSystem = pkgs.stdenv.hostPlatform.system;
|
||||||
detectvirt = "${config.systemd.package}/bin/systemd-detect-virt";
|
detectvirt = "${config.systemd.package}/bin/systemd-detect-virt";
|
||||||
btrfs = "${pkgs.btrfs-progs}/bin/btrfs";
|
btrfs = "${pkgs.btrfs-progs}/bin/btrfs";
|
||||||
inherit (config.system.nixos-generate-config) configuration desktopConfiguration;
|
inherit (config.system.nixos-generate-config) configuration desktopConfiguration;
|
||||||
xserverEnabled = config.services.xserver.enable;
|
xserverEnabled = config.services.xserver.enable;
|
||||||
|
};
|
||||||
manPage = ./manpages/nixos-generate-config.8;
|
manPage = ./manpages/nixos-generate-config.8;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixos-version = makeProg {
|
nixos-version = makeProg {
|
||||||
name = "nixos-version";
|
name = "nixos-version";
|
||||||
src = ./nixos-version.sh;
|
src = ./nixos-version.sh;
|
||||||
|
replacements = {
|
||||||
inherit (pkgs) runtimeShell;
|
inherit (pkgs) runtimeShell;
|
||||||
inherit (config.system.nixos) version codeName revision;
|
inherit (config.system.nixos) version codeName revision;
|
||||||
inherit (config.system) configurationRevision;
|
inherit (config.system) configurationRevision;
|
||||||
|
@ -40,6 +43,7 @@ let
|
||||||
} // lib.optionalAttrs (config.system.configurationRevision != null) {
|
} // lib.optionalAttrs (config.system.configurationRevision != null) {
|
||||||
configurationRevision = config.system.configurationRevision;
|
configurationRevision = config.system.configurationRevision;
|
||||||
});
|
});
|
||||||
|
};
|
||||||
manPage = ./manpages/nixos-version.8;
|
manPage = ./manpages/nixos-version.8;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue