-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathflake.nix
More file actions
74 lines (66 loc) · 1.8 KB
/
flake.nix
File metadata and controls
74 lines (66 loc) · 1.8 KB
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
{
description = "Elytra";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {...} @ inputs:
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = inputs.nixpkgs.lib.systems.flakeExposed;
imports = [
inputs.treefmt-nix.flakeModule
inputs.flake-parts.flakeModules.easyOverlay
];
perSystem = {
system,
config,
...
}: let
pkgs = import inputs.nixpkgs {inherit system;};
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
go
golangci-lint
gotools
config.treefmt.build.wrapper
];
};
packages.elytra = pkgs.buildGoModule rec {
pname = "elytra";
version = inputs.self.rev or "dirty";
src = inputs.self;
vendorHash = "sha256-scQQP9hRezE0pB6zh36IEqETktWwE8PH4gBCel8L3hQ=";
ldflags = [
"-s"
"-w"
"-X"
"github.com/pyrohost/elytra/system.Version=${version}"
];
};
treefmt = {
projectRootFile = "flake.nix";
programs = {
alejandra.enable = true;
deadnix.enable = true;
gofmt.enable = true;
shellcheck.enable = true;
shfmt = {
enable = true;
indent_size = 0; # 0 causes shfmt to use tabs
};
yamlfmt = {
enable = true;
settings = {
formatter.retain_line_breaks = true;
};
};
};
};
};
};
}