migra a version nueva de shenvs
This commit is contained in:
parent
177659997f
commit
8f48524a76
13 changed files with 61 additions and 80 deletions
|
@ -1,34 +1,6 @@
|
|||
pkgs:
|
||||
with pkgs.lib; let
|
||||
inherit (pkgs) buildEnv callPackage writeTextDir;
|
||||
|
||||
importAll = { root, exclude ? [] }:
|
||||
|
||||
# adapted from http://chriswarbo.net/projects/nixos/useful_hacks.html
|
||||
let
|
||||
basename = removeSuffix ".nix";
|
||||
|
||||
isMatch = name: type: (hasSuffix ".nix" name || type == "directory")
|
||||
&& ! elem name (map basename exclude);
|
||||
|
||||
entry = name: _: {
|
||||
name = basename name;
|
||||
value = import (root + "/${name}");
|
||||
};
|
||||
in
|
||||
mapAttrs' entry (filterAttrs isMatch (builtins.readDir root));
|
||||
|
||||
inherit (pkgs) callPackage;
|
||||
in {
|
||||
shenvs = let
|
||||
build = name: { paths, enter ? null }: buildEnv {
|
||||
name = "shenv-${name}";
|
||||
paths = (optional (enter != null) (writeTextDir "lib/shenv/enter" enter))
|
||||
++ paths;
|
||||
};
|
||||
in mapAttrs (name: shenv: build name (shenv pkgs)) (importAll {
|
||||
root = ../shenvs;
|
||||
exclude = [ "config" ];
|
||||
});
|
||||
|
||||
vscode-extensions = pkgs.callPackage ./vscode.nix {};
|
||||
vscode-extensions = callPackage ./vscode.nix {};
|
||||
}
|
||||
|
|
Reference in a new issue