-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
57 lines (50 loc) · 1.79 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
{
description = "update nixpkgs automatically";
inputs.mmdoc.url = "github:ryantm/mmdoc";
inputs.mmdoc.inputs.nixpkgs.follows = "nixpkgs";
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
inputs.runtimeDeps.url = "github:NixOS/nixpkgs/nixos-unstable-small";
outputs =
{
self,
nixpkgs,
mmdoc,
treefmt-nix,
runtimeDeps,
}@args:
let
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
eachSystem = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
treefmtEval = eachSystem (
pkgs:
treefmt-nix.lib.evalModule pkgs {
projectRootFile = ".git/config";
programs.ormolu.enable = true;
}
);
in
{
checks.x86_64-linux =
let
packages = nixpkgs.lib.mapAttrs' (
n: nixpkgs.lib.nameValuePair "package-${n}"
) self.packages.x86_64-linux;
devShells = nixpkgs.lib.mapAttrs' (
n: nixpkgs.lib.nameValuePair "devShell-${n}"
) self.devShells.x86_64-linux;
in
packages // devShells // { treefmt = treefmtEval.x86_64-linux.config.build.check self; };
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
packages.x86_64-linux = import ./pkgs/default.nix (args // { system = "x86_64-linux"; });
devShells.x86_64-linux.default = self.packages."x86_64-linux".devShell;
# nix flake check is broken for these when run on x86_64-linux
# packages.x86_64-darwin = import ./pkgs/default.nix (args // { system = "x86_64-darwin"; });
# devShells.x86_64-darwin.default = self.packages."x86_64-darwin".devShell;
};
}