refactor(nix): simplify style tool outputs
This commit is contained in:
22
flake.nix
22
flake.nix
@@ -82,19 +82,9 @@
|
|||||||
...
|
...
|
||||||
}@inputs:
|
}@inputs:
|
||||||
let
|
let
|
||||||
supportedSystems = [ "x86_64-linux" ];
|
system = "x86_64-linux";
|
||||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
pkgsFor = system: nixpkgs.legacyPackages.${system};
|
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
|
||||||
treefmtEvalFor = system: treefmt-nix.lib.evalModule (pkgsFor system) ./treefmt.nix;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
formatter = forAllSystems (system: (treefmtEvalFor system).config.build.wrapper);
|
|
||||||
|
|
||||||
apps = forAllSystems (
|
|
||||||
system:
|
|
||||||
let
|
|
||||||
pkgs = pkgsFor system;
|
|
||||||
treefmtEval = treefmtEvalFor system;
|
|
||||||
nixStyleCheck = pkgs.writeShellApplication {
|
nixStyleCheck = pkgs.writeShellApplication {
|
||||||
name = "nix-style-check";
|
name = "nix-style-check";
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
@@ -110,12 +100,12 @@
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nix-style-check = {
|
formatter.${system} = treefmtEval.config.build.wrapper;
|
||||||
|
|
||||||
|
apps.${system}.nix-style-check = {
|
||||||
type = "app";
|
type = "app";
|
||||||
program = "${nixStyleCheck}/bin/nix-style-check";
|
program = "${nixStyleCheck}/bin/nix-style-check";
|
||||||
};
|
};
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
nixosConfigurations = (import ./src/dotfiles {
|
nixosConfigurations = (import ./src/dotfiles {
|
||||||
inherit inputs self;
|
inherit inputs self;
|
||||||
|
|||||||
Reference in New Issue
Block a user