-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
169 lines (139 loc) · 5.03 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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
inputs = {
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.91.0.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
# -----------------------
# package repositories
# nixpkgs.url = "github:nixos/nixpkgs/cd11caeb123796cbd017af8514e7c0657a767527";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nur-src.url = "github:nix-community/NUR";
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
nixneovimplugins.url = "github:jooooscha/nixpkgs-vim-extra-plugins";
# -----------------------
# macos inputs (work laptop)
# locked to specific version due to https://github.com/LnL7/nix-darwin/issues/1082
#darwin.url = "github:lnl7/nix-darwin/f4f18f3d7229845e1c9d517457b7a0b90a38b728";
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs";
# -----------------------
# flake utilities
flake-parts.url = "github:hercules-ci/flake-parts";
# devshell for some nice menu + easy command adding capabilities
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt-nix.url = "github:numtide/treefmt-nix";
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks-nix.inputs.nixpkgs.follows = "nixpkgs";
# -----------------------
# nixos modules
stylix.url = "github:danth/stylix";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# local user package managment
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# for secret managment
sops-nix-src = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# partitioning
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# -----------------------
# single applications/services
# deploy remote setups
deploy-rs = {
url = "github:philtaken/deploy-rs/phil/optimize-compile-times";
inputs.nixpkgs.follows = "nixpkgs";
};
spicetify.url = "github:Gerg-L/spicetify-nix";
spicetify.inputs.nixpkgs.follows = "nixpkgs";
# TODO: once my prs are merged revert to main repo
#eww-git.url = "github:elkowar/eww?ref=7623e7e692042f4da8525bb1e4ef140831fcdb6a";
#eww-git.url = "github:PhilTaken/eww?ref=7837576ee0d2b5ba93b7c9bace0a66338897f5ef";
eww-git.url = "github:ralismark/eww?ref=68471c9b23e55ad3c8b31a99473552e16594a44f";
# better discord clone/fork
webcord.url = "github:fufexan/webcord-flake";
# best nix language server
nil-ls.url = "github:oxalica/nil";
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
neovim-nightly-overlay.inputs.nixpkgs.follows = "nixpkgs";
#xdg-desktop-hyprland.url = "github:hyprwm/xdg-desktop-portal-hyprland";
nix-doom-emacs.url = "github:nix-community/nix-doom-emacs";
parinfer-rust.url = "github:PhilTaken/parinfer-rust";
zjstatus = {
url = "github:dj95/zjstatus";
inputs.nixpkgs.follows = "nixpkgs";
};
# time tracker
#ttrack.url = "git+https://gitea.pherzog.xyz/phil/ttrack";
dimsum.url = "git+https://gitea.pherzog.xyz/mini-x/dimsum";
fc-utils.url = "git+https://gitea.pherzog.xyz/phil/fc-utils";
ghostty = {
url = "git+ssh://[email protected]/ghostty-org/ghostty";
inputs.nixpkgs-stable.follows = "nixpkgs";
inputs.nixpkgs-unstable.follows = "nixpkgs";
};
};
outputs = {flake-parts, ...} @ inputs: let
custom_pkgs_overlay = import ./custom_pkgs;
in
flake-parts.lib.mkFlake {inherit inputs;} {
systems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
flake.overlays = {
inherit custom_pkgs_overlay;
default = custom_pkgs_overlay;
};
imports = [
./modules/flake/configurations.nix
./modules/flake/modules.nix
./modules/flake/deploy.nix
./modules/flake/shells.nix
inputs.treefmt-nix.flakeModule
inputs.pre-commit-hooks-nix.flakeModule
# inputs.disko.nixosModules.disko
];
perSystem = {
config,
pkgs,
...
}: {
pre-commit = {
settings.hooks = {
alejandra.enable = true;
#treefmt.enable = true;
};
};
treefmt = {
projectRootFile = "flake.nix";
programs.alejandra.enable = true;
programs.stylua.enable = true;
programs.deadnix.enable = true;
};
formatter = config.treefmt.build.wrapper;
# filter packages by compatibility
packages = let
inherit (pkgs) lib system;
l = builtins // lib;
in
pkgs.lib.filterAttrs
(_: package:
if l.hasAttrByPath ["meta" "platforms"] package
then l.elem system package.meta.platforms
else (lib.hasInfix "linux" pkgs.system))
(custom_pkgs_overlay pkgs pkgs);
};
};
}