diff options
| author | Alice Carroll <git@alice-carroll.pet> | 2024-08-03 14:57:36 +0300 |
|---|---|---|
| committer | Alice Carroll <git@alice-carroll.pet> | 2024-08-17 02:50:56 +0300 |
| commit | d5dba1c6f5b4069988f9601df861fff2490fb3d2 (patch) | |
| tree | 2645af1cac7b96f68912c655d2213d9f156e8f37 /modules | |
| parent | f7142b8024d6b70c66fd646e1d099d3aa5bfec49 (diff) | |
refactor: rename environment.postBuild to environment.extraSetup
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/environment/default.nix | 25 | ||||
| -rw-r--r-- | modules/programs/info/default.nix | 2 |
2 files changed, 18 insertions, 9 deletions
diff --git a/modules/environment/default.nix b/modules/environment/default.nix index 3b97a3e..00d58c0 100644 --- a/modules/environment/default.nix +++ b/modules/environment/default.nix @@ -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} ''; - }; } diff --git a/modules/programs/info/default.nix b/modules/programs/info/default.nix index cf857d9..d70e377 100644 --- a/modules/programs/info/default.nix +++ b/modules/programs/info/default.nix @@ -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 |
