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
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "home-manager";
|
||||
|
||||
buildCommand = ''
|
||||
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 \
|
||||
|
@ -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;
|
||||
};
|
||||
}
|
||||
''
|
||||
|
|
|
@ -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 = ''
|
||||
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
|
||||
);
|
||||
};
|
||||
));
|
||||
};
|
||||
}
|
||||
|
|
|
@ -383,13 +383,13 @@ in
|
|||
${activationCmds}
|
||||
'';
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "home-manager-generation";
|
||||
|
||||
pkgs.runCommand
|
||||
"home-manager-generation"
|
||||
{
|
||||
preferLocalBuild = true;
|
||||
allowSubstitutes = false;
|
||||
|
||||
buildCommand = ''
|
||||
}
|
||||
''
|
||||
mkdir -p $out
|
||||
|
||||
cp ${activationScript} $out/activate
|
||||
|
@ -402,7 +402,6 @@ in
|
|||
|
||||
${cfg.extraBuilderCommands}
|
||||
'';
|
||||
};
|
||||
|
||||
home.path = pkgs.buildEnv {
|
||||
name = "home-manager-path";
|
||||
|
|
Loading…
Reference in a new issue