From a3395bc3a4f5d9b607c460408735bc51daba4c47 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 28 Aug 2017 11:37:34 +0200 Subject: [PATCH] home-manager: move Nix code to own file (cherry picked from commit e9ca4305a6bf8727f347c57b65883d2e1e1a5070) --- home-manager/default.nix | 20 +------------------- home-manager/home-manager.nix | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 19 deletions(-) create mode 100644 home-manager/home-manager.nix diff --git a/home-manager/default.nix b/home-manager/default.nix index e517ee9ec..a58539617 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -8,24 +8,6 @@ let - homeManagerExpr = pkgs.writeText "home-manager.nix" '' - { pkgs ? import {}, confPath, confAttr }: - - let - env = import { - 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; { diff --git a/home-manager/home-manager.nix b/home-manager/home-manager.nix new file mode 100644 index 000000000..34ce49ace --- /dev/null +++ b/home-manager/home-manager.nix @@ -0,0 +1,15 @@ +{ pkgs ? import {}, confPath, confAttr }: + +let + env = import { + configuration = + let + conf = import confPath; + in + if confAttr == "" then conf else conf.''${confAttr}; + pkgs = pkgs; + }; +in + { + inherit (env) activationPackage; + }