1
0
Fork 0
This commit is contained in:
Lukas Wurzinger 2025-06-14 00:11:10 +02:00
parent 6cb94f531a
commit 1564605890
No known key found for this signature in database
3 changed files with 146 additions and 27 deletions

View file

@ -4,25 +4,59 @@
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,
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
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 = {lib, pkgs, ...}: {
packages = let
packages = lib.packagesFromDirectoryRecursive {
inherit (pkgs) callPackage;
directory = ./packages;
perSystem =
{
config,
pkgs,
...
}:
{
treefmt = {
projectRootFile = "flake.nix";
programs.nixfmt = {
enable = true;
package = pkgs.nixfmt-rfc-style;
};
};
in packages // {
default = packages.helix;
pre-commit.settings.hooks = {
treefmt.enable = true;
};
devShells.default = pkgs.mkShellNoCC {
shellHook = ''
${config.pre-commit.installationScript}
'';
};
packages.default = pkgs.callPackage ./package.nix { };
};
};
};
}