Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake . --show-trace -Lv
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/target
/.direnv
/test.norg
61 changes: 61 additions & 0 deletions flake.lock

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

58 changes: 58 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
description = "Norg parser library written in Rust";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = {
self,
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {inherit system;};
toolchain = pkgs.rustPlatform;
cargoPackage = (pkgs.lib.importTOML "${self}/Cargo.toml").package;
in rec {
packages.default = toolchain.buildRustPackage {
pname = cargoPackage.name;
version = cargoPackage.version;
src = pkgs.lib.cleanSource "${self}";
cargoLock = {
lockFile = "${self}/Cargo.lock";
allowBuiltinFetchGit = true;
};
useNextest = true;
dontUseCargoParallelTests = true;

meta = {
description = "Norg parser library written in Rust";
license = pkgs.lib.licenses.gpl2Only;
};
};

apps.default = flake-utils.lib.mkApp {drv = packages.default;};

devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
(with toolchain; [
cargo
rustc
rustLibSrc
])
clippy
rustfmt
cargo-edit
cargo-nextest
rust-analyzer
];

RUST_SRC_PATH = "${toolchain.rustLibSrc}";
};
}
);
}
Loading