mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-08-16 23:51:00 +03:00
add format check
This commit is contained in:
parent
c0889cabd9
commit
2091cad026
5
checks/is-formatted.nix
Normal file
5
checks/is-formatted.nix
Normal file
@ -0,0 +1,5 @@
|
||||
{pkgs ? import <nixpkgs> {}}:
|
||||
pkgs.runCommand "check-format" {} ''
|
||||
${pkgs.alejandra}/bin/alejandra -c ${./.}
|
||||
touch $out
|
||||
''
|
12
flake.nix
12
flake.nix
@ -46,7 +46,7 @@
|
||||
name
|
||||
(value
|
||||
// {
|
||||
imports = (value.imports or [] ++ [./format-module.nix]);
|
||||
imports = value.imports or [] ++ [./format-module.nix];
|
||||
})
|
||||
)
|
||||
customFormats;
|
||||
@ -109,8 +109,13 @@
|
||||
});
|
||||
|
||||
checks = forAllSystems (system: {
|
||||
inherit (self.packages.${system})
|
||||
nixos-generate;
|
||||
inherit
|
||||
(self.packages.${system})
|
||||
nixos-generate
|
||||
;
|
||||
is-formatted = import ./checks/is-formatted.nix {
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
};
|
||||
});
|
||||
|
||||
devShells = forAllSystems (system: let
|
||||
@ -136,7 +141,6 @@
|
||||
default = nixos-generate;
|
||||
});
|
||||
|
||||
|
||||
# legacy flake schema compat
|
||||
defaultApp = forAllSystems (system: self.apps."${system}".nixos-generate);
|
||||
defaultPackage =
|
||||
|
Loading…
Reference in New Issue
Block a user