mirror of
https://github.com/nix-community/home-manager
synced 2024-11-24 03:59:46 +01:00
home-manager: move Nix code to own file
(cherry picked from commit e9ca4305a6
)
This commit is contained in:
parent
edb46f4aa2
commit
a3395bc3a4
2 changed files with 16 additions and 19 deletions
|
@ -8,24 +8,6 @@
|
|||
|
||||
let
|
||||
|
||||
homeManagerExpr = pkgs.writeText "home-manager.nix" ''
|
||||
{ pkgs ? import <nixpkgs> {}, confPath, confAttr }:
|
||||
|
||||
let
|
||||
env = import <home-manager> {
|
||||
configuration =
|
||||
let
|
||||
conf = import confPath;
|
||||
in
|
||||
if confAttr == "" then conf else conf.''${confAttr};
|
||||
pkgs = pkgs;
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit (env) activationPackage;
|
||||
}
|
||||
'';
|
||||
|
||||
modulesPathStr = if modulesPath == null then "" else modulesPath;
|
||||
|
||||
in
|
||||
|
@ -42,7 +24,7 @@ pkgs.stdenv.mkDerivation {
|
|||
--subst-var-by bash "${pkgs.bash}" \
|
||||
--subst-var-by coreutils "${pkgs.coreutils}" \
|
||||
--subst-var-by MODULES_PATH '${modulesPathStr}' \
|
||||
--subst-var-by HOME_MANAGER_EXPR_PATH "${homeManagerExpr}"
|
||||
--subst-var-by HOME_MANAGER_EXPR_PATH "${./home-manager.nix}"
|
||||
'';
|
||||
|
||||
meta = with pkgs.stdenv.lib; {
|
||||
|
|
15
home-manager/home-manager.nix
Normal file
15
home-manager/home-manager.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{ pkgs ? import <nixpkgs> {}, confPath, confAttr }:
|
||||
|
||||
let
|
||||
env = import <home-manager> {
|
||||
configuration =
|
||||
let
|
||||
conf = import confPath;
|
||||
in
|
||||
if confAttr == "" then conf else conf.''${confAttr};
|
||||
pkgs = pkgs;
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit (env) activationPackage;
|
||||
}
|
Loading…
Reference in a new issue