Skip to content

Commit

Permalink
update nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
pcasaretto committed Mar 25, 2024
1 parent 7aff9ff commit f35742c
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 84 deletions.
88 changes: 39 additions & 49 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 27 additions & 35 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
{
inputs = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
};

outputs = { self, nixpkgs, utils, naersk }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
in
{
defaultPackage = naersk-lib.buildPackage ./.;
devShell = with pkgs; mkShell {
buildInputs = [
cargo
rustc
rustfmt
pre-commit
rustPackages.clippy

cargo-deny

cargo-edit
cargo-watch

# Spelling and linting
codespell
];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
shellHook = ''
export DYLD_LIBRARY_PATH=${rustc}/lib:$DYLD_LIBRARY_PATH
'';
};
});
}
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
flake-utils.lib.eachDefaultSystem
(system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
in
with pkgs;
{
devShells.default = mkShell {
buildInputs = [ rustToolchain ];
};
}
);
}
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.77.0"
components = [ "rustfmt", "clippy" ]

0 comments on commit f35742c

Please # to comment.