This commit is contained in:
death916 2025-07-29 02:33:27 -07:00
parent e7d4e743ce
commit 5a97b697a9
2 changed files with 29 additions and 40 deletions

View file

@ -1,10 +1,12 @@
self: super: self: super:
let let
# Use the standard stable rust platform provided by nixpkgs nightlyRustPlatform = super.makeRustPlatform {
stableRustPlatform = super.rustPlatform; cargo = super.rust-bin.nightly."2025-07-28".default;
rustc = super.rust-bin.nightly."2025-07-28".default;
};
in in
{ {
halloy = stableRustPlatform.buildRustPackage rec { halloy = nightlyRustPlatform.buildRustPackage rec {
pname = "halloy"; pname = "halloy";
version = "2025.7"; version = "2025.7";
@ -15,13 +17,14 @@ in
sha256 = "sha256-qBBJAW2QKwcqZRS3D/giT2EzruuGLrCne7odz2vl9is="; sha256 = "sha256-qBBJAW2QKwcqZRS3D/giT2EzruuGLrCne7odz2vl9is=";
}; };
RUSTC_BOOTSTRAP = 1;
RUSTFLAGS = "-Z allow-features=let_chains";
cargoLock = { cargoLock = {
lockFile = src + "/Cargo.lock"; lockFile = src + "/Cargo.lock";
outputHashes = { outputHashes = {
"cryoglyph-0.1.0" = "sha256-Jc+rhzd5BIT7aYBtIfsBFFKkGChdEYhDHdYGiv4KE+c="; "cryoglyph-0.1.0" = "sha256-Jc+rhzd5BIT7aYBtIfsBFFKkGChdEYhDHdYGiv4KE+c=";
#"dark-light-2.0.0" = "sha256-e826vF7iSkGUqv65TXHBUX04Kz2aaJJEW9f7JsAMaXE=";
"iced-0.14.0-dev" = "sha256-mt9PsX3FjLFIaE8OyPxCRFeSaxrmZaiVs+QwV2oYtVc="; "iced-0.14.0-dev" = "sha256-mt9PsX3FjLFIaE8OyPxCRFeSaxrmZaiVs+QwV2oYtVc=";
# "winit-0.30.8" = "sha256-hlVhlQ8MmIbNFNr6BM4edKdZbe+ixnPpKm819zauFLQ=";
"dpi-0.1.1" = "sha256-hlVhlQ8MmIbNFNr6BM4edKdZbe+ixnPpKm819zauFLQ="; "dpi-0.1.1" = "sha256-hlVhlQ8MmIbNFNr6BM4edKdZbe+ixnPpKm819zauFLQ=";
}; };
}; };
@ -75,3 +78,4 @@ in
}; };
}; };
} }

View file

@ -1,52 +1,27 @@
self: super: self: super:
let let
rustNightly = super.rust-bin.nightly.latest.default.override { # Use the standard stable rust platform provided by nixpkgs
extensions = [ stableRustPlatform = super.rustPlatform;
"rust-src"
"rustc-dev"
];
};
nightlyRustPlatform = super.makeRustPlatform {
cargo = rustNightly;
rustc = rustNightly;
};
in in
{ {
halloy = nightlyRustPlatform.buildRustPackage rec { halloy = stableRustPlatform.buildRustPackage rec {
pname = "halloy"; pname = "halloy";
version = "2025.6"; version = "2025.7";
src = super.fetchFromGitHub { src = super.fetchFromGitHub {
owner = "squidowl"; owner = "squidowl";
repo = pname; repo = pname;
rev = version; rev = version;
sha256 = "sha256-a95PmVEx4j9euqh+z9MvzvwfmWCGydeZjDCfYLOM4tI="; sha256 = "sha256-qBBJAW2QKwcqZRS3D/giT2EzruuGLrCne7odz2vl9is=";
}; };
RUSTC_BOOTSTRAP = 1;
# Add doc_cfg to allowed features
RUSTFLAGS = "-Z allow-features=edition2024,avx512_target_feature,stdarch_x86_avx512,doc_cfg";
postPatch = ''
# Add feature flags to all relevant crates
find . -name '*.rs' -exec sed -i '1i #![feature(avx512_target_feature,stdarch_x86_avx512,doc_cfg)]' {} \;
# Add cargo-features to Cargo.toml files
find . -name Cargo.toml -exec sh -c '
if ! grep -q "cargo-features" {}; then
sed -i "1i cargo-features = [\"edition2024\"]" {}
fi
' \;
'';
cargoLock = { cargoLock = {
lockFile = src + "/Cargo.lock"; lockFile = src + "/Cargo.lock";
outputHashes = { outputHashes = {
"cryoglyph-0.1.0" = "sha256-X7S9jq8wU6g1DDNEzOtP3lKWugDnpopPDBK49iWvD4o="; "cryoglyph-0.1.0" = "sha256-Jc+rhzd5BIT7aYBtIfsBFFKkGChdEYhDHdYGiv4KE+c=";
"dark-light-2.0.0" = "sha256-e826vF7iSkGUqv65TXHBUX04Kz2aaJJEW9f7JsAMaXE="; #"dark-light-2.0.0" = "sha256-e826vF7iSkGUqv65TXHBUX04Kz2aaJJEW9f7JsAMaXE=";
"iced-0.14.0-dev" = "sha256-FEGk1zkXM9o+fGMoDtmi621G6pL+Yca9owJz4q2Lzks="; "iced-0.14.0-dev" = "sha256-mt9PsX3FjLFIaE8OyPxCRFeSaxrmZaiVs+QwV2oYtVc=";
"winit-0.30.8" = "sha256-hlVhlQ8MmIbNFNr6BM4edKdZbe+ixnPpKm819zauFLQ="; # "winit-0.30.8" = "sha256-hlVhlQ8MmIbNFNr6BM4edKdZbe+ixnPpKm819zauFLQ=";
"dpi-0.1.1" = "sha256-hlVhlQ8MmIbNFNr6BM4edKdZbe+ixnPpKm819zauFLQ="; "dpi-0.1.1" = "sha256-hlVhlQ8MmIbNFNr6BM4edKdZbe+ixnPpKm819zauFLQ=";
}; };
}; };
@ -68,7 +43,6 @@ in
alsa-lib.dev alsa-lib.dev
]; ];
# Add this postInstall phase to set up proper library paths
postInstall = '' postInstall = ''
wrapProgram $out/bin/halloy \ wrapProgram $out/bin/halloy \
--prefix LD_LIBRARY_PATH : ${ --prefix LD_LIBRARY_PATH : ${
@ -80,6 +54,17 @@ in
super.openssl super.openssl
] ]
} }
mkdir -p $out/share/applications
cat > $out/share/applications/halloy.desktop << EOF
[Desktop Entry]
Type=Application
Name=Halloy IRC Client
Exec=$out/bin/halloy
Comment=A modern IRC client built with Rust
Categories=Network;Chat;
Terminal=false
EOF
''; '';
meta = with super.lib; { meta = with super.lib; {