diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-12-23 18:39:15 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-12-23 18:39:15 +0100 |
commit | 54c04d379643e92dadeccda6f2423937d5e2b1ee (patch) | |
tree | 0605ddaace69334d347161ae7a187fda571da343 /flake.nix | |
parent | feat(pkgs): Hook up to the flake and add needed infrastructure (diff) | |
download | nixos-server-54c04d379643e92dadeccda6f2423937d5e2b1ee.tar.gz nixos-server-54c04d379643e92dadeccda6f2423937d5e2b1ee.zip |
build(flake): Use treefmt as nix formatter
This allows us to also keep markdown and other documents, that aren't nix, formatted.
Diffstat (limited to '')
-rw-r--r-- | flake.nix | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/flake.nix b/flake.nix index dc63ea9..c7af7b4 100644 --- a/flake.nix +++ b/flake.nix @@ -7,6 +7,13 @@ library.url = "git+https://git.vhack.eu/vhack.eu/nix-library?ref=prime"; + treefmt-nix = { + url = "github:numtide/treefmt-nix"; + inputs = { + nixpkgs.follows = "nixpkgs"; + }; + }; + # inputs for following systems = { url = "github:nix-systems/x86_64-linux"; # only evaluate for this system @@ -76,6 +83,7 @@ nixpkgs, nixpkgs-unstable, library, + treefmt-nix, # modules simple-nixos-mailserver, impermanence, @@ -107,6 +115,7 @@ vhackPackages = import ./pkgs {inherit pkgs nixLib;}; inherit (library) nixLib; + treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;}; in { nixosConfigurations."server1" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -119,15 +128,17 @@ ]; }; - checks."${system}" = tests; + checks."${system}" = nixLib.warnMerge tests { + formatting = + treefmtEval.config.build.check self; + } "the flake checks"; packages."${system}" = vhackPackages; + formatter."${system}" = treefmtEval.config.build.wrapper; devShells."${system}" = { default = pkgs.mkShell { packages = with pkgs; [ - alejandra - # used for certificate generation in the taskserver setup gnutls @@ -138,6 +149,5 @@ ]; }; }; - formatter."${system}" = pkgs.alejandra; }; } |