|
4 | 4 | { config, lib, pkgs, ... }: |
5 | 5 |
|
6 | 6 | let |
7 | | - makeProg = args: pkgs.substituteAll (args // { |
| 7 | + makeProg = args: pkgs.replaceVarsWith (args // { |
8 | 8 | dir = "bin"; |
9 | 9 | isExecutable = true; |
10 | 10 | nativeBuildInputs = [ |
|
18 | 18 | nixos-generate-config = makeProg { |
19 | 19 | name = "nixos-generate-config"; |
20 | 20 | src = ./nixos-generate-config.pl; |
21 | | - perl = "${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl"; |
22 | | - hostPlatformSystem = pkgs.stdenv.hostPlatform.system; |
23 | | - detectvirt = "${config.systemd.package}/bin/systemd-detect-virt"; |
24 | | - btrfs = "${pkgs.btrfs-progs}/bin/btrfs"; |
25 | | - inherit (config.system.nixos-generate-config) configuration desktopConfiguration; |
26 | | - xserverEnabled = config.services.xserver.enable; |
| 21 | + replacements = { |
| 22 | + perl = "${pkgs.perl.withPackages (p: [ p.FileSlurp ])}/bin/perl"; |
| 23 | + hostPlatformSystem = pkgs.stdenv.hostPlatform.system; |
| 24 | + detectvirt = "${config.systemd.package}/bin/systemd-detect-virt"; |
| 25 | + btrfs = "${pkgs.btrfs-progs}/bin/btrfs"; |
| 26 | + inherit (config.system.nixos-generate-config) configuration desktopConfiguration; |
| 27 | + xserverEnabled = config.services.xserver.enable; |
| 28 | + }; |
27 | 29 | manPage = ./manpages/nixos-generate-config.8; |
28 | 30 | }; |
29 | 31 |
|
30 | 32 | nixos-version = makeProg { |
31 | 33 | name = "nixos-version"; |
32 | 34 | src = ./nixos-version.sh; |
33 | | - inherit (pkgs) runtimeShell; |
34 | | - inherit (config.system.nixos) version codeName revision; |
35 | | - inherit (config.system) configurationRevision; |
36 | | - json = builtins.toJSON ({ |
37 | | - nixosVersion = config.system.nixos.version; |
38 | | - } // lib.optionalAttrs (config.system.nixos.revision != null) { |
39 | | - nixpkgsRevision = config.system.nixos.revision; |
40 | | - } // lib.optionalAttrs (config.system.configurationRevision != null) { |
41 | | - configurationRevision = config.system.configurationRevision; |
42 | | - }); |
| 35 | + replacements = { |
| 36 | + inherit (pkgs) runtimeShell; |
| 37 | + inherit (config.system.nixos) version codeName revision; |
| 38 | + inherit (config.system) configurationRevision; |
| 39 | + json = builtins.toJSON ({ |
| 40 | + nixosVersion = config.system.nixos.version; |
| 41 | + } // lib.optionalAttrs (config.system.nixos.revision != null) { |
| 42 | + nixpkgsRevision = config.system.nixos.revision; |
| 43 | + } // lib.optionalAttrs (config.system.configurationRevision != null) { |
| 44 | + configurationRevision = config.system.configurationRevision; |
| 45 | + }); |
| 46 | + }; |
43 | 47 | manPage = ./manpages/nixos-version.8; |
44 | 48 | }; |
45 | 49 |
|
|
0 commit comments