1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-05 08:17:01 +00:00

system-build: change type of setEnvironment and setAliases

On NixOS system.build.setEnvironment also is a writeText
This commit is contained in:
Daiderd Jordan 2017-10-07 12:39:47 +02:00
parent a8b4770275
commit e8355cdd93
No known key found for this signature in database
GPG key ID: D02435D05B810C96
5 changed files with 10 additions and 7 deletions

View file

@ -154,14 +154,16 @@ in {
inherit (cfg) postBuild pathsToLink extraOutputsToInstall;
};
system.build.setEnvironment = ''
system.build.setEnvironment = pkgs.writeText "set-environment" ''
${concatStringsSep "\n" exportVariables}
# Extra initialisation
${cfg.extraInit}
'';
system.build.setAliases = concatStringsSep "\n" aliasCommands;
system.build.setAliases = pkgs.writeText "set-aliases" ''
${concatStringsSep "\n" aliasCommands}
'';
};
}

View file

@ -73,8 +73,8 @@ in
__ETC_BASHRC_SOURCED=1
export PATH=${config.environment.systemPath}
${config.system.build.setEnvironment}
${config.system.build.setAliases}
${config.system.build.setEnvironment.text}
${config.system.build.setAliases.text}
${config.environment.interactiveShellInit}
${cfg.interactiveShellInit}

View file

@ -9,7 +9,7 @@ let
foreignEnv = pkgs.writeText "fish-foreign-env" ''
# TODO: environment.shellInit
${config.system.build.setEnvironment}
${config.system.build.setEnvironment.text}
'';
loginForeignEnv = pkgs.writeText "fish-login-foreign-env" ''

View file

@ -130,7 +130,7 @@ in
if test -n "$IN_NIX_SHELL"; then return; fi
export PATH=${config.environment.systemPath}
${config.system.build.setEnvironment}
${config.system.build.setEnvironment.text}
${cfg.shellInit}
@ -149,7 +149,7 @@ in
__ETC_ZPROFILE_SOURCED=1
${concatStringsSep "\n" zshVariables}
${config.system.build.setAliases}
${config.system.build.setAliases.text}
${cfg.loginShellInit}

View file

@ -20,6 +20,7 @@ in
system.build = mkOption {
internal = true;
type = types.attrsOf types.package;
default = {};
description = ''
Attribute set of derivation used to setup the system.