From 0139e4a35f244de158dad180bd543c871a776e6d Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Thu, 14 Aug 2025 09:45:13 -0400 Subject: [PATCH] fix nix dev shell on darwin nixfmt was run too so please review without whitespace changes --- flake.lock | 6 ++--- flake.nix | 66 ++++++++++++++++++++++++++++++++---------------------- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/flake.lock b/flake.lock index 67f87dfaf62c5..1aa393f27b134 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1752480373, - "narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=", + "lastModified": 1755027561, + "narHash": "sha256-IVft239Bc8p8Dtvf7UAACMG5P3ZV+3/aO28gXpGtMXI=", "owner": "nixos", "repo": "nixpkgs", - "rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08", + "rev": "005433b926e16227259a1843015b5b2b7f7d1fc3", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 13aa5008e6e86..29730e8c16ab6 100644 --- a/flake.nix +++ b/flake.nix @@ -18,38 +18,50 @@ go = go_1_24; nodejs = nodejs_24; python3 = python312; + + # Platform-specific dependencies + linuxOnlyInputs = lib.optionals pkgs.stdenv.isLinux [ + glibc.static + ]; + + linuxOnlyEnv = lib.optionalAttrs pkgs.stdenv.isLinux { + CFLAGS = "-I${glibc.static.dev}/include"; + LDFLAGS = "-L ${glibc.static}/lib"; + }; in - pkgs.mkShell { - buildInputs = [ - # generic - git - git-lfs - gnumake - gnused - gnutar - gzip + pkgs.mkShell ( + { + buildInputs = [ + # generic + git + git-lfs + gnumake + gnused + gnutar + gzip - # frontend - nodejs + # frontend + nodejs - # linting - python3 - uv + # linting + python3 + uv - # backend - go - glibc.static - gofumpt - sqlite - ]; - CFLAGS = "-I${glibc.static.dev}/include"; - LDFLAGS = "-L ${glibc.static}/lib"; - GO = "${go}/bin/go"; - GOROOT = "${go}/share/go"; + # backend + go + gofumpt + sqlite + ] + ++ linuxOnlyInputs; + + GO = "${go}/bin/go"; + GOROOT = "${go}/share/go"; - TAGS = "sqlite sqlite_unlock_notify"; - STATIC = "true"; - }; + TAGS = "sqlite sqlite_unlock_notify"; + STATIC = "true"; + } + // linuxOnlyEnv + ); } ); }