mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-11-22 01:52:05 +03:00
add format check
This commit is contained in:
parent
ef5c3a94b2
commit
27efbe76ba
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