add git hooks

This commit is contained in:
Julie B. 2021-07-01 11:43:48 +02:00
parent 2f80efa8e5
commit 5f7a244991
3 changed files with 24 additions and 17 deletions

1
.envrc
View File

@ -1 +1,2 @@
watch_file devshell.toml
use flake || use nix

View File

@ -1,21 +1,23 @@
inputs@{ self, nixpkgs, ... }:
final: prev:
let
kvm_guest = nixpkgs.lib.nixosSystem {
inherit (final) system;
modules = [
self.nixosModules.miniguest
{
boot.miniguest.enable = true;
boot.loader.grub.enable = false;
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "mode=755" ];
};
} ];
};
in final.lib.optionalAttrs final.stdenv.isLinux {
build_kvm_guest = kvm_guest.config.system.build.miniguest;
let
kvm_guest = nixpkgs.lib.nixosSystem {
inherit (final) system;
modules = [
self.nixosModules.miniguest
{
boot.miniguest.enable = true;
boot.loader.grub.enable = false;
fileSystems."/" = {
device = "none";
fsType = "tmpfs";
options = [ "defaults" "mode=755" ];
};
}
];
};
in
final.lib.optionalAttrs final.stdenv.isLinux {
build_kvm_guest = kvm_guest.config.system.build.miniguest;
}

View File

@ -17,3 +17,7 @@ category = "linters"
[git.hooks]
enable = true
pre-commit.text = """
find -name '*.nix' | xargs -r nixpkgs-fmt --check || exit
find -name '*.bash' | xargs -r shfmt -d -s || exit
"""