-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
74 lines (73 loc) · 2.08 KB
/
Copy pathflake.nix
File metadata and controls
74 lines (73 loc) · 2.08 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
ignoreBoy.url = "github:Ookiiboy/ignoreBoy";
# Non-flake
editorconfig.url = "github:Ookiiboy/editor-config/";
editorconfig.flake = false;
};
outputs = {
self,
systems,
nixpkgs,
pre-commit-hooks,
editorconfig,
ignoreBoy,
...
}: let
forAllSystems = nixpkgs.lib.genAttrs (import systems);
in {
formatter = forAllSystems (system: let
pkgs = import nixpkgs {inherit system;};
in
pkgs.alejandra);
checks = forAllSystems (system: {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
# Nix
alejandra.enable = true;
deadnix.enable = true;
statix.enable = true;
flake-checker.enable = true;
# JSON
check-json.enable = true;
# Generic - .editorconfig
editorconfig-checker.enable = true;
};
};
});
modules = rec {
default = home-manager;
home-manager = import ./modules/home-manager.nix;
};
devShells = forAllSystems (system: let
pkgs = import nixpkgs {inherit system;};
ignoreSettings = {
github.languages = [];
# gitignoreio.languages = [];
# gitignoreio.hash = "";
# Anything custom you might want in your .gitignore you can place in extraConfig.
extraConfig = ''
.pre-commit-config.yaml
.editorconfig
'';
};
in {
default = pkgs.mkShell {
# Environment Variables
ENV = "dev";
name = "Development_Shell";
shellHook = ''
if [ ! -d ".git" ]; then git init; fi
ln -sf ${editorconfig}/.editorconfig ./.editorconfig
${self.checks.${system}.pre-commit-check.shellHook}
${ignoreBoy.lib.${system}.gitignore ignoreSettings}
'';
buildInputs = self.checks.${system}.pre-commit-check.enabledPackages;
};
});
};
}