Refactor flake.nix

This commit is contained in:
Erwin Boskma 2024-01-10 21:53:04 +01:00
parent ef2f170462
commit 31ef819960
Signed by: erwin
SSH key fingerprint: SHA256:/Wk1WZdLg+vQHs3in9qq7PsIp8SMzwGSk/RLZ5zPuZk

View file

@ -149,6 +149,10 @@
"aarch64-linux" "aarch64-linux"
]; ];
imports = [
inputs.pre-commit-hooks.flakeModule
];
flake = { flake = {
lib = import ./lib inputs; lib = import ./lib inputs;
@ -201,11 +205,10 @@
}; };
perSystem = { self', pkgs, system, lib, ... }: perSystem = { inputs', pkgs, config, ... }: {
{
checks = { pre-commit = {
pre-commit-check = pre-commit-hooks.lib.${system}.run { settings = {
src = ./.;
hooks = { hooks = {
nixpkgs-fmt.enable = true; nixpkgs-fmt.enable = true;
deadnix.enable = true; deadnix.enable = true;
@ -218,16 +221,13 @@
shfmt.enable = true; shfmt.enable = true;
}; };
}; };
}; };
packages = { packages = {
incus-ui = pkgs.callPackage ./pkgs/incus-ui { }; incus-ui = pkgs.callPackage ./pkgs/incus-ui { };
}; };
devShells.default = with pkgs; devShells.default = with pkgs; mkShell {
mkShell {
inherit (self'.checks.pre-commit-check) shellHook;
name = "dotfiles"; name = "dotfiles";
packages = [ packages = [
pkgs.sops pkgs.sops
@ -251,16 +251,20 @@
cryptsetup cryptsetup
disko.packages.${system}.disko inputs'.disko.packages.disko
colmena colmena
]; ];
shellHook = ''
${config.pre-commit.installationScript}
'';
}; };
devShells.install = with pkgs; mkShell { devShells.install = with pkgs; mkShell {
name = "install"; name = "install";
packages = [ packages = [
disko.packages.${system}.disko inputs'.disko.packages.disko
]; ];
}; };