all repos — nixfiles @ ec92b62d48052d2e4074b194faee86bf7ad18144

System and user configuration, managed by nix and home-manager

set up lorri

Alan Pearce
commit

ec92b62d48052d2e4074b194faee86bf7ad18144

parent

160dacb051bb3529f33e8d388818f63db810b3a1

1 file changed, 21 insertions(+), 6 deletions(-)

changed files
M shell.nixshell.nix
@@ -1,13 +1,30 @@
-let +with builtins; +let sources = import ./nix/sources.nix; + sourcesJSON = fromJSON (readFile ./nix/sources.json); nixpkgs = sources.nixpkgs; + pkgs = import nixpkgs { }; + inherit (pkgs.lib) path attrsets; - pkgs = import nixpkgs { }; + mkPathable = v: toString ( + if + path.subpath.isValid v + then + path.append ./. v + else + v + ); + nixPath = concatStringsSep ":" ( + attrsets.mapAttrsToList + (k: v: "${k}=${mkPathable (getAttr "outPath" v)}") + (intersectAttrs sourcesJSON sources) + ); in -pkgs.mkShell rec { +pkgs.mkShell +{ name = "nixfiles-shell";
@@ -19,9 +36,7 @@ (import sources.home-manager { inherit pkgs; }).home-manager
]; shellHook = '' - export HOST=$(hostname) - export NIX_PATH="nixpkgs=${nixpkgs}:home-manager=${sources."home-manager"}:darwin=${sources.nix-darwin}:darwin-config=$PWD/system/$HOST.nix:private=$PWD/private:nixpkgs-overlays=$PWD/overlays:nix-index-database=${sources.nix-index-database}"; - export HOME_MANAGER_CONFIG="./user/$HOST.nix" + export NIX_PATH="${nixPath}"; ''; }