gitea源码

flake.nix 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {
  2. inputs = {
  3. nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
  4. flake-utils.url = "github:numtide/flake-utils";
  5. };
  6. 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. # Platform-specific dependencies
  23. linuxOnlyInputs = lib.optionals pkgs.stdenv.isLinux [
  24. glibc.static
  25. ];
  26. linuxOnlyEnv = lib.optionalAttrs pkgs.stdenv.isLinux {
  27. CFLAGS = "-I${glibc.static.dev}/include";
  28. LDFLAGS = "-L ${glibc.static}/lib";
  29. };
  30. in
  31. pkgs.mkShell (
  32. {
  33. buildInputs = [
  34. # generic
  35. git
  36. git-lfs
  37. gnumake
  38. gnused
  39. gnutar
  40. gzip
  41. zip
  42. # frontend
  43. nodejs
  44. pnpm
  45. cairo
  46. pixman
  47. pkg-config
  48. # linting
  49. python3
  50. uv
  51. # backend
  52. go
  53. gofumpt
  54. sqlite
  55. ]
  56. ++ linuxOnlyInputs;
  57. GO = "${go}/bin/go";
  58. GOROOT = "${go}/share/go";
  59. TAGS = "sqlite sqlite_unlock_notify";
  60. STATIC = "true";
  61. }
  62. // linuxOnlyEnv
  63. );
  64. }
  65. );
  66. }