You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.4 KiB
Nix

2 years ago
{ inputs, ... }: {
2 years ago
imports = [
inputs.treefmt-nix.flakeModule
];
2 years ago
perSystem =
{ pkgs
, ...
}: {
treefmt = {
# Used to find the project root
projectRootFile = "flake.lock";
2 years ago
2 years ago
programs.gofumpt.enable = true;
programs.prettier.enable = true;
2 years ago
2 years ago
settings.formatter = {
nix = {
command = "sh";
options = [
"-eucx"
''
# First deadnix
${pkgs.lib.getExe pkgs.deadnix} --edit "$@"
# Then nixpkgs-fmt
${pkgs.lib.getExe pkgs.nixpkgs-fmt} "$@"
''
"--"
];
includes = [ "*.nix" ];
};
2 years ago
2 years ago
python = {
command = "sh";
options = [
"-eucx"
''
${pkgs.lib.getExe pkgs.ruff} --fix "$@"
${pkgs.lib.getExe pkgs.python3.pkgs.black} "$@"
''
"--" # this argument is ignored by bash
];
includes = [ "*.py" ];
};
2 years ago
};
};
checks =
let
nixosTests = pkgs.callPackages ./nixos-test.nix {
makeTest = import (pkgs.path + "/nixos/tests/make-test-python.nix");
};
in
{
inherit (nixosTests) unittests vault-agent systemd-vaultd;
};
};
}