-
Notifications
You must be signed in to change notification settings - Fork 91
/
flake.nix
41 lines (39 loc) · 1.22 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
{
description = "Universal Package Manager";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# nix-editor is a dev dependency in this project. At Replit, we use
# nix-editor directly too, so nix-editor is already in the
# environment.
inputs.nix-editor.url = "github:replit/nix-editor";
inputs.nix-editor.inputs.nixpkgs.follows = "nixpkgs";
inputs.build-go-cache.url = "github:numtide/build-go-cache/1f0056d94c4097cf8cfc9ed9c1864e400f689c6b";
inputs.build-go-cache.inputs.nixpkgs.follows = "nixpkgs";
outputs = {
self,
nixpkgs,
nix-editor,
build-go-cache,
}: let
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
eachSystem = nixpkgs.lib.genAttrs systems;
rev =
if self ? rev
then "0.0.0-${builtins.substring 0 7 self.rev}"
else "0.0.0-dirty";
in {
packages = eachSystem (system:
import ./nix {
inherit self nixpkgs rev system nix-editor;
inherit (build-go-cache.legacyPackages.${system}) buildGoCache;
});
devShells = eachSystem (system: {
default = self.packages.${system}.devShell;
});
formatter = eachSystem (system: self.packages.${system}.fmt);
};
}