-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
94 lines (87 loc) · 2.67 KB
/
flake.nix
File metadata and controls
94 lines (87 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
description = "Collection of abbreviations and interactive fish-shell integrations I use to make `git` easier!";
inputs = {
# keep-sorted start block=yes
flake-parts.url = "github:hercules-ci/flake-parts";
git-hooks-nix = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:cachix/git-hooks.nix";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
treefmt-nix = {
inputs.nixpkgs.follows = "nixpkgs";
url = "github:numtide/treefmt-nix";
};
# keep-sorted end
};
outputs =
inputs@{ self, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.git-hooks-nix.flakeModule
inputs.treefmt-nix.flakeModule
];
systems = [
# keep-sorted start
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
# keep-sorted end
];
perSystem =
{
config,
pkgs,
lib,
...
}:
{
pre-commit.settings = {
package = pkgs.prek;
hooks = {
# keep-sorted start block=yes
check-symlinks.enable = true;
deadnix.enable = true;
statix.enable = true;
treefmt.enable = true;
# keep-sorted end
};
};
treefmt.programs = {
# keep-sorted start block=yes
fish_indent.enable = true;
flake-edit.enable = true;
keep-sorted.enable = true;
nixfmt.enable = true;
rumdl-check.enable = true;
rumdl-format.enable = true;
taplo.enable = true;
typos.enable = true;
# keep-sorted end
};
devShells.default = pkgs.mkShell {
inherit (config.pre-commit) shellHook;
packages = config.pre-commit.settings.enabledPackages ++ [
pkgs.fish
];
};
packages.default = pkgs.fishPlugins.buildFishPlugin {
pname = "git.fish";
version = "unknown";
src = lib.cleanSource ./.;
meta = {
description = "Collection of abbreviations and interactive fish-shell integrations I use to make `git` easier!";
homepage = "https://github.com/kpbaks/git.fish";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ kpbaks ];
};
};
};
flake.overlays.default = final: prev: {
fishPlugins = prev.fishPlugins // {
git-fish = self.packages.${final.stdenv.hostPlatform.system}.default;
};
};
};
}