toxic: 0.15.1 -> 0.16.0
[NixPkgs.git] / pkgs / by-name / ho / home-manager / package.nix
blobfa2fb7e40cd3c020c45b2a618539070589599f3e
2   lib,
3   bash,
4   coreutils,
5   fetchFromGitHub,
6   findutils,
7   gettext,
8   gnused,
9   inetutils,
10   installShellFiles,
11   jq,
12   less,
13   ncurses,
14   nixos-option,
15   stdenvNoCC,
16   unixtools,
17   unstableGitUpdater,
20 stdenvNoCC.mkDerivation (finalAttrs: {
21   pname = "home-manager";
22   version = "0-unstable-2024-11-29";
24   src = fetchFromGitHub {
25     name = "home-manager-source";
26     owner = "nix-community";
27     repo = "home-manager";
28     rev = "819f682269f4e002884702b87e445c82840c68f2";
29     hash = "sha256-r8j6R3nrvwbT1aUp4EPQ1KC7gm0pu9VcV1aNaB+XG6Q=";
30   };
32   nativeBuildInputs = [
33     gettext
34     installShellFiles
35   ];
37   dontConfigure = true;
38   dontBuild = true;
40   installPhase = ''
41     runHook preInstall
43     install -D -m755 home-manager/home-manager $out/bin/home-manager
44     install -D -m755 lib/bash/home-manager.sh $out/share/bash/home-manager.sh
46     installShellCompletion --cmd home-manager \
47       --bash home-manager/completion.bash \
48       --fish home-manager/completion.fish \
49       --zsh home-manager/completion.zsh
51     for pofile in home-manager/po/*.po; do
52       lang="''${pofile##*/}"
53       lang="''${lang%%.*}"
54       mkdir -p "$out/share/locale/$lang/LC_MESSAGES"
55       msgfmt -o "$out/share/locale/$lang/LC_MESSAGES/home-manager.mo" "$pofile"
56     done
58     runHook postInstall
59   '';
61   postFixup = ''
62     substituteInPlace $out/bin/home-manager \
63       --subst-var-by bash "${bash}" \
64       --subst-var-by DEP_PATH "${
65         lib.makeBinPath [
66           coreutils
67           findutils
68           gettext
69           gnused
70           jq
71           less
72           ncurses
73           nixos-option
74           inetutils # for `hostname`
75         ]
76       }" \
77       --subst-var-by HOME_MANAGER_LIB "$out/share/bash/home-manager.sh" \
78       --subst-var-by HOME_MANAGER_PATH "${finalAttrs.src}" \
79       --subst-var-by OUT "$out"
80   '';
82   passthru.updateScript = unstableGitUpdater {
83     url = "https://github.com/nix-community/home-manager/";
84   };
86   meta = {
87     homepage = "https://nix-community.github.io/home-manager/";
88     description = "Nix-based user environment configurator";
89     longDescription = ''
90       The Home-Manager project provides a basic system for managing a user
91       environment using the Nix package manager together with the Nix libraries
92       found in Nixpkgs. It allows declarative configuration of user specific
93       (non global) packages and dotfiles.
94     '';
95     license = lib.licenses.mit;
96     mainProgram = "home-manager";
97     maintainers = with lib.maintainers; [ bryango ];
98     platforms = lib.platforms.unix;
99   };