flake: activate formatter

This commit is contained in:
Tim Schubert 2023-05-25 16:52:10 +02:00 committed by Tim Schubert
parent 1d29a3cc54
commit 1f579be166
2 changed files with 11 additions and 1 deletions

View file

@ -5,12 +5,21 @@
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system}; in
let
pkgs = import nixpkgs { inherit system; };
in
rec {
formatter = pkgs.nixpkgs-fmt;
packages = flake-utils.lib.flattenTree {
pad-archiver = pkgs.callPackage ./nix { pkgs = pkgs; };
gitAndTools = pkgs.gitAndTools;
};
checks = {
nix-format = pkgs.runCommand "nix-format" { buildInputs = [ formatter ]; } "nixpkgs-fmt --check ${./.} && touch $out";
};
defaultPackage = packages.pad-archiver;
apps.pad-archiver = flake-utils.lib.mkApp { drv = packages.pad-archiver; };
defaultApp = apps.pad-archiver;