Remove some use of mkDerivation

Instead use `runCommand`, which by default uses `stdenvNoCC` resulting
in a reduced dependency footprint.

Fixes #612
This commit is contained in:
Robert Helgesson 2019-03-18 01:25:14 +01:00
parent 52692e299d
commit 70d4cf2cd9
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
3 changed files with 33 additions and 35 deletions

View file

@ -12,11 +12,20 @@ let
in in
pkgs.stdenv.mkDerivation { pkgs.runCommand
name = "home-manager"; "home-manager"
{
buildCommand = '' preferLocalBuild = true;
install -v -D -m755 ${./home-manager} $out/bin/home-manager allowSubstitutes = false;
meta = with pkgs.stdenv.lib; {
description = "A user environment configurator";
maintainers = [ maintainers.rycee ];
platforms = platforms.unix;
license = licenses.mit;
};
}
''
install -v -D -m755 ${./home-manager} $out/bin/home-manager
substituteInPlace $out/bin/home-manager \ substituteInPlace $out/bin/home-manager \
--subst-var-by bash "${pkgs.bash}" \ --subst-var-by bash "${pkgs.bash}" \
@ -25,12 +34,4 @@ pkgs.stdenv.mkDerivation {
--subst-var-by gnused "${pkgs.gnused}" \ --subst-var-by gnused "${pkgs.gnused}" \
--subst-var-by less "${pkgs.less}" \ --subst-var-by less "${pkgs.less}" \
--subst-var-by HOME_MANAGER_PATH '${pathStr}' --subst-var-by HOME_MANAGER_PATH '${pathStr}'
''; ''
meta = with pkgs.stdenv.lib; {
description = "A user environment configurator";
maintainers = [ maintainers.rycee ];
platforms = platforms.unix;
license = licenses.mit;
};
}

View file

@ -210,17 +210,16 @@ in
'') (filter (v: v.onChange != "") (attrValues cfg)) '') (filter (v: v.onChange != "") (attrValues cfg))
); );
home-files = pkgs.stdenv.mkDerivation { # Symlink directories and files that have the right execute bit.
name = "home-manager-files"; # Copy files that need their execute bit changed.
home-files = pkgs.runCommand
nativeBuildInputs = [ pkgs.xlibs.lndir ]; "home-manager-files"
{
preferLocalBuild = true; nativeBuildInputs = [ pkgs.xlibs.lndir ];
allowSubstitutes = false; preferLocalBuild = true;
allowSubstitutes = false;
# Symlink directories and files that have the right execute bit. }
# Copy files that need their execute bit changed. (''
buildCommand = ''
mkdir -p $out mkdir -p $out
function insertFile() { function insertFile() {
@ -279,7 +278,6 @@ in
else builtins.toString v.executable}" \ else builtins.toString v.executable}" \
"${builtins.toString v.recursive}" "${builtins.toString v.recursive}"
'') cfg '') cfg
); ));
};
}; };
} }

View file

@ -383,13 +383,13 @@ in
${activationCmds} ${activationCmds}
''; '';
in in
pkgs.stdenv.mkDerivation { pkgs.runCommand
name = "home-manager-generation"; "home-manager-generation"
{
preferLocalBuild = true; preferLocalBuild = true;
allowSubstitutes = false; allowSubstitutes = false;
}
buildCommand = '' ''
mkdir -p $out mkdir -p $out
cp ${activationScript} $out/activate cp ${activationScript} $out/activate
@ -402,7 +402,6 @@ in
${cfg.extraBuilderCommands} ${cfg.extraBuilderCommands}
''; '';
};
home.path = pkgs.buildEnv { home.path = pkgs.buildEnv {
name = "home-manager-path"; name = "home-manager-path";