forked from nix-community/nix-ts-mode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
52 lines (45 loc) · 1.34 KB
/
flake.nix
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
{
description = "An Emacs major mode for editing Nix expressions, powered by tree-sitter.";
outputs =
{ nixpkgs-unstable
, pre-commit-nix
, ...
}:
let
supportedSystems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
forAllSystems = nixpkgs-unstable.lib.genAttrs supportedSystems;
in
{
supportedEmacsVersions = import ./nix/emacs-versions.nix;
devShells = forAllSystems (system:
let
pre-commit-check = pre-commit-nix.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
deadnix.enable = true;
statix.enable = true;
};
};
in
{
default = nixpkgs-unstable.legacyPackages.${system}.mkShell {
name = "nix-ts-mode-shell";
packages = with nixpkgs-unstable.legacyPackages.${system}; [ nixpkgs-fmt cask python311 ];
shellHook = ''
${pre-commit-check.shellHook}
'';
};
});
formatter = forAllSystems (system: nixpkgs-unstable.legacyPackages.${system}.nixpkgs-fmt);
};
inputs = {
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
pre-commit-nix.url = "github:cachix/pre-commit-hooks.nix";
};
}