refactor: statix, deadnix, alejandra

This commit is contained in:
Kat Inskip 2023-01-17 14:26:07 -05:00
parent 961ec369ba
commit 53eed4454d
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
57 changed files with 1296 additions and 963 deletions

20
shells/default.nix Normal file
View file

@ -0,0 +1,20 @@
{
lib,
tree,
inputs,
...
}: let
inherit (lib.attrsets) mapAttrs;
in
inputs.utils.lib.eachDefaultSystem (system: {
devShells = let
shells = mapAttrs (_: path:
import path rec {
inherit tree inputs system;
pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (inputs.nixpkgs) lib;
})
tree.shells;
in
shells // {default = shells.repo;};
})

View file

@ -1,15 +1,22 @@
{pkgs, inputs, system, ...}: with pkgs; let
repo = import ../outputs.nix (inputs // { inherit inputs system; });
{
pkgs,
inputs,
system,
...
}:
with pkgs; let
repo = import ../outputs.nix (inputs // {inherit inputs system;});
inherit (lib.attrsets) mapAttrsToList;
in
mkShell {
nativeBuildInputs = [
deadnix # dead-code scanner
alejandra # code formatter
statix # anti-pattern finder
] ++ mapAttrsToList (name: _:
(pkgs.writeShellScriptBin "${name}-rebuild" ''
darwin-rebuild switch --flake ${toString ../.}#${name}
nativeBuildInputs =
[
deadnix # dead-code scanner
alejandra # code formatter
statix # anti-pattern finder
]
++ mapAttrsToList (name: _: (pkgs.writeShellScriptBin "${name}-rebuild" ''
darwin-rebuild switch --flake $REPO_ROOT#${name}
''))
repo.darwinConfigurations;
repo.darwinConfigurations;
}

10
shells/work.nix Normal file
View file

@ -0,0 +1,10 @@
{pkgs, ...}:
with pkgs;
mkShell {
nativeBuildInputs = [
jq
k9s
terraform
awscli
];
}