home-manager/home-manager/default.nix

42 lines
974 B
Nix
Raw Normal View History

{ pkgs, modulesPath ? "$HOME/.config/nixpkgs/home-manager/modules" }:
2017-01-07 19:16:26 +01:00
let
homeManagerExpr = pkgs.writeText "home-manager.nix" ''
{ pkgs ? import <nixpkgs> {}, confPath }:
2017-01-07 19:16:26 +01:00
let
env = import <home-manager> {
2017-01-07 19:16:26 +01:00
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}' \
2017-01-07 19:16:26 +01:00
--subst-var-by HOME_MANAGER_EXPR_PATH "${homeManagerExpr}"
'';
meta = with pkgs.stdenv.lib; {
description = "A user environment configurator";
maintainers = [ maintainers.rycee ];
platforms = platforms.linux;
};
}