0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-11-05 01:45:41 +01:00

Port away from flake-utils

This commit is contained in:
Naxdy 2025-10-15 13:04:18 +02:00
parent c55a017225
commit 185a07256f
No known key found for this signature in database
GPG Key ID: CC15075846BCE91B
2 changed files with 80 additions and 93 deletions

34
flake.lock generated
View File

@ -1,23 +1,5 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1760038930, "lastModified": 1760038930,
@ -36,24 +18,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View File

@ -1,38 +1,57 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = outputs =
{ nixpkgs, flake-utils, ... }: { nixpkgs, ... }:
flake-utils.lib.eachDefaultSystem ( let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
forEachSupportedSystem =
f:
nixpkgs.lib.genAttrs supportedSystems (
system: system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = import nixpkgs {
inherit system;
};
in
f { inherit pkgs; }
);
in in
{ {
devShells.default = devShells = forEachSupportedSystem (
with pkgs; { pkgs, ... }:
{
default =
let let
inherit (pkgs) lib;
# only bump toolchain versions here # only bump toolchain versions here
go = go_1_25; go = pkgs.go_1_25;
nodejs = nodejs_24; nodejs = pkgs.nodejs_24;
python3 = python312; python3 = pkgs.python312;
pnpm = pnpm_10; pnpm = pkgs.pnpm_10;
# Platform-specific dependencies # Platform-specific dependencies
linuxOnlyInputs = lib.optionals pkgs.stdenv.isLinux [ linuxOnlyInputs = lib.optionals pkgs.stdenv.isLinux [
glibc.static pkgs.glibc.static
]; ];
linuxOnlyEnv = lib.optionalAttrs pkgs.stdenv.isLinux { linuxOnlyEnv = lib.optionalAttrs pkgs.stdenv.isLinux {
CFLAGS = "-I${glibc.static.dev}/include"; CFLAGS = "-I${pkgs.glibc.static.dev}/include";
LDFLAGS = "-L ${glibc.static}/lib"; LDFLAGS = "-L ${pkgs.glibc.static}/lib";
}; };
in in
pkgs.mkShell ( pkgs.mkShell {
{ packages =
buildInputs = [ with pkgs;
[
# generic # generic
git git
git-lfs git-lfs
@ -60,14 +79,16 @@
] ]
++ linuxOnlyInputs; ++ linuxOnlyInputs;
env = {
GO = "${go}/bin/go"; GO = "${go}/bin/go";
GOROOT = "${go}/share/go"; GOROOT = "${go}/share/go";
TAGS = "sqlite sqlite_unlock_notify"; TAGS = "sqlite sqlite_unlock_notify";
STATIC = "true"; STATIC = "true";
} }
// linuxOnlyEnv // linuxOnlyEnv;
); };
} }
); );
};
} }