working flake-parts
This commit is contained in:
parent
ed864615e7
commit
35e6b01a56
15 changed files with 243 additions and 88 deletions
33
flake/fmt.nix
Normal file
33
flake/fmt.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
perSystem = {
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# https://github.com/numtide/treefmt-nix?tab=readme-ov-file#flake-parts
|
||||
formatter = config.treefmt.build.wrapper;
|
||||
treefmt = {
|
||||
projectRootFile = "flake.nix";
|
||||
programs = {
|
||||
alejandra.enable = true;
|
||||
|
||||
shellcheck.enable = true; # cannot be configured, errors on basic bash convention
|
||||
|
||||
prettier = {
|
||||
enable = true;
|
||||
package = pkgs.prettierd;
|
||||
excludes = ["*.age"];
|
||||
settings = {
|
||||
editorconfig = true;
|
||||
};
|
||||
};
|
||||
|
||||
shfmt = {
|
||||
enable = true;
|
||||
# https://flake.parts/options/treefmt-nix.html#opt-perSystem.treefmt.programs.shfmt.indent_size
|
||||
indent_size = 2; # set to 0 to use tabs
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
0
flake/lib/builders.nix
Normal file
0
flake/lib/builders.nix
Normal file
28
flake/shell.nix
Normal file
28
flake/shell.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
perSystem = {pkgs, ...}: {
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
name = "nichts";
|
||||
DIRENV_LOG_FORMAT = "";
|
||||
packages = with pkgs; [
|
||||
nil # nix language server
|
||||
alejandra
|
||||
git # take a guess
|
||||
statix # no idea
|
||||
deadnix # clean up unused nix code
|
||||
|
||||
(pkgs.writeShellApplication {
|
||||
name = "update";
|
||||
text = ''
|
||||
nix flake update && git commit flake.lock -m "flake: bump inputs"
|
||||
'';
|
||||
})
|
||||
(pkgs.writeShellApplication {
|
||||
name = "rebuild";
|
||||
text = ''
|
||||
nh os switch
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue