mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
refactor: rename environment.postBuild to environment.extraSetup
This commit is contained in:
parent
f7142b8024
commit
d5dba1c6f5
2 changed files with 18 additions and 9 deletions
|
@ -16,6 +16,10 @@ let
|
|||
in
|
||||
|
||||
{
|
||||
imports = [
|
||||
(mkRenamedOptionModule ["environment" "postBuild"] ["environment" "extraSetup"])
|
||||
];
|
||||
|
||||
options = {
|
||||
environment.systemPackages = mkOption {
|
||||
type = types.listOf types.package;
|
||||
|
@ -43,12 +47,6 @@ in
|
|||
description = "A list of profiles used to setup the global environment.";
|
||||
};
|
||||
|
||||
environment.postBuild = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = "Commands to execute when building the global environment.";
|
||||
};
|
||||
|
||||
environment.extraOutputsToInstall = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
|
@ -147,6 +145,17 @@ in
|
|||
'';
|
||||
type = types.lines;
|
||||
};
|
||||
|
||||
environment.extraSetup = mkOption {
|
||||
type = types.lines;
|
||||
default = "";
|
||||
description = ''
|
||||
Shell fragments to be run after the system environment has been created.
|
||||
This should only be used for things that need to modify the internals
|
||||
of the environment, e.g. generating MIME caches.
|
||||
The environment being built can be accessed at $out.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
@ -188,7 +197,8 @@ in
|
|||
system.path = pkgs.buildEnv {
|
||||
name = "system-path";
|
||||
paths = cfg.systemPackages;
|
||||
inherit (cfg) postBuild pathsToLink extraOutputsToInstall;
|
||||
postBuild = cfg.extraSetup;
|
||||
inherit (cfg) pathsToLink extraOutputsToInstall;
|
||||
};
|
||||
|
||||
system.build.setEnvironment = pkgs.writeText "set-environment" ''
|
||||
|
@ -205,6 +215,5 @@ in
|
|||
system.build.setAliases = pkgs.writeText "set-aliases" ''
|
||||
${concatStringsSep "\n" aliasCommands}
|
||||
'';
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ in
|
|||
environment.pathsToLink = [ "/info" "/share/info" ];
|
||||
environment.extraOutputsToInstall = [ "info" ];
|
||||
|
||||
environment.postBuild = ''
|
||||
environment.extraSetup = ''
|
||||
if test -w $out/share/info; then
|
||||
shopt -s nullglob
|
||||
for i in $out/share/info/*.info $out/share/info/*.info.gz; do
|
||||
|
|
Loading…
Reference in a new issue