From fc669d5534cc862e8cfc16a4ba391cb9595f9411 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Tue, 29 Apr 2025 08:08:00 +0200 Subject: [PATCH] fix(treefmt): respect the packages edition Otherwise it might upgrade to edition 2024 which is not available in stable. --- flake-modules/default.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/flake-modules/default.nix b/flake-modules/default.nix index 6736a16..7cf532e 100644 --- a/flake-modules/default.nix +++ b/flake-modules/default.nix @@ -1,4 +1,8 @@ -{ inputs, ... }: +{ lib, inputs, ... }: +let + webnsupdate = ../module.nix; + cargoToml = lib.importTOML ../Cargo.toml; +in { imports = [ inputs.treefmt-nix.flakeModule @@ -6,14 +10,10 @@ ./tests.nix ]; - flake.nixosModules = - let - webnsupdate = ../module.nix; - in - { - default = webnsupdate; - inherit webnsupdate; - }; + flake.nixosModules = { + default = webnsupdate; + inherit webnsupdate; + }; perSystem = { pkgs, ... }: @@ -23,7 +23,10 @@ projectRootFile = "flake.nix"; programs = { nixfmt.enable = true; - rustfmt.enable = true; + rustfmt = { + enable = true; + inherit (cargoToml.package) edition; # respect the package's edition + }; statix.enable = true; typos.enable = true; };