flake.nix: add sqlite derivations
Build and test / build-static-library (push) Successful in 50s
Build and test / build-dynamic-library (push) Successful in 50s
Build and test / test (push) Successful in 1m4s
Build and test / check (push) Successful in 1m19s

This commit is contained in:
2026-05-22 10:10:10 +09:00
parent 11518e12d6
commit e71afe9803
2 changed files with 76 additions and 1 deletions
Generated
+22
View File
@@ -15,6 +15,27 @@
"type": "github"
}
},
"nix-sqlite": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1779411945,
"narHash": "sha256-8aCvP/VXmhephNNTlpjKApCV1Qf4Uq/j/KBSPq6KFes=",
"ref": "main",
"rev": "8d0ea0b23b2f8bcddc9fbbd4cec2e1c00090dde1",
"revCount": 20,
"type": "git",
"url": "https://git.pvv.ntnu.no/mugiten/nix-custom-sqlite.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "https://git.pvv.ntnu.no/mugiten/nix-custom-sqlite.git"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1778869304,
@@ -34,6 +55,7 @@
"root": {
"inputs": {
"crane": "crane",
"nix-sqlite": "nix-sqlite",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
+54 -1
View File
@@ -5,10 +5,13 @@
rust-overlay.url = "github:oxalica/rust-overlay";
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
nix-sqlite.url = "git+https://git.pvv.ntnu.no/mugiten/nix-custom-sqlite.git?ref=main";
nix-sqlite.inputs.nixpkgs.follows = "nixpkgs";
crane.url = "github:ipetkov/crane";
};
outputs = { self, nixpkgs, rust-overlay, crane }:
outputs = { self, nixpkgs, rust-overlay, nix-sqlite, crane }:
let
inherit (nixpkgs) lib;
@@ -119,6 +122,31 @@
];
};
tamerye-static-lib-android = androidPkgs.rustPlatform.buildRustPackage {
pname = "tamerye-static-lib-android";
version = cargoToml.package.version;
inherit src;
inherit cargoLock;
strictDeps = true;
doCheck = false;
nativeBuildInputs = with androidPkgs; [
rustfmt
];
postPatch = ''
'${lib.getExe pkgs.yq-go}' '.lib.crate-type = [ "staticlib" ]' --inplace Cargo.toml
'';
buildInputs = with pkgs; [
sqlite
];
cargoExtraArgs = lib.escapeShellArgs [ "--features" "static" ];
};
tamerye-shared-lib-crane = craneLib.buildPackage {
pname = "tamerye-shared-lib";
version = cargoToml.package.version;
@@ -186,6 +214,31 @@
partitionType = "count";
cargoNextestPartitionsExtraArgs = "--no-tests=pass";
};
sqlite-tamerye-static = let
custom-sqlite = nix-sqlite.mkSqlite {
inherit pkgs;
enableInteractive = true;
# features = {
# ENABLE_COLUMN_METADATA = true;
# };
extensions = [{
library = "${self.packages.${system}.tamerye-static-lib-crane}/lib/libtamerye.a";
init = "sqlite3_tamerye_init";
}];
};
in custom-sqlite.sqlite-cli;
sqlite-tamerye-static-android = let
custom-sqlite = nix-sqlite.mkSqlite {
pkgs = androidPkgs;
enableInteractive = true;
extensions = [{
library = "${self.packages.${system}.tamerye-static-lib-android}/lib/libtamerye.a";
init = "sqlite3_tamerye_init";
}];
};
in custom-sqlite.sqlite;
});
};
}