2 #https://github.com/rycee/home-manager/blob/2c07829be2bcae55e04997b19719ff902a44016d/home-manager/default.nix
4 { bash, coreutils, findutils, gnused, less, ncurses, gettext, nixos-option, lib, stdenv, makeWrapper, fetchFromGitHub }:
6 stdenv.mkDerivation rec {
8 pname = "home-manager";
9 version = "2022-10-25";
11 src = fetchFromGitHub {
12 owner = "nix-community";
13 repo = "home-manager";
14 rev = "7dc4e4ebd71280842b4d30975439980baaac9db8";
15 sha256 = "sha256-kINnLxC0KFalUk4tVO/H5hUU7FVAOYYcUSWrsBpnl+I=";
18 nativeBuildInputs = [ makeWrapper ];
22 install -v -D -m755 ${src}/home-manager/home-manager $out/bin/home-manager
24 substituteInPlace $out/bin/home-manager \
25 --subst-var-by bash "${bash}" \
26 --subst-var-by DEP_PATH "${
27 lib.makeBinPath [ coreutils findutils gettext gnused less ncurses nixos-option ]
29 --subst-var-by HOME_MANAGER_LIB '${src}/lib/bash/home-manager.sh' \
30 --subst-var-by HOME_MANAGER_PATH '${src}' \
31 --subst-var-by OUT "$out"
33 install -D -m755 ${src}/home-manager/completion.bash \
34 $out/share/bash-completion/completions/home-manager
35 install -D -m755 ${src}/home-manager/completion.zsh \
36 $out/share/zsh/site-functions/_home-manager
37 install -D -m755 ${src}/home-manager/completion.fish \
38 $out/share/fish/vendor_completions.d/home-manager.fish
40 install -D -m755 ${src}/lib/bash/home-manager.sh \
41 "$out/share/bash/home-manager.sh"
43 for path in ${src}/home-manager/po/*.po; do
46 mkdir -p "$out/share/locale/$lang/LC_MESSAGES"
47 ${gettext}/bin/msgfmt -o "$out/share/locale/$lang/LC_MESSAGES/home-manager.mo" "$path"
52 description = "A user environment configurator";
53 homepage = "https://rycee.gitlab.io/home-manager/";
54 platforms = platforms.unix;
55 license = licenses.mit;