mirror of
https://github.com/nix-community/nixos-generators.git
synced 2024-09-11 12:15:29 +03:00
add formatter to flake.nix
This commit is contained in:
parent
b3488033c0
commit
121b5a7b38
12
flake.nix
12
flake.nix
@ -28,11 +28,11 @@
|
||||
# }
|
||||
|
||||
nixosGenerate = { pkgs ? null, lib ? nixpkgs.lib, format, system ? null, specialArgs ? { }, modules ? [ ], customFormats ? {} }:
|
||||
let
|
||||
extraFormats = lib.mapAttrs' (name: value: lib.nameValuePair
|
||||
(name)
|
||||
(value // {
|
||||
imports = ( value.imports or [] ++ [ ./format-module.nix ] );
|
||||
let
|
||||
extraFormats = lib.mapAttrs' (name: value: lib.nameValuePair
|
||||
(name)
|
||||
(value // {
|
||||
imports = ( value.imports or [] ++ [ ./format-module.nix ] );
|
||||
} )
|
||||
) customFormats;
|
||||
formatModule = builtins.getAttr format (self.nixosModules // extraFormats);
|
||||
@ -58,6 +58,8 @@
|
||||
forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "x86_64-darwin" "i686-linux" "aarch64-linux" "aarch64-darwin" ];
|
||||
in {
|
||||
|
||||
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
||||
|
||||
packages = forAllSystems (system: let
|
||||
pkgs = nixpkgs.legacyPackages."${system}";
|
||||
in rec {
|
||||
|
Loading…
Reference in New Issue
Block a user