1
0
Fork 0
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:
Alice Carroll 2024-08-03 14:57:36 +03:00
parent f7142b8024
commit d5dba1c6f5
No known key found for this signature in database
GPG key ID: 05140B67902CD3AF
2 changed files with 18 additions and 9 deletions

View file

@ -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}
'';
};
}

View file

@ -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