mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +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,28 +18,32 @@ 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;
|
||||||
perl = "${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl";
|
replacements = {
|
||||||
hostPlatformSystem = pkgs.stdenv.hostPlatform.system;
|
perl = "${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl";
|
||||||
detectvirt = "${config.systemd.package}/bin/systemd-detect-virt";
|
hostPlatformSystem = pkgs.stdenv.hostPlatform.system;
|
||||||
btrfs = "${pkgs.btrfs-progs}/bin/btrfs";
|
detectvirt = "${config.systemd.package}/bin/systemd-detect-virt";
|
||||||
inherit (config.system.nixos-generate-config) configuration desktopConfiguration;
|
btrfs = "${pkgs.btrfs-progs}/bin/btrfs";
|
||||||
xserverEnabled = config.services.xserver.enable;
|
inherit (config.system.nixos-generate-config) configuration desktopConfiguration;
|
||||||
|
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;
|
||||||
inherit (pkgs) runtimeShell;
|
replacements = {
|
||||||
inherit (config.system.nixos) version codeName revision;
|
inherit (pkgs) runtimeShell;
|
||||||
inherit (config.system) configurationRevision;
|
inherit (config.system.nixos) version codeName revision;
|
||||||
json = builtins.toJSON ({
|
inherit (config.system) configurationRevision;
|
||||||
nixosVersion = config.system.nixos.version;
|
json = builtins.toJSON ({
|
||||||
} // lib.optionalAttrs (config.system.nixos.revision != null) {
|
nixosVersion = config.system.nixos.version;
|
||||||
nixpkgsRevision = config.system.nixos.revision;
|
} // lib.optionalAttrs (config.system.nixos.revision != null) {
|
||||||
} // lib.optionalAttrs (config.system.configurationRevision != null) {
|
nixpkgsRevision = config.system.nixos.revision;
|
||||||
configurationRevision = config.system.configurationRevision;
|
} // lib.optionalAttrs (config.system.configurationRevision != null) {
|
||||||
});
|
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