diff --git a/.editorconfig b/.editorconfig index c1e2c643..8b7907dc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,6 @@ end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true + +[*.nix] +indent_size = 2 diff --git a/flake.lock b/flake.lock index 46078504..5d42af72 100644 --- a/flake.lock +++ b/flake.lock @@ -20,27 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739863612, - "narHash": "sha256-UbtgxplOhFcyjBcNbTVO8+HUHAl/WXFDOb6LvqShiZo=", + "lastModified": 1744868846, + "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "632f04521e847173c54fa72973ec6c39a371211c", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1736320768, - "narHash": "sha256-nIYdTAiKIGnFNugbomgBJR+Xv5F1ZQU+HfaBqJKroC0=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "4bc9c909d9ac828a039f288cf872d16d38185db8", + "rev": "ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c", "type": "github" }, "original": { @@ -53,26 +37,7 @@ "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1739932111, - "narHash": "sha256-WkayjH0vuGw0hx2gmjTUGFRvMKpM17gKcpL/U8EUUw0=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "75b2271c5c087d830684cd5462d4410219acc367", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" + "nixpkgs": "nixpkgs" } }, "systems": { diff --git a/flake.nix b/flake.nix index 0677e846..e66a2f0c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,14 +2,22 @@ inputs = { flake-utils.url = "github:numtide/flake-utils"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - rust-overlay.url = "github:oxalica/rust-overlay"; }; - outputs = { flake-utils, nixpkgs, rust-overlay, ... }: + outputs = { flake-utils, nixpkgs, ... }: flake-utils.lib.eachDefaultSystem (system: let - overlays = [ (import rust-overlay) ]; - pkgs = import nixpkgs { inherit system overlays; }; + pkgs = import nixpkgs { inherit system; }; in { - devShell = import ./shell.nix { inherit pkgs system; }; + devShell = pkgs.mkShell { + buildInputs = [ + pkgs.pre-commit + pkgs.python3 + pkgs.rustup + ]; + shellHook = '' + FLAKE_DIR=$(dirname $(dirname $out)) + source $FLAKE_DIR/.venv/bin/activate + ''; + }; }); } diff --git a/shell.nix b/shell.nix deleted file mode 100644 index bf71a7c2..00000000 --- a/shell.nix +++ /dev/null @@ -1,14 +0,0 @@ -# If you plan to use `nix-shell` you have first to: -# -# $ nix-channel --add https://github.com/oxalica/rust-overlay/archive/master.tar.gz rust-overlay -# $ nix-channel --update -{ pkgs ? import { overlays = [ (import ) ]; } -, system ? builtins.currentSystem }: -with pkgs; -let - toolchain = (rust-bin.fromRustupToolchainFile ./rust-toolchain).override { - extensions = [ "rust-src" "rust-analyzer" "clippy" ]; - }; -in mkShell { - buildInputs = [ toolchain openssl pre-commit pkg-config python3 uv ]; -}