aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-09-14 09:17:44 +0000
committerFuwn <[email protected]>2024-09-14 09:17:44 +0000
commit0870052b3f854e7d275b722c5eafb3b23324eadb (patch)
tree94a02b76971bfcf800b6e641e90e64cc53b85a87 /flake.nix
parentfix(html): selection and highlighting borders (diff)
downloadseptember-0870052b3f854e7d275b722c5eafb3b23324eadb.tar.xz
september-0870052b3f854e7d275b722c5eafb3b23324eadb.zip
chore(nix): flake-based development shell
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..493b0fc
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,46 @@
+{
+ inputs = {
+ nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+
+ rust-overlay = {
+ url = "github:oxalica/rust-overlay";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs =
+ {
+ nixpkgs,
+ flake-utils,
+ rust-overlay,
+ ...
+ }:
+ flake-utils.lib.eachDefaultSystem (
+ system:
+ let
+ overlays = [ (import rust-overlay) ];
+ pkgs = import nixpkgs { inherit system overlays; };
+ in
+ {
+ devShell =
+ with pkgs;
+ mkShell.override
+ {
+ stdenv = stdenvAdapters.useMoldLinker clangStdenv;
+ }
+ {
+ nativeBuildInputs = [
+ rust-bin.stable.latest.default
+ cargo-make
+ openssl
+ pkg-config
+ cargo-watch
+ ];
+
+ # https://discourse.nixos.org/t/rust-src-not-found-and-other-misadventures-of-developing-rust-on-nixos/11570/5?u=fuwn
+ RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
+ };
+ }
+ );
+}