-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
139 lines (118 loc) · 3.42 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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{
description = "Garuda Linux NixOS flake ❄️";
nixConfig.extra-substituters = [
"https://nyx.chaotic.cx"
];
nixConfig.extra-trusted-public-keys = [
"chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
"nyx.chaotic.cx-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8="
];
inputs = {
#
# OS internals
#
# Chaotic's Nyx
chaotic-nyx = {
url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
inputs.home-manager.follows = "home-manager";
};
# If you need to, override this to use a different nixpkgs version
# by default we follow Chaotic Nyx' nyxpkgs-unstable branch
nixpkgs.follows = "chaotic-nyx/nixpkgs";
# Modules support for flakes
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "chaotic-nyx/nixpkgs";
};
# Have a local index of nixpkgs for fast launching of apps
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "chaotic-nyx/nixpkgs";
};
# Home configuration management
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "chaotic-nyx/nixpkgs";
};
#
# Development tooling
#
# Devshell to set up a development environment
devshell = {
url = "github:numtide/devshell";
flake = false;
};
# Easy linting of the flake and all kind of other stuff
pre-commit-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.flake-compat.follows = "chaotic-nyx/nixpkgs";
inputs.nixpkgs.follows = "chaotic-nyx/nixpkgs";
};
#
# Theming
#
# Beautiful pastel theming
catppuccin.url = "github:catppuccin/nix";
catppuccin-vsc = {
url = "github:catppuccin/vscode";
inputs.nixpkgs.follows = "chaotic-nyx/nixpkgs";
};
};
outputs =
{ flake-parts
, nixpkgs
, pre-commit-hooks
, ...
} @ inputs:
let
internal = import ./internal {
inherit lib;
overlay = import ./packages/overlay.nix {
inherit inputs lib;
};
inputs = inputs // { inherit nixpkgs; };
};
lib = import ./lib { inherit inputs nixpkgs internal; };
perSystem =
{ pkgs
, system
, ...
}:
let
packages = import ./packages { inherit system pkgs inputs lib; };
in
{
checks.pre-commit-check = pre-commit-hooks.lib.${system}.run {
hooks = {
actionlint.enable = true;
commitizen.enable = true;
deadnix.enable = true;
nil.enable = true;
nixpkgs-fmt.enable = true;
prettier.enable = true;
statix.enable = true;
yamllint.enable = true;
};
src = ./.;
};
devShells = import ./devshell {
inherit inputs nixpkgs system pkgs packages;
};
formatter = pkgs.nixpkgs-fmt;
packages = packages.external;
};
in
flake-parts.lib.mkFlake { inherit inputs; } {
# Flake modules
imports = [ inputs.pre-commit-hooks.flakeModule ];
# The available systems
systems = [ "x86_64-linux" "aarch64-linux" ];
# Regular flake stuff
flake = {
inherit lib;
inherit internal;
};
# This applies to all systems
inherit perSystem;
};
}