From 80250b0179d67b42e8687a944e986a14f1dc4aac Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Thu, 14 Nov 2024 14:47:14 +0100 Subject: [PATCH] feat: prepare for treefmt-nix --- .vscode/settings.json | 2 +- flake.lock | 21 +++++++++++++++++++++ flake.nix | 6 +++++- nix/devShells.nix | 1 + 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 8ace7b1..79eb182 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -11,7 +11,7 @@ }, "formatting": { "command": [ - "alejandra", + "treefmt-nix", ] } } diff --git a/flake.lock b/flake.lock index 785838f..4ea2cd8 100644 --- a/flake.lock +++ b/flake.lock @@ -1080,6 +1080,7 @@ "rperf": "rperf", "sops-nix": "sops-nix", "srvos": "srvos", + "treefmt-nix": "treefmt-nix_4", "x13s-bt-firmware": "x13s-bt-firmware", "yofi": "yofi" } @@ -1316,6 +1317,26 @@ "type": "github" } }, + "treefmt-nix_4": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1730321837, + "narHash": "sha256-vK+a09qq19QNu2MlLcvN4qcRctJbqWkX7ahgPZ/+maI=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "746901bb8dba96d154b66492a29f5db0693dbfcc", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "x13s-bt-firmware": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 1a53f44..d1d4106 100644 --- a/flake.nix +++ b/flake.nix @@ -125,6 +125,10 @@ url = "github:nix-community/nixvim/nixos-24.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = inputs @ { @@ -325,7 +329,7 @@ ''; }; - formatter = pkgs.alejandra; + formatter = inputs.treefmt-nix.formatter.${system}; devShells = let all = import ./nix/devShells.nix { diff --git a/nix/devShells.nix b/nix/devShells.nix index fabf520..1358f30 100644 --- a/nix/devShells.nix +++ b/nix/devShells.nix @@ -24,6 +24,7 @@ in { self'.devShells.install ]; packages = with pkgs; [ + self'.formatter inputs'.colmena.packages.colmena dconf2nix inputs'.nixos-anywhere.packages.nixos-anywhere