-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
87 lines (78 loc) · 2.35 KB
/
Copy pathflake.nix
File metadata and controls
87 lines (78 loc) · 2.35 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
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
inputs = import ./nix/tamal { bootstrap-nixpkgs = nixpkgs; };
overlays.default = import ./overlay.nix;
eachSystem = f: nixpkgs.lib.genAttrs [
# Should work on any system with a POSIX compliant shell
# that is supported by both kitty and git.
#
# <https://search.nixos.org/packages?channel=unstable&query=kitty#show=kitty>
"aarch64-darwin"
"aarch64-linux"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
]
(system: f (import nixpkgs {
inherit system;
overlays = [ overlays.default ];
}));
treefmt = import inputs.treefmt;
fmtOpts = {
projectRootFile = "flake.lock";
programs = {
nixpkgs-fmt.enable = true;
shfmt.enable = true;
kdlfmt.enable = true;
yamlfmt.enable = true;
mdformat.enable = true;
};
settings.formatter = {
nixpkgs-fmt.excludes = [ "nix/tamal/*.nix" ];
shfmt.options = [ "-ci" ];
};
};
in
{
inherit overlays;
packages = eachSystem (pkgs: {
inherit (pkgs) git-kitten;
default = pkgs.git-kitten;
});
apps = eachSystem (pkgs: {
default = {
type = "app";
program = "${pkgs.git-kitten}/bin/git-kitten";
meta.description = "An opt-in kitty-diff git plugin.";
};
});
checks = eachSystem (pkgs: {
treefmt-check =
(treefmt.evalModule pkgs fmtOpts).config.build.check ./.;
install-script-lint = pkgs.runCommand "install-script-lint"
{
nativeBuildInputs = with pkgs; [
shellcheck
checkbashisms
];
}
''
install_sh=${./install.sh}
shellcheck --shell=sh "$install_sh"
checkbashisms "$install_sh"
touch $out
'';
});
formatter = eachSystem (pkgs: treefmt.mkWrapper pkgs fmtOpts);
devShells = eachSystem (pkgs: {
default = pkgs.mkShell {
inputsFrom = [
pkgs.git-kitten
] ++ builtins.attrValues self.checks.${pkgs.stdenv.buildPlatform.system};
packages = with pkgs; [ nil ];
};
});
};
}