mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
refactor: statix, deadnix, alejandra
This commit is contained in:
parent
961ec369ba
commit
53eed4454d
57 changed files with 1296 additions and 963 deletions
20
shells/default.nix
Normal file
20
shells/default.nix
Normal 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;};
|
||||
})
|
||||
|
|
@ -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
10
shells/work.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{pkgs, ...}:
|
||||
with pkgs;
|
||||
mkShell {
|
||||
nativeBuildInputs = [
|
||||
jq
|
||||
k9s
|
||||
terraform
|
||||
awscli
|
||||
];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue