-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
97 lines (92 loc) · 2.56 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
{
description = "Go' og Varm web";
inputs = {
dream2nix.url = "github:nix-community/dream2nix";
nixpkgs.follows = "dream2nix/nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-root.url = "github:srid/flake-root";
devshell.url = "github:numtide/devshell";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [inputs.flake-root.flakeModule inputs.treefmt-nix.flakeModule inputs.devshell.flakeModule];
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem = {
pkgs,
config,
system,
...
}: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
(final: prev: {
go = prev.go.overrideAttrs (_old: {
version = "1.22.5";
src = prev.fetchurl {
url = "https://go.dev/dl/go1.22.5.src.tar.gz";
hash = "sha256-rJxyPyJJaa7mJLw0/TTJ4T8qIS11xxyAfeZEu0bhEvY=";
};
});
})
];
};
devshells.default = {
packages =
(with pkgs; [
caddy
gcc # needed for sqlite3-go
gnumake
go
go-tools
gopls
gotools
httpie
imagemagick
nodePackages.terser
nodejs_22
protobuf
shellcheck
sqlite-interactive # -interactive gives readline / ncurses
rustc
cargo
rustfmt
pre-commit
rustPackages.clippy
])
++ (with pkgs.elmPackages; [
elm
elm-doc-preview
elm-format
elm-optimize-level-2
elm-test
])
++ [config.treefmt.build.wrapper];
env = [
{
name = "RUST_SRC_PATH";
value = "${pkgs.rustPlatform.rustLibSrc}";
}
];
motd = "";
};
treefmt.config = {
inherit (config.flake-root) projectRootFile;
package = pkgs.treefmt;
programs = {
alejandra.enable = true;
deadnix.enable = true;
gofumpt.enable = true;
prettier.enable = true;
statix.enable = true;
};
};
};
};
}