This commit is contained in:
Lukas Wurzinger 2025-06-01 16:47:14 +02:00
commit ee5313c9bf
No known key found for this signature in database
5 changed files with 471 additions and 0 deletions

78
flake.nix Normal file
View file

@ -0,0 +1,78 @@
{
description = "Disk zapper";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
flake-parts,
hooks,
treefmt,
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
hooks.flakeModule
treefmt.flakeModule
];
systems = nixpkgs.lib.systems.flakeExposed;
perSystem =
{
config,
pkgs,
self',
...
}:
{
treefmt = {
projectRootFile = "flake.nix";
programs = {
nixfmt = {
enable = true;
package = pkgs.nixfmt-rfc-style;
};
shfmt = {
enable = true;
includes = [
"zap"
];
};
shellcheck.enable = true;
};
};
pre-commit.settings.hooks = {
treefmt.enable = true;
};
devShells.default = pkgs.mkShellNoCC {
packages = [
self'.packages.default
];
shellHook = ''
${config.pre-commit.installationScript}
'';
};
packages.default = pkgs.callPackage ./package.nix { };
};
};
}