-
Notifications
You must be signed in to change notification settings - Fork 12
/
flake.nix
73 lines (64 loc) · 1.87 KB
/
flake.nix
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
67
68
69
70
71
72
73
{
description = "A `nix` and `nix-shell` wrapper for shells other than `bash`";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default";
advisory-db = {
url = "github:rustsec/advisory-db";
flake = false;
};
};
nixConfig = {
extra-substituters = ["https://cache.garnix.io"];
extra-trusted-substituters = ["https://cache.garnix.io"];
extra-trusted-public-keys = ["cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="];
};
outputs = inputs @ {
self,
nixpkgs,
systems,
...
}: let
inherit (nixpkgs) lib;
makePkgs = system:
import nixpkgs {
localSystem = system;
};
eachSystem = fn: lib.genAttrs (import systems) fn;
in {
pkgs = eachSystem (system: makePkgs system);
localPkgs = eachSystem (system: self.pkgs.${system}.callPackage ./nix/makePackages.nix {inherit inputs;});
packages = eachSystem (system: let
localPkgs = self.localPkgs.${system};
in
(lib.filterAttrs (_name: lib.isDerivation) localPkgs)
// {
default = localPkgs.nix-your-shell;
nix-your-shell-from-overlay = let
overlayed = self.pkgs.${system}.appendOverlays [
self.overlays.default
];
in
overlayed.nix-your-shell;
});
checks = eachSystem (
system:
builtins.removeAttrs
self.localPkgs.${system}.checks
# Ugh.
["override" "overrideDerivation"]
);
devShells = eachSystem (system: {
default = self.localPkgs.${system}.nix-your-shell.devShell;
});
overlays.default = final: prev: let
localPkgs = prev.callPackage ./nix/makePackages.nix {inherit inputs;};
in {
inherit (localPkgs) nix-your-shell;
};
};
}