-
-
Notifications
You must be signed in to change notification settings - Fork 104
/
flake.nix
75 lines (69 loc) · 2.19 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
74
75
{
description = "A faster, persistent implementation of `direnv`'s `use_nix`, to replace the built-in one.";
nixConfig.extra-substituters = [ "https://cache.thalheim.io" ];
nixConfig.extra-trusted-public-keys = [
"cache.thalheim.io-1:R7msbosLEZKrxk/lKxf9BTjOOH7Ax3H0Qj0/6wiHOgc="
];
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } (
{ lib, ... }:
{
imports = [
./treefmt.nix
./pkgs/bash4/flake-module.nix
];
systems = [
"aarch64-linux"
"x86_64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
perSystem =
{
config,
pkgs,
self',
...
}:
{
packages = {
nix-direnv = pkgs.callPackage ./default.nix { };
default = config.packages.nix-direnv;
test-runner-stable = pkgs.callPackage ./test-runner.nix { nixVersion = "stable"; };
test-runner-latest = pkgs.callPackage ./test-runner.nix { nixVersion = "latest"; };
};
devShells.default = pkgs.callPackage ./shell.nix {
packages = [
config.treefmt.build.wrapper
pkgs.shellcheck
];
};
checks =
let
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages;
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
in
packages // devShells;
};
flake = {
overlays.default = final: _prev: { nix-direnv = final.callPackage ./default.nix { }; };
templates.default = {
path = ./templates/flake;
description = "nix flake new -t github:nix-community/nix-direnv .";
};
};
}
);
}