1
0
mirror of https://github.com/nix-community/home-manager synced 2024-06-01 20:43:34 +02:00

home-manager: use callPackage where appropriate

This commit is contained in:
arcnmx 2019-04-02 21:21:38 -07:00 committed by Robert Helgesson
parent 652c694244
commit 2c07829be2
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89
5 changed files with 17 additions and 17 deletions

View File

@ -1,13 +1,12 @@
{ pkgs ? import <nixpkgs> {} }: { pkgs ? import <nixpkgs> {} }:
rec { rec {
home-manager = import ./home-manager { home-manager = pkgs.callPackage ./home-manager {
inherit pkgs;
path = toString ./.; path = toString ./.;
}; };
install = import ./home-manager/install.nix { install = pkgs.callPackage ./home-manager/install.nix {
inherit home-manager pkgs; inherit home-manager;
}; };
nixos = import ./nixos; nixos = import ./nixos;

View File

@ -1,4 +1,4 @@
{ pkgs { runCommand, lib, bash, coreutils, findutils, gnused, less
# Extra path to Home Manager. If set then this path will be tried # Extra path to Home Manager. If set then this path will be tried
# before `$HOME/.config/nixpkgs/home-manager` and # before `$HOME/.config/nixpkgs/home-manager` and
@ -12,12 +12,12 @@ let
in in
pkgs.runCommand runCommand
"home-manager" "home-manager"
{ {
preferLocalBuild = true; preferLocalBuild = true;
allowSubstitutes = false; allowSubstitutes = false;
meta = with pkgs.stdenv.lib; { meta = with lib; {
description = "A user environment configurator"; description = "A user environment configurator";
maintainers = [ maintainers.rycee ]; maintainers = [ maintainers.rycee ];
platforms = platforms.unix; platforms = platforms.unix;
@ -28,10 +28,10 @@ pkgs.runCommand
install -v -D -m755 ${./home-manager} $out/bin/home-manager install -v -D -m755 ${./home-manager} $out/bin/home-manager
substituteInPlace $out/bin/home-manager \ substituteInPlace $out/bin/home-manager \
--subst-var-by bash "${pkgs.bash}" \ --subst-var-by bash "${bash}" \
--subst-var-by coreutils "${pkgs.coreutils}" \ --subst-var-by coreutils "${coreutils}" \
--subst-var-by findutils "${pkgs.findutils}" \ --subst-var-by findutils "${findutils}" \
--subst-var-by gnused "${pkgs.gnused}" \ --subst-var-by gnused "${gnused}" \
--subst-var-by less "${pkgs.less}" \ --subst-var-by less "${less}" \
--subst-var-by HOME_MANAGER_PATH '${pathStr}' --subst-var-by HOME_MANAGER_PATH '${pathStr}'
'' ''

View File

@ -1,6 +1,6 @@
{ home-manager, pkgs }: { home-manager, runCommand }:
pkgs.runCommand runCommand
"home-manager-install" "home-manager-install"
{ {
propagatedBuildInputs = [ home-manager ]; propagatedBuildInputs = [ home-manager ];

View File

@ -34,8 +34,7 @@ in
config = mkIf (cfg.enable && !config.submoduleSupport.enable) { config = mkIf (cfg.enable && !config.submoduleSupport.enable) {
home.packages = [ home.packages = [
(import ../../home-manager { (pkgs.callPackage ../../home-manager {
inherit pkgs;
inherit (cfg) path; inherit (cfg) path;
}) })
]; ];

View File

@ -1,3 +1,5 @@
self: super: { self: super: {
home-manager = import ./home-manager { pkgs = super; }; home-manager = super.callPackage ./home-manager {
path = toString ./.;
};
} }