From 95f1229c14f3a2567a8683daef8b24e9687ee5bf Mon Sep 17 00:00:00 2001 From: Tobias Berger Date: Tue, 16 Apr 2024 09:26:30 +0200 Subject: [PATCH] nixfmt --- flake.lock | 6 +++--- flake.nix | 50 ++++++++++++++++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index dc58937..523e62c 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1712163089, - "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", + "lastModified": 1712963716, + "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", + "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index e56e5a4..353fe0b 100644 --- a/flake.nix +++ b/flake.nix @@ -7,29 +7,43 @@ treefmt-nix.url = "github:numtide/treefmt-nix"; }; - outputs = inputs: + outputs = + inputs: inputs.flake-parts.lib.mkFlake { inherit inputs; } { systems = import inputs.systems; imports = [ inputs.treefmt-nix.flakeModule ]; - perSystem = { config, self', pkgs, lib, system, ... }: { - # Rust dev environment - devShells.default = pkgs.mkShell { - inputsFrom = [ config.treefmt.build.devShell ]; - nativeBuildInputs = with pkgs; [ dotnet-sdk_8 libxslt ]; - shellHook = '' - DOTNET_ROOT="${pkgs.dotnet-sdk_8}"; - ''; - }; + perSystem = + { + config, + self', + pkgs, + lib, + system, + ... + }: + { + # Rust dev environment + devShells.default = pkgs.mkShell { + inputsFrom = [ config.treefmt.build.devShell ]; + nativeBuildInputs = with pkgs; [ + dotnet-sdk_8 + libxslt + ]; + shellHook = '' + DOTNET_ROOT="${pkgs.dotnet-sdk_8}"; + ''; + }; - # Add your auto-formatters here. - # cf. https://numtide.github.io/treefmt/ - treefmt.config = { - projectRootFile = "flake.nix"; - programs = { - nixpkgs-fmt.enable = true; - csharpier.enable = true; + # Add your auto-formatters here. + # cf. https://numtide.github.io/treefmt/ + treefmt.config = { + projectRootFile = "flake.nix"; + programs = { + nixpkgs-fmt.enable = true; + csharpier.enable = true; + nixfmt-rfc-style.enable = true; + }; }; }; - }; }; }