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:
parent
52692e299d
commit
70d4cf2cd9
3 changed files with 33 additions and 35 deletions
|
@ -12,10 +12,19 @@ let
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
pkgs.stdenv.mkDerivation {
|
pkgs.runCommand
|
||||||
name = "home-manager";
|
"home-manager"
|
||||||
|
{
|
||||||
buildCommand = ''
|
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
|
install -v -D -m755 ${./home-manager} $out/bin/home-manager
|
||||||
|
|
||||||
substituteInPlace $out/bin/home-manager \
|
substituteInPlace $out/bin/home-manager \
|
||||||
|
@ -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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
|
@ -210,17 +210,16 @@ in
|
||||||
'') (filter (v: v.onChange != "") (attrValues cfg))
|
'') (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.
|
# Symlink directories and files that have the right execute bit.
|
||||||
# Copy files that need their execute bit changed.
|
# Copy files that need their execute bit changed.
|
||||||
buildCommand = ''
|
home-files = pkgs.runCommand
|
||||||
|
"home-manager-files"
|
||||||
|
{
|
||||||
|
nativeBuildInputs = [ pkgs.xlibs.lndir ];
|
||||||
|
preferLocalBuild = true;
|
||||||
|
allowSubstitutes = false;
|
||||||
|
}
|
||||||
|
(''
|
||||||
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
|
||||||
);
|
));
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -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";
|
||||||
|
|
Loading…
Reference in a new issue