summaryrefslogtreecommitdiff
path: root/default.nix
blob: fbf95e48fe38a73137d8f22f3ef197aaa880d76c (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
let
  lock = builtins.readFile ./flake.lock |> builtins.fromJSON;

  defaultNixpkgs = builtins.fetchGit {
    url = "https://github.com/NixOS/nixpkgs";
    shallow = true;
    inherit (lock.nodes.nixpkgs.locked) rev;
    inherit (lock.nodes.nixpkgs.original) ref;
  };
in
{
  pkgs ? import defaultNixpkgs { },
  localSystem ? builtins.currentSystem,
  crossSystem ? null,
  ...
}:

let
  inherit (pkgs) lib;

  inherit (lib)
    packagesFromDirectoryRecursive
    ;

  overlay =
    final: _:
    let
      depotPackages = packagesFromDirectoryRecursive {
        callPackage = lib.callPackageWith (final // { inherit depotPackages; });
        directory = ./packages;
      };
    in
    {
      inherit depotPackages;
    };

  newPkgs = import defaultNixpkgs {
    config = {
      allowUnfree = true;
      allowUnfreeRedistributable = true;
    };

    overlays = [ overlay ];
  };

in
newPkgs.depotPackages