Skip to content

Commit d523ad0

Browse files
committed
flake provide rust builds
1 parent 0fe9f1b commit d523ad0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

rust/.envrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
use flake .
1+
if [ -z "$NIX_DEVELOP_ONCE" ]; then
2+
export NIX_DEVELOP_ONCE=1
3+
nix develop
4+
fi

rust/flake.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
flake-utils.lib.eachDefaultSystem (
1515
system: let
1616
pkgs = nixpkgs.legacyPackages.${system};
17+
mkRustPkg = pkg:
18+
pkgs.rustPlatform.buildRustPackage {
19+
name = pkg;
20+
src = pkgs.nix-gitignore.gitignoreSource [] ./${pkg};
21+
cargoLock.lockFile = ./${pkg}/Cargo.lock;
22+
};
1723
in {
1824
devShells.default = pkgs.mkShell {
1925
packages = with pkgs; [
@@ -27,6 +33,10 @@
2733
rustfmt
2834
];
2935
};
36+
packages = {
37+
rustell = mkRustPkg "rustell";
38+
default = self.packages.${system}.rustell;
39+
};
3040
}
3141
);
3242
}

0 commit comments

Comments
 (0)