Skip to content

Commit eaedd00

Browse files
committed
updating the project nix flake
1 parent 4a0ff4c commit eaedd00

File tree

3 files changed

+116
-36
lines changed

3 files changed

+116
-36
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# and the Deno Javascript runtime. A OCI-compliant Containerfile with this environment
1616
# is also provided.
1717
!flake.nix
18+
!flake.lock
1819
!pyproject.toml
1920
!pixi.lock
2021
!uv.lock

flake.lock

Lines changed: 96 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,45 +52,28 @@
5252
else
5353
null;
5454

55-
# Build refman using cargo-binstall
56-
refman = pkgs.stdenv.mkDerivation {
57-
name = "refman";
58-
version = "latest";
59-
60-
nativeBuildInputs = with pkgs; [
61-
cargo-binstall
62-
pkg-config
63-
openssl
64-
cacert
65-
];
66-
67-
buildInputs = with pkgs; [
68-
openssl
69-
];
55+
# Build refman from source
56+
refman = pkgs.rustPlatform.buildRustPackage rec {
57+
pname = "refman";
58+
version = "1.3.5";
7059

71-
dontUnpack = true;
72-
dontBuild = true;
60+
src = pkgs.fetchFromGitHub {
61+
owner = "nrminor";
62+
repo = "refman";
63+
rev = "refman-${version}";
64+
hash = "sha256-zKw6/J3x4PupBYbwqTMspXT2ii+fvjtdE/6C3hg04B4=";
65+
};
7366

74-
installPhase = ''
75-
export HOME=$TMPDIR
76-
export CARGO_HOME=$TMPDIR/.cargo
77-
export RUSTUP_HOME=$TMPDIR/.rustup
78-
export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
67+
cargoHash = "sha256-cc8TUf6MdsRgTZmh5mLxNzQopuSVXYdkdiFaoix38mA=";
7968

80-
# Create output directory
81-
mkdir -p $out/bin
69+
nativeBuildInputs = with pkgs; [ pkg-config ];
70+
buildInputs = with pkgs; [ openssl ];
8271

83-
# Install refman using cargo-binstall
84-
${pkgs.cargo-binstall}/bin/cargo-binstall \
85-
--no-confirm \
86-
--no-symlinks \
87-
--root $TMPDIR \
88-
refman
72+
# Use system OpenSSL instead of vendoring
73+
OPENSSL_NO_VENDOR = 1;
8974

90-
# Move the binary to the output
91-
mv $TMPDIR/bin/refman $out/bin/refman
92-
chmod +x $out/bin/refman
93-
'';
75+
# Skip doctests (they have incomplete examples in refman)
76+
doCheck = false;
9477
};
9578

9679
in
@@ -112,7 +95,7 @@
11295
pkgs.pixi
11396
pkgs.just
11497
pkgs.just-lsp
115-
pkgs.pre-commit
98+
pkgs.prek
11699
rustToolchain
117100
pkgs.cargo-binstall
118101
refman
@@ -136,7 +119,7 @@
136119
if [ -f .pre-commit-config.yaml ]; then
137120
if [ ! -f .git/hooks/pre-commit ] || [ ! -f .pre-commit-installed.stamp ]; then
138121
echo "📝 Installing pre-commit hooks..."
139-
pre-commit install
122+
prek install
140123
touch .pre-commit-installed.stamp
141124
echo "✅ Pre-commit hooks installed successfully"
142125
fi

0 commit comments

Comments
 (0)