-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
58 lines (54 loc) · 1.53 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
{
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} ({
flake-parts-lib,
self,
withSystem,
...
}: {
imports = [
inputs.devshell.flakeModule
inputs.generate-go-sri.flakeModules.default
./nixos/tests/flake-part.nix
];
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = {
config,
pkgs,
lib,
...
}: {
formatter = pkgs.alejandra;
go-sri-hashes.default = {};
packages = {
default = config.packages.hoopsnake;
hoopsnake = pkgs.buildGo123Module rec {
pname = "hoopsnake";
version = "0.0.0";
vendorHash = builtins.readFile ./default.sri;
subPackages = ["cmd/hoopsnake"];
src = lib.sourceFilesBySuffices (lib.sources.cleanSource ./.) [".go" ".mod" ".sum"];
CGO_ENABLED = 0;
meta.mainProgram = "hoopsnake";
};
};
devshells.default = {
commands = [
];
packages = [
pkgs.go_1_23
pkgs.golangci-lint
];
};
};
flake.nixosModules.default = import ./nixos/module.nix {
inherit withSystem;
};
});
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
devshell.url = "github:numtide/devshell";
generate-go-sri.url = "github:antifuchs/generate-go-sri";
};
}