Skip to content

Commit 185a072

Browse files
committed
Port away from flake-utils
1 parent c55a017 commit 185a072

File tree

2 files changed

+80
-93
lines changed

2 files changed

+80
-93
lines changed

flake.lock

Lines changed: 0 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 80 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,94 @@
11
{
22
inputs = {
33
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
4-
flake-utils.url = "github:numtide/flake-utils";
54
};
65
outputs =
7-
{ nixpkgs, flake-utils, ... }:
8-
flake-utils.lib.eachDefaultSystem (
9-
system:
10-
let
11-
pkgs = nixpkgs.legacyPackages.${system};
12-
in
13-
{
14-
devShells.default =
15-
with pkgs;
16-
let
17-
# only bump toolchain versions here
18-
go = go_1_25;
19-
nodejs = nodejs_24;
20-
python3 = python312;
21-
pnpm = pnpm_10;
22-
23-
# Platform-specific dependencies
24-
linuxOnlyInputs = lib.optionals pkgs.stdenv.isLinux [
25-
glibc.static
26-
];
6+
{ nixpkgs, ... }:
7+
let
8+
supportedSystems = [
9+
"aarch64-darwin"
10+
"aarch64-linux"
11+
"x86_64-darwin"
12+
"x86_64-linux"
13+
];
2714

28-
linuxOnlyEnv = lib.optionalAttrs pkgs.stdenv.isLinux {
29-
CFLAGS = "-I${glibc.static.dev}/include";
30-
LDFLAGS = "-L ${glibc.static}/lib";
15+
forEachSupportedSystem =
16+
f:
17+
nixpkgs.lib.genAttrs supportedSystems (
18+
system:
19+
let
20+
pkgs = import nixpkgs {
21+
inherit system;
3122
};
3223
in
33-
pkgs.mkShell (
34-
{
35-
buildInputs = [
36-
# generic
37-
git
38-
git-lfs
39-
gnumake
40-
gnused
41-
gnutar
42-
gzip
43-
zip
24+
f { inherit pkgs; }
25+
);
26+
in
27+
{
28+
devShells = forEachSupportedSystem (
29+
{ pkgs, ... }:
30+
{
31+
default =
32+
let
33+
inherit (pkgs) lib;
34+
35+
# only bump toolchain versions here
36+
go = pkgs.go_1_25;
37+
nodejs = pkgs.nodejs_24;
38+
python3 = pkgs.python312;
39+
pnpm = pkgs.pnpm_10;
4440

45-
# frontend
46-
nodejs
47-
pnpm
48-
cairo
49-
pixman
50-
pkg-config
41+
# Platform-specific dependencies
42+
linuxOnlyInputs = lib.optionals pkgs.stdenv.isLinux [
43+
pkgs.glibc.static
44+
];
5145

52-
# linting
53-
python3
54-
uv
46+
linuxOnlyEnv = lib.optionalAttrs pkgs.stdenv.isLinux {
47+
CFLAGS = "-I${pkgs.glibc.static.dev}/include";
48+
LDFLAGS = "-L ${pkgs.glibc.static}/lib";
49+
};
50+
in
51+
pkgs.mkShell {
52+
packages =
53+
with pkgs;
54+
[
55+
# generic
56+
git
57+
git-lfs
58+
gnumake
59+
gnused
60+
gnutar
61+
gzip
62+
zip
5563

56-
# backend
57-
go
58-
gofumpt
59-
sqlite
60-
]
61-
++ linuxOnlyInputs;
64+
# frontend
65+
nodejs
66+
pnpm
67+
cairo
68+
pixman
69+
pkg-config
6270

63-
GO = "${go}/bin/go";
64-
GOROOT = "${go}/share/go";
71+
# linting
72+
python3
73+
uv
6574

66-
TAGS = "sqlite sqlite_unlock_notify";
67-
STATIC = "true";
68-
}
69-
// linuxOnlyEnv
70-
);
71-
}
72-
);
75+
# backend
76+
go
77+
gofumpt
78+
sqlite
79+
]
80+
++ linuxOnlyInputs;
81+
82+
env = {
83+
GO = "${go}/bin/go";
84+
GOROOT = "${go}/share/go";
85+
86+
TAGS = "sqlite sqlite_unlock_notify";
87+
STATIC = "true";
88+
}
89+
// linuxOnlyEnv;
90+
};
91+
}
92+
);
93+
};
7394
}

0 commit comments

Comments
 (0)