Skip to content

Commit c2737ec

Browse files
authored
Merge pull request #2 from docprofsky/flake-update
Update Flake and create Flake package
2 parents 940bbc0 + 0642466 commit c2737ec

File tree

3 files changed

+22
-72
lines changed

3 files changed

+22
-72
lines changed

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ things. So I made one.
1818
Building
1919
========
2020

21-
Running `nix-shell --command 'cargo build --release'` should work. The
21+
Running `nix develop --command cargo build --release` should work. The
2222
executable will then be in `./target/release/scromble`. Please file an
2323
issue if that doesn't work!
2424

2525
If you would like to use the AVX2 backend for XChaCha20, build with
26-
`nix-shell --command 'RUSTFLAGS="-Ctarget-cpu=haswell
27-
-Ctarget-feature=+sse2" cargo build --release'` instead. Everything
28-
else should be the same. The fastest results I've seen are expected
29-
with `RUSTFLAGS="-Ctarget-cpu=native"`.
26+
`RUSTFLAGS="-Ctarget-cpu=haswell -Ctarget-feature=+sse2" nix develop
27+
--command cargo build --release` instead. Everything else should be the
28+
same. The fastest results I've seen are expected with
29+
`RUSTFLAGS="-Ctarget-cpu=native"`.
3030

3131
NOTE FOR WINDOWS USERS
3232
======================

flake.lock

+5-56
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+12-11
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,31 @@
22
description = "A devShell example";
33

44
inputs = {
5-
nixpkgs.url = github:nixos/nixpkgs/nixos-21.11;
5+
nixpkgs.url = github:nixos/nixpkgs/nixos-24.11;
66
flake-utils.url = github:numtide/flake-utils;
7-
rust-overlay.url = github:oxalica/rust-overlay;
87
};
98

10-
outputs = { self, nixpkgs, flake-utils, rust-overlay, ... }:
9+
outputs = { self, nixpkgs, flake-utils, ... }:
1110
flake-utils.lib.eachDefaultSystem (system:
1211
let
13-
overlays = [ (import rust-overlay) ];
1412
pkgs = import nixpkgs {
15-
inherit system overlays;
13+
inherit system;
1614
};
1715
in
1816
with pkgs;
19-
{
17+
rec {
2018
devShell = mkShell {
21-
buildInputs = [
22-
openssl
23-
pkgconfig
24-
rust-bin.stable.latest.default
25-
];
19+
buildInputs = [ cargo ];
2620

2721
RUST_BACKTRACE="full";
2822
};
23+
packages.scromble = rustPlatform.buildRustPackage rec {
24+
name = "scromble-${version}";
25+
version = if (self ? rev) then self.rev else "dirty";
26+
src = self;
27+
cargoLock.lockFile = ./Cargo.lock;
28+
};
29+
packages.default = packages.scromble;
2930
}
3031
);
3132
}

0 commit comments

Comments
 (0)