1
0
Fork 0
nini/flake.nix

65 lines
1.3 KiB
Nix
Raw Normal View History

2025-05-12 17:15:30 +02:00
{
description = "nini";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
2025-07-04 21:16:23 +02:00
hooks = {
url = "github:cachix/git-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-05-12 17:15:30 +02:00
};
outputs =
{
self,
2025-07-04 21:16:23 +02:00
nixpkgs,
2025-05-12 17:15:30 +02:00
flake-parts,
2025-07-04 21:16:23 +02:00
hooks,
treefmt,
2025-05-12 17:15:30 +02:00
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
2025-07-04 21:16:23 +02:00
imports = [
hooks.flakeModule
treefmt.flakeModule
2025-05-12 17:15:30 +02:00
];
2025-07-04 21:16:23 +02:00
systems = nixpkgs.lib.systems.flakeExposed;
2025-05-12 17:15:30 +02:00
perSystem =
{
2025-07-04 21:16:23 +02:00
config,
2025-05-12 17:15:30 +02:00
pkgs,
...
}:
{
2025-07-04 21:16:23 +02:00
treefmt = {
projectRootFile = "flake.nix";
programs.nixfmt = {
enable = true;
package = pkgs.nixfmt-rfc-style;
};
};
pre-commit.settings.hooks = {
treefmt.enable = true;
};
devShells.default = pkgs.mkShellNoCC {
shellHook = ''
${config.pre-commit.installationScript}
'';
};
2025-05-12 17:15:30 +02:00
packages.default = pkgs.callPackage ./package.nix { };
};
2025-07-04 21:16:23 +02:00
flake.nixosModules.default = import ./module.nix self;
2025-05-12 17:15:30 +02:00
};
}