-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
132 lines (118 loc) · 3.5 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
description = "Well-typed path manipulation for Dhall";
nixConfig = {
## https://github.com/NixOS/rfcs/blob/master/rfcs/0045-deprecate-url-syntax.md
extra-experimental-features = ["no-url-literals"];
extra-substituters = [
"https://cache.dhall-lang.org"
"https://cache.garnix.io"
"https://dhall.cachix.org"
];
extra-trusted-public-keys = [
"cache.dhall-lang.org:I9/H18WHd60olG5GsIjolp7CtepSgJmM2CsO813VTmM="
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"dhall.cachix.org-1:8laGciue2JBwD49ICFtg+cIF8ddDaW7OFBjDb/dHEAo="
];
## Isolate the build.
registries = false;
sandbox = "relaxed";
};
outputs = {
bash-strict-mode,
flake-utils,
flaky,
nixpkgs,
self,
}: let
pname = "dhall-path";
supportedSystems =
nixpkgs.lib.remove
## NB: cborg-0.2.9.0, needed by Dhall, doesn’t compile on i686-linux.
flake-utils.lib.system.i686-linux
flaky.lib.defaultSystems;
in
{
schemas = {
inherit
(flaky.schemas)
overlays
homeConfigurations
packages
devShells
projectConfigurations
checks
formatter
;
};
overlays = {
default = final: prev: {
dhallPackages = prev.dhallPackages.override (old: {
overrides =
final.lib.composeExtensions
(old.overrides or (_: _: {}))
(self.overlays.dhall final prev);
});
};
dhall = final: prev: dfinal: dprev: {
${pname} = self.packages.${final.system}.${pname};
};
};
homeConfigurations =
builtins.listToAttrs
(builtins.map
(flaky.lib.homeConfigurations.example
pname
self
[
({pkgs, ...}: {
## TODO: Is there something more like `dhallWithPackages`?
home.packages = [pkgs.dhallPackages.${pname}];
})
])
supportedSystems);
}
// flake-utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs {inherit system;};
src = pkgs.lib.cleanSource ./.;
in {
packages = {
default = self.packages.${system}.${pname};
"${pname}" =
bash-strict-mode.lib.checkedDrv
pkgs
(pkgs.dhallPackages.buildDhallDirectoryPackage {
src = "${src}/dhall";
name = pname;
dependencies = [pkgs.dhallPackages.Prelude];
document = true;
});
};
projectConfigurations =
flaky.lib.projectConfigurations.default {inherit pkgs self;};
devShells =
self.projectConfigurations.${system}.devShells
// {default = flaky.lib.devShells.default system self [] "";};
checks = self.projectConfigurations.${system}.checks;
formatter = self.projectConfigurations.${system}.formatter;
});
inputs = {
bash-strict-mode = {
inputs = {
flake-utils.follows = "flake-utils";
flaky.follows = "flaky";
nixpkgs.follows = "nixpkgs";
};
url = "github:sellout/bash-strict-mode";
};
flake-utils.url = "github:numtide/flake-utils";
flaky = {
inputs = {
bash-strict-mode.follows = "bash-strict-mode";
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
};
url = "github:sellout/flaky";
};
nixpkgs.url = "github:NixOS/nixpkgs/release-23.11";
};
}