Add allHosts script and formatting app
This commit is contained in:
parent
66092ec8e5
commit
31e4a7f56f
1 changed files with 16 additions and 9 deletions
11
flake.nix
11
flake.nix
|
@ -21,6 +21,7 @@
|
|||
inherit system;
|
||||
config.allowUnfree = true; # For vscode
|
||||
};
|
||||
hosts = [ "speer" "hummelberg" ];
|
||||
in {
|
||||
checks.${system}.formatCheck = let pkgs = pkgsUnstable;
|
||||
in pkgs.runCommand "nixfmt-check" { } ''
|
||||
|
@ -33,7 +34,6 @@
|
|||
# Build with `nixos-rebuild --flake .#<hostname>` or
|
||||
# `nix build .#nixosConfigurations.<hostname>.config.system.build.toplevel
|
||||
nixosConfigurations = let
|
||||
hosts = [ "speer" "hummelberg" ];
|
||||
home-manager-config = {
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
|
@ -80,7 +80,13 @@
|
|||
};
|
||||
devShell.${system} = import ./shell.nix { pkgs = pkgsUnstable; };
|
||||
|
||||
apps.${system}.format = let
|
||||
packages.${system}.defaultPackage.${system} = let
|
||||
configs = map (host: self.nixosConfigurations.${host}.config.system.build.toplevel) hosts;
|
||||
in pkgsUnstable.linkFarmFromDrvs "allHosts" configs;
|
||||
|
||||
|
||||
apps.${system} = {
|
||||
format = let
|
||||
pkgs = pkgsUnstable;
|
||||
formatter = pkgsUnstable.writeShellScriptBin "formatter" ''
|
||||
${pkgs.findutils}/bin/find . -type f -name '*.nix' -exec ${pkgs.nixfmt}/bin/nixfmt {} +
|
||||
|
@ -90,4 +96,5 @@
|
|||
program = "${formatter}/bin/formatter";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue