From b46cf7ce2d784125e9a25249ad20cb20e4f12478 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Wed, 9 Apr 2025 12:45:17 +0100 Subject: [PATCH 1/2] Update flake.lock --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 46078504..7067cf12 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1739863612, - "narHash": "sha256-UbtgxplOhFcyjBcNbTVO8+HUHAl/WXFDOb6LvqShiZo=", + "lastModified": 1744096231, + "narHash": "sha256-kUfx3FKU1Etnua3EaKvpeuXs7zoFiAcli1gBwkPvGSs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "632f04521e847173c54fa72973ec6c39a371211c", + "rev": "b2b0718004cc9a5bca610326de0a82e6ea75920b", "type": "github" }, "original": { @@ -62,11 +62,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1739932111, - "narHash": "sha256-WkayjH0vuGw0hx2gmjTUGFRvMKpM17gKcpL/U8EUUw0=", + "lastModified": 1744166053, + "narHash": "sha256-mpI7OzFwp+fUeDtZYQbVZ2YmtxTN2UNrrOwbYD27xKU=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "75b2271c5c087d830684cd5462d4410219acc367", + "rev": "896158be1835589db6f42f45ef0a49b8b492cc66", "type": "github" }, "original": { From e071fbb8667a3491d47928cde0daa722374e2497 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Mon, 21 Apr 2025 00:40:45 +0100 Subject: [PATCH 2/2] Install rustup instead of using rust overlay --- .editorconfig | 3 +++ flake.lock | 43 ++++--------------------------------------- flake.nix | 18 +++++++++++++----- shell.nix | 14 -------------- 4 files changed, 20 insertions(+), 58 deletions(-) delete mode 100644 shell.nix 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 7067cf12..5d42af72 100644 --- a/flake.lock +++ b/flake.lock @@ -20,27 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1744096231, - "narHash": "sha256-kUfx3FKU1Etnua3EaKvpeuXs7zoFiAcli1gBwkPvGSs=", + "lastModified": 1744868846, + "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b2b0718004cc9a5bca610326de0a82e6ea75920b", - "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": 1744166053, - "narHash": "sha256-mpI7OzFwp+fUeDtZYQbVZ2YmtxTN2UNrrOwbYD27xKU=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "896158be1835589db6f42f45ef0a49b8b492cc66", - "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 ]; -}