Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

139 changes: 80 additions & 59 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,73 +1,94 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default =
with pkgs;
let
# only bump toolchain versions here
go = go_1_25;
nodejs = nodejs_24;
python3 = python312;
pnpm = pnpm_10;

# Platform-specific dependencies
linuxOnlyInputs = lib.optionals pkgs.stdenv.isLinux [
glibc.static
];
{ nixpkgs, ... }:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];

linuxOnlyEnv = lib.optionalAttrs pkgs.stdenv.isLinux {
CFLAGS = "-I${glibc.static.dev}/include";
LDFLAGS = "-L ${glibc.static}/lib";
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system:
let
pkgs = import nixpkgs {
inherit system;
};
in
pkgs.mkShell (
{
buildInputs = [
# generic
git
git-lfs
gnumake
gnused
gnutar
gzip
zip
f { inherit pkgs; }
);
in
{
devShells = forEachSupportedSystem (
{ pkgs, ... }:
{
default =
let
inherit (pkgs) lib;

# only bump toolchain versions here
go = pkgs.go_1_25;
nodejs = pkgs.nodejs_24;
python3 = pkgs.python312;
pnpm = pkgs.pnpm_10;

# frontend
nodejs
pnpm
cairo
pixman
pkg-config
# Platform-specific dependencies
linuxOnlyInputs = lib.optionals pkgs.stdenv.isLinux [
pkgs.glibc.static
];

# linting
python3
uv
linuxOnlyEnv = lib.optionalAttrs pkgs.stdenv.isLinux {
CFLAGS = "-I${pkgs.glibc.static.dev}/include";
LDFLAGS = "-L ${pkgs.glibc.static}/lib";
};
in
pkgs.mkShell {
packages =
with pkgs;
[
# generic
git
git-lfs
gnumake
gnused
gnutar
gzip
zip

# backend
go
gofumpt
sqlite
]
++ linuxOnlyInputs;
# frontend
nodejs
pnpm
cairo
pixman
pkg-config

GO = "${go}/bin/go";
GOROOT = "${go}/share/go";
# linting
python3
uv

TAGS = "sqlite sqlite_unlock_notify";
STATIC = "true";
}
// linuxOnlyEnv
);
}
);
# backend
go
gofumpt
sqlite
]
++ linuxOnlyInputs;

env = {
GO = "${go}/bin/go";
GOROOT = "${go}/share/go";

TAGS = "sqlite sqlite_unlock_notify";
STATIC = "true";
}
// linuxOnlyEnv;
};
}
);
};
}