2024-08-08 21:38:44 +02:00
|
|
|
{ inputs, ... }:
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
inputs.devshell.flakeModule
|
|
|
|
inputs.pre-commit-hooks.flakeModule
|
2024-07-26 22:12:48 +02:00
|
|
|
];
|
2024-08-08 21:38:44 +02:00
|
|
|
|
|
|
|
perSystem =
|
|
|
|
{ config, pkgs, ... }:
|
2024-07-26 22:12:48 +02:00
|
|
|
{
|
2024-08-08 21:38:44 +02:00
|
|
|
pre-commit.settings.hooks = {
|
2024-10-10 19:11:21 +02:00
|
|
|
nixfmt-rfc-style = {
|
2024-08-08 21:38:44 +02:00
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
deadnix.enable = true;
|
|
|
|
statix.enable = true;
|
|
|
|
};
|
|
|
|
formatter = pkgs.nixfmt-rfc-style;
|
|
|
|
devshells.default = {
|
|
|
|
packages = with pkgs; [
|
|
|
|
# Nix
|
|
|
|
nil
|
2024-11-14 12:27:17 +01:00
|
|
|
inputs.nixp-meta.packages.x86_64-linux.nixp-meta-release
|
2024-08-08 21:38:44 +02:00
|
|
|
|
|
|
|
# Misc
|
|
|
|
shellcheck
|
|
|
|
pre-commit
|
|
|
|
rage
|
|
|
|
nix
|
|
|
|
nix-diff
|
|
|
|
nix-update
|
|
|
|
];
|
|
|
|
commands = [
|
|
|
|
{
|
|
|
|
package = pkgs.deploy;
|
|
|
|
help = "build and deploy nix configurations";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
package = pkgs.nixfmt-rfc-style;
|
|
|
|
help = "Format nix code";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
package = pkgs.statix;
|
|
|
|
help = "Linter for nix";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
package = pkgs.deadnix;
|
|
|
|
help = "Remove dead nix code";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
package = pkgs.nix-tree;
|
|
|
|
help = "Show nix closure tree";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
package = pkgs.update-nix-fetchgit;
|
|
|
|
help = "Update fetcher inside nix files";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
package = pkgs.nvd;
|
|
|
|
help = "List package differences between systems";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
package = pkgs.vulnix;
|
|
|
|
help = "List vulnerabilities found in your system";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
env = [
|
|
|
|
{
|
|
|
|
name = "NIX_CONFIG";
|
|
|
|
value = ''
|
|
|
|
plugin-files = ${pkgs.nix-plugins}/lib/nix/plugins
|
|
|
|
extra-builtins-file = ${../nix}/extra-builtins.nix
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
2023-05-02 15:08:36 +02:00
|
|
|
|
2024-08-08 21:38:44 +02:00
|
|
|
devshell.startup.pre-commit.text = config.pre-commit.installationScript;
|
|
|
|
};
|
|
|
|
};
|
2024-07-26 22:12:48 +02:00
|
|
|
}
|