57 lines
1.6 KiB
Nix
57 lines
1.6 KiB
Nix
{ flake-parts-lib, inputs, ... }:
|
|
{
|
|
imports = [
|
|
inputs.treefmt-nix.flakeModule
|
|
inputs.git-hooks-nix.flakeModule
|
|
inputs.devshell.flakeModule
|
|
];
|
|
options.perSystem = flake-parts-lib.mkPerSystemOption (
|
|
{ config, pkgs, ... }:
|
|
{
|
|
config = {
|
|
devshells.default = {
|
|
commands = [
|
|
{
|
|
help = " update dependencies";
|
|
name = "update";
|
|
command = "${pkgs.lix}/bin/nix flake update";
|
|
category = " Flake";
|
|
}
|
|
{
|
|
help = " reload direnv environment";
|
|
name = "reload";
|
|
command = "${pkgs.direnv}/bin/direnv reload";
|
|
category = " Flake";
|
|
}
|
|
];
|
|
packages = [
|
|
pkgs.git
|
|
pkgs.jujutsu
|
|
pkgs.lix
|
|
pkgs.man
|
|
pkgs.uutils-coreutils-noprefix
|
|
];
|
|
devshell.startup = {
|
|
pre-commit.text = ''
|
|
${config.pre-commit.installationScript}
|
|
'';
|
|
};
|
|
};
|
|
# https://flake.parts/options/git-hooks-nix.html
|
|
pre-commit.settings = {
|
|
hooks = {
|
|
treefmt = {
|
|
enable = true;
|
|
package = config.treefmt.build.wrapper;
|
|
};
|
|
check-merge-conflicts.enable = true;
|
|
check-symlinks.enable = true;
|
|
flake-checker.enable = true;
|
|
};
|
|
};
|
|
# https://flake.parts/options/treefmt-nix.html
|
|
treefmt.projectRootFile = "flake.nix";
|
|
};
|
|
}
|
|
);
|
|
}
|