1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 05:29:46 +01:00

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
pkgs.stdenv.mkDerivation {
name = "home-manager";
buildCommand = ''
install -v -D -m755 ${./home-manager} $out/bin/home-manager
pkgs.runCommand
"home-manager"
{
preferLocalBuild = true;
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 \
--subst-var-by bash "${pkgs.bash}" \
@ -25,12 +34,4 @@ pkgs.stdenv.mkDerivation {
--subst-var-by gnused "${pkgs.gnused}" \
--subst-var-by less "${pkgs.less}" \
--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))
);
home-files = pkgs.stdenv.mkDerivation {
name = "home-manager-files";
nativeBuildInputs = [ pkgs.xlibs.lndir ];
preferLocalBuild = true;
allowSubstitutes = false;
# Symlink directories and files that have the right execute bit.
# Copy files that need their execute bit changed.
buildCommand = ''
# Symlink directories and files that have the right execute bit.
# Copy files that need their execute bit changed.
home-files = pkgs.runCommand
"home-manager-files"
{
nativeBuildInputs = [ pkgs.xlibs.lndir ];
preferLocalBuild = true;
allowSubstitutes = false;
}
(''
mkdir -p $out
function insertFile() {
@ -279,7 +278,6 @@ in
else builtins.toString v.executable}" \
"${builtins.toString v.recursive}"
'') cfg
);
};
));
};
}

View file

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