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

126
flake.nix
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,70 +205,70 @@
}; };
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; statix.enable = true;
statix.enable = true; black.enable = true;
black.enable = true; shellcheck = {
shellcheck = { enable = true;
enable = true; types_or = [ "executable" ];
types_or = [ "executable" ];
};
shfmt.enable = true;
}; };
shfmt.enable = true;
}; };
}; };
packages = {
incus-ui = pkgs.callPackage ./pkgs/incus-ui { };
};
devShells.default = with pkgs;
mkShell {
inherit (self'.checks.pre-commit-check) shellHook;
name = "dotfiles";
packages = [
pkgs.sops
ssh-to-age
age
nodejs
nodePackages.typescript-language-server
nodePackages.yaml-language-server
nodePackages.vscode-css-languageserver-bin
nodePackages.prettier
multimarkdown
nix-diff
nix-prefetch
nix-prefetch-scripts
nix-prefetch-github
nix-prefetch-docker
nix-top
taplo
just
pciutils
cryptsetup
disko.packages.${system}.disko
colmena
];
};
devShells.install = with pkgs; mkShell {
name = "install";
packages = [
disko.packages.${system}.disko
];
};
formatter = pkgs.nixpkgs-fmt;
}; };
packages = {
incus-ui = pkgs.callPackage ./pkgs/incus-ui { };
};
devShells.default = with pkgs; mkShell {
name = "dotfiles";
packages = [
pkgs.sops
ssh-to-age
age
nodejs
nodePackages.typescript-language-server
nodePackages.yaml-language-server
nodePackages.vscode-css-languageserver-bin
nodePackages.prettier
multimarkdown
nix-diff
nix-prefetch
nix-prefetch-scripts
nix-prefetch-github
nix-prefetch-docker
nix-top
taplo
just
pciutils
cryptsetup
inputs'.disko.packages.disko
colmena
];
shellHook = ''
${config.pre-commit.installationScript}
'';
};
devShells.install = with pkgs; mkShell {
name = "install";
packages = [
inputs'.disko.packages.disko
];
};
formatter = pkgs.nixpkgs-fmt;
};
}; };
} }