1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-28 17:38:33 +02:00
home-manager/home-manager/default.nix
Christopher League 1a491f24f7
home-manager: add coreutils to PATH
This ensures that we use the expected version of some useful tools,
such as readlink.
2017-05-16 22:04:58 +02:00

42 lines
977 B
Nix

{ pkgs, modulesPath ? "$HOME/.nixpkgs/home-manager/modules" }:
let
homeManagerExpr = pkgs.writeText "home-manager.nix" ''
{ pkgs ? import <nixpkgs> {}, confPath, modulesPath }:
let
env = import modulesPath {
configuration = import confPath;
pkgs = pkgs;
};
in
{
inherit (env) activation-script;
}
'';
in
pkgs.stdenv.mkDerivation {
name = "home-manager";
phases = [ "installPhase" ];
installPhase = ''
install -v -D -m755 ${./home-manager} $out/bin/home-manager
substituteInPlace $out/bin/home-manager \
--subst-var-by bash "${pkgs.bash}" \
--subst-var-by coreutils "${pkgs.coreutils}" \
--subst-var-by MODULES_PATH '${modulesPath}' \
--subst-var-by HOME_MANAGER_EXPR_PATH "${homeManagerExpr}"
'';
meta = with pkgs.stdenv.lib; {
description = "A user environment configurator";
maintainers = [ maintainers.rycee ];
platforms = platforms.linux;
};
}