-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault.nix
More file actions
35 lines (31 loc) · 1016 Bytes
/
default.nix
File metadata and controls
35 lines (31 loc) · 1016 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{
pkgs ? import <nixpkgs> { },
}:
let
inherit (pkgs) lib;
callPackage = pkgs.lib.callPackageWith (pkgs // { nur.repos.josh = pkgs' // internalPkgs; });
internalPkgs = {
fetchhelm = import ./internal/fetchhelm.nix pkgs;
nix-prefetch-helm = callPackage ./internal/nix-prefetch-helm.nix { };
nixhelm-update = callPackage ../../internal/nixhelm-update.nix { };
};
packagesFromDirectory =
directory:
lib.attrsets.concatMapAttrs (
name: type:
let
filename = lib.path.append directory name;
isNix = lib.strings.hasSuffix ".nix" name;
basename = lib.strings.removeSuffix ".nix" name;
in
if type == "regular" && isNix then { "${basename}" = callPackage filename { }; } else { }
) (builtins.readDir directory);
pkgs' = lib.attrsets.concatMapAttrs (
name: type:
let
dirname = lib.path.append ./pkgs name;
in
if type == "directory" then packagesFromDirectory dirname else { }
) (builtins.readDir ./pkgs);
in
pkgs'