From 3b852b7073470a29a9ddc41e266fa5f73741ea5b Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Sat, 29 Mar 2025 17:53:42 +0100 Subject: [PATCH] bump rust, remove nixago --- templates/default/.vscode/settings.json | 9 +- templates/default/flake.lock | 232 ++------------------ templates/default/flake.nix | 2 - templates/default/nix/devshells/default.nix | 13 +- templates/default/nix/formatter.nix | 9 +- templates/default/rust-toolchain.toml | 4 +- 6 files changed, 43 insertions(+), 226 deletions(-) diff --git a/templates/default/.vscode/settings.json b/templates/default/.vscode/settings.json index f78dcd9..0067b69 100644 --- a/templates/default/.vscode/settings.json +++ b/templates/default/.vscode/settings.json @@ -14,5 +14,12 @@ "command": ["treefmt-nix", "--stdin", "neverexists.nix"] } } - } + }, + + "[rust]": { + "editor.formatOnSave": true, + "editor.defaultFormatter": "rust-lang.rust-analyzer" + }, + "rust-analyzer.interpret.tests": true, + "rust-analyzer.cfg.setTest": true } diff --git a/templates/default/flake.lock b/templates/default/flake.lock index 3450f98..5bdf7ce 100644 --- a/templates/default/flake.lock +++ b/templates/default/flake.lock @@ -8,11 +8,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1733562445, - "narHash": "sha256-gLmqbX40Qos+EeBvmlzvntWB3NrdiDaFxhr3VAmhrf4=", + "lastModified": 1743008896, + "narHash": "sha256-mU0WYwrgN8Sus4ktBsSzkvs0++vAKrhNE0A0vWo8AzY=", "owner": "numtide", "repo": "blueprint", - "rev": "97ef7fba3a6eec13e12a108ce4b3473602eb424f", + "rev": "7ae2142c8b5a47bed6d403fdd5f5a1215961e10c", "type": "github" }, "original": { @@ -23,11 +23,11 @@ }, "crane": { "locked": { - "lastModified": 1734808813, - "narHash": "sha256-3aH/0Y6ajIlfy7j52FGZ+s4icVX0oHhqBzRdlOeztqg=", + "lastModified": 1742394900, + "narHash": "sha256-vVOAp9ahvnU+fQoKd4SEXB2JG2wbENkpqcwlkIXgUC0=", "owner": "ipetkov", "repo": "crane", - "rev": "72e2d02dbac80c8c86bf6bf3e785536acf8ee926", + "rev": "70947c1908108c0c551ddfd73d4f750ff2ea67cd", "type": "github" }, "original": { @@ -36,208 +36,13 @@ "type": "github" } }, - "flake-utils": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_5": { - "locked": { - "lastModified": 1653893745, - "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixago": { - "inputs": { - "flake-utils": "flake-utils", - "nixago-exts": "nixago-exts", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1714086354, - "narHash": "sha256-yKVQMxL9p7zCWUhnGhDzRVT8sDgHoI3V595lBK0C2YA=", - "owner": "jmgilman", - "repo": "nixago", - "rev": "5133633e9fe6b144c8e00e3b212cdbd5a173b63d", - "type": "github" - }, - "original": { - "owner": "jmgilman", - "repo": "nixago", - "type": "github" - } - }, - "nixago-exts": { - "inputs": { - "flake-utils": "flake-utils_2", - "nixago": "nixago_2", - "nixpkgs": [ - "nixago", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1676070308, - "narHash": "sha256-QaJ65oc2l8iwQIGWUJ0EKjCeSuuCM/LqR8RauxZUUkc=", - "owner": "nix-community", - "repo": "nixago-extensions", - "rev": "e5380cb0456f4ea3c86cf94e3039eb856bf07d0b", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixago-extensions", - "type": "github" - } - }, - "nixago-exts_2": { - "inputs": { - "flake-utils": "flake-utils_4", - "nixago": "nixago_3", - "nixpkgs": [ - "nixago", - "nixago-exts", - "nixago", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1655508669, - "narHash": "sha256-BDDdo5dZQMmwNH/GNacy33nPBnCpSIydWFPZs0kkj/g=", - "owner": "nix-community", - "repo": "nixago-extensions", - "rev": "3022a932ce109258482ecc6568c163e8d0b426aa", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixago-extensions", - "type": "github" - } - }, - "nixago_2": { - "inputs": { - "flake-utils": "flake-utils_3", - "nixago-exts": "nixago-exts_2", - "nixpkgs": [ - "nixago", - "nixago-exts", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1676070010, - "narHash": "sha256-iYzJIWptE1EUD8VINAg66AAMUajizg8JUYN3oBmb8no=", - "owner": "nix-community", - "repo": "nixago", - "rev": "d480ba6c0c16e2c5c0bd2122852d6a0c9ad1ed0e", - "type": "github" - }, - "original": { - "owner": "nix-community", - "ref": "rename-config-data", - "repo": "nixago", - "type": "github" - } - }, - "nixago_3": { - "inputs": { - "flake-utils": "flake-utils_5", - "nixpkgs": [ - "nixago", - "nixago-exts", - "nixago", - "nixago-exts", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1655405483, - "narHash": "sha256-Crd49aZWNrpczlRTOwWGfwBMsTUoG9vlHDKQC7cx264=", - "owner": "nix-community", - "repo": "nixago", - "rev": "e6a9566c18063db5b120e69e048d3627414e327d", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "nixago", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1734875076, - "narHash": "sha256-Pzyb+YNG5u3zP79zoi8HXYMs15Q5dfjDgwCdUI5B0nY=", + "lastModified": 1742937945, + "narHash": "sha256-lWc+79eZRyvHp/SqMhHTMzZVhpxkRvthsP1Qx6UCq0E=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1807c2b91223227ad5599d7067a61665c52d1295", + "rev": "d02d88f8de5b882ccdde0465d8fa2db3aa1169f7", "type": "github" }, "original": { @@ -249,11 +54,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1734649271, - "narHash": "sha256-4EVBRhOjMDuGtMaofAIqzJbg4Ql7Ai0PSeuVZTHjyKQ=", + "lastModified": 1743095683, + "narHash": "sha256-gWd4urRoLRe8GLVC/3rYRae1h+xfQzt09xOfb0PaHSk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d70bd19e0a38ad4790d3913bf08fcbfc9eeca507", + "rev": "5e5402ecbcb27af32284d4a62553c019a3a49ea6", "type": "github" }, "original": { @@ -267,7 +72,6 @@ "inputs": { "blueprint": "blueprint", "crane": "crane", - "nixago": "nixago", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "rust-overlay": "rust-overlay", @@ -281,11 +85,11 @@ ] }, "locked": { - "lastModified": 1734834660, - "narHash": "sha256-bm8V+Cu8rWJA+vKQnc94mXTpSDgvedyoDKxTVi/uJfw=", + "lastModified": 1743215516, + "narHash": "sha256-52qbrkG65U1hyrQWltgHTgH4nm0SJL+9TWv2UDCEPNI=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "b070e6030118680977bc2388868c4b3963872134", + "rev": "524463199fdee49338006b049bc376b965a2cfed", "type": "github" }, "original": { @@ -316,11 +120,11 @@ ] }, "locked": { - "lastModified": 1734704479, - "narHash": "sha256-MMi74+WckoyEWBRcg/oaGRvXC9BVVxDZNRMpL+72wBI=", + "lastModified": 1743081648, + "narHash": "sha256-WRAylyYptt6OX5eCEBWyTwOEqEtD6zt33rlUkr6u3cE=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "65712f5af67234dad91a5a4baee986a8b62dbf8f", + "rev": "29a3d7b768c70addce17af0869f6e2bd8f5be4b7", "type": "github" }, "original": { diff --git a/templates/default/flake.nix b/templates/default/flake.nix index 6d2cfa1..cfbb853 100644 --- a/templates/default/flake.nix +++ b/templates/default/flake.nix @@ -8,8 +8,6 @@ blueprint.inputs.nixpkgs.follows = "nixpkgs"; treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; - nixago.url = "github:jmgilman/nixago"; - nixago.inputs.nixpkgs.follows = "nixpkgs"; crane.url = "github:ipetkov/crane"; rust-overlay = { diff --git a/templates/default/nix/devshells/default.nix b/templates/default/nix/devshells/default.nix index c2cd433..29ac272 100644 --- a/templates/default/nix/devshells/default.nix +++ b/templates/default/nix/devshells/default.nix @@ -16,12 +16,13 @@ pkgs.mkShell { # Load custom bash code shellHook = # TODO(blocked/upstream): remove this once https://github.com/isbecker/treefmt-vscode/issues/3 is resolved - (flake.inputs.nixago.lib.${system}.make { - data = flake.formatter.${system}.settings; - output = "treefmt.toml"; - format = "toml"; - }).shellHook - + '' + # (flake.inputs.nixago.lib.${system}.make { + # data = flake.formatter.${system}.settings; + # output = "treefmt.toml"; + # format = "toml"; + # }).shellHook + # + + '' echo $(git rev-parse --show-toplevel) ''; } diff --git a/templates/default/nix/formatter.nix b/templates/default/nix/formatter.nix index 1308b56..9db385b 100644 --- a/templates/default/nix/formatter.nix +++ b/templates/default/nix/formatter.nix @@ -18,7 +18,10 @@ let }; statix.enable = true; - rustfmt.enable = true; + rustfmt = { + enable = true; + edition = "2024"; + }; gofmt.enable = true; @@ -27,6 +30,10 @@ let taplo.enable = true; prettier.enable = true; + + formatjson5.enable = true; + + just.enable = true; } // pkgs.lib.optionalAttrs (pkgs.system != "riscv64-linux") { shellcheck.enable = true; }; settings = { diff --git a/templates/default/rust-toolchain.toml b/templates/default/rust-toolchain.toml index 7dde9f8..1a248a7 100644 --- a/templates/default/rust-toolchain.toml +++ b/templates/default/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "1.83.0" -components = [ "cargo","llvm-tools", "rustc", "clippy", "rust-src" ] +channel = "1.85.0" +components = [ "cargo","llvm-tools", "rustc", "clippy", "rust-src", "rust-analyzer" ] targets = [ ] profile = "minimal"