This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
postgres-c = import ./postgres-c.nix { inherit self system pkgs; };
|
postgres-c = import ./postgres-c.nix { inherit self system pkgs; };
|
||||||
pure-c = import ./pure-c.nix { inherit self system pkgs; };
|
pure-c = import ./pure-c.nix { inherit self system pkgs; };
|
||||||
rust = import ./rust.nix { inherit self system pkgs; };
|
rust = import ./rust.nix { inherit self system pkgs; };
|
||||||
|
ratatui = import ./ratatui.nix { inherit self system pkgs; };
|
||||||
haskell = import ./haskell.nix { inherit self system pkgs; };
|
haskell = import ./haskell.nix { inherit self system pkgs; };
|
||||||
neuro = import ./neuro.nix { inherit self system pkgs; };
|
neuro = import ./neuro.nix { inherit self system pkgs; };
|
||||||
xmpp = import ./xmpp.nix { inherit self system pkgs; };
|
xmpp = import ./xmpp.nix { inherit self system pkgs; };
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
self,
|
||||||
|
pkgs,
|
||||||
|
system
|
||||||
|
}: let
|
||||||
|
rustToolchain =
|
||||||
|
if builtins.pathExists ./rust-toolchain.toml
|
||||||
|
then pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml
|
||||||
|
else pkgs.pkgsBuildHost.rust-bin.stable."1.81.0".default;
|
||||||
|
in
|
||||||
|
self.devShells.${system}.default
|
||||||
|
// (pkgs.mkShell {
|
||||||
|
nativeBuildInputs = [
|
||||||
|
rustToolchain
|
||||||
|
pkgs.pkg-config
|
||||||
|
pkgs.gcc
|
||||||
|
pkgs.gnumake
|
||||||
|
];
|
||||||
|
})
|
||||||
+16
-38
@@ -2,14 +2,12 @@
|
|||||||
lib,
|
lib,
|
||||||
buildGo126Module,
|
buildGo126Module,
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
writeShellScriptBin,
|
|
||||||
git,
|
git,
|
||||||
bash,
|
bash,
|
||||||
coreutils,
|
coreutils,
|
||||||
gzip,
|
gzip,
|
||||||
nodejs,
|
nodejs,
|
||||||
openssh,
|
openssh,
|
||||||
fetchurl,
|
|
||||||
fetchPnpmDeps,
|
fetchPnpmDeps,
|
||||||
pnpmConfigHook,
|
pnpmConfigHook,
|
||||||
pnpm_10,
|
pnpm_10,
|
||||||
@@ -20,31 +18,9 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
pname = "gitea";
|
pname = "gitea";
|
||||||
version = "1.27.3";
|
version = "1.26.2";
|
||||||
src = ./source;
|
src = ./source;
|
||||||
pnpm = pnpm_10.overrideAttrs (_: {
|
pnpm = pnpm_10;
|
||||||
version = "11.9.0";
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://registry.npmjs.org/pnpm/-/pnpm-11.9.0.tgz";
|
|
||||||
hash = "sha256-K1Z6pmAmI4B4rC4KM77D/r1g6WKYeqxpdFbzGAgZsoc=";
|
|
||||||
};
|
|
||||||
postPatch = ''
|
|
||||||
chmod +x bin/pnpm.cjs bin/pnpx.cjs
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
pnpmForNix = ((writeShellScriptBin "pnpm" ''
|
|
||||||
if [ "''${1-}" = config ] && [ "''${2-}" = set ] && [ "''${3-}" = manage-package-manager-versions ]; then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
exec ${pnpm}/bin/pnpm "$@"
|
|
||||||
'').overrideAttrs (_: {
|
|
||||||
version = "11.9.0";
|
|
||||||
})) // {
|
|
||||||
nodejs-slim = nodejs;
|
|
||||||
};
|
|
||||||
pnpmPreInstall = ''
|
|
||||||
export NODE_OPTIONS=--dns-result-order=ipv4first
|
|
||||||
'';
|
|
||||||
|
|
||||||
frontend = stdenv.mkDerivation {
|
frontend = stdenv.mkDerivation {
|
||||||
pname = "gitea-frontend";
|
pname = "gitea-frontend";
|
||||||
@@ -53,18 +29,15 @@ let
|
|||||||
pnpmDeps = fetchPnpmDeps {
|
pnpmDeps = fetchPnpmDeps {
|
||||||
pname = "gitea-frontend";
|
pname = "gitea-frontend";
|
||||||
inherit version src;
|
inherit version src;
|
||||||
pnpm = pnpmForNix;
|
inherit pnpm;
|
||||||
fetcherVersion = 4;
|
fetcherVersion = 3;
|
||||||
prePnpmInstall = pnpmPreInstall;
|
hash = "sha256-Qo0DLuZv+2GVLsBfCv/6CC9E/qhSE4HwV4StQL4HX4Y=";
|
||||||
hash = "sha256-rduD3GqgdUlF95HTnKe8smToyHop4RrO6QDTRzh2RCk=";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
prePnpmInstall = pnpmPreInstall;
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
nodejs
|
nodejs
|
||||||
pnpmConfigHook
|
pnpmConfigHook
|
||||||
pnpmForNix
|
pnpm
|
||||||
];
|
];
|
||||||
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
@@ -81,7 +54,7 @@ buildGo126Module rec {
|
|||||||
inherit pname version src;
|
inherit pname version src;
|
||||||
|
|
||||||
proxyVendor = true;
|
proxyVendor = true;
|
||||||
vendorHash = "sha256-YRBMGWKIZgMxOXaXG2bIBj1XzkhSwiMyfRy+yQGw+Bo=";
|
vendorHash = "sha256-7+M1n8RSgB3gZ/2na4RF9kYOf90H0bnsJZMDKpgAy64=";
|
||||||
|
|
||||||
outputs = [
|
outputs = [
|
||||||
"out"
|
"out"
|
||||||
@@ -90,16 +63,21 @@ buildGo126Module rec {
|
|||||||
|
|
||||||
patches = [ ./static-root-path.patch ];
|
patches = [ ./static-root-path.patch ];
|
||||||
|
|
||||||
|
overrideModAttrs = _: {
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace go.mod \
|
||||||
|
--replace-fail "go 1.26.3" "go 1.26"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace modules/setting/server.go --subst-var data
|
substituteInPlace modules/setting/server.go --subst-var data
|
||||||
|
substituteInPlace go.mod \
|
||||||
|
--replace-fail "go 1.26.3" "go 1.26"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
subPackages = [ "." ];
|
subPackages = [ "." ];
|
||||||
|
|
||||||
postBuild = ''
|
|
||||||
mv "$GOPATH/bin/gitea.dev" "$GOPATH/bin/gitea"
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
tags = lib.optionals sqliteSupport [
|
tags = lib.optionals sqliteSupport [
|
||||||
|
|||||||
Reference in New Issue
Block a user