Compare commits

...

4 Commits

Author SHA1 Message Date
e08e916cbc
redlib: embed Git hash 2024-11-19 17:47:19 -05:00
444e7048f9
Update redlib 2024-11-19 17:40:16 -05:00
a6058ced54
flake.nix: switch packages to nixpkgs-unstable 2024-11-19 17:39:26 -05:00
9d4e81fffc
update script: allow only updating pkgs 2024-11-19 16:56:16 -05:00
4 changed files with 47 additions and 7 deletions

View File

@ -357,7 +357,7 @@
# (extraS|s)pecialArgs to pass variables
nixosModules = (import ./modules/nixos) moduleInputs;
homeManagerModules = (import ./modules/home-manager) moduleInputs;
packages = eachSystem (system: let pkgs = import nixpkgs { inherit system; };
packages = eachSystem (system: let pkgs = import nixpkgs-unstable { inherit system; };
in (
import ./pkgs { inherit pkgs; }) // {
iso = let

View File

@ -5,26 +5,39 @@
, rustPlatform
, fetchFromGitHub
, darwin
, pkg-config
, perl
, openssl
, nix-update-script
}:
rustPlatform.buildRustPackage rec {
pname = "redlib";
version = "0.35.1-unstable-2024-11-15";
version = "0.35.1-unstable-2024-11-19";
src = fetchFromGitHub {
owner = "redlib-org";
repo = "redlib";
rev = "6c64ebd56b98f5616c2014e2e0567fa37791844c";
hash = "sha256-QXcjpIO1y6mi+4E2BC6O16TaLFfpcPcCHumuJBXmcoU=";
rev = "18efb8c714ad10e0082059e1d47e0f95686d04a7";
hash = "sha256-Kzh0nSGxSqr4c6EvshqHdvqYbqiKCRehf2ngAuj2fmw=";
};
patches = [
# this is so the commit hash can be embedded so redlib doesn't complain
# about the server being outdated unless it's /actually/ outdated
./no-hash.patch
];
cargoHash = "sha256-tb+qTANios+dvNK775gqy0AmB5fuj5BhfYYYegnraEg=";
cargoHash = "sha256-ZmIYTDfdMDkxT1doV5kMMjqIHQ/zhiY/ewd77RqRSMU=";
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Security
] ++ lib.optionals stdenv.isLinux [
openssl
];
nativeBuildInputs = lib.optionals stdenv.isLinux [
pkg-config
perl
];
checkFlags = [
@ -53,6 +66,7 @@ rustPlatform.buildRustPackage rec {
env = {
SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
GIT_HASH=src.rev;
};
passthru.tests = {

10
pkgs/redlib/no-hash.patch Normal file
View File

@ -0,0 +1,10 @@
diff --git a/build.rs b/build.rs
index 0bdbda0..869c7e6 100644
--- a/build.rs
+++ b/build.rs
@@ -21,5 +21,4 @@ fn main() {
)
.unwrap_or_default();
let git_hash = if output == String::default() { "dev".into() } else { output };
- println!("cargo:rustc-env=GIT_HASH={git_hash}");
}

View File

@ -3,8 +3,24 @@
set -Eeuxo pipefail
if [[ "$#" -ne 0 ]] ; then
until [[ "$#" -le 0 ]]; do
case "$1" in
pkgs|packages) DO_PACKAGES=1;;
flake) DO_FLAKE=1;;
esac
shift
done
else
DO_PACKAGES=1
DO_FLAKE=1
fi
cd "$(dirname "$0")"
nix flake update
nix-update --flake redlib --version=branch=main
[[ -n "${DO_FLAKE:+x}" ]] && nix flake update || true
if [[ -n "${DO_PACKAGES:+x}" ]] ; then
nix-update --flake redlib --version=branch=main
fi