Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
66 lines (63 loc) · 2.21 KB
/
Copy pathflake.nix
File metadata and controls
66 lines (63 loc) · 2.21 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
description = "A useless flake by berberman";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nvfetcher.url = "github:berberman/nvfetcher";
inputs.nvfetcher.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, nvfetcher }:
let
genPkg = f: name: {
inherit name;
value = f name;
};
pkgDir = ./packages;
broken = import ./broken.nix;
generated = import ./_sources/generated.nix;
overlays = import ./overlays.nix;
names = with builtins;
nixpkgs.lib.subtractLists broken (attrNames (readDir pkgDir));
withContents = f: with builtins; listToAttrs (map (genPkg f) names);
in {
overlays.default = final: prev:
prev.lib.composeManyExtensions [
overlays
(final: prev: {
nv-sources = generated {
inherit (final) fetchurl fetchgit fetchFromGitHub dockerTools;
};
})
(final: prev:
withContents (name:
let
pkg = import (pkgDir + "/${name}");
override =
builtins.intersectAttrs (builtins.functionArgs pkg) ({
pythonPackages = final.python3.pkgs;
mySource = prev.nv-sources.${name} or null;
});
in final.callPackage pkg override))
] final prev;
} // (let
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ self.overlays.default nvfetcher.overlays.default ];
config.allowUnfree = true;
};
in rec {
nixosModules.default = ./modules;
legacyPackages.x86_64-linux = pkgs;
packages.x86_64-linux = withContents (name: pkgs.${name});
apps.x86_64-linux = pkgs.lib.filterAttrs (_: x: x.program != null)
(withContents (name:
let drv = pkgs.${name};
in {
type = "app";
program = if drv.passthru.runnable or false then
"${drv}/bin/${drv.passthru.program or name}"
else
null;
}));
checks.x86_64-linux = packages.x86_64-linux;
devShells.x86_64-linux.default =
nvfetcher.packages.x86_64-linux.ghcWithNvfetcher;
});
}