├── .envrc
├── .forgejo
└── workflows
│ └── update.yml
├── .gitignore
├── LICENSE
├── README.md
├── flake.lock
├── flake.nix
├── home
├── programs
│ ├── alacritty.nix
│ ├── bash.nix
│ ├── direnv.nix
│ ├── easyeffects.nix
│ ├── firefox.nix
│ ├── fonts.nix
│ ├── git.nix
│ ├── gpg.nix
│ ├── i3.nix
│ ├── neovim
│ │ ├── default.nix
│ │ ├── fx_loader.sh
│ │ └── nvim
│ │ │ ├── init.lua
│ │ │ └── lua
│ │ │ ├── kidsan
│ │ │ ├── remap.lua
│ │ │ └── set.lua
│ │ │ └── plugins
│ │ │ ├── alpha.lua
│ │ │ ├── autopairs.lua
│ │ │ ├── comment.lua
│ │ │ ├── copilot.lua
│ │ │ ├── dap.lua
│ │ │ ├── devicons.lua
│ │ │ ├── diffview.lua
│ │ │ ├── fidget.lua
│ │ │ ├── flash.lua
│ │ │ ├── fugitive.lua
│ │ │ ├── gitsigns.lua
│ │ │ ├── go.lua
│ │ │ ├── indent-blankline.lua
│ │ │ ├── init.lua
│ │ │ ├── lsp.lua
│ │ │ ├── lualine.lua
│ │ │ ├── noice.lua
│ │ │ ├── nonels.lua
│ │ │ ├── notify.lua
│ │ │ ├── octo.lua
│ │ │ ├── persistence.lua
│ │ │ ├── rust.lua
│ │ │ ├── statuscol.lua
│ │ │ ├── substitute.lua
│ │ │ ├── supermaven.lua
│ │ │ ├── telekasten.lua
│ │ │ ├── telescope.lua
│ │ │ ├── treesitter.lua
│ │ │ ├── trouble.lua
│ │ │ └── which-key.lua
│ ├── nextcloud.nix
│ ├── nix-flake-templates
│ │ ├── default.nix
│ │ └── shells
│ │ │ ├── flake.nix
│ │ │ ├── go
│ │ │ ├── .envrc
│ │ │ ├── flake.nix
│ │ │ ├── go.mod
│ │ │ ├── main.go
│ │ │ └── sqlc.yaml
│ │ │ └── rust
│ │ │ ├── .envrc
│ │ │ └── flake.nix
│ ├── nushell.nix
│ ├── sway.nix
│ ├── tmux.nix
│ └── vscode.nix
└── users
│ ├── kidsan
│ ├── common.nix
│ ├── kidsan_desktop.nix
│ ├── kidsan_ihasa.nix
│ └── kidsan_thinkpad.nix
│ ├── lobster
│ └── home.nix
│ └── pachinko.nix
├── nixos
├── base_pi.nix
├── desktop.nix
├── hardware
│ ├── desktop.nix
│ ├── ihasa.nix
│ ├── monster.nix
│ ├── pachinko.nix
│ └── thinkpad.nix
├── ihasa.nix
├── modules
│ ├── adguard.nix
│ ├── alvr.nix
│ ├── caddy.nix
│ ├── common.nix
│ ├── disko
│ │ ├── desktop.nix
│ │ └── pachinko.nix
│ ├── fonts.nix
│ ├── forgejo.nix
│ ├── grafana.nix
│ ├── home-assistant.nix
│ ├── homelab.nix
│ ├── i3.nix
│ ├── impermanence
│ │ └── desktop.nix
│ ├── linux-kernel.nix
│ ├── locale.nix
│ ├── networkmanager.nix
│ ├── nix-options.nix
│ ├── ollama.nix
│ ├── pipewire.nix
│ ├── sponsorblock.nix
│ ├── ssh.nix
│ ├── steam.nix
│ ├── sunshine.nix
│ ├── tailscale.nix
│ ├── thunar.nix
│ ├── ttrss.nix
│ ├── unbound.nix
│ ├── upgrades.nix
│ ├── user.nix
│ ├── virtualization.nix
│ ├── xdg.nix
│ ├── znc.nix
│ └── zwave_ui.nix
├── monster.nix
├── pachinko.nix
└── thinkpad.nix
└── overlays
├── nvim-treesitter.nix
├── transcribe.nix
└── weechat.nix
/.envrc:
--------------------------------------------------------------------------------
1 | use flake;
2 |
--------------------------------------------------------------------------------
/.forgejo/workflows/update.yml:
--------------------------------------------------------------------------------
1 | name: Updater
2 |
3 | on:
4 | schedule:
5 | - cron: '0 7 * * *'
6 | workflow_dispatch: {}
7 |
8 | jobs:
9 | update_flake:
10 | runs-on: native
11 | steps:
12 | - name: Set up git
13 | run: |
14 | git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
15 | git config --global user.name "github-actions[bot]"
16 | git config --global http.sslVerify "false"
17 | - name: Clone repository
18 | uses: actions/checkout@v4
19 | with:
20 | ssh-strict: false
21 | github-server-url: https://git.home
22 | - name: Update nixpkgs
23 | run: nix flake lock --update-input nixpkgs
24 | - name: Update nixos
25 | run: nix flake lock --update-input nixos
26 | - name: Update nixpkgs-wayland
27 | run: nix flake lock --update-input nixpkgs-wayland
28 | - name: Update neovim-nightly-overlay
29 | run: nix flake lock --update-input neovim-nightly-overlay
30 | - name: Update waybar
31 | run: nix flake lock --update-input waybar
32 | - name: Update home-manager
33 | run: nix flake lock --update-input home-manager
34 | - name: Update agenix
35 | run: nix flake lock --update-input agenix
36 | - name: Commit and push
37 | run: |
38 | if git diff --exit-code; then
39 | echo "Found no changes"
40 | exit 0
41 | fi
42 | git add .
43 | git commit -m "flake.lock: Update"
44 | git push
45 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | result
2 | .direnv
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Kieran O'Sullivan
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # NixOS-Config
2 |
3 | This is a mirror of a repository on my Codeberg. Check it out there for an up to date version.
4 |
5 |
6 |
7 |
8 |
9 | This is a dotfiles repository containing the configuration for my [NixOS](https://nixos.org/) machines. It also manages user environments for users `kidsan` and `lobster` via [home-manager](https://github.com/nix-community/home-manager).
10 |
11 | ## Hosts
12 |
13 | This configures nixos for the following hosts
14 |
15 | + _desktop_: my main machine for development, gaming, etc
16 | + _thinkpad_: my laptop, primarily for development
17 | + _monster_: raspberry pi 4
18 | + _pachinko_: my main homelab machine, an N100 beelink device.
19 |
20 | It also configures darwin machines via nix-darwin for
21 |
22 | + _Kierans-Air_: an m1 macbook air
23 |
24 |
25 |
--------------------------------------------------------------------------------
/flake.lock:
--------------------------------------------------------------------------------
1 | {
2 | "nodes": {
3 | "agenix": {
4 | "inputs": {
5 | "darwin": "darwin",
6 | "home-manager": "home-manager",
7 | "nixpkgs": [
8 | "nixpkgs"
9 | ],
10 | "systems": "systems"
11 | },
12 | "locked": {
13 | "lastModified": 1745630506,
14 | "narHash": "sha256-bHCFgGeu8XjWlVuaWzi3QONjDW3coZDqSHvnd4l7xus=",
15 | "owner": "ryantm",
16 | "repo": "agenix",
17 | "rev": "96e078c646b711aee04b82ba01aefbff87004ded",
18 | "type": "github"
19 | },
20 | "original": {
21 | "owner": "ryantm",
22 | "repo": "agenix",
23 | "type": "github"
24 | }
25 | },
26 | "crane": {
27 | "locked": {
28 | "lastModified": 1739053031,
29 | "narHash": "sha256-LrMDRuwAlRFD2T4MgBSRd1s2VtOE+Vl1oMCNu3RpPE0=",
30 | "owner": "ipetkov",
31 | "repo": "crane",
32 | "rev": "112e6591b2d6313b1bd05a80a754a8ee42432a7e",
33 | "type": "github"
34 | },
35 | "original": {
36 | "owner": "ipetkov",
37 | "repo": "crane",
38 | "type": "github"
39 | }
40 | },
41 | "darwin": {
42 | "inputs": {
43 | "nixpkgs": [
44 | "agenix",
45 | "nixpkgs"
46 | ]
47 | },
48 | "locked": {
49 | "lastModified": 1744478979,
50 | "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=",
51 | "owner": "lnl7",
52 | "repo": "nix-darwin",
53 | "rev": "43975d782b418ebf4969e9ccba82466728c2851b",
54 | "type": "github"
55 | },
56 | "original": {
57 | "owner": "lnl7",
58 | "ref": "master",
59 | "repo": "nix-darwin",
60 | "type": "github"
61 | }
62 | },
63 | "disko": {
64 | "inputs": {
65 | "nixpkgs": [
66 | "nixpkgs"
67 | ]
68 | },
69 | "locked": {
70 | "lastModified": 1744145203,
71 | "narHash": "sha256-I2oILRiJ6G+BOSjY+0dGrTPe080L3pbKpc+gCV3Nmyk=",
72 | "owner": "nix-community",
73 | "repo": "disko",
74 | "rev": "76c0a6dba345490508f36c1aa3c7ba5b6b460989",
75 | "type": "github"
76 | },
77 | "original": {
78 | "owner": "nix-community",
79 | "ref": "master",
80 | "repo": "disko",
81 | "type": "github"
82 | }
83 | },
84 | "fenix": {
85 | "inputs": {
86 | "nixpkgs": [
87 | "rippkgs",
88 | "nixpkgs"
89 | ],
90 | "rust-analyzer-src": "rust-analyzer-src"
91 | },
92 | "locked": {
93 | "lastModified": 1739255730,
94 | "narHash": "sha256-RkZx53J5UZu58DclU13tKzwo0oaTIiHgT+ncbaaCnT8=",
95 | "owner": "nix-community",
96 | "repo": "fenix",
97 | "rev": "c023dde9e8b73c78348384661cf3d5e5f209558d",
98 | "type": "github"
99 | },
100 | "original": {
101 | "owner": "nix-community",
102 | "repo": "fenix",
103 | "type": "github"
104 | }
105 | },
106 | "flake-compat": {
107 | "flake": false,
108 | "locked": {
109 | "lastModified": 1733328505,
110 | "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
111 | "owner": "edolstra",
112 | "repo": "flake-compat",
113 | "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
114 | "type": "github"
115 | },
116 | "original": {
117 | "owner": "edolstra",
118 | "repo": "flake-compat",
119 | "type": "github"
120 | }
121 | },
122 | "flake-compat_2": {
123 | "flake": false,
124 | "locked": {
125 | "lastModified": 1696426674,
126 | "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
127 | "owner": "edolstra",
128 | "repo": "flake-compat",
129 | "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
130 | "type": "github"
131 | },
132 | "original": {
133 | "owner": "edolstra",
134 | "repo": "flake-compat",
135 | "type": "github"
136 | }
137 | },
138 | "flake-compat_3": {
139 | "locked": {
140 | "lastModified": 1717312683,
141 | "narHash": "sha256-FrlieJH50AuvagamEvWMIE6D2OAnERuDboFDYAED/dE=",
142 | "owner": "nix-community",
143 | "repo": "flake-compat",
144 | "rev": "38fd3954cf65ce6faf3d0d45cd26059e059f07ea",
145 | "type": "github"
146 | },
147 | "original": {
148 | "owner": "nix-community",
149 | "repo": "flake-compat",
150 | "type": "github"
151 | }
152 | },
153 | "flake-compat_4": {
154 | "flake": false,
155 | "locked": {
156 | "lastModified": 1733328505,
157 | "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
158 | "owner": "edolstra",
159 | "repo": "flake-compat",
160 | "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
161 | "type": "github"
162 | },
163 | "original": {
164 | "owner": "edolstra",
165 | "repo": "flake-compat",
166 | "type": "github"
167 | }
168 | },
169 | "flake-parts": {
170 | "inputs": {
171 | "nixpkgs-lib": [
172 | "neovim-nightly-overlay",
173 | "nixpkgs"
174 | ]
175 | },
176 | "locked": {
177 | "lastModified": 1743550720,
178 | "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
179 | "owner": "hercules-ci",
180 | "repo": "flake-parts",
181 | "rev": "c621e8422220273271f52058f618c94e405bb0f5",
182 | "type": "github"
183 | },
184 | "original": {
185 | "owner": "hercules-ci",
186 | "repo": "flake-parts",
187 | "type": "github"
188 | }
189 | },
190 | "flake-parts_2": {
191 | "inputs": {
192 | "nixpkgs-lib": [
193 | "neovim-nightly-overlay",
194 | "hercules-ci-effects",
195 | "nixpkgs"
196 | ]
197 | },
198 | "locked": {
199 | "lastModified": 1743550720,
200 | "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
201 | "owner": "hercules-ci",
202 | "repo": "flake-parts",
203 | "rev": "c621e8422220273271f52058f618c94e405bb0f5",
204 | "type": "github"
205 | },
206 | "original": {
207 | "id": "flake-parts",
208 | "type": "indirect"
209 | }
210 | },
211 | "flake-parts_3": {
212 | "inputs": {
213 | "nixpkgs-lib": "nixpkgs-lib_2"
214 | },
215 | "locked": {
216 | "lastModified": 1738453229,
217 | "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
218 | "owner": "hercules-ci",
219 | "repo": "flake-parts",
220 | "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
221 | "type": "github"
222 | },
223 | "original": {
224 | "owner": "hercules-ci",
225 | "repo": "flake-parts",
226 | "type": "github"
227 | }
228 | },
229 | "flake-utils": {
230 | "inputs": {
231 | "systems": "systems_2"
232 | },
233 | "locked": {
234 | "lastModified": 1731533236,
235 | "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
236 | "owner": "numtide",
237 | "repo": "flake-utils",
238 | "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
239 | "type": "github"
240 | },
241 | "original": {
242 | "owner": "numtide",
243 | "repo": "flake-utils",
244 | "type": "github"
245 | }
246 | },
247 | "git-hooks": {
248 | "inputs": {
249 | "flake-compat": "flake-compat_2",
250 | "gitignore": "gitignore",
251 | "nixpkgs": [
252 | "neovim-nightly-overlay",
253 | "nixpkgs"
254 | ]
255 | },
256 | "locked": {
257 | "lastModified": 1742649964,
258 | "narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
259 | "owner": "cachix",
260 | "repo": "git-hooks.nix",
261 | "rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
262 | "type": "github"
263 | },
264 | "original": {
265 | "owner": "cachix",
266 | "repo": "git-hooks.nix",
267 | "type": "github"
268 | }
269 | },
270 | "gitignore": {
271 | "inputs": {
272 | "nixpkgs": [
273 | "neovim-nightly-overlay",
274 | "git-hooks",
275 | "nixpkgs"
276 | ]
277 | },
278 | "locked": {
279 | "lastModified": 1709087332,
280 | "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
281 | "owner": "hercules-ci",
282 | "repo": "gitignore.nix",
283 | "rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
284 | "type": "github"
285 | },
286 | "original": {
287 | "owner": "hercules-ci",
288 | "repo": "gitignore.nix",
289 | "type": "github"
290 | }
291 | },
292 | "hercules-ci-effects": {
293 | "inputs": {
294 | "flake-parts": "flake-parts_2",
295 | "nixpkgs": [
296 | "neovim-nightly-overlay",
297 | "nixpkgs"
298 | ]
299 | },
300 | "locked": {
301 | "lastModified": 1744693102,
302 | "narHash": "sha256-1Z4WPGVky4w3lrhrgs89OKsLzPdtkbi1bPLNFWsoLfY=",
303 | "owner": "hercules-ci",
304 | "repo": "hercules-ci-effects",
305 | "rev": "5b6cec51c9ec095a0d3fd4c8eeb53eb5c59ae33e",
306 | "type": "github"
307 | },
308 | "original": {
309 | "owner": "hercules-ci",
310 | "repo": "hercules-ci-effects",
311 | "type": "github"
312 | }
313 | },
314 | "home-manager": {
315 | "inputs": {
316 | "nixpkgs": [
317 | "agenix",
318 | "nixpkgs"
319 | ]
320 | },
321 | "locked": {
322 | "lastModified": 1745494811,
323 | "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=",
324 | "owner": "nix-community",
325 | "repo": "home-manager",
326 | "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be",
327 | "type": "github"
328 | },
329 | "original": {
330 | "owner": "nix-community",
331 | "repo": "home-manager",
332 | "type": "github"
333 | }
334 | },
335 | "home-manager_2": {
336 | "inputs": {
337 | "nixpkgs": [
338 | "nixpkgs"
339 | ]
340 | },
341 | "locked": {
342 | "lastModified": 1745627989,
343 | "narHash": "sha256-mOCdFmxocBPae7wg7RYWOtJzWMJk34u9493ItY0dVqw=",
344 | "owner": "nix-community",
345 | "repo": "home-manager",
346 | "rev": "4d2d32231797bfa7213ae5e8ac89d25f8caaae82",
347 | "type": "github"
348 | },
349 | "original": {
350 | "owner": "nix-community",
351 | "ref": "master",
352 | "repo": "home-manager",
353 | "type": "github"
354 | }
355 | },
356 | "impermanence": {
357 | "locked": {
358 | "lastModified": 1725690722,
359 | "narHash": "sha256-4qWg9sNh5g1qPGO6d/GV2ktY+eDikkBTbWSg5/iD2nY=",
360 | "owner": "nix-community",
361 | "repo": "impermanence",
362 | "rev": "63f4d0443e32b0dd7189001ee1894066765d18a5",
363 | "type": "github"
364 | },
365 | "original": {
366 | "owner": "nix-community",
367 | "repo": "impermanence",
368 | "rev": "63f4d0443e32b0dd7189001ee1894066765d18a5",
369 | "type": "github"
370 | }
371 | },
372 | "lib-aggregate": {
373 | "inputs": {
374 | "flake-utils": "flake-utils",
375 | "nixpkgs-lib": "nixpkgs-lib"
376 | },
377 | "locked": {
378 | "lastModified": 1745151208,
379 | "narHash": "sha256-DrWqBD3S5r+wcd9i339uctx8K9rpk4hk5f+vYEwhEhY=",
380 | "owner": "nix-community",
381 | "repo": "lib-aggregate",
382 | "rev": "2b767b1c75e88222eeb3d1735d15da283d0307f9",
383 | "type": "github"
384 | },
385 | "original": {
386 | "owner": "nix-community",
387 | "repo": "lib-aggregate",
388 | "type": "github"
389 | }
390 | },
391 | "neovim-nightly-overlay": {
392 | "inputs": {
393 | "flake-compat": "flake-compat",
394 | "flake-parts": "flake-parts",
395 | "git-hooks": "git-hooks",
396 | "hercules-ci-effects": "hercules-ci-effects",
397 | "neovim-src": "neovim-src",
398 | "nixpkgs": "nixpkgs",
399 | "treefmt-nix": "treefmt-nix"
400 | },
401 | "locked": {
402 | "lastModified": 1745560179,
403 | "narHash": "sha256-MstfCAfbDsmQUClArlVnYxCgjpkb//fDzm1Mmb8PNHQ=",
404 | "owner": "nix-community",
405 | "repo": "neovim-nightly-overlay",
406 | "rev": "70b077b1cfbd5e0799dd4a1ca5981d400759464a",
407 | "type": "github"
408 | },
409 | "original": {
410 | "owner": "nix-community",
411 | "repo": "neovim-nightly-overlay",
412 | "type": "github"
413 | }
414 | },
415 | "neovim-src": {
416 | "flake": false,
417 | "locked": {
418 | "lastModified": 1745522483,
419 | "narHash": "sha256-Ec8lfVqIuLm7enH4N9/qpjNM02Sr59jvAB7agm2VmJg=",
420 | "owner": "neovim",
421 | "repo": "neovim",
422 | "rev": "1670fbee0f57af9aa9c43f448d92870cf0407285",
423 | "type": "github"
424 | },
425 | "original": {
426 | "owner": "neovim",
427 | "repo": "neovim",
428 | "type": "github"
429 | }
430 | },
431 | "nixos": {
432 | "locked": {
433 | "lastModified": 1745526057,
434 | "narHash": "sha256-ITSpPDwvLBZBnPRS2bUcHY3gZSwis/uTe255QgMtTLA=",
435 | "owner": "NixOS",
436 | "repo": "nixpkgs",
437 | "rev": "f771eb401a46846c1aebd20552521b233dd7e18b",
438 | "type": "github"
439 | },
440 | "original": {
441 | "id": "nixpkgs",
442 | "ref": "nixos-unstable",
443 | "type": "indirect"
444 | }
445 | },
446 | "nixpkgs": {
447 | "locked": {
448 | "lastModified": 1745377448,
449 | "narHash": "sha256-jhZDfXVKdD7TSEGgzFJQvEEZ2K65UMiqW5YJ2aIqxMA=",
450 | "owner": "NixOS",
451 | "repo": "nixpkgs",
452 | "rev": "507b63021ada5fee621b6ca371c4fca9ca46f52c",
453 | "type": "github"
454 | },
455 | "original": {
456 | "owner": "NixOS",
457 | "ref": "nixpkgs-unstable",
458 | "repo": "nixpkgs",
459 | "type": "github"
460 | }
461 | },
462 | "nixpkgs-lib": {
463 | "locked": {
464 | "lastModified": 1745111456,
465 | "narHash": "sha256-6k3oWdGcWOIzh3OQBkIf+HBU+xH5vbZtUhwzXEX4NWI=",
466 | "owner": "nix-community",
467 | "repo": "nixpkgs.lib",
468 | "rev": "eab2ba94b72a8664e0fb92912160151d99db850e",
469 | "type": "github"
470 | },
471 | "original": {
472 | "owner": "nix-community",
473 | "repo": "nixpkgs.lib",
474 | "type": "github"
475 | }
476 | },
477 | "nixpkgs-lib_2": {
478 | "locked": {
479 | "lastModified": 1738452942,
480 | "narHash": "sha256-vJzFZGaCpnmo7I6i416HaBLpC+hvcURh/BQwROcGIp8=",
481 | "type": "tarball",
482 | "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
483 | },
484 | "original": {
485 | "type": "tarball",
486 | "url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
487 | }
488 | },
489 | "nixpkgs-wayland": {
490 | "inputs": {
491 | "flake-compat": "flake-compat_3",
492 | "lib-aggregate": "lib-aggregate",
493 | "nixpkgs": [
494 | "nixpkgs"
495 | ]
496 | },
497 | "locked": {
498 | "lastModified": 1745649446,
499 | "narHash": "sha256-SvHHHKM+nQfHIvreY0gimRAikjwjXFerGhg9JsONB70=",
500 | "owner": "nix-community",
501 | "repo": "nixpkgs-wayland",
502 | "rev": "49d9cf94b666c706233b7bc67a8dceaab480ab72",
503 | "type": "github"
504 | },
505 | "original": {
506 | "owner": "nix-community",
507 | "repo": "nixpkgs-wayland",
508 | "type": "github"
509 | }
510 | },
511 | "nixpkgs_2": {
512 | "locked": {
513 | "lastModified": 1745377448,
514 | "narHash": "sha256-jhZDfXVKdD7TSEGgzFJQvEEZ2K65UMiqW5YJ2aIqxMA=",
515 | "owner": "NixOS",
516 | "repo": "nixpkgs",
517 | "rev": "507b63021ada5fee621b6ca371c4fca9ca46f52c",
518 | "type": "github"
519 | },
520 | "original": {
521 | "id": "nixpkgs",
522 | "ref": "nixpkgs-unstable",
523 | "type": "indirect"
524 | }
525 | },
526 | "nixpkgs_3": {
527 | "locked": {
528 | "lastModified": 1745391562,
529 | "narHash": "sha256-sPwcCYuiEopaafePqlG826tBhctuJsLx/mhKKM5Fmjo=",
530 | "owner": "NixOS",
531 | "repo": "nixpkgs",
532 | "rev": "8a2f738d9d1f1d986b5a4cd2fd2061a7127237d7",
533 | "type": "github"
534 | },
535 | "original": {
536 | "owner": "NixOS",
537 | "ref": "nixos-unstable",
538 | "repo": "nixpkgs",
539 | "type": "github"
540 | }
541 | },
542 | "rippkgs": {
543 | "inputs": {
544 | "crane": "crane",
545 | "fenix": "fenix",
546 | "flake-parts": "flake-parts_3",
547 | "nixpkgs": [
548 | "nixpkgs"
549 | ]
550 | },
551 | "locked": {
552 | "lastModified": 1739314348,
553 | "narHash": "sha256-nRaGbJg1zCHTL8y/Tk5dM1dSu2v06ECsZYyMPIQTlvg=",
554 | "owner": "replit",
555 | "repo": "rippkgs",
556 | "rev": "a6c494b18e3913953cda6022c4679c97316f9249",
557 | "type": "github"
558 | },
559 | "original": {
560 | "owner": "replit",
561 | "repo": "rippkgs",
562 | "type": "github"
563 | }
564 | },
565 | "root": {
566 | "inputs": {
567 | "agenix": "agenix",
568 | "disko": "disko",
569 | "home-manager": "home-manager_2",
570 | "impermanence": "impermanence",
571 | "neovim-nightly-overlay": "neovim-nightly-overlay",
572 | "nixos": "nixos",
573 | "nixpkgs": "nixpkgs_2",
574 | "nixpkgs-wayland": "nixpkgs-wayland",
575 | "rippkgs": "rippkgs",
576 | "secrets": "secrets",
577 | "waybar": "waybar"
578 | }
579 | },
580 | "rust-analyzer-src": {
581 | "flake": false,
582 | "locked": {
583 | "lastModified": 1739201154,
584 | "narHash": "sha256-jP/Z+X28XQMqR6fWkIokJ45dVBkvsTe4dQOq5s/sA+4=",
585 | "owner": "rust-lang",
586 | "repo": "rust-analyzer",
587 | "rev": "f5e7172e96ff8a75af99ac570085d22a4afab09b",
588 | "type": "github"
589 | },
590 | "original": {
591 | "owner": "rust-lang",
592 | "ref": "nightly",
593 | "repo": "rust-analyzer",
594 | "type": "github"
595 | }
596 | },
597 | "secrets": {
598 | "inputs": {
599 | "nixpkgs": [
600 | "nixpkgs"
601 | ]
602 | },
603 | "locked": {
604 | "lastModified": 1739730136,
605 | "narHash": "sha256-je29Z5Ddrzu2eVSS2L1EXR6oBDUB0tLhABY2000TV58=",
606 | "ref": "main",
607 | "rev": "f744a26d67a482eb915ed0b8a5a311026a44efc6",
608 | "revCount": 30,
609 | "type": "git",
610 | "url": "ssh://forgejo@git.home/kidsan/secrets.git"
611 | },
612 | "original": {
613 | "ref": "main",
614 | "type": "git",
615 | "url": "ssh://forgejo@git.home/kidsan/secrets.git"
616 | }
617 | },
618 | "systems": {
619 | "locked": {
620 | "lastModified": 1681028828,
621 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
622 | "owner": "nix-systems",
623 | "repo": "default",
624 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
625 | "type": "github"
626 | },
627 | "original": {
628 | "owner": "nix-systems",
629 | "repo": "default",
630 | "type": "github"
631 | }
632 | },
633 | "systems_2": {
634 | "locked": {
635 | "lastModified": 1681028828,
636 | "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
637 | "owner": "nix-systems",
638 | "repo": "default",
639 | "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
640 | "type": "github"
641 | },
642 | "original": {
643 | "owner": "nix-systems",
644 | "repo": "default",
645 | "type": "github"
646 | }
647 | },
648 | "treefmt-nix": {
649 | "inputs": {
650 | "nixpkgs": [
651 | "neovim-nightly-overlay",
652 | "nixpkgs"
653 | ]
654 | },
655 | "locked": {
656 | "lastModified": 1744961264,
657 | "narHash": "sha256-aRmUh0AMwcbdjJHnytg1e5h5ECcaWtIFQa6d9gI85AI=",
658 | "owner": "numtide",
659 | "repo": "treefmt-nix",
660 | "rev": "8d404a69efe76146368885110f29a2ca3700bee6",
661 | "type": "github"
662 | },
663 | "original": {
664 | "owner": "numtide",
665 | "repo": "treefmt-nix",
666 | "type": "github"
667 | }
668 | },
669 | "waybar": {
670 | "inputs": {
671 | "flake-compat": "flake-compat_4",
672 | "nixpkgs": "nixpkgs_3"
673 | },
674 | "locked": {
675 | "lastModified": 1745487176,
676 | "narHash": "sha256-eF1l/KB8eXKTNf+CJ34gh5si3RZCZzme/W9StA+oTiw=",
677 | "owner": "Alexays",
678 | "repo": "waybar",
679 | "rev": "0332d2ebf84392c82c86d615079f762f27de94ba",
680 | "type": "github"
681 | },
682 | "original": {
683 | "owner": "Alexays",
684 | "repo": "waybar",
685 | "type": "github"
686 | }
687 | }
688 | },
689 | "root": "root",
690 | "version": 7
691 | }
692 |
--------------------------------------------------------------------------------
/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "Kidsan's NixOS Configuration";
3 |
4 | inputs = {
5 | nixpkgs.url = "nixpkgs/nixpkgs-unstable";
6 | nixos.url = "nixpkgs/nixos-unstable";
7 |
8 | home-manager.inputs.nixpkgs.follows = "nixpkgs";
9 | home-manager.url = "github:nix-community/home-manager/master";
10 |
11 | neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
12 |
13 | agenix.inputs.nixpkgs.follows = "nixpkgs";
14 | agenix.url = "github:ryantm/agenix";
15 |
16 | impermanence.url = "github:nix-community/impermanence/63f4d0443e32b0dd7189001ee1894066765d18a5";
17 |
18 | disko.inputs.nixpkgs.follows = "nixpkgs";
19 | disko.url = "github:nix-community/disko/master";
20 |
21 | secrets.inputs.nixpkgs.follows = "nixpkgs";
22 | secrets.url = "git+ssh://forgejo@git.home/kidsan/secrets.git?ref=main";
23 |
24 | nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
25 | nixpkgs-wayland.inputs.nixpkgs.follows = "nixpkgs";
26 |
27 | waybar.url = "github:Alexays/waybar";
28 |
29 | rippkgs.url = "github:replit/rippkgs";
30 | rippkgs.inputs.nixpkgs.follows = "nixpkgs";
31 | };
32 |
33 | outputs = { self, nixpkgs, nixpkgs-wayland, nixos, home-manager, secrets, agenix, impermanence, disko, waybar, rippkgs, ... } @ inputs:
34 | let
35 | overlays = [
36 | inputs.neovim-nightly-overlay.overlays.default
37 | (import ./overlays/weechat.nix)
38 | (import ./overlays/transcribe.nix)
39 | inputs.nixpkgs-wayland.overlays.default
40 | inputs.waybar.overlays.default
41 |
42 | (self: super: {
43 | vulkan-validation-layers = super.vulkan-validation-layers.overrideAttrs (old: {
44 | buildInputs = old.buildInputs ++ [ super.spirv-tools ];
45 | });
46 | swayidle = super.swayidle.overrideAttrs (old: {
47 | nativeBuildInputs = old.nativeBuildInputs ++ [ super.cmake ];
48 | buildInputs = old.buildInputs ++ [ super.wayland-scanner ];
49 | });
50 | })
51 | ];
52 |
53 | config = {
54 | allowUnfree = true;
55 | };
56 |
57 | nixosPackages = import nixos {
58 | system = "x86_64-linux";
59 | inherit config overlays;
60 | };
61 |
62 | x86Pkgs = import nixpkgs {
63 | system = "x86_64-linux";
64 | inherit config overlays;
65 | };
66 |
67 | armPkgs = import nixpkgs {
68 | system = "aarch64-linux";
69 | config = { allowUnfree = true; allowUnsupportedSystem = true; };
70 | inherit overlays;
71 | };
72 |
73 | in
74 | {
75 | homeConfigurations = { };
76 |
77 | nixosConfigurations = {
78 | desktop = nixos.lib.nixosSystem {
79 | system = "x86_64-linux";
80 | pkgs = nixosPackages;
81 | modules =
82 | [
83 | ./nixos/desktop.nix
84 | disko.nixosModules.disko
85 | impermanence.nixosModule
86 | agenix.nixosModules.default
87 | {
88 | nix.nixPath = [ "nixpkgs=flake:nixpkgs" ];
89 | }
90 | secrets.nixosModules.desktop or { }
91 | home-manager.nixosModules.home-manager
92 | {
93 | home-manager.extraSpecialArgs = {
94 | pkgs = x86Pkgs;
95 | };
96 | home-manager.users.kidsan = import ./home/users/kidsan/kidsan_desktop.nix;
97 | home-manager.backupFileExtension = "backup";
98 | }
99 | ({ pkgs, ... }: {
100 | environment.systemPackages = [
101 | inputs.rippkgs.packages.${pkgs.system}.rippkgs
102 | inputs.rippkgs.packages.${pkgs.system}.rippkgs-index
103 | ];
104 | })
105 | ];
106 | };
107 |
108 | thinkpad = nixos.lib.nixosSystem {
109 | system = "x86_64-linux";
110 | pkgs = nixosPackages;
111 | modules = [
112 | agenix.nixosModules.default
113 | {
114 | environment.etc."nix/inputs/nixpkgs".source = inputs.nixos.outPath;
115 | }
116 | ./nixos/thinkpad.nix
117 | secrets.nixosModules.thinkpad or { }
118 | home-manager.nixosModules.home-manager
119 | {
120 | home-manager.extraSpecialArgs = {
121 | pkgs = x86Pkgs;
122 | };
123 | home-manager.users.kidsan = import ./home/users/kidsan/kidsan_thinkpad.nix;
124 | }
125 | ];
126 | };
127 |
128 | monster = nixos.lib.nixosSystem {
129 | system = "aarch64-linux";
130 | modules = [
131 | agenix.nixosModules.default
132 | ./nixos/monster.nix
133 | secrets.nixosModules.monster or { }
134 | home-manager.nixosModules.home-manager
135 | {
136 | home-manager.extraSpecialArgs = {
137 | pkgs = armPkgs;
138 | };
139 | home-manager.users.lobster = import ./home/users/lobster/home.nix;
140 | }
141 | ];
142 | };
143 |
144 | pachinko = nixos.lib.nixosSystem {
145 | system = "x86_64-linux";
146 | pkgs = nixosPackages;
147 | specialArgs = {
148 | inherit inputs;
149 | };
150 | modules = [
151 | agenix.nixosModules.default
152 | disko.nixosModules.disko
153 | ./nixos/pachinko.nix
154 | secrets.nixosModules.pachinko or { }
155 | home-manager.nixosModules.home-manager
156 | {
157 | home-manager.extraSpecialArgs = {
158 | pkgs = x86Pkgs;
159 | };
160 | home-manager.users.kidsan = import ./home/users/pachinko.nix;
161 | }
162 | ];
163 | };
164 | };
165 |
166 | devShell.x86_64-linux = x86Pkgs.mkShell
167 | {
168 | nativeBuildInputs = [ x86Pkgs.bashInteractive ];
169 | buildInputs = with x86Pkgs; [
170 | nil
171 | nixpkgs-fmt
172 | ];
173 | };
174 | };
175 |
176 | }
177 |
--------------------------------------------------------------------------------
/home/programs/alacritty.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | programs.alacritty = {
5 | enable = true;
6 | settings = {
7 | general = {
8 | import = [
9 | "~/.config/alacritty/dracula.toml"
10 | ];
11 | };
12 | font = {
13 | size = 13;
14 | normal = {
15 | family = "JetBrains Mono Nerd Font";
16 | style = "Regular";
17 | };
18 | bold = {
19 | family = "JetBrains Mono Nerd Font";
20 | style = "Bold";
21 | };
22 | italic = {
23 | family = "JetBrains Mono Nerd Font";
24 | style = "Italic";
25 | };
26 | bold_italic = {
27 | family = "JetBrains Mono Nerd Font";
28 | style = "Bold Italic";
29 | };
30 | };
31 | };
32 | };
33 |
34 | # Dracula theme
35 | home.file = {
36 | "./.config/alacritty/dracula.toml".text = /*toml*/ ''
37 | [colors.bright]
38 | black = "0x555555"
39 | blue = "0xcaa9fa"
40 | cyan = "0x8be9fd"
41 | green = "0x50fa7b"
42 | magenta = "0xff79c6"
43 | red = "0xff5555"
44 | white = "0xffffff"
45 | yellow = "0xf1fa8c"
46 |
47 | [colors.normal]
48 | black = "0x000000"
49 | blue = "0xbd93f9"
50 | cyan = "0x8be9fd"
51 | green = "0x50fa7b"
52 | magenta = "0xff79c6"
53 | red = "0xff5555"
54 | white = "0xbbbbbb"
55 | yellow = "0xf1fa8c"
56 |
57 | [colors.primary]
58 | background = "0x282a36"
59 | foreground = "0xf8f8f2"
60 | '';
61 | };
62 | }
63 |
--------------------------------------------------------------------------------
/home/programs/bash.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | home.packages = [
5 | pkgs.eza
6 | pkgs.bat
7 | ];
8 |
9 | programs.fzf.enable = true;
10 | programs.bash.enable = true;
11 | programs.bash.bashrcExtra = ''
12 | export PATH=$PATH:~/go/bin:~/.cargo/bin
13 | parse_git_branch() {
14 | git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\[(\1)\]/'
15 | }
16 | export PS1="\n\[\033[1;32m\][\[\e]0;\u@\h: \w\a\]\u@\h:\w]\[\033[33m\]\$(parse_git_branch)\[\033[1;32m\]\$\[\033[0m\] "
17 | source <(${pkgs.kubectl}/bin/kubectl completion bash)
18 | complete -o default -F __start_kubectl k
19 | '';
20 | programs.bash.shellAliases = {
21 | k = "kubectl";
22 | ls = "eza";
23 | cat = "bat --paging=never";
24 | };
25 |
26 |
27 | # programs.bash.sessionVariables = {
28 | # SSH_AGENT_PID="";
29 | # SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh";
30 | # };
31 | }
32 |
--------------------------------------------------------------------------------
/home/programs/direnv.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | programs.direnv = {
5 | enable = true;
6 | nix-direnv.enable = true;
7 | };
8 | }
9 |
--------------------------------------------------------------------------------
/home/programs/easyeffects.nix:
--------------------------------------------------------------------------------
1 | _:
2 | {
3 | services.easyeffects.enable = true;
4 | services.easyeffects.preset = "microphone";
5 |
6 | home.file.".config/easyeffects/input/microphone.json" = {
7 | text = /*json*/''
8 | {
9 | "input": {
10 | "blocklist": [],
11 | "compressor#0": {
12 | "attack": 20.0,
13 | "boost-amount": 6.0,
14 | "boost-threshold": -72.0,
15 | "bypass": false,
16 | "dry": -100.0,
17 | "hpf-frequency": 10.0,
18 | "hpf-mode": "off",
19 | "input-gain": 0.0,
20 | "knee": -6.0,
21 | "lpf-frequency": 20000.0,
22 | "lpf-mode": "off",
23 | "makeup": 0.0,
24 | "mode": "Downward",
25 | "output-gain": 0.0,
26 | "ratio": 4.0,
27 | "release": 100.0,
28 | "release-threshold": -100.0,
29 | "sidechain": {
30 | "lookahead": 0.0,
31 | "mode": "RMS",
32 | "preamp": 0.0,
33 | "reactivity": 10.0,
34 | "source": "Middle",
35 | "stereo-split-source": "Left/Right",
36 | "type": "Feed-forward"
37 | },
38 | "stereo-split": false,
39 | "threshold": -12.0,
40 | "wet": 0.0
41 | },
42 | "deesser#0": {
43 | "bypass": false,
44 | "detection": "RMS",
45 | "f1-freq": 6000.0,
46 | "f1-level": 0.0,
47 | "f2-freq": 4500.0,
48 | "f2-level": 12.0,
49 | "f2-q": 1.0,
50 | "input-gain": 0.0,
51 | "laxity": 15,
52 | "makeup": 0.0,
53 | "mode": "Wide",
54 | "output-gain": 0.0,
55 | "ratio": 3.0,
56 | "sc-listen": false,
57 | "threshold": -18.0
58 | },
59 | "gate#0": {
60 | "attack": 5.0,
61 | "bypass": false,
62 | "curve-threshold": -24.0,
63 | "curve-zone": -6.0,
64 | "dry": -100.0,
65 | "hpf-frequency": 10.0,
66 | "hpf-mode": "off",
67 | "hysteresis": false,
68 | "hysteresis-threshold": -12.0,
69 | "hysteresis-zone": -6.0,
70 | "input-gain": 0.0,
71 | "lpf-frequency": 20000.0,
72 | "lpf-mode": "off",
73 | "makeup": 0.0,
74 | "output-gain": 0.0,
75 | "reduction": 0.0,
76 | "release": 100.0,
77 | "sidechain": {
78 | "input": "Internal",
79 | "lookahead": 0.0,
80 | "mode": "RMS",
81 | "preamp": 0.0,
82 | "reactivity": 10.0,
83 | "source": "Middle",
84 | "stereo-split-source": "Left/Right"
85 | },
86 | "stereo-split": false,
87 | "wet": 0.0
88 | },
89 | "limiter#0": {
90 | "alr": false,
91 | "alr-attack": 5.0,
92 | "alr-knee": 0.0,
93 | "alr-release": 50.0,
94 | "attack": 5.0,
95 | "bypass": false,
96 | "dithering": "None",
97 | "external-sidechain": false,
98 | "gain-boost": true,
99 | "input-gain": 0.0,
100 | "lookahead": 5.0,
101 | "mode": "Herm Thin",
102 | "output-gain": 0.0,
103 | "oversampling": "None",
104 | "release": 5.0,
105 | "sidechain-preamp": 0.0,
106 | "stereo-link": 100.0,
107 | "threshold": -1.0
108 | },
109 | "plugins_order": [
110 | "gate#0",
111 | "compressor#0",
112 | "deesser#0",
113 | "rnnoise#0",
114 | "limiter#0"
115 | ],
116 | "rnnoise#0": {
117 | "bypass": false,
118 | "enable-vad": true,
119 | "input-gain": 0.0,
120 | "model-path": "",
121 | "output-gain": 0.0,
122 | "release": 20.0,
123 | "vad-thres": 0.0,
124 | "wet": 0.0
125 | }
126 | }
127 | }
128 | '';
129 | };
130 | }
131 |
--------------------------------------------------------------------------------
/home/programs/firefox.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | programs.firefox = {
5 | enable = true;
6 | package = pkgs.firefox-wayland;
7 | };
8 | }
9 |
--------------------------------------------------------------------------------
/home/programs/fonts.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 |
5 | fonts.fontconfig.enable = true;
6 |
7 | home.packages = with pkgs; [
8 | (stdenv.mkDerivation {
9 | pname = "symbols-nerd-font";
10 | version = "2.2.0";
11 | src = fetchFromGitHub {
12 | owner = "ryanoasis";
13 | repo = "nerd-fonts";
14 | rev = "v2.2.0";
15 | sha256 = "sha256-wCQSV3mVNwsA2TlrGgl0A8Pb42SI9CsVCYpVyRzF8Fg=";
16 | sparseCheckout = [
17 | "10-nerd-font-symbols.conf"
18 | "patched-fonts/NerdFontsSymbolsOnly"
19 | ];
20 | };
21 | dontConfigure = true;
22 | dontBuild = true;
23 | installPhase = ''
24 | runHook preInstall
25 |
26 | fontconfigdir="$out/etc/fonts/conf.d"
27 | install -d "$fontconfigdir"
28 | install 10-nerd-font-symbols.conf "$fontconfigdir"
29 |
30 | fontdir="$out/share/fonts/truetype"
31 | install -d "$fontdir"
32 | install "patched-fonts/NerdFontsSymbolsOnly/complete/Symbols-2048-em Nerd Font Complete.ttf" "$fontdir"
33 |
34 | runHook postInstall
35 | '';
36 | enableParallelBuilding = true;
37 | })
38 | ];
39 | }
40 |
41 |
42 |
--------------------------------------------------------------------------------
/home/programs/git.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | home.packages = with pkgs; [
5 | tig
6 | ];
7 |
8 | programs.git = {
9 | enable = true;
10 | userName = "kidsan";
11 | userEmail = "git@kidsan.dev";
12 | ignores = [
13 | ".direnv/"
14 | ".go/"
15 | ];
16 | extraConfig = {
17 | init = { defaultBranch = "main"; };
18 | pull = { rebase = true; };
19 | push = { autoSetupRemote = true; };
20 | merge = { conflictstyle = "diff3"; };
21 | http = {
22 | "https://git.home" = {
23 | sslVerify = false;
24 | };
25 | };
26 | };
27 | };
28 | }
29 |
--------------------------------------------------------------------------------
/home/programs/gpg.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 |
5 | services.gpg-agent = {
6 | enable = false;
7 | enableSshSupport = true;
8 | enableBashIntegration = true;
9 | defaultCacheTtlSsh = 36000;
10 | maxCacheTtlSsh = 36000;
11 | };
12 |
13 | programs.gpg.enable = true;
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/home/programs/i3.nix:
--------------------------------------------------------------------------------
1 | { ... }:
2 | {
3 | # i3 config
4 | home.file = {
5 | "./.config/i3/config".text = ''
6 | set $mod Mod1
7 | default_border pixel 3
8 | for_window [class="^steam$"] border pixel 3
9 | for_window [class="^steam$" title="^Friends List$"] floating enable
10 | assign [class="(?i)steam_app_594650"] 9
11 |
12 | # exec "xautolock -detectsleep -time 3 -locker \"i3lock -c 000000\""
13 |
14 | # Font for window titles. Will also be used by the bar unless a different font
15 | # is used in the bar {} block below.
16 | font pango:monospace 8
17 | # default_border pixel 2
18 |
19 | # This font is widely installed, provides lots of unicode glyphs, right-to-left
20 | # text rendering and scalability on retina/hidpi displays (thanks to pango).
21 | #font pango:DejaVu Sans Mono 8
22 |
23 | # Start XDG autostart .desktop files using dex. See also
24 | # https://wiki.archlinux.org/index.php/XDG_Autostart
25 | exec --no-startup-id dex --autostart --environment i3
26 |
27 | # The combination of xss-lock, nm-applet and pactl is a popular choice, so
28 | # they are included here as an example. Modify as you see fit.
29 |
30 | # xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the
31 | # screen before suspend. Use loginctl lock-session to lock your screen.
32 | # exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork
33 | exec --no-startup-id xss-lock --transfer-sleep-lock --ignore-sleep -- i3lock --nofork
34 |
35 | # NetworkManager is the most popular way to manage wireless networks on Linux,
36 | # and nm-applet is a desktop environment-independent system tray GUI for it.
37 | exec --no-startup-id nm-applet
38 |
39 | exec --no-startup-id kdeconnect-indicator
40 |
41 | # Use pactl to adjust volume in PulseAudio.
42 | set $refresh_i3status killall -SIGUSR1 i3status
43 | bindsym XF86AudioRaiseVolume exec --no-startup-id wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.0 && pkill -SIGRTMIN+10 i3blocks
44 | bindsym XF86AudioLowerVolume exec --no-startup-id wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.0 && pkill -SIGRTMIN+10 i3blocks
45 | bindsym XF86AudioMute exec --no-startup-id wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && pkill -SIGRTMIN+10 i3blocks
46 |
47 | # Use Mouse+$mod to drag floating windows to their wanted position
48 | floating_modifier $mod
49 |
50 | # move tiling windows via drag & drop by left-clicking into the title bar,
51 | # or left-clicking anywhere into the window while holding the floating modifier.
52 | tiling_drag modifier titlebar
53 |
54 | # start a terminal
55 | bindsym $mod+Return exec alacritty
56 |
57 | # kill focused window
58 | bindsym $mod+Shift+Q kill
59 |
60 | # start dmenu (a program launcher)
61 | bindsym $mod+d exec --no-startup-id SHELL=/bin/sh dmenu_run
62 | # A more modern dmenu replacement is rofi:
63 | # bindcode $mod+40 exec "rofi -modi drun,run -show drun"
64 | # There also is i3-dmenu-desktop which only displays applications shipping a
65 | # .desktop file. It is a wrapper around dmenu, so you need that installed.
66 | # bindcode $mod+40 exec --no-startup-id i3-dmenu-desktop
67 |
68 | # change focus
69 | bindsym $mod+h focus left
70 | bindsym $mod+j focus down
71 | bindsym $mod+k focus up
72 | bindsym $mod+l focus right
73 |
74 | # alternatively, you can use the cursor keys:
75 | bindsym $mod+Left focus left
76 | bindsym $mod+Down focus down
77 | bindsym $mod+Up focus up
78 | bindsym $mod+Right focus right
79 |
80 | # move focused window
81 | bindsym $mod+Shift+H move left
82 | bindsym $mod+Shift+J move down
83 | bindsym $mod+Shift+K move up
84 | bindsym $mod+Shift+L move right
85 |
86 | # alternatively, you can use the cursor keys:
87 | bindsym $mod+Shift+Left move left
88 | bindsym $mod+Shift+Down move down
89 | bindsym $mod+Shift+Up move up
90 | bindsym $mod+Shift+Right move right
91 |
92 | # split in horizontal orientation
93 | bindsym $mod+b split h
94 |
95 | # split in vertical orientation
96 | bindsym $mod+v split v
97 |
98 | # enter fullscreen mode for the focused container
99 | bindsym $mod+f fullscreen toggle
100 |
101 | # change container layout (stacked, tabbed, toggle split)
102 | bindsym $mod+s layout stacking
103 | bindsym $mod+w layout tabbed
104 | bindsym $mod+e layout toggle split
105 |
106 | # toggle tiling / floating
107 | bindsym $mod+Shift+space floating toggle
108 |
109 | # change focus between tiling / floating windows
110 | bindsym $mod+space focus mode_toggle
111 |
112 | # focus the parent container
113 | bindsym $mod+a focus parent
114 |
115 | # focus the child container
116 | #bindsym $mod+d focus child
117 |
118 | # Define names for default workspaces for which we configure key bindings later on.
119 | # We use variables to avoid repeating the names in multiple places.
120 | set $ws1 "1"
121 | set $ws2 "2"
122 | set $ws3 "3"
123 | set $ws4 "4"
124 | set $ws5 "5"
125 | set $ws6 "6"
126 | set $ws7 "7"
127 | set $ws8 "8"
128 | set $ws9 "9"
129 | set $ws10 "10"
130 |
131 | # switch to workspace
132 | bindsym $mod+1 workspace number $ws1
133 | bindsym $mod+2 workspace number $ws2
134 | bindsym $mod+3 workspace number $ws3
135 | bindsym $mod+4 workspace number $ws4
136 | bindsym $mod+5 workspace number $ws5
137 | bindsym $mod+6 workspace number $ws6
138 | bindsym $mod+7 workspace number $ws7
139 | bindsym $mod+8 workspace number $ws8
140 | bindsym $mod+9 workspace number $ws9
141 | bindsym $mod+0 workspace number $ws10
142 |
143 | # move focused container to workspace
144 | bindsym $mod+Shift+exclam move container to workspace number $ws1
145 | bindsym $mod+Shift+quotedbl move container to workspace number $ws2
146 | bindsym $mod+Shift+sterling move container to workspace number $ws3
147 | bindsym $mod+Shift+dollar move container to workspace number $ws4
148 | bindsym $mod+Shift+percent move container to workspace number $ws5
149 | bindsym $mod+Shift+asciicircum move container to workspace number $ws6
150 | bindsym $mod+Shift+ampersand move container to workspace number $ws7
151 | bindsym $mod+Shift+asterisk move container to workspace number $ws8
152 | bindsym $mod+Shift+parenleft move container to workspace number $ws9
153 | bindsym $mod+Shift+parenright move container to workspace number $ws10
154 |
155 | # reload the configuration file
156 | bindsym $mod+Shift+C reload
157 | # restart i3 inplace (preserves your layout/session, can be used to upgrade i3)
158 | bindsym $mod+Shift+R restart
159 | # exit i3 (logs you out of your X session)
160 | bindsym $mod+Shift+E exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'"
161 |
162 | # resize window (you can also use the mouse for that)
163 | mode "resize" {
164 | # These bindings trigger as soon as you enter the resize mode
165 |
166 | # Pressing left will shrink the window’s width.
167 | # Pressing right will grow the window’s width.
168 | # Pressing up will shrink the window’s height.
169 | # Pressing down will grow the window’s height.
170 | bindsym j resize shrink width 10 px or 10 ppt
171 | bindsym k resize grow height 10 px or 10 ppt
172 | bindsym l resize shrink height 10 px or 10 ppt
173 | bindsym semicolon resize grow width 10 px or 10 ppt
174 |
175 | # same bindings, but for the arrow keys
176 | bindsym Left resize shrink width 10 px or 10 ppt
177 | bindsym Down resize grow height 10 px or 10 ppt
178 | bindsym Up resize shrink height 10 px or 10 ppt
179 | bindsym Right resize grow width 10 px or 10 ppt
180 |
181 | # back to normal: Enter or Escape or $mod+r
182 | bindsym Return mode "default"
183 | bindsym Escape mode "default"
184 | bindsym $mod+r mode "default"
185 | }
186 |
187 | bindsym $mod+r mode "resize"
188 |
189 | # gaming mode so that modifier key works in game
190 | mode "gaming" {
191 | bindsym $mod+Shift+G exec "~/.config/i3/mode_default.sh"
192 | bindsym $mod+f fullscreen toggle
193 | bindsym XF86AudioRaiseVolume exec --no-startup-id "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.0 && pkill -SIGRTMIN+10 i3blocks"
194 | bindsym XF86AudioLowerVolume exec --no-startup-id "wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.0 && pkill -SIGRTMIN+10 i3blocks"
195 | bindsym XF86AudioMute exec --no-startup-id "kill -s USR1 $(ps -C gpu-screen-recorder)"
196 | }
197 |
198 | bindsym $mod+Shift+G exec "~/.config/i3/mode_gaming.sh"
199 |
200 | # exec_always --no-startup-id ~/.config/i3/bar.sh
201 |
202 | # Start i3bar to display a workspace bar (plus the system information i3status
203 | # finds out, if available)
204 | bar {
205 | status_command i3blocks
206 | position top
207 | }
208 | for_window [class="discord"] move to workspace 2
209 | for_window [class="^steam$"] move to workspace 2
210 | '';
211 |
212 | "./.config/i3blocks/config".text = ''
213 | # Global properties
214 | #
215 | # The top properties below are applied to every block, but can be overridden.
216 | # Each block command defaults to the script name to avoid boilerplate.
217 | # Change $SCRIPT_DIR to the location of your scripts!
218 | command=$SCRIPT_DIR/$BLOCK_NAME
219 | separator_block_width=15
220 | markup=none
221 |
222 | [CPU-temperature]
223 | label=
224 | command=/home/kidsan/.config/i3blocks/temperature/temperature --chip k10temp-pci-00c3
225 | color=#96c6f8
226 | interval=1
227 |
228 | # Volume indicator
229 | #
230 | # The first parameter sets the step (and units to display)
231 | # The second parameter overrides the mixer selection
232 | # See the script for details.
233 |
234 | [volume]
235 | label=♪
236 | # label=VOL
237 | interval=1
238 | signal=10
239 | command=wpctl get-volume @DEFAULT_AUDIO_SINK@ | cut -c 9-
240 | #STEP=5%
241 |
242 | [weather]
243 | command=curl -Ss 'https://wttr.in?0&T&Q' | cut -c 16- | head -2 | xargs echo
244 | interval=3600
245 | color=#A4C2F4
246 |
247 | # Date Time
248 | #
249 | [time]
250 | command=date '+%Y-%m-%d %H:%M:%S'
251 | interval=5
252 | '';
253 |
254 | "./.config/i3/mode_gaming.sh" = {
255 | executable = true;
256 | text = ''
257 | #!/bin/sh
258 |
259 | i3-msg 'mode gaming'
260 | setxkbmap -option -option caps:none
261 |
262 | window=$(xdotool getactivewindow)
263 | window_name=$(xdotool getwindowclassname "$window" || xdotool getwindowname "$window" || echo "game")
264 | gpu-screen-recorder -w "$window" -f 60 -c mp4 -a "alsa_output.usb-Universal_Audio_Volt_1_23032036038581-00.analog-stereo.monitor" -r 30 -o "$HOME/Videos/replay/$window_name"
265 | '';
266 | };
267 |
268 | "./.config/i3/mode_default.sh" = {
269 | executable = true;
270 | text = ''
271 | #!/bin/sh
272 | i3-msg 'mode default'
273 | setxkbmap -option -option caps:escape
274 | pkill gpu-screen-reco
275 | '';
276 | };
277 |
278 | };
279 | }
280 |
--------------------------------------------------------------------------------
/home/programs/neovim/default.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | let
3 |
4 | treesitterWithGrammars = (pkgs.vimPlugins.nvim-treesitter.withPlugins (p: [
5 | p.bash
6 | p.comment
7 | p.css
8 | p.dockerfile
9 | p.fish
10 | p.gitattributes
11 | p.gitignore
12 | p.go
13 | p.gomod
14 | p.gowork
15 | p.hcl
16 | p.javascript
17 | p.jq
18 | p.json5
19 | p.json
20 | p.lua
21 | p.make
22 | p.markdown
23 | p.nix
24 | p.python
25 | p.rust
26 | p.toml
27 | p.typescript
28 | p.vue
29 | p.yaml
30 | ]));
31 |
32 | treesitter-parsers = pkgs.symlinkJoin {
33 | name = "treesitter-parsers";
34 | paths = treesitterWithGrammars.dependencies;
35 | };
36 | in
37 | {
38 | home.packages = with pkgs; [
39 | ripgrep
40 | fd
41 | lua-language-server
42 | rust-analyzer-unwrapped
43 | black
44 | nodejs_22
45 | gh
46 | ];
47 |
48 | programs.neovim = {
49 | enable = true;
50 | package = pkgs.neovim;
51 | vimAlias = true;
52 | coc.enable = false;
53 | withNodeJs = true;
54 |
55 | plugins = [
56 | treesitterWithGrammars
57 | ];
58 | };
59 |
60 | home.file."./.config/nvim/" = {
61 | source = ./nvim;
62 | recursive = true;
63 | };
64 |
65 | home.file."./.config/nvim/lua/kidsan/init.lua".text = ''
66 | require("kidsan.set")
67 | require("kidsan.remap")
68 | vim.opt.runtimepath:append("${treesitter-parsers}")
69 | '';
70 |
71 | # Treesitter is configured as a locally developed module in lazy.nvim
72 | # we hardcode a symlink here so that we can refer to it in our lazy config
73 | home.file."./.local/share/nvim/nix/nvim-treesitter/" = {
74 | recursive = true;
75 | source = treesitterWithGrammars;
76 | };
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/home/programs/neovim/fx_loader.sh:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env nix-shell
2 | #! nix-shell -i bash -p patchelf
3 |
4 | # Fixes linking for NixOS
5 | # ./fx_loader.sh ~/.local/share/nvim/mason/packages/rust-analyzer/rust-analyzer
6 | for binary in ${@}
7 | do
8 | patchelf \
9 | --set-interpreter "$(cat ${NIX_CC}/nix-support/dynamic-linker)" \
10 | "${binary}"
11 | done
12 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/init.lua:
--------------------------------------------------------------------------------
1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
2 | if not vim.loop.fs_stat(lazypath) then
3 | vim.fn.system({
4 | "git",
5 | "clone",
6 | "--filter=blob:none",
7 | "https://github.com/folke/lazy.nvim.git",
8 | "--branch=stable", -- latest stable release
9 | lazypath,
10 | })
11 | end
12 | vim.opt.rtp:prepend(lazypath)
13 | vim.g.mapleader = " "
14 | vim.opt.termguicolors = true
15 | vim.opt.guicursor = ""
16 |
17 | require("lazy").setup("plugins", {
18 | rocks = { enabled = false },
19 | dev = {
20 | path = "~/.local/share/nvim/nix",
21 | patterns = { "nvim-treesitter" },
22 | fallback = false,
23 | }
24 | })
25 | require("kidsan")
26 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/kidsan/remap.lua:
--------------------------------------------------------------------------------
1 | vim.keymap.set("v", "J", ":m '>+1gv=gv")
2 | vim.keymap.set("v", "K", ":m '<-2gv=gv")
3 |
4 | vim.keymap.set("n", "J", "mzJ`z")
5 | vim.keymap.set("n", "", "zz")
6 | vim.keymap.set("n", "", "zz")
7 | vim.keymap.set("n", "n", "nzzzv")
8 | vim.keymap.set("n", "N", "Nzzzv")
9 |
10 | -- greatest remap ever
11 | vim.keymap.set("x", "p", [["_dP]])
12 |
13 | -- next greatest remap ever : asbjornHaland
14 | vim.keymap.set({ "n", "v" }, "y", [["+y]])
15 | vim.keymap.set("n", "Y", [["+Y]])
16 |
17 | vim.keymap.set({ "n", "v" }, "d", [["_d]])
18 |
19 | vim.keymap.set("n", "Q", "")
20 | vim.keymap.set("n", "f", vim.lsp.buf.format)
21 |
22 | vim.keymap.set("n", "", "cnextzz")
23 | vim.keymap.set("n", "", "cprevzz")
24 | vim.keymap.set("n", "k", "lnextzz")
25 | vim.keymap.set("n", "j", "lprevzz")
26 |
27 | vim.keymap.set("n", "s", [[:%s/\<\>//gI]])
28 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/kidsan/set.lua:
--------------------------------------------------------------------------------
1 | -- vim.opt.guicursor = ""
2 |
3 | vim.opt.nu = true
4 |
5 | vim.opt.relativenumber = true
6 |
7 | vim.opt.tabstop = 4
8 | vim.opt.softtabstop = 4
9 | vim.opt.shiftwidth = 4
10 | vim.opt.expandtab = true
11 |
12 | vim.opt.smartindent = true
13 |
14 | vim.opt.wrap = false
15 |
16 | vim.opt.swapfile = false
17 | vim.opt.backup = false
18 | vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
19 | vim.opt.undofile = true
20 |
21 | vim.opt.hlsearch = false
22 | vim.opt.incsearch = true
23 |
24 | vim.opt.termguicolors = true
25 |
26 | vim.opt.scrolloff = 8
27 | vim.opt.signcolumn = "yes"
28 | vim.opt.isfname:append("@-@")
29 |
30 | vim.opt.updatetime = 50
31 |
32 | vim.opt.colorcolumn = "80"
33 |
34 | vim.g.mapleader = " "
35 |
36 | vim.opt.autowrite = true
37 | vim.opt.autowriteall = true
38 | vim.opt.autoindent = true
39 | vim.opt.list = true
40 | vim.opt.listchars:append "space:."
41 | vim.opt.listchars:append "eol:"
42 | vim.o.timeout = true
43 | vim.o.timeoutlen = 1000
44 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/alpha.lua:
--------------------------------------------------------------------------------
1 | return {
2 | "goolord/alpha-nvim",
3 | event = "VimEnter",
4 | opts = function()
5 | local dashboard = require("alpha.themes.dashboard")
6 | local logo = [[
7 | ██╗ ██╗██╗██████╗ ███████╗ █████╗ ███╗ ██╗
8 | ██║ ██╔╝██║██╔══██╗██╔════╝██╔══██╗████╗ ██║
9 | █████╔╝ ██║██║ ██║███████╗███████║██╔██╗ ██║
10 | ██╔═██╗ ██║██║ ██║╚════██║██╔══██║██║╚██╗██║
11 | ██║ ██╗██║██████╔╝███████║██║ ██║██║ ╚████║
12 | ╚═╝ ╚═╝╚═╝╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═══╝
13 | ]]
14 |
15 | dashboard.section.header.val = vim.split(logo, "\n")
16 | dashboard.section.buttons.val = {
17 | dashboard.button("f", " " .. " Find file", ":Telescope find_files "),
18 | dashboard.button("n", " " .. " New file", ":ene startinsert "),
19 | dashboard.button("r", " " .. " Recent files", ":Telescope oldfiles "),
20 | dashboard.button("g", " " .. " Find text", ":Telescope live_grep "),
21 | dashboard.button("c", " " .. " Config", ":e $MYVIMRC "),
22 | dashboard.button("s", " " .. " Restore Session", [[:lua require("persistence").load() ]]),
23 | dashboard.button("l", " " .. " Lazy", ":Lazy"),
24 | dashboard.button("q", " " .. " Quit", ":qa"),
25 | }
26 | for _, button in ipairs(dashboard.section.buttons.val) do
27 | button.opts.hl = "AlphaButtons"
28 | button.opts.hl_shortcut = "AlphaShortcut"
29 | end
30 | dashboard.section.header.opts.hl = "AlphaHeader"
31 | dashboard.section.buttons.opts.hl = "AlphaButtons"
32 | dashboard.section.footer.opts.hl = "AlphaFooter"
33 | dashboard.opts.layout[1].val = 8
34 | return dashboard
35 | end,
36 | config = function(_, dashboard)
37 | -- close Lazy and re-open when the dashboard is ready
38 | if vim.o.filetype == "lazy" then
39 | vim.cmd.close()
40 | vim.api.nvim_create_autocmd("User", {
41 | pattern = "AlphaReady",
42 | callback = function()
43 | require("lazy").show()
44 | end,
45 | })
46 | end
47 |
48 | require("alpha").setup(dashboard.opts)
49 |
50 | vim.api.nvim_create_autocmd("User", {
51 | pattern = "LazyVimStarted",
52 | callback = function()
53 | local stats = require("lazy").stats()
54 | local ms = (math.floor(stats.startuptime * 100 + 0.5) / 100)
55 | dashboard.section.footer.val = "⚡ Neovim loaded " .. stats.count .. " plugins in " .. ms .. "ms"
56 | pcall(vim.cmd.AlphaRedraw)
57 | end,
58 | })
59 | end,
60 | }
61 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/autopairs.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "windwp/nvim-autopairs",
4 | event = "InsertEnter",
5 | opts = {},
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/comment.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "numToStr/Comment.nvim",
4 | opts = {},
5 | event = { "BufReadPost", "BufNewFile" },
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/copilot.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "zbirenbaum/copilot.lua",
4 | enabled = false,
5 | event = "BufEnter",
6 | opts = {
7 | suggestion = { enabled = false },
8 | panel = { enabled = false },
9 | },
10 | },
11 | {
12 | "zbirenbaum/copilot-cmp",
13 | enabled = false,
14 | opts = {}
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/dap.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | 'mfussenegger/nvim-dap',
4 | lazy = true,
5 | dependencies = {
6 | { 'rcarriga/nvim-dap-ui' },
7 | { 'nvim-neotest/nvim-nio' },
8 | {'leoluz/nvim-dap-go'},
9 | },
10 | keys = {
11 | {"ds", mode = "n", function()
12 | require("dap").continue()
13 | require("dapui").toggle({})
14 | vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("=", false, true, true), "n", false) -- Spaces buffers evenly
15 | end, desc = "dap start"},
16 | { "dl",mode = "n", function() require("dap.ui.widgets").hover() end, desc = "dap ui hove"},
17 | { "dc",mode = "n", function() require("dap").continue() end, desc="dap continue"},
18 | { "db",mode = "n", function() require("dap").toggle_breakpoint() end, desc="dap breakpoint toggle"},
19 | { "dn",mode = "n", function() require("dap").step_over() end, desc=" dap step over"},
20 | { "di",mode = "n", function() require("dap").step_into() end, desc="dap step into"},
21 | { "do",mode = "n", function() require("dap").step_out() end, desc=" dap step out"},
22 | {"dC", mode = "n", function()
23 | require("dap").clear_breakpoints()
24 | require("notify")("Breakpoints cleared", "warn", { title = "DAP" })
25 | end, desc = "dap clear"},
26 |
27 | -- Close debugger and clear breakpoints
28 | {"de", mode = "n", function()
29 | require("dap").clear_breakpoints()
30 | require("dapui").toggle({})
31 | require("dap").terminate()
32 | vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("=", false, true, true), "n", false)
33 | require("notify")("Debugger session ended", "warn", { title = "DAP" })
34 | end, desc = ""},
35 | },
36 | config = function()
37 | local dap = require('dap')
38 | local ui = require('dapui')
39 |
40 | dap.set_log_level('INFO')
41 |
42 | ui.setup({
43 | icons = { expanded = "▾", collapsed = "▸" },
44 | mappings = {
45 | open = "o",
46 | remove = "d",
47 | edit = "e",
48 | repl = "r",
49 | toggle = "t",
50 | },
51 | expand_lines = vim.fn.has("nvim-0.7"),
52 | layouts = {
53 | {
54 | elements = {
55 | "scopes",
56 | },
57 | size = 0.3,
58 | position = "right"
59 | },
60 | {
61 | elements = {
62 | "repl",
63 | "breakpoints"
64 | },
65 | size = 0.3,
66 | position = "bottom",
67 | },
68 | },
69 | floating = {
70 | max_height = nil,
71 | max_width = nil,
72 | border = "single",
73 | mappings = {
74 | close = { "q", "" },
75 | },
76 | },
77 | windows = { indent = 1 },
78 | render = {
79 | max_type_length = nil,
80 | },
81 | })
82 |
83 |
84 | dap.configurations = {
85 | go = {
86 | {
87 | type = "go", -- Which adapter to use
88 | name = "Debug go file", -- Human readable name
89 | request = "launch", -- Whether to "launch" or "attach" to program
90 | program = "${file}",
91 | },
92 | }
93 | }
94 |
95 | local opts = {
96 | dap_configurations = {
97 | {
98 | type = "go",
99 | name = "Attach remote",
100 | mode = "remote",
101 | request = "attach",
102 | },
103 | }
104 | }
105 | require('dap-go').setup(opts)
106 | require('dap.ext.vscode').load_launchjs(nil, {})
107 |
108 | dap.adapters.go = {
109 | type = "server",
110 | port = "${port}",
111 | executable = {
112 | command = vim.fn.stdpath("data") .. '/mason/bin/dlv',
113 | args = { "dap", "-l", "127.0.0.1:${port}" },
114 | },
115 | }
116 |
117 | vim.fn.sign_define('DapBreakpoint', { text = '', texthl = 'Error' })
118 | end
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/devicons.lua:
--------------------------------------------------------------------------------
1 | return {
2 | { 'nvim-tree/nvim-web-devicons', opts = {}, lazy = true }
3 | }
4 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/diffview.lua:
--------------------------------------------------------------------------------
1 | return {
2 | "sindrets/diffview.nvim",
3 | lazy = true,
4 | opts = {},
5 | keys = {
6 | {
7 | "v",
8 | mode = "n",
9 | function()
10 | if next(require('diffview.lib').views) == nil then vim.cmd('DiffviewOpen') else vim.cmd('DiffviewClose') end
11 | end,
12 | desc = "diffview"
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/fidget.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'j-hui/fidget.nvim',
3 | tag = "legacy",
4 | event = "LspAttach",
5 | opts = {},
6 | }
7 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/flash.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "folke/flash.nvim",
4 | lazy = true,
5 | opts = {},
6 | keys = {
7 | {
8 | "s",
9 | mode = { "n", "x", "o" },
10 | function()
11 | require("flash").jump({
12 | search = {
13 | mode = function(str)
14 | return "\\<" .. str
15 | end
16 | }
17 | })
18 | end,
19 | desc = "Flash"
20 | },
21 | {
22 | "S",
23 | mode = { "n", "o", "x" },
24 | function() require("flash").treesitter() end,
25 | desc =
26 | "Flash Treesitter"
27 | },
28 | {
29 | "r",
30 | mode = "o",
31 | function() require("flash").remote() end,
32 | desc =
33 | "Remote Flash"
34 | },
35 | {
36 | "R",
37 | mode = { "o", "x" },
38 | function() require("flash").treesitter_search() end,
39 | desc =
40 | "Treesitter Search"
41 | },
42 | {
43 | "",
44 | mode = { "c" },
45 | function() require("flash").toggle() end,
46 | desc =
47 | "Toggle Flash Search"
48 | },
49 | },
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/fugitive.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | 'tpope/vim-fugitive',
4 | lazy = true,
5 | keys = {
6 | {
7 | "gs",
8 | mode = "n",
9 | function()
10 | vim.cmd.Git()
11 | end,
12 | desc = "Git Fugitive status"
13 | }
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/gitsigns.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | 'lewis6991/gitsigns.nvim',
4 | lazy = true,
5 | tag = 'v0.8.0',
6 | event = { "BufReadPost" },
7 | opts = {}
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/go.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | 'ray-x/go.nvim',
4 | ft = "go",
5 | dependencies = {
6 | { 'ray-x/guihua.lua' },
7 | { 'theHamsta/nvim-dap-virtual-text' }
8 | },
9 | config = function()
10 | local opts = {
11 | luasnip = true,
12 | lsp_cfg = true,
13 | lsp_semantic_highlights = false,
14 | lsp_inlay_hints = {
15 | enable = false,
16 | },
17 | diagnostic = {
18 | virtual_text = true,
19 | signs = true,
20 | update_in_insert = true,
21 | underline = true,
22 | severity_sort = false,
23 | float = true,
24 | },
25 | }
26 | require('go').setup(opts)
27 | local format_sync_grp = vim.api.nvim_create_augroup("GoImport", {})
28 | vim.api.nvim_create_autocmd("BufWritePre", {
29 | pattern = "*.go",
30 | callback = function()
31 | require('go.format').goimport()
32 | end,
33 | group = format_sync_grp,
34 | })
35 | end
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/indent-blankline.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "lukas-reineke/indent-blankline.nvim",
4 | tag = "v2.20.8",
5 | event = { "BufReadPost", "BufNewFile" },
6 | opts = {
7 | space_char_blankline = " ",
8 | show_current_context = true,
9 | show_current_context_start = true,
10 | },
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/init.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "dracula/vim",
4 | lazy = false,
5 | priority = 1000,
6 | opts = {},
7 | config = function()
8 | vim.cmd([[colorscheme dracula]])
9 | end
10 | },
11 | }
12 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/lsp.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 |
4 | 'williamboman/mason.nvim',
5 | config = function()
6 | require("mason").setup()
7 | end
8 | },
9 | {
10 |
11 | 'VonHeikemen/lsp-zero.nvim',
12 | branch = "v4.x",
13 | lazy = true,
14 | config = false
15 | },
16 | {
17 | 'hrsh7th/nvim-cmp',
18 | event = 'InsertEnter',
19 | dependencies = {
20 | { 'onsails/lspkind.nvim' },
21 | { 'L3MON4D3/LuaSnip' },
22 | -- -- Snippet Collection (Optional)
23 | { 'rafamadriz/friendly-snippets' },
24 | { 'hrsh7th/cmp-buffer' },
25 | { 'hrsh7th/cmp-path' },
26 | { 'saadparwaiz1/cmp_luasnip' },
27 | { 'hrsh7th/cmp-nvim-lsp' },
28 | { 'hrsh7th/cmp-nvim-lua' },
29 | },
30 | config = function()
31 | local cmp = require('cmp')
32 | -- local cmp_format = require('lsp-zero').cmp_format()
33 | local cmp_select = { behavior = cmp.SelectBehavior.Select }
34 | local cmp_mappings = cmp.mapping.preset.insert({
35 | [''] = cmp.mapping.select_prev_item(cmp_select),
36 | [''] = cmp.mapping.select_next_item(cmp_select),
37 | [''] = cmp.mapping.confirm({ select = true }),
38 | [''] = cmp.mapping.complete(),
39 | [''] = cmp.mapping.scroll_docs(-4),
40 | [''] = cmp.mapping.scroll_docs(4),
41 | })
42 |
43 | local cmp_autopairs = require("nvim-autopairs.completion.cmp")
44 | cmp.event:on(
45 | 'confirm_done',
46 | cmp_autopairs.on_confirm_done()
47 | )
48 |
49 | local lspkind = require("lspkind")
50 |
51 | cmp.setup({
52 | mapping = cmp_mappings,
53 | formatting = {
54 | format = lspkind.cmp_format({
55 | mode = 'symbol_text',
56 | maxwidth = 75,
57 | ellipsis_char = '...',
58 | symbol_map = {
59 | Copilot = "",
60 | Supermaven = ""
61 | },
62 | })
63 | },
64 | sources = {
65 | { name = 'supermaven' },
66 | { name = 'nvim_lsp' },
67 | { name = 'buffer' },
68 | { name = 'copilot' },
69 | { name = 'path' },
70 | { name = 'luasnip' },
71 | }
72 | })
73 | end
74 | },
75 | {
76 | 'neovim/nvim-lspconfig',
77 | event = { "BufReadPre", "BufNewFile" },
78 | dependencies = {
79 | { 'williamboman/mason-lspconfig.nvim' },
80 | { 'nvim-treesitter/nvim-treesitter' },
81 | },
82 | config = function()
83 | local lsp = require('lsp-zero')
84 | local parser_config = require("nvim-treesitter.parsers").get_parser_configs()
85 | parser_config.nu = {
86 | install_info = {
87 | url = "https://github.com/nushell/tree-sitter-nu",
88 | files = { "src/parser.c" },
89 | branch = "main",
90 | },
91 | filetype = "nu",
92 | }
93 |
94 | local format_sync_grp = vim.api.nvim_create_augroup("Format", {})
95 | vim.api.nvim_create_autocmd("BufWritePre", {
96 | pattern = "*",
97 | callback = function()
98 | vim.lsp.buf.format({ timeout_ms = 200 })
99 | end,
100 | group = format_sync_grp,
101 | })
102 |
103 | local lsp_attach = function(client, bufnr)
104 | local opts = { buffer = bufnr, remap = false }
105 | vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts)
106 | vim.keymap.set("n", "K", vim.lsp.buf.hover, opts)
107 | vim.keymap.set("n", "vws", vim.lsp.buf.workspace_symbol, opts)
108 | vim.keymap.set("n", "vd", vim.diagnostic.open_float, opts)
109 | vim.keymap.set("n", "[d", function() vim.diagnostic.jump({ count = -1, float = true }) end, opts)
110 | vim.keymap.set("n", "]d", function() vim.diagnostic.jump({ count = 1, float = true }) end, opts)
111 | vim.keymap.set("n", "vca", vim.lsp.buf.code_action, opts)
112 | vim.keymap.set("n", "a", vim.lsp.buf.code_action, opts)
113 | vim.keymap.set("n", "vrr", vim.lsp.buf.references, opts)
114 | vim.keymap.set("n", "vrn", vim.lsp.buf.rename, opts)
115 | vim.keymap.set("i", "", vim.lsp.buf.signature_help, opts)
116 | client.server_capabilities.semanticTokensProvider = nil
117 | end
118 |
119 |
120 | lsp.extend_lspconfig({
121 | capabilities = require('cmp_nvim_lsp').default_capabilities(),
122 | lsp_attach = lsp_attach,
123 | float_border = 'rounded',
124 | sign_text = true,
125 | set_lsp_keymaps = { preserve_mappings = false }
126 | })
127 |
128 | local lspconfig = require("lspconfig")
129 |
130 | lspconfig.nushell.setup({
131 | command = { "nu", "--lsp" },
132 | filetypes = { "nu" },
133 | root_dir = require("lspconfig.util").find_git_ancestor,
134 | single_file_support = true,
135 | })
136 |
137 | vim.diagnostic.config({
138 | virtual_text = true,
139 | signs = true,
140 | update_in_insert = true,
141 | underline = true,
142 | severity_sort = false,
143 | float = true,
144 | })
145 |
146 | require('mason-lspconfig').setup({
147 | ensure_installed = { 'lua_ls', 'gopls', 'terraformls' },
148 | handlers = {
149 | function(server_name)
150 | lspconfig[server_name].setup({})
151 | end,
152 |
153 | gopls = lsp.noop,
154 | rust_analyzer = lsp.noop,
155 |
156 | yamlls = function()
157 | require('lspconfig').yamlls.setup({
158 | settings = {
159 | yaml = {
160 | format = {
161 | enable = true,
162 | }
163 | },
164 | },
165 | })
166 | end,
167 |
168 | lua_ls = function()
169 | lspconfig.lua_ls.setup({
170 | on_init = function(client)
171 | lsp.nvim_lua_settings(client, {})
172 | end
173 | })
174 | end,
175 | nil_ls = function()
176 | local nil_ls_opts = {
177 | settings = {}
178 | }
179 | nil_ls_opts.settings['nil'] = {
180 | formatting = {
181 | command = { "nixpkgs-fmt" }
182 | }
183 | }
184 | lspconfig.nil_ls.setup(nil_ls_opts)
185 | end,
186 | }
187 | })
188 | end
189 | }
190 | }
191 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/lualine.lua:
--------------------------------------------------------------------------------
1 | local go_package = function()
2 | for _, line in ipairs(vim.api.nvim_buf_get_lines(0, 0, -1, true)) do
3 | if line:match("^package ") then
4 | return "⬡ " .. string.sub(line, 9);
5 | end
6 | end
7 | return ""
8 | end
9 |
10 | return {
11 | {
12 | 'nvim-lualine/lualine.nvim',
13 | event = "VeryLazy",
14 | dependencies = { 'nvim-tree/nvim-web-devicons', optional = true },
15 | opts = {
16 | options = {
17 | theme = 'dracula',
18 | },
19 | sections = {
20 | lualine_a = { 'mode' },
21 | lualine_b = { 'branch', 'diff', 'diagnostics' },
22 | lualine_c = { {
23 | go_package,
24 | cond = function()
25 | return vim.bo.filetype == "go"
26 | end
27 | },
28 | { 'filename' }
29 | },
30 | lualine_x = {
31 | 'encoding',
32 | 'fileformat',
33 | 'filetype'
34 | },
35 | lualine_y = { 'progress' },
36 | lualine_z = { 'location' }
37 | },
38 | }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/noice.lua:
--------------------------------------------------------------------------------
1 | return {
2 | -- "folke/noice.nvim",
3 | -- event = "VeryLazy",
4 | -- opts = {
5 | -- cmdline = {
6 | -- -- view = "cmdline",
7 | -- },
8 | -- lsp = {
9 | -- hover = {
10 | -- enabled = false,
11 | -- },
12 | -- signature = {
13 | -- enabled = false,
14 | -- },
15 | -- -- override markdown rendering so that **cmp** and other plugins use **Treesitter**
16 | -- override = {
17 | -- ["vim.lsp.util.convert_input_to_markdown_lines"] = true,
18 | -- ["vim.lsp.util.stylize_markdown"] = true,
19 | -- ["cmp.entry.get_documentation"] = true,
20 | -- },
21 | -- },
22 | -- -- you can enable a preset for easier configuration
23 | -- presets = {
24 | -- bottom_search = true, -- use a classic bottom cmdline for search
25 | -- command_palette = true, -- position the cmdline and popupmenu together
26 | -- long_message_to_split = true, -- long messages will be sent to a split
27 | -- inc_rename = false, -- enables an input dialog for inc-rename.nvim
28 | -- lsp_doc_border = false, -- add a border to hover docs and signature help
29 | -- },
30 | -- },
31 | -- dependencies = {
32 | -- "MunifTanjim/nui.nvim",
33 | -- "rcarriga/nvim-notify"
34 | -- }
35 | }
36 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/nonels.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'nvimtools/none-ls.nvim',
3 | ft = "python",
4 | opts = function(_, opts)
5 | local nls = require("null-ls")
6 | opts.sources = vim.list_extend(opts.sources or {}, {
7 | nls.builtins.code_actions.gitsigns,
8 | -- ts
9 | nls.builtins.formatting.biome,
10 | -- other
11 | nls.builtins.formatting.stylua,
12 | nls.builtins.formatting.shfmt,
13 | nls.builtins.formatting.black
14 | })
15 | return opts
16 | end
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/notify.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | 'rcarriga/nvim-notify',
4 | lazy = true,
5 | opts = {
6 | render = "compact",
7 | background_colour = "#000000"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/octo.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "pwntester/octo.nvim",
4 | requires = {
5 | 'nvim-lua/plenary.nvim',
6 | 'nvim-telescope/telescope.nvim',
7 | },
8 | opts = {}
9 | },
10 | }
11 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/persistence.lua:
--------------------------------------------------------------------------------
1 | return {
2 | "folke/persistence.nvim",
3 | event = "BufReadPre",
4 | opts = {},
5 | }
6 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/rust.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | 'mrcjkb/rustaceanvim',
4 | version = "^5",
5 | event = { "BufReadPost *.rs" },
6 | keys = {
7 | { "a", mode = "n", function() vim.cmd.RustLsp('codeAction') end, { buffer = vim.api.nvim_get_current_buf() }, desc = "LSP Code Action" },
8 | },
9 | config = function()
10 | vim.g.rustaceanvim = {
11 | tools = {
12 | inlay_hints = {
13 | auto = false,
14 | highlight = "Debug",
15 | },
16 | hover_actions = {
17 | auto_focus = true,
18 | },
19 | },
20 | server = {
21 | settings = {
22 | ["rust-analyzer"] = {
23 | files = {
24 | excludeDirs = { ".direnv" }
25 | },
26 | checkOnSave = {
27 | enable = true,
28 | command = "clippy",
29 | },
30 | cargo = {
31 | allFeatures = true,
32 | }
33 | },
34 | },
35 | on_attach = function(client, _)
36 | client.server_capabilities.semanticTokensProvider = nil
37 | end,
38 | }
39 | }
40 | end
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/statuscol.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "luukvbaal/statuscol.nvim",
4 | event = "VeryLazy",
5 | opts = {
6 | setopt = true,
7 | }
8 | },
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/substitute.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'gbprod/substitute.nvim',
3 | keys = {
4 | { "r", mode = "n", function() require('substitute').operator() end, desc = "substitute w/ motion" },
5 | { "rr", mode = "n", function() require('substitute').line() end, desc = "substitute w/ line" },
6 | { "R", mode = "n", function() require('substitute').eol() end, desc = "substitute w/ eol" },
7 | { "r", mode = "x", function() require('substitute').visual() end, desc = "substitute w/ visual" },
8 | },
9 | opts = {
10 |
11 | },
12 | }
13 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/supermaven.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "supermaven-inc/supermaven-nvim",
4 | opts = {
5 | disable_inline_completion = true,
6 | disable_keymaps = true,
7 | }
8 | },
9 | }
10 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/telekasten.lua:
--------------------------------------------------------------------------------
1 | local home = vim.fn.expand("~/zettelkasten/")
2 | return {
3 | {
4 | 'renerocksai/telekasten.nvim',
5 | dependencies = { 'renerocksai/calendar-vim' },
6 | lazy = true,
7 | keys = {
8 | { "z", mode = "n", "Telekasten panel", desc = "Telekasten panel" },
9 | { "zf", mode = "n", "Telekasten find_notes", desc = "Telekasten find notes" },
10 | { "zg", mode = "n", "Telekasten search_notes", desc = "Telekasten search notes" },
11 | { "zd", mode = "n", "Telekasten goto_today", desc = "Telekasten goto today" },
12 | { "zz", mode = "n", "Telekasten follow_link", desc = "Telekasten follow link" },
13 | { "zn", mode = "n", "Telekasten new_note", desc = "Telekasten new note link" },
14 | { "zc", mode = "n", "Telekasten show_calendar", desc = "Telekasten show calendar" },
15 | { "zb", mode = "n", "Telekasten show_backlinks", desc = "Telekasten show backlinks" },
16 | { "zI", mode = "n", "Telekasten insert_img_link", desc = "Telekasten insert img link" },
17 | { "[[", mode = "i", "Telekasten insert_link", desc = "Telekasten insert link" },
18 | },
19 | opts = {
20 | home = home,
21 |
22 | -- if true, telekasten will be enabled when opening a note within the configured home
23 | take_over_my_home = true,
24 |
25 | -- auto-set telekasten filetype: if false, the telekasten filetype will not be used
26 | -- and thus the telekasten syntax will not be loaded either
27 | auto_set_filetype = true,
28 |
29 | -- dir names for special notes (absolute path or subdir name)
30 | dailies = home .. '/' .. 'daily',
31 | weeklies = home .. '/' .. 'weekly',
32 | templates = home .. '/' .. 'templates',
33 |
34 | -- image (sub)dir for pasting
35 | -- dir name (absolute path or subdir name)
36 | -- or nil if pasted images shouldn't go into a special subdir
37 | image_subdir = "img",
38 |
39 | -- markdown file extension
40 | extension = ".md",
41 |
42 | -- following a link to a non-existing note will create it
43 | follow_creates_nonexisting = true,
44 | dailies_create_nonexisting = true,
45 | weeklies_create_nonexisting = true,
46 |
47 | -- template for new notes (new_note, follow_link)
48 | -- set to `nil` or do not specify if you do not want a template
49 | template_new_note = home .. '/' .. 'templates/new_note.md',
50 |
51 | -- template for newly created daily notes (goto_today)
52 | -- set to `nil` or do not specify if you do not want a template
53 | template_new_daily = home .. '/' .. 'templates/daily.md',
54 |
55 | -- template for newly created weekly notes (goto_thisweek)
56 | -- set to `nil` or do not specify if you do not want a template
57 | template_new_weekly = home .. '/' .. 'templates/weekly.md',
58 |
59 | -- image link style
60 | -- wiki: ![[image name]]
61 | -- markdown: 
62 | image_link_style = "markdown",
63 |
64 | -- integrate with calendar-vim
65 | plug_into_calendar = true,
66 | calendar_opts = {
67 | -- calendar week display mode: 1 .. 'WK01', 2 .. 'WK 1', 3 .. 'KW01', 4 .. 'KW 1', 5 .. '1'
68 | weeknm = 4,
69 | -- use monday as first day of week: 1 .. true, 0 .. false
70 | calendar_monday = 1,
71 | -- calendar mark: where to put mark for marked days: 'left', 'right', 'left-fit'
72 | calendar_mark = 'left-fit',
73 | },
74 |
75 | -- telescope actions behavior
76 | close_after_yanking = false,
77 | insert_after_inserting = true,
78 |
79 | -- tag notation: '#tag', ':tag:', 'yaml-bare'
80 | tag_notation = "#tag",
81 |
82 | -- command palette theme: dropdown (window) or ivy (bottom panel)
83 | command_palette_theme = "ivy",
84 |
85 | -- tag list theme:
86 | -- get_cursor: small tag list at cursor; ivy and dropdown like above
87 | show_tags_theme = "ivy",
88 |
89 | -- when linking to a note in subdir/, create a [[subdir/title]] link
90 | -- instead of a [[title only]] link
91 | subdirs_in_links = true,
92 |
93 | -- template_handling
94 | -- What to do when creating a new note via `new_note()` or `follow_link()`
95 | -- to a non-existing note
96 | -- - prefer_new_note: use `new_note` template
97 | -- - smart: if day or week is detected in title, use daily / weekly templates (default)
98 | -- - always_ask: always ask before creating a note
99 | template_handling = "smart",
100 |
101 | -- path handling:
102 | -- this applies to:
103 | -- - new_note()
104 | -- - new_templated_note()
105 | -- - follow_link() to non-existing note
106 | --
107 | -- it does NOT apply to:
108 | -- - goto_today()
109 | -- - goto_thisweek()
110 | --
111 | -- Valid options:
112 | -- - smart: put daily-looking notes in daily, weekly-looking ones in weekly,
113 | -- all other ones in home, except for notes/with/subdirs/in/title.
114 | -- (default)
115 | --
116 | -- - prefer_home: put all notes in home except for goto_today(), goto_thisweek()
117 | -- except for notes with subdirs/in/title.
118 | --
119 | -- - same_as_current: put all new notes in the dir of the current note if
120 | -- present or else in home
121 | -- except for notes/with/subdirs/in/title.
122 | new_note_location = "smart",
123 |
124 | -- should all links be updated when a file is renamed
125 | rename_update_links = true,
126 | }
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/telescope.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "nvim-telescope/telescope.nvim",
4 | lazy = false,
5 | dependencies = {
6 | 'nvim-lua/plenary.nvim',
7 | 'nvim-treesitter/nvim-treesitter',
8 | {
9 | 'nvim-telescope/telescope-file-browser.nvim',
10 | event = "VeryLazy",
11 | dependencies = { 'nvim-telescope/telescope.nvim', 'nvim-lua/plenary.nvim', 'nvim-tree/nvim-web-devicons' }
12 | }
13 | },
14 | -- stylua: ignore
15 | keys = {
16 | {
17 | "pf",
18 | mode = "n",
19 | function() require("telescope.builtin").find_files() end,
20 | desc = "telescope find files"
21 | },
22 | {
23 | "",
24 | mode = "n",
25 | function() require("telescope.builtin").git_files() end,
26 | desc = "telescope find files"
27 | },
28 | {
29 | "ps",
30 | mode = "n",
31 | function()
32 | require("telescope.builtin").live_grep()
33 | end,
34 | desc = "telescope grep string"
35 | },
36 | {
37 | "pt",
38 | mode = "n",
39 | function()
40 | require("telescope.builtin").treesitter()
41 | end,
42 | desc = "telescope treesitter"
43 | },
44 | {
45 | "b",
46 | mode = "n",
47 | function() require("telescope.builtin").buffers() end,
48 | desc = "telescope buffers"
49 | },
50 | {
51 | "pv",
52 | mode = "n",
53 | function() require("telescope").extensions.file_browser.file_browser() end,
54 | desc = "telescope file browser"
55 | },
56 | {
57 | "pr",
58 | mode = "n",
59 | function() require("telescope.builtin").resume() end,
60 | desc = "telescope resume",
61 | }
62 | },
63 | config = function()
64 | local opts = {
65 | extensions = {
66 | file_browser = {
67 | respect_gitignore = false,
68 | hijack_netrw = true,
69 | hidden = true,
70 | }
71 | }
72 | }
73 | require('telescope').setup(opts)
74 | require("telescope").load_extension "file_browser"
75 | end
76 |
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/treesitter.lua:
--------------------------------------------------------------------------------
1 | return {
2 | 'nvim-treesitter/nvim-treesitter',
3 | event = { "BufReadPost", "BufNewFile" },
4 | main = "nvim-treesitter.configs",
5 | dev = true,
6 | opts = {
7 | -- autotag = {
8 | -- enable = true
9 | -- },
10 | highlight = {
11 | -- `false` will disable the whole extension
12 | enable = true,
13 | additional_vim_regex_highlighting = false,
14 | },
15 | incremental_selection = {
16 | enable = true,
17 | keymaps = {
18 | init_selection = "",
19 | node_incremental = "",
20 | scope_incremental = "",
21 | node_decremental = "",
22 | },
23 | },
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/trouble.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | "folke/trouble.nvim",
4 | dependencies = { "nvim-tree/nvim-web-devicons" },
5 | lazy = true,
6 | opts = {
7 | auto_close = false, -- auto close when there are no items
8 | auto_open = false, -- auto open when there are items
9 | auto_preview = true, -- automatically open preview when on an item
10 | auto_refresh = true, -- auto refresh when open
11 | auto_jump = false, -- auto jump to the item when there's only one
12 | focus = true, -- Focus the window when opened
13 | restore = true, -- restores the last location in the list when opening
14 | follow = true, -- Follow the current item
15 | indent_guides = true, -- show indent guides
16 | max_items = 200, -- limit number of items that can be displayed per section
17 | multiline = true, -- render multi-line messages
18 | pinned = false, -- When pinned, the opened trouble window will be bound to the current buffer
19 | warn_no_results = true, -- show a warning when there are no results
20 | open_no_results = false, -- open the trouble window when there are no results
21 | ---@type trouble.Window.opts
22 | win = {}, -- window options for the results window. Can be a split or a floating window.
23 | -- Window options for the preview window. Can be a split, floating window,
24 | -- or `main` to show the preview in the main editor window.
25 | ---@type trouble.Window.opts
26 | preview = {
27 | type = "main",
28 | -- when a buffer is not yet loaded, the preview window will be created
29 | -- in a scratch buffer with only syntax highlighting enabled.
30 | -- Set to false, if you want the preview to always be a real loaded buffer.
31 | scratch = true,
32 | },
33 | -- Throttle/Debounce settings. Should usually not be changed.
34 | ---@type table
35 | throttle = {
36 | refresh = 20, -- fetches new data when needed
37 | update = 10, -- updates the window
38 | render = 10, -- renders the window
39 | follow = 100, -- follows the current item
40 | preview = { ms = 100, debounce = true }, -- shows the preview for the current item
41 | },
42 | ---@type table
43 | modes = {
44 | -- sources define their own modes, which you can use directly,
45 | -- or override like in the example below
46 | lsp_references = {
47 | -- some modes are configurable, see the source code for more details
48 | params = {
49 | include_declaration = true,
50 | },
51 | },
52 | -- The LSP base mode for:
53 | -- * lsp_definitions, lsp_references, lsp_implementations
54 | -- * lsp_type_definitions, lsp_declarations, lsp_command
55 | lsp_base = {
56 | params = {
57 | -- don't include the current location in the results
58 | include_current = false,
59 | },
60 | },
61 | -- more advanced example that extends the lsp_document_symbols
62 | symbols = {
63 | desc = "document symbols",
64 | mode = "lsp_document_symbols",
65 | focus = false,
66 | win = { position = "right" },
67 | filter = {
68 | -- remove Package since luals uses it for control flow structures
69 | ["not"] = { ft = "lua", kind = "Package" },
70 | any = {
71 | -- all symbol kinds for help / markdown files
72 | ft = { "help", "markdown" },
73 | -- default set of symbol kinds
74 | kind = {
75 | "Class",
76 | "Constructor",
77 | "Enum",
78 | "Field",
79 | "Function",
80 | "Interface",
81 | "Method",
82 | "Module",
83 | "Namespace",
84 | "Package",
85 | "Property",
86 | "Struct",
87 | "Trait",
88 | },
89 | },
90 | },
91 | },
92 | },
93 | -- stylua: ignore
94 | icons = {
95 | ---@type trouble.Indent.symbols
96 | indent = {
97 | top = "│ ",
98 | middle = "├╴",
99 | last = "└╴",
100 | -- last = "-╴",
101 | -- last = "╰╴", -- rounded
102 | fold_open = " ",
103 | fold_closed = " ",
104 | ws = " ",
105 | },
106 | folder_closed = " ",
107 | folder_open = " ",
108 | kinds = {
109 | Array = " ",
110 | Boolean = " ",
111 | Class = " ",
112 | Constant = " ",
113 | Constructor = " ",
114 | Enum = " ",
115 | EnumMember = " ",
116 | Event = " ",
117 | Field = " ",
118 | File = " ",
119 | Function = " ",
120 | Interface = " ",
121 | Key = " ",
122 | Method = " ",
123 | Module = " ",
124 | Namespace = " ",
125 | Null = " ",
126 | Number = " ",
127 | Object = " ",
128 | Operator = " ",
129 | Package = " ",
130 | Property = " ",
131 | String = " ",
132 | Struct = " ",
133 | TypeParameter = " ",
134 | Variable = " ",
135 | },
136 | },
137 | },
138 | keys = {
139 | {
140 | "xx",
141 | mode = "n",
142 | "Trouble diagnostics toggle",
143 | desc = "TroubleToggle"
144 | },
145 | {
146 | "xd",
147 | mode = "n",
148 | "TroubleToggle document_diagnostics",
149 | desc =
150 | "Trouble document_diagnostics"
151 | },
152 | {
153 | "xl",
154 | mode = "n",
155 | "Trouble loclist toggle",
156 | desc = "Trouble loclist"
157 | },
158 | {
159 | "xq",
160 | mode = "n",
161 | "Trouble quickfix toggle",
162 | desc = "Trouble quickfix"
163 | },
164 | {
165 | "xR",
166 | mode = "n",
167 | "Trouble lsp_references toggle",
168 | desc =
169 | "Trouble lsp_references"
170 | },
171 | }
172 | }
173 | }
174 |
--------------------------------------------------------------------------------
/home/programs/neovim/nvim/lua/plugins/which-key.lua:
--------------------------------------------------------------------------------
1 | return {
2 | {
3 | 'folke/which-key.nvim',
4 | event = "VeryLazy",
5 | opts = {},
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/home/programs/nextcloud.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | {
3 |
4 | systemd.user.services = {
5 | nextcloud-sync = {
6 | Unit = {
7 | Description = "Zettelkasten Sync";
8 | After = "sway-session.target";
9 | PartOf = "sway-session.target";
10 | Requires = "sway-session.target";
11 | };
12 | Install = {
13 | WantedBy = [ "sway-session.target" ];
14 | };
15 | Service = {
16 | Type = "oneshot";
17 | ExecStart = "${pkgs.writeShellScript "sync-zettelkasten" ''
18 | #!/run/current-system/sw/bin/bash
19 | # ${pkgs.nextcloud-client}/bin/nextcloudcmd --path /zettelkasten -n ~/zettelkasten
20 | ''}";
21 | };
22 | };
23 | };
24 |
25 | systemd.user.timers = {
26 | nextcloud-sync = {
27 | Unit = {
28 | After = "sway-session.target";
29 | PartOf = "sway-session.target";
30 | Requires = "sway-session.target";
31 | };
32 | Timer = {
33 | OnCalendar = "hourly";
34 | Persistent = "true";
35 | };
36 | Install = {
37 | WantedBy = [ "sway-session.target" ];
38 | };
39 | };
40 | };
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/home/programs/nix-flake-templates/default.nix:
--------------------------------------------------------------------------------
1 | { ... }:
2 | {
3 | home.file.".shells/" = {
4 | source = ./shells;
5 | recursive = true;
6 | };
7 | }
8 |
--------------------------------------------------------------------------------
/home/programs/nix-flake-templates/shells/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | outputs = { self }: {
3 |
4 | templates.rust = {
5 | path = ./rust;
6 | description = "A simple Rust/Cargo project";
7 | welcomeText = ''
8 | Initialized a new Rust flake
9 | '';
10 | };
11 |
12 | templates.go = {
13 | path = ./go;
14 | description = "A simple Go project";
15 | welcomeText = ''
16 | Initialized a new Go flake
17 | '';
18 | };
19 |
20 | templates.default = self.templates.rust;
21 | };
22 | }
23 |
--------------------------------------------------------------------------------
/home/programs/nix-flake-templates/shells/go/.envrc:
--------------------------------------------------------------------------------
1 | use flake;
2 |
--------------------------------------------------------------------------------
/home/programs/nix-flake-templates/shells/go/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | description = "A sample go flake";
3 |
4 | # Nixpkgs / NixOS version to use.
5 | inputs.nixpkgs.url = "nixpkgs/nixos-unstable";
6 |
7 |
8 | outputs = { self, nixpkgs }:
9 | let
10 |
11 | # to work with older version of flakes
12 | lastModifiedDate = self.lastModifiedDate or self.lastModified or "19700101";
13 |
14 | # Generate a user-friendly version number.
15 | version = builtins.substring 0 8 lastModifiedDate;
16 |
17 | # System types to support.
18 | supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
19 |
20 | # Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
21 | forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
22 |
23 | # Nixpkgs instantiated for supported system types.
24 | nixpkgsFor = forAllSystems (system: import nixpkgs {
25 | inherit system;
26 | });
27 |
28 | in
29 | {
30 | # Provide some binary packages for selected system types.
31 | packages = forAllSystems (system:
32 | let
33 | pkgs = nixpkgsFor.${system};
34 | in
35 | {
36 | app = pkgs.buildGoApplication {
37 | nativeBuildInputs = [ ];
38 | buildInputs = [ ];
39 | pname = "app";
40 | inherit version;
41 | src = ./.;
42 | };
43 | });
44 |
45 | defaultPackage = forAllSystems (system: self.packages.${system}.app);
46 |
47 | devShell = forAllSystems (system:
48 | let pkgs = nixpkgsFor.${system};
49 |
50 | in with pkgs;
51 | mkShell {
52 | hardeningDisable = [ "all" ];
53 | nativeBuildInputs = [
54 | pkgs.bashInteractive
55 | pkgs.buildPackages.go_1_22
56 | pkgs.sqlc
57 | pkgs.go-migrate
58 | ];
59 | });
60 | };
61 | }
62 |
--------------------------------------------------------------------------------
/home/programs/nix-flake-templates/shells/go/go.mod:
--------------------------------------------------------------------------------
1 | module github.com/kidsan/app
2 |
3 | go 1.22.2
4 |
--------------------------------------------------------------------------------
/home/programs/nix-flake-templates/shells/go/main.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "fmt"
5 | )
6 |
7 | func main() {
8 | fmt.Println("Hello, World!")
9 | }
10 |
--------------------------------------------------------------------------------
/home/programs/nix-flake-templates/shells/go/sqlc.yaml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | sql:
3 | - engine: "postgresql"
4 | queries: "db/sql"
5 | schema: "db/migrations"
6 | gen:
7 | go:
8 | package: "db"
9 | out: "db"
10 | sql_package: "pgx/v5"
11 |
--------------------------------------------------------------------------------
/home/programs/nix-flake-templates/shells/rust/.envrc:
--------------------------------------------------------------------------------
1 | use flake;
2 |
--------------------------------------------------------------------------------
/home/programs/nix-flake-templates/shells/rust/flake.nix:
--------------------------------------------------------------------------------
1 | {
2 | inputs = {
3 | nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4 | rust-overlay.url = "github:oxalica/rust-overlay";
5 | utils.url = "github:numtide/flake-utils";
6 | cargo2nix.url = "github:cargo2nix/cargo2nix/unstable";
7 | };
8 |
9 | outputs = { self, nixpkgs, utils, rust-overlay, cargo2nix }:
10 | utils.lib.eachDefaultSystem (system:
11 | let
12 | pkgs = import nixpkgs {
13 | inherit system;
14 | overlays = [ (import rust-overlay) cargo2nix.overlays.default ];
15 | };
16 | manifest = (pkgs.lib.importTOML ./Cargo.toml).package;
17 | app = (pkgs: pkgs.rustPlatform.buildRustPackage {
18 | pname = manifest.name;
19 | version = manifest.version;
20 | cargoLock.lockFile = ./Cargo.lock;
21 | src = pkgs.lib.cleanSource ./.;
22 | buildInputs = [
23 | # pkgs.openssl
24 | ];
25 | nativeBuildInputs = [
26 | # pkgs.pkg-config
27 | ];
28 | doCheck = false;
29 | });
30 | rustPkgs = pkgs.rustBuilder.makePackageSet
31 | {
32 | rustVersion = "1.75.0";
33 | packageFun = import ./Cargo.nix;
34 | };
35 | in
36 | rec
37 | {
38 | packages = {
39 | app = (rustPkgs.workspace.app { });
40 | docker = pkgs.dockerTools.buildLayeredImage {
41 | name = "";
42 | tag = if (self ? rev) then self.shortRev else "dirty";
43 | config.Cmd = [ "${packages.app}/bin/app" ];
44 | contents = [ packages.app ];
45 | };
46 | };
47 |
48 | defaultPackage = packages.app;
49 |
50 | devShell = with pkgs; mkShell {
51 | LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath [
52 | # pkgs.openssl
53 | ];
54 | buildInputs = [
55 | pkg-config
56 | (rust-bin.stable.latest.default.override {
57 | extensions = [ "rust-src" ];
58 | })
59 | bashInteractive
60 | cargo-watch
61 | sqlx-cli
62 | ];
63 | RUST_SRC_PATH = rustPlatform.rustLibSrc;
64 | shellHook = ''
65 | export OPENSSL_DIR="${openssl.dev}"
66 | export OPENSSL_LIB_DIR="${openssl.out}/lib"
67 | '';
68 | };
69 | });
70 | }
71 |
--------------------------------------------------------------------------------
/home/programs/nushell.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | {
3 | home.packages = [
4 | pkgs.fish
5 | ];
6 |
7 | programs.nushell = {
8 | enable = true;
9 | shellAliases = {
10 | k = "kubectl";
11 | };
12 | envFile = {
13 | text = /* nu */''
14 | let fish_completer = {|spans|
15 | fish --command $'complete "--do-complete=($spans | str join " ")"'
16 | | $"value(char tab)description(char newline)" + $in
17 | | from tsv --flexible --no-infer
18 | }
19 | let external_completer = {|spans|
20 | let expanded_alias = scope aliases
21 | | where name == $spans.0
22 | | get -i 0.expansion
23 |
24 | let spans = if $expanded_alias != null {
25 | $spans
26 | | skip 1
27 | | prepend ($expanded_alias | split row ' ')
28 | } else {
29 | $spans
30 | }
31 |
32 | match $spans.0 {
33 | _ => $fish_completer
34 | } | do $in $spans
35 | }
36 | $env.PATH = ($env.PATH | split row (char esep) | append '$env.HOME/.nix-profile/bin')
37 | $env.PATH = ($env.PATH | split row (char esep) | append '/etc/profiles/per-user/$env.USER/bin')
38 | $env.PATH = ($env.PATH | split row (char esep) | append '/run/current-system/sw/bin')
39 | $env.PATH = ($env.PATH | split row (char esep) | append '/nix/var/nix/profiles/default/bin')
40 | $env.config = {
41 | show_banner: false,
42 | completions: {
43 | external: {
44 | enable: true
45 | completer: $external_completer
46 | }
47 | },
48 | cursor_shape: {
49 | emacs: inherit # block, underscore, line (line is the default)
50 | vi_insert: inherit # block, underscore, line (block is the default)
51 | vi_normal: inherit # block, underscore, line (underscore is the default)
52 | }
53 | };
54 | def dockill [] {
55 | docker ps -aq | str trim | split row "\n" | each { |it| docker rm -f $it }
56 | }
57 | $env.NIXPKGS_ALLOW_UNFREE = 1
58 | '';
59 | };
60 | loginFile = {
61 | text = /* nu */''
62 | let hostname = (sys host | get hostname)
63 | $env.EDITOR = "nvim"
64 | $env.NIX_PATH = "nixpkgs=flake:nixpkgs"
65 | if $env.XDG_VTNR? == "1" {
66 | if (which sway | length) > 0 {
67 | if hostname == "desktop" {
68 | exec sway --unsupported-gpu
69 | } else if hostname == "framework" {
70 | exec sway
71 | }
72 | }
73 | }
74 | '';
75 | };
76 | };
77 |
78 | programs.starship = {
79 | enable = true;
80 | enableBashIntegration = false;
81 | enableNushellIntegration = true;
82 | settings = {
83 | add_newline = true;
84 | character.success_symbol = "[➜](bold green)";
85 | package.disabled = true;
86 | nix_shell = {
87 | format = "[$symbol]($style)";
88 | };
89 | rust = { };
90 | golang = { format = "[$symbol($version )]($style)"; };
91 | format = "$username$directory$git_branch$golang$rust$nix_shell$character";
92 | };
93 | };
94 | }
95 |
--------------------------------------------------------------------------------
/home/programs/sway.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, osConfig, ... }:
2 |
3 | {
4 |
5 | programs.bash.profileExtra = ''
6 | if [ -z "$DISPLAY" ] && [ "''\${XDG_VTNR:-0}" -eq 1 ]; then
7 | exec sway
8 | fi
9 | '';
10 |
11 | home.packages = with pkgs; [
12 | gamescope
13 | playerctl
14 | glib # gsettings
15 | swaylock
16 | swayidle
17 | grim # screenshot functionality
18 | slurp # screenshot functionality
19 | wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout
20 | bemenu # wayland clone of dmenu
21 | xdg-utils
22 | waybar
23 | ];
24 |
25 | gtk = {
26 | enable = true;
27 | theme = {
28 | package = pkgs.dracula-theme;
29 | name = "Dracula";
30 | };
31 | cursorTheme = {
32 | package = pkgs.adwaita-icon-theme;
33 | name = "Adwaita";
34 | };
35 | font = {
36 | package = pkgs.dejavu_fonts;
37 | name = "DejaVu Sans";
38 | size = 10;
39 | };
40 | };
41 |
42 | services.swayidle = {
43 | enable = true;
44 | events = [
45 | {
46 | event = "before-sleep";
47 | command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";
48 | }
49 | ];
50 | timeouts = [
51 | {
52 | timeout = 1800;
53 | command = "${pkgs.swaylock}/bin/swaylock -f -c 000000";
54 | }
55 | {
56 | timeout = 1800;
57 | command = ''${pkgs.sway}/bin/swaymsg "output * power off" '';
58 | resumeCommand = ''${pkgs.sway}/bin/swaymsg "output * power on"'';
59 | }
60 | ];
61 | };
62 |
63 | wayland.windowManager.sway = {
64 | enable = true;
65 | package = pkgs.sway-unwrapped;
66 | checkConfig = false;
67 | wrapperFeatures = {
68 | gtk = true;
69 | };
70 |
71 | config = {
72 | modifier = "Mod1";
73 | terminal = "alacritty";
74 | defaultWorkspace = "workspace number 1";
75 | startup = [
76 | { command = "sleep 5; systemctl --user restart kanshi.service"; always = true; }
77 | # { command = "swaymsg create_output HEADLESS-1"; }
78 | { command = "obsidian"; always = true; }
79 | { command = "alacritty -e ncspot"; }
80 | { command = "firefox"; }
81 | { command = "kdeconnect-indicator"; }
82 | { command = "pkill swaybg; curl -Lo /tmp/wp.jpeg \"https://unsplash.it/1920/1080?random\"; ${pkgs.swaybg}/bin/swaybg -i /tmp/wp.jpeg"; always = true; }
83 | ];
84 |
85 | menu = "bemenu-run -H 30 --tb '#6272a4' --tf '#f8f8f2' --fb '#282a36' --ff '#f8f8f2' --nb '#282a36' --nf '#6272a4' --hb '#44475a' --hf '#50fa7b' --sb '#44475a' --sf '#50fa7b' --scb '#282a36' --scf '#ff79c6'";
86 |
87 | input = {
88 | "12815:20550:USB_HID_GMMK_Pro" = {
89 | xkb_layout = "gb,us";
90 | xkb_variant = ",dvp";
91 | xkb_options = "caps:escape,compose:ralt,grp:ctrls_toggle";
92 | };
93 | "1133:49305:Logitech_G502_X" = {
94 | accel_profile = "flat";
95 | pointer_accel = "-0.8";
96 | };
97 | "1:1:AT_Translated_Set_2_keyboard" = {
98 | xkb_layout = "gb,us";
99 | xkb_variant = ",dvp";
100 | xkb_options = "caps:escape,compose:ralt,grp:ctrls_toggle";
101 | };
102 | };
103 |
104 | output.DP-1 = {
105 | allow_tearing = "yes";
106 | };
107 |
108 | # output.HEADLESS-1 = {
109 | # allow_tearing = "yes";
110 | # mode = "2560x1440@99.946Hz";
111 | # };
112 |
113 | modes =
114 | let
115 | inherit (config.wayland.windowManager.sway.config) modifier;
116 | in
117 | lib.mkOptionDefault
118 | {
119 | gaming = {
120 | "${modifier}+shift+g" = "exec '~/.config/sway/mode_default.sh'";
121 | "${modifier}+f" = "fullscreen toggle";
122 | "XF86AudioRaiseVolume" = "exec --no-startup-id 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ -l 1.0'";
123 | "XF86AudioLowerVolume" = "exec --no-startup-id 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- -l 1.0'";
124 | "XF86AudioMute" = "exec --no-startup-id 'kill -s USR1 $(ps -C gpu-screen-recorder)'";
125 | };
126 | };
127 |
128 | keybindings =
129 | let
130 | inherit (config.wayland.windowManager.sway.config) modifier;
131 | in
132 | lib.mkOptionDefault {
133 | "XF86AudioRaiseVolume" = "exec 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+ -l 1.0'";
134 | "XF86AudioLowerVolume" = "exec 'wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%- -l 1.0'";
135 | "XF86AudioMute" = "exec 'wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle'";
136 | "Print" = "exec 'mkdir -p ~/Downloads; FILENAME=\"screenshot-`date +%F-%T`\"; grim -g \"$(slurp)\" ~/Downloads/$FILENAME.png '";
137 | "${modifier}+Print" = "exec 'grim -g \"$(slurp -d)\" - | wl-copy";
138 | "${modifier}+period" = "exec 'playerctl -p ncspot next'";
139 | "${modifier}+comma" = "exec 'playerctl -p ncspot previous'";
140 | "${modifier}+shift+g" = "exec '~/.config/sway/mode_gaming.sh'";
141 | "${modifier}+o" = "exec 'swaymsg [app_id=\"obsidian\"] scratchpad show";
142 | "${modifier}+m" = "exec 'swaymsg [title=\"ncspot\"] scratchpad show";
143 | "${modifier}+shift+y" = "exec 'swaylock -f -c 000000'";
144 | };
145 |
146 | bars = [
147 | {
148 | colors = {
149 | statusline = "#ffffff";
150 | background = "#323232";
151 | inactiveWorkspace = { background = "#32323200"; border = "#32323200"; text = "#5c5c5c"; };
152 | };
153 | position = "top";
154 | command = "waybar";
155 | }
156 | ];
157 |
158 | assigns = {
159 | "1" = [{ app_id = "firefox-nightly"; }];
160 | "2" = [
161 | { app_id = "thunderbird"; }
162 | { app_id = "Slack"; }
163 | # { class = "steam"; }
164 | { app_id = "discord"; }
165 | ];
166 | # "5" = [{ app_id = "discord"; }];
167 | };
168 | workspaceOutputAssign =
169 | lib.mkMerge [
170 | (lib.mkIf (osConfig.networking.hostName == "desktop") [ ])
171 | (lib.mkIf (osConfig.networking.hostName != "desktop")
172 | [
173 | { output = "eDP-1"; workspace = "8"; }
174 | { output = "HDMI-A-1"; workspace = "1"; }
175 | { output = "HDMI-A-1"; workspace = "2"; }
176 | { output = "HDMI-A-1"; workspace = "3"; }
177 | { output = "HDMI-A-1"; workspace = "4"; }
178 | { output = "HDMI-A-1"; workspace = "5"; }
179 | { output = "HDMI-A-1"; workspace = "6"; }
180 | { output = "HDMI-A-1"; workspace = "7"; }
181 | { output = "HDMI-A-1"; workspace = "9"; }
182 | ]
183 |
184 | )
185 | ];
186 |
187 | window.titlebar = false;
188 | window.commands = [
189 | {
190 | command = "move scratchpad";
191 | criteria = {
192 | app_id = "obsidian";
193 | };
194 | }
195 | {
196 | command = "move scratchpad";
197 | criteria = {
198 | app_id = "Alacritty";
199 | title = "ncspot";
200 | };
201 | }
202 | ];
203 | };
204 | };
205 |
206 | services.kanshi = {
207 | enable = true;
208 | settings = [
209 | {
210 | profile.name = "undocked";
211 | profile.outputs = [
212 | { criteria = "eDP-1"; status = "enable"; mode = "1920x1200@59.999Hz"; }
213 | ];
214 | }
215 |
216 | {
217 | profile.name = "desktop";
218 | profile.outputs = [
219 | { criteria = "DP-1"; status = "enable"; adaptiveSync = true; mode = "2560x1440@143.973Hz"; }
220 | ];
221 | }
222 |
223 | {
224 | profile.name = "docked";
225 | profile.outputs = [
226 | { criteria = "eDP-1"; status = "enable"; mode = "1920x1200@59.999Hz"; }
227 | { criteria = "HDMI-A-1"; status = "enable"; adaptiveSync = true; mode = "2560x1440@99.946Hz"; }
228 | ];
229 | }
230 | ];
231 | };
232 |
233 | services.mako = {
234 | enable = true;
235 | defaultTimeout = 5000;
236 | ignoreTimeout = true;
237 | extraConfig = /*toml*/ ''
238 | background-color=#282a36
239 | text-color=#ffffff
240 | border-color=#282a36
241 |
242 | [urgency=low]
243 | border-color=#282a36
244 |
245 | [urgency=normal]
246 | border-color=#f1fa8c
247 |
248 | [urgency=high]
249 | border-color=#ff5555
250 | '';
251 | };
252 |
253 | programs.waybar = {
254 | enable = true;
255 | settings = {
256 | mainBar = {
257 | layer = "bottom";
258 | position = "top";
259 | height = 30;
260 | modules-left = [ "sway/workspaces" "sway/mode" ];
261 | modules-center = [ "custom/weather" "sway/window" ];
262 | modules-right = [
263 | "custom/media"
264 | "bluetooth"
265 | #"network"
266 | "cpu"
267 | "custom/gpu"
268 | "temperature"
269 | "sway/language"
270 | "battery"
271 | "pulseaudio"
272 | "tray"
273 | "clock#date"
274 | "clock#time"
275 | ];
276 |
277 | battery = {
278 | "interval" = 10;
279 | "states" = {
280 | "warning" = 30;
281 | "critical" = 15;
282 | };
283 | # Connected to AC
284 | "format" = " {icon} {capacity}%"; # Icon: bolt
285 | # Not connected to AC
286 | "format-discharging" = "{icon} {capacity}%";
287 | "format-icons" = [
288 | "" # Icon= battery-full
289 | "" # Icon= battery-three-quarters
290 | "" # Icon= battery-half
291 | "" # Icon= battery-quarter
292 | "" # Icon= battery-empty
293 | ];
294 | "tooltip" = true;
295 | };
296 | "clock#time" = {
297 | interval = 1;
298 | format = "{:%H:%M:%S}";
299 | tooltip = true;
300 | };
301 | "clock#date" = {
302 | interval = 10;
303 | format = " {:%e %b %Y}";
304 | # "tooltip-format" = "{:%e %B %Y}";
305 | "tooltip-format" = "{calendar}";
306 | };
307 | "cpu" = {
308 | interval = 5;
309 | format = " {usage}%";
310 | states = {
311 | warning = 70;
312 | critical = 90;
313 | };
314 | };
315 | #"custom/keyboard-layout" = {
316 | # exec = "swaymsg -t get_inputs | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4";
317 | # interval = 30;
318 | # format = " {}";
319 | # signal = 1;
320 | # tooltip = false;
321 | #};
322 | "sway/language" = {
323 | "format" = "{variant}";
324 | "on-click" = "swaymsg input type:keyboard xkb_switch_layout next";
325 | };
326 | memory = {
327 | interval = 5;
328 | format = " {}%";
329 | states = {
330 | warning = 70;
331 | critical = 90;
332 | };
333 | };
334 | network = {
335 | interval = 5;
336 | "format-wifi" = " {essid} ({signalStrength}%)";
337 | "format-ethernet" = " {ifname}: {ipaddr}/{cidr}";
338 | "format-disconnected" = "⚠ Disconnected";
339 | "tooltip-format" = "{ifname}: {ipaddr}";
340 |
341 | };
342 | "sway/mode" = {
343 | "format" = " {}";
344 | "tooltip" = false;
345 | };
346 | "sway/window" = {
347 | format = "{}";
348 | "max-length" = 120;
349 | };
350 | "sway/workspaces" = {
351 | "all-outputs" = false;
352 | "disable-scroll" = true;
353 | format = "{icon} {name}";
354 | "format-icons" = {
355 | "1" = ""; #/ FF logo
356 | "2" = "";
357 | "3" = "";
358 | "4" = "";
359 | "5" = "";
360 | "urgent" = "";
361 | "focused" = "";
362 | "default" = "";
363 | };
364 | };
365 | pulseaudio = {
366 | "scroll-step" = 2;
367 | "format" = "{icon} {volume}%";
368 | #"format-bluetooth"= "{icon} {volume}%";
369 | "format-muted" = "";
370 | "format-icons" = {
371 | "headphones" = "";
372 | "handsfree" = "";
373 | "headset" = "";
374 | "phone" = "";
375 | "portable" = "";
376 | "car" = "";
377 | "default" = [ "" "" ];
378 | };
379 | "on-click" = "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
380 | };
381 | temperature = {
382 | "critical-threshold" = 80;
383 | "interval" = 5;
384 | "format" = "{icon} {temperatureC}°C";
385 | "format-icons" = [
386 | "" #/ Icon: temperature-empty
387 | "" #/ Icon: temperature-quarter
388 | "" #/ Icon: temperature-half
389 | "" #/ Icon: temperature-three-quarters
390 | "" #/ Icon: temperature-full
391 | ];
392 | "tooltip" = true;
393 | };
394 | "tray" = {
395 | "icon-size" = 21;
396 | "spacing" = 10;
397 | };
398 |
399 | "custom/weather" = {
400 | "format" = "{}° ";
401 | "tooltip" = true;
402 | "interval" = 3600;
403 | "exec" = "wttrbar --location Bonn";
404 | "return-type" = "json";
405 | };
406 |
407 | "custom/gpu" = {
408 | "format" = "GPU {}°";
409 | "tooltip" = true;
410 | "interval" = 10;
411 | "exec" = "nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits";
412 | "return-type" = "csv";
413 | };
414 |
415 | "bluetooth" = {
416 | "format" = " {status}";
417 | "format-connected" = " {device_alias}";
418 | "format-connected-battery" = " {device_alias} {device_battery_percentage}%";
419 | #/ "format-device-preference": [ "device1", "device2" ], // preference list deciding the displayed device
420 | "tooltip-format" = "{controller_alias}\t{controller_address}\n\n{num_connections} connected";
421 | "tooltip-format-connectee" = "{controller_alias}\t{controller_address}\n\n{num_connections} connected\n\n{device_enumerate}";
422 | "tooltip-format-enumerate-connected" = "{device_alias}\t{device_address}";
423 | "tooltip-format-enumerate-connected-battery" = "{device_alias}\t{device_address}\t{device_battery_percentage}%";
424 | "on-click-right" = "rfkill toggle bluetooth";
425 | };
426 |
427 | "custom/media" = {
428 | "exec-if" = "pgrep spotify";
429 | "format" = "{icon} {}";
430 | "return-type" = "json";
431 | "smooth-scrolling-threshold" = 1;
432 | "on-scroll-up" = "playerctl -p ncspot next";
433 | "on-scroll-down" = "playerctl -p ncspot previous";
434 | "format-icons" = {
435 | "Playing" = "";
436 | "Paused" = "";
437 | };
438 | "max-length" = 30;
439 | "exec" = "playerctl -p ncspot -a metadata --format '{\"text\": \"{{markup_escape(title)}} - {{artist}}\", \"tooltip\": \"{{playerName}} : {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F";
440 | "on-click" = "playerctl -p ncspot play-pause";
441 | };
442 | };
443 |
444 | };
445 | style = /* css */ ''
446 | /* =============================================================================
447 | *
448 | * Waybar configuration
449 | *
450 | * Configuration reference: https://github.com/Alexays/Waybar/wiki/Configuration
451 | *
452 | * =========================================================================== */
453 |
454 | /* -----------------------------------------------------------------------------
455 | * Keyframes
456 | * -------------------------------------------------------------------------- */
457 |
458 | @keyframes blink-warning {
459 | 70% {
460 | color: white;
461 | }
462 |
463 | to {
464 | color: white;
465 | background-color: orange;
466 | }
467 | }
468 |
469 | @keyframes blink-critical {
470 | 70% {
471 | color: white;
472 | }
473 |
474 | to {
475 | color: white;
476 | background-color: red;
477 | }
478 | }
479 |
480 |
481 | /* -----------------------------------------------------------------------------
482 | * Base styles
483 | * -------------------------------------------------------------------------- */
484 |
485 | /* Reset all styles */
486 | * {
487 | border: none;
488 | border-radius: 0;
489 | min-height: 0;
490 | margin: 0;
491 | padding: 0;
492 | }
493 |
494 | /* The whole bar */
495 | #waybar {
496 | /* background: #323232; */
497 | background: @theme_base_color;
498 | /* color: white; */
499 | color: @theme_text_color;
500 | font-family: JetBrains Mono Nerd Font, Cantarell, Noto Sans, sans-serif;
501 | font-size: 13px;
502 | }
503 |
504 | /* Each module */
505 | #battery,
506 | #clock,
507 | #cpu,
508 | #custom-keyboard-layout,
509 | #memory,
510 | #custom-media
511 | #bluetooth,
512 | #mode,
513 | #network,
514 | #pulseaudio,
515 | #temperature,
516 | #tray {
517 | padding-left: 10px;
518 | padding-right: 10px;
519 | }
520 |
521 |
522 | /* -----------------------------------------------------------------------------
523 | * Module styles
524 | * -------------------------------------------------------------------------- */
525 |
526 | #battery {
527 | animation-timing-function: linear;
528 | animation-iteration-count: infinite;
529 | animation-direction: alternate;
530 | }
531 |
532 | #battery.warning {
533 | color: orange;
534 | }
535 |
536 | #battery.critical {
537 | color: red;
538 | }
539 |
540 | #battery.warning.discharging {
541 | animation-name: blink-warning;
542 | animation-duration: 3s;
543 | }
544 |
545 | #battery.critical.discharging {
546 | animation-name: blink-critical;
547 | animation-duration: 2s;
548 | }
549 |
550 | #clock {
551 | font-weight: bold;
552 | }
553 |
554 | #cpu {
555 | /* No styles */
556 | }
557 |
558 | #cpu.warning {
559 | color: orange;
560 | }
561 |
562 | #cpu.critical {
563 | color: red;
564 | }
565 |
566 | #memory {
567 | animation-timing-function: linear;
568 | animation-iteration-count: infinite;
569 | animation-direction: alternate;
570 | }
571 |
572 | #memory.warning {
573 | color: orange;
574 | }
575 |
576 | #memory.critical {
577 | color: red;
578 | animation-name: blink-critical;
579 | animation-duration: 2s;
580 | }
581 |
582 | #mode {
583 | background: #64727D;
584 | border-top: 2px solid white;
585 | /* To compensate for the top border and still have vertical centering */
586 | padding-bottom: 2px;
587 | }
588 |
589 | #network {
590 | /* No styles */
591 | }
592 |
593 | #network.disconnected {
594 | color: orange;
595 | }
596 |
597 | #pulseaudio {
598 | /* No styles */
599 | }
600 |
601 | #pulseaudio.muted {
602 | /* No styles */
603 | }
604 |
605 | #custom-media {
606 | color: rgb(102, 220, 105);
607 | padding-left: 20px;
608 | padding-right: 20px;
609 | }
610 |
611 | #temperature {
612 | /* No styles */
613 | }
614 |
615 | #temperature.critical {
616 | color: red;
617 | }
618 |
619 | #tray {
620 | /* No styles */
621 | }
622 |
623 | #window {
624 | font-weight: bold;
625 | }
626 |
627 | #workspaces button {
628 | border-top: 2px solid transparent;
629 | /* To compensate for the top border and still have vertical centering */
630 | padding-bottom: 2px;
631 | padding-left: 10px;
632 | padding-right: 10px;
633 | color: #888888;
634 | }
635 |
636 | #workspaces button.focused {
637 | border-color: #4c7899;
638 | color: white;
639 | background-color: #285577;
640 | }
641 |
642 | #workspaces button.urgent {
643 | border-color: #c9545d;
644 | color: #c9545d;
645 | }
646 | '';
647 |
648 | };
649 |
650 | home.file."./.config/sway/mode_gaming.sh" = {
651 | executable = true;
652 | text = ''
653 | #!/bin/sh
654 |
655 | swaymsg 'mode gaming'
656 | # setxkbmap -option -option caps:none
657 |
658 | game=$(swaymsg -t get_tree | jq '.. | select(.type?) | select(.focused==true) | .name')
659 |
660 | gpu-screen-recorder -w screen -f 60 -c mp4 -a "alsa_output.usb-Universal_Audio_Volt_1_23032036038581-00.analog-stereo.monitor" -r 30 -o "$HOME/Videos/replay/$game"
661 | '';
662 | };
663 |
664 | home.file."./.config/sway/mode_default.sh" = {
665 | executable = true;
666 | text = ''
667 | #!/bin/sh
668 | swaymsg 'mode default'
669 | # setxkbmap -option -option caps:escape
670 | pkill gpu-screen-reco
671 | '';
672 | };
673 |
674 |
675 | }
676 |
--------------------------------------------------------------------------------
/home/programs/tmux.nix:
--------------------------------------------------------------------------------
1 | { ... }:
2 | {
3 | programs.tmux = {
4 | enable = true;
5 | escapeTime = 10;
6 | baseIndex = 1;
7 | clock24 = true;
8 |
9 | keyMode = "vi";
10 | shell = "/home/kidsan/.nix-profile/bin/nu";
11 | terminal = "tmux-256color";
12 | extraConfig = ''
13 | set -g default-terminal "tmux-256color"
14 | set -g default-command "''${SHELL}"
15 | set -ag terminal-overrides ",*:Tc"
16 | set-environment -g COLORTERM "truecolor"
17 | bind C-p previous-window
18 | bind C-n next-window
19 | '';
20 | };
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/home/programs/vscode.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | programs.vscode = {
5 | enable = true;
6 | package = pkgs.vscodium;
7 | extensions = with pkgs.vscode-extensions; [
8 | rust-lang.rust-analyzer
9 | golang.go
10 | humao.rest-client
11 | jnoortheen.nix-ide
12 | eamodio.gitlens
13 | vadimcn.vscode-lldb
14 | vscodevim.vim
15 | ];
16 | enableUpdateCheck = true;
17 |
18 | userSettings = {
19 | editor = {
20 | formatOnSave = true;
21 | };
22 | debug = {
23 | allowBreakpointsEverywhere = true;
24 | };
25 | nix = {
26 | enableLanguageServer = true;
27 | serverPath = "nil";
28 | serverSettings = {
29 | nil = {
30 | diagnostics = {
31 | ignored = [ "unused_binding" "unused_with" "unused_rec" ];
32 | };
33 | formatting = {
34 | command = [ "nixpkgs-fmt" ];
35 | };
36 | };
37 | };
38 | };
39 | keyboard = {
40 | dispatch = "keyCode";
41 | };
42 | vim = {
43 | useSystemClipboard = true;
44 | };
45 | };
46 | };
47 | }
48 |
49 |
--------------------------------------------------------------------------------
/home/users/kidsan/common.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 | {
3 | # Let Home Manager install and manage itself.
4 | programs.home-manager.enable = true;
5 |
6 | # home.activation.report-changes = config.lib.dag.entryAnywhere ''
7 | # ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff $oldGenPath $newGenPath
8 | # '';
9 |
10 | home.username = "kidsan";
11 | home.homeDirectory = "/home/kidsan";
12 |
13 | home.sessionVariables = {
14 | EDITOR = "nvim";
15 | NIX_PATH = "nixpkgs=flake:nixpkgs$\{NIX_PATH:+:$NIX_PATH}";
16 | };
17 |
18 |
19 | xdg.mimeApps = {
20 | enable = true;
21 | defaultApplications = {
22 | "text/html" = [ "firefox.desktop" "chromium-browser.desktop" ];
23 | "x-scheme-handler/http " = [ " firefox.desktop" "chromium-browser.desktop" ];
24 | "x-scheme-handler/https" = [ "firefox.desktop" "chromium-browser.desktop" ];
25 | "x-scheme-handler/about" = [ "firefox.desktop" "chromium-browser.desktop" ];
26 | "x-scheme-handler/unknown" = [ "firefox.desktop" "chromium-browser.desktop" ];
27 | };
28 | };
29 |
30 | home.packages = with pkgs; [
31 | unzip
32 | spotify
33 | discord
34 | element-desktop
35 | nixpkgs-fmt
36 | jq
37 | weechat
38 | vlc
39 | signal-desktop
40 | obsidian
41 | btop
42 | ];
43 |
44 | imports = [
45 | ../../programs/alacritty.nix
46 | ../../programs/bash.nix
47 | ../../programs/direnv.nix
48 | ../../programs/firefox.nix
49 | ../../programs/fonts.nix
50 | ../../programs/git.nix
51 | ../../programs/neovim
52 | ../../programs/tmux.nix
53 | ../../programs/nushell.nix
54 | ../../programs/nix-flake-templates
55 | ];
56 |
57 | # restart homeage decrypt services on home-manager change
58 | systemd.user.startServices = "sd-switch";
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/home/users/kidsan/kidsan_desktop.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | home.stateVersion = "23.05";
5 | home.packages = with pkgs; [
6 | transcribe
7 | xdotool
8 | chromium
9 | r2modman
10 | remmina
11 | discordo
12 | blender
13 | ];
14 |
15 | imports = [
16 | ./common.nix
17 | ../../programs/easyeffects.nix
18 | ../../programs/sway.nix
19 | ];
20 |
21 | home.file.".config/sunshine/apps.json".text = builtins.toJSON {
22 | env = "/run/current-system/sw/bin";
23 | apps = [
24 | {
25 | name = "Desktop";
26 | image-path = "desktop.png";
27 | }
28 | {
29 | name = "Steam Big Picture";
30 | detached = [ "${pkgs.util-linux}/bin/setsid ${pkgs.steam}/bin/steam steam://open/bigpicture" ];
31 | output = "steam.txt";
32 | image-path = "steam.png";
33 | }
34 | {
35 | name = "Persona 5 Royal";
36 | detached = [ "${pkgs.util-linux}/bin/setsid ${pkgs.steam}/bin/steam steam://rungameid/1687950" ];
37 | }
38 | ];
39 |
40 | };
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/home/users/kidsan/kidsan_ihasa.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | home.stateVersion = "22.11";
5 |
6 | # Let Home Manager install and manage itself.
7 | programs.home-manager.enable = true;
8 |
9 | home.activation.report-changes = config.lib.dag.entryAnywhere ''
10 | ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff $oldGenPath $newGenPath
11 | '';
12 |
13 | home.username = "kidsan";
14 | home.homeDirectory = "/home/kidsan";
15 |
16 | home.sessionVariables = {
17 | EDITOR = "nvim";
18 | };
19 |
20 | home.packages = [
21 | pkgs.armcord
22 | ];
23 |
24 | imports = [
25 | ../../programs/bash.nix
26 | ../../programs/git.nix
27 | ../../programs/neovim
28 | ../../programs/sway.nix
29 | ../../programs/fonts.nix
30 | ../../programs/alacritty.nix
31 | ];
32 |
33 | wayland.windowManager.sway.config.modifier = lib.mkForce "Mod4";
34 | wayland.windowManager.sway.config.startup = lib.mkForce [];
35 | wayland.windowManager.sway.config.input = lib.mkForce {
36 | "1452:641:Apple_Internal_Keyboard_/_Trackpad" = {
37 | xkb_layout = "gb,us";
38 | xkb_variant = ",dvp";
39 | xkb_options = "caps:escape,compose:ralt,grp:ctrls_toggle";
40 | };
41 | };
42 | services.kanshi.enable = lib.mkForce false;
43 |
44 | wayland.windowManager.sway.extraConfig = ''
45 | output Unknown-1 scale 2
46 | '';
47 | }
48 |
--------------------------------------------------------------------------------
/home/users/kidsan/kidsan_thinkpad.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | home.stateVersion = "22.11";
5 |
6 | home.packages = with pkgs; [
7 | wttrbar
8 | ];
9 |
10 | imports = [
11 | ./common.nix
12 | ../../programs/sway.nix
13 | ../../programs/easyeffects.nix
14 | ];
15 |
16 | programs.ncspot = {
17 | enable = true;
18 | settings = {
19 | shuffle = true;
20 | gapless = true;
21 | };
22 | };
23 | }
24 |
--------------------------------------------------------------------------------
/home/users/lobster/home.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | # Let Home Manager install and manage itself.
5 | programs.home-manager.enable = true;
6 |
7 | home.username = "lobster";
8 | home.homeDirectory = "/home/lobster";
9 |
10 | home.stateVersion = "20.09";
11 |
12 | home.packages = with pkgs; [
13 |
14 | ];
15 |
16 | imports = [
17 | ../../programs/direnv.nix
18 | ../../programs/git.nix
19 | ];
20 |
21 | # restart homeage decrypt services on home-manager change
22 | systemd.user.startServices = "sd-switch";
23 | }
24 |
--------------------------------------------------------------------------------
/home/users/pachinko.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | home.stateVersion = "23.05";
5 | home.packages = with pkgs; [
6 | discordo
7 | vim
8 | curl
9 | git
10 | btop
11 | ];
12 |
13 | imports = [
14 | ../programs/git.nix
15 | ../programs/tmux.nix
16 | ../programs/nushell.nix
17 | ../programs/neovim
18 | ];
19 |
20 | # Let Home Manager install and manage itself.
21 | programs.home-manager.enable = true;
22 |
23 | home.activation.report-changes = config.lib.dag.entryAnywhere ''
24 | ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff $oldGenPath $newGenPath
25 | '';
26 |
27 | home.username = "kidsan";
28 | home.homeDirectory = "/home/kidsan";
29 |
30 | home.sessionVariables = {
31 | EDITOR = "nvim";
32 | NIX_PATH = "nixpkgs=flake:nixpkgs$\{NIX_PATH:+:$NIX_PATH}";
33 | };
34 |
35 | # restart homeage decrypt services on home-manager change
36 | systemd.user.startServices = "sd-switch";
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/nixos/base_pi.nix:
--------------------------------------------------------------------------------
1 | { config, libs, pkgs, ... }:
2 |
3 | {
4 | environment.systemPackages = with pkgs; [
5 | vim
6 | git
7 | ];
8 |
9 | system.stateVersion = "20.03";
10 | imports = [ ];
11 |
12 | boot = {
13 | loader.grub.enable = false;
14 | loader.generic-extlinux-compatible.enable = true;
15 | # kernelPackages = pkgs.linuxPackages_rpi4;
16 | initrd.availableKernelModules = [ "usbhid" "usb_storage" ];
17 | };
18 |
19 | console = {
20 | font = "Lat2-Terminus16";
21 | keyMap = "uk";
22 | };
23 |
24 | networking = {
25 | hostName = "newpi";
26 | useDHCP = false;
27 | interfaces.eth0.useDHCP = true;
28 | };
29 |
30 | # networking.networkmanager.enable = true;
31 |
32 | services.openssh = {
33 | enable = true;
34 | settings = {
35 | permitRootLogin = "yes";
36 | passwordAuthentication = false;
37 | };
38 | };
39 |
40 | systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
41 |
42 | users.users.lobster = {
43 | isNormalUser = true;
44 | home = "/home/lobster";
45 | extraGroups = [ "wheel" "networkmanager" "docker" ];
46 | openssh.authorizedKeys.keys = [
47 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKas9qjJOceFVG6IS3LgH1RL0EBNZ66LFeLrsOqT31IL kidsan@thinkpad"
48 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPkgNbqSgAdMEx/IaXFsGW6HlobqrsSnl7lanbdfMYaZ JuiceSSH"
49 | ];
50 | };
51 |
52 | # Required for the Wireless firmware
53 | hardware.enableRedistributableFirmware = true;
54 |
55 | nix = {
56 | settings = {
57 | auto-optimise-store = true;
58 | };
59 | gc = {
60 | automatic = true;
61 | dates = "weekly";
62 | options = "--delete-older-than 30d";
63 | };
64 | # Free up to 1GiB whenever there is less than 100MiB left.
65 | extraOptions = ''
66 | experimental-features = nix-command flakes
67 | min-free = ${toString (100 * 1024 * 1024)}
68 | max-free = ${toString (1024 * 1024 * 1024)}
69 | '';
70 | };
71 |
72 |
73 | }
74 |
--------------------------------------------------------------------------------
/nixos/desktop.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, ... }:
2 |
3 | {
4 | imports =
5 | [
6 | ./hardware/desktop.nix
7 | ./modules/impermanence/desktop.nix
8 | ./modules/common.nix
9 | ./modules/steam.nix
10 | ./modules/xdg.nix
11 | ./modules/sunshine.nix
12 | ./modules/alvr.nix
13 | ];
14 |
15 | environment = {
16 | pathsToLink = [
17 | "/share/bash-completion"
18 | ];
19 | shells = [
20 | pkgs.nushell
21 | ];
22 | systemPackages = [
23 | pkgs.cachix
24 | pkgs.curl
25 | pkgs.openssl
26 | pkgs.vim
27 | pkgs.jq
28 | pkgs.lm_sensors
29 | pkgs.xfce.thunar
30 | pkgs.qpwgraph
31 | ];
32 | };
33 |
34 | # Wayland stuff
35 | security.pam.services.swaylock = { }; # allows swaylock check if password is correct
36 | environment.sessionVariables.NIXOS_OZONE_WL = "1";
37 | environment.sessionVariables.DEFAULT_BROWSER = "${pkgs.firefox}/bin/firefox";
38 | security.pam.services.gpu-screen-recorder = { }; # allows swaylock check if password is correct
39 |
40 | boot = {
41 | binfmt.emulatedSystems = [ "aarch64-linux" "armv7l-linux" ];
42 | initrd = {
43 | checkJournalingFS = false;
44 | network = {
45 | enable = true;
46 | ssh = {
47 | enable = true;
48 | port = 2222;
49 | hostKeys = [ /persist/system/home/kidsan/other/ssh_host_ed25519_key ];
50 | authorizedKeys = [
51 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKas9qjJOceFVG6IS3LgH1RL0EBNZ66LFeLrsOqT31IL kidsan@thinkpad"
52 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPkgNbqSgAdMEx/IaXFsGW6HlobqrsSnl7lanbdfMYaZ JuiceSSH"
53 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMAhyQg3HIZZ+XcpmIEzNkmbMUQwXX2YyjX+RTYAY6cG u0_a191@localhost"
54 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDj31MXtyzN28GceFMNpvXoTioUl3r+aaw4CUQuvAUm/ kidsan@macbookair"
55 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfLqsgzH8AdYco3e1LbE+gkIIaey/h9QgJevlEC0i67"
56 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAUGx9cSW8Ot5r4xA+8HG0snCtKtBrhdbEQBCJ2/uQG1 kidsan@framework"
57 | ];
58 | };
59 | postCommands = ''
60 | zpool import -a
61 | echo "zfs load-key -a; killall zfs" >> /root/.profile
62 | '';
63 | };
64 | kernelModules = [ "r8169" ];
65 | postDeviceCommands = lib.mkAfter ''
66 | zfs rollback -r rpool/root/nixos@blank
67 | '';
68 |
69 | };
70 | kernel.sysctl."vm.max_map_count" = 2147483642;
71 | kernelModules = [ "coretemp" "nct6775" "r8169" ];
72 | loader = {
73 | grub = {
74 | # Use the GRUB 2 boot loader.
75 | enable = true;
76 | efiSupport = true;
77 | efiInstallAsRemovable = true;
78 | # Define on which hard drive you want to install Grub.
79 | device = "/dev/nvme0n1"; # or "nodev" for efi only
80 | };
81 | };
82 | supportedFilesystems = [ "zfs" ];
83 | zfs = {
84 | devNodes = "/dev/disk/by-partuuid"; # for vm usage
85 | package = pkgs.zfs_unstable;
86 | };
87 | };
88 | boot.initrd.systemd.suppressedUnits = [ "systemd-machine-id-commit.service" ];
89 | systemd.suppressedSystemUnits = [ "systemd-machine-id-commit.service" ];
90 |
91 | disko.devices = import ./modules/disko/desktop.nix {
92 | disks = [ "/dev/nvme0n1" "/dev/sda" "/dev/sdb" ];
93 | };
94 |
95 | hardware = {
96 | enableRedistributableFirmware = true;
97 | graphics.enable = true;
98 | graphics.extraPackages = [
99 | pkgs.vulkan-validation-layers
100 |
101 | ];
102 | nvidia = {
103 | modesetting.enable = true;
104 | nvidiaSettings = true;
105 | open = false;
106 | powerManagement.enable = false;
107 | package = config.boot.kernelPackages.nvidiaPackages.beta;
108 | };
109 | };
110 | systemd.services.systemd-suspend.environment.SYSTEMD_SLEEP_FREEZE_USER_SESSIONS = "false"; # fix suspend when nvidia hardware
111 |
112 | networking.hostId = "e39fd16b";
113 | networking.hostName = "desktop";
114 | networking.useDHCP = true;
115 | networking.interfaces.enp42s0.wakeOnLan = {
116 | enable = true;
117 | policy = [ "magic" ];
118 | };
119 |
120 | programs.dconf.enable = true;
121 |
122 | services = {
123 | printing.enable = true;
124 | xserver.videoDrivers = [ "nvidia" ];
125 | zfs.autoScrub.enable = true;
126 | zfs.autoSnapshot.enable = true;
127 | };
128 |
129 |
130 | # This value determines the NixOS release from which the default
131 | # settings for stateful data, like file locations and database versions
132 | # on your system were taken. It‘s perfectly fine and recommended to leave
133 | # this value at the release version of the first install of this system.
134 | # Before changing this value read the documentation for this option
135 | # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
136 | system.stateVersion = "23.05"; # Did you read the comment?
137 |
138 | users = {
139 | mutableUsers = false;
140 | users.kidsan = {
141 | extraGroups = [ "dialout" ];
142 | shell = pkgs.nushell;
143 | hashedPasswordFile = "/persist/passwords/kidsan";
144 | };
145 | };
146 |
147 | virtualisation.docker.enable = true;
148 | hardware.nvidia-container-toolkit.enable = true;
149 | programs.nix-ld.enable = true;
150 | programs.nix-ld.libraries = with pkgs; [ ];
151 |
152 | services.gitea-actions-runner = {
153 | package = pkgs.forgejo-runner;
154 | instances = {
155 | desktop = {
156 | enable = true;
157 | token = "KBxpGnOLRY9uH0yFRKLgEl5wnJIKg6aYCLzUtonV";
158 | url = "https://git.home";
159 | name = "desktop";
160 | settings = {
161 | runner.insecure = true;
162 | };
163 | hostPackages = [
164 | pkgs.bash
165 | pkgs.coreutils
166 | pkgs.curl
167 | pkgs.gawk
168 | pkgs.gitMinimal
169 | pkgs.gnused
170 | pkgs.nodejs
171 | pkgs.wget
172 | pkgs.nix
173 | ];
174 | labels = [
175 | # provide a debian base with nodejs for actions
176 | "debian-latest:docker://node:18-bullseye"
177 | # fake the ubuntu name, because node provides no ubuntu builds
178 | "ubuntu-latest:docker://node:18-bullseye"
179 | # provide native execution on the host
180 | "native:host"
181 | "nix:docker://nixos/nix"
182 | ];
183 | };
184 | };
185 | };
186 |
187 | programs.obs-studio.enable = true;
188 | programs.obs-studio.plugins = [ pkgs.obs-studio-plugins.wlrobs pkgs.obs-studio-plugins.obs-pipewire-audio-capture ];
189 |
190 | }
191 |
192 |
193 |
--------------------------------------------------------------------------------
/nixos/hardware/desktop.nix:
--------------------------------------------------------------------------------
1 | # Do not modify this file! It was generated by ‘nixos-generate-config’
2 | # and may be overwritten by future invocations. Please make changes
3 | # to /etc/nixos/configuration.nix instead.
4 | { config, lib, pkgs, modulesPath, ... }:
5 |
6 | {
7 | imports =
8 | [ (modulesPath + "/installer/scan/not-detected.nix")
9 | ];
10 |
11 | boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
12 | boot.initrd.kernelModules = [ ];
13 | boot.kernelModules = [ "kvm-amd" ];
14 | boot.extraModulePackages = [ ];
15 |
16 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
17 | # (the default) this is the recommended approach. When using systemd-networkd it's
18 | # still possible to use this option, but it's recommended to use it in conjunction
19 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`.
20 | networking.useDHCP = lib.mkDefault true;
21 | # networking.interfaces.enp42s0.useDHCP = lib.mkDefault true;
22 |
23 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
24 | hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
25 | }
26 |
--------------------------------------------------------------------------------
/nixos/hardware/ihasa.nix:
--------------------------------------------------------------------------------
1 | # Do not modify this file! It was generated by ‘nixos-generate-config’
2 | # and may be overwritten by future invocations. Please make changes
3 | # to /etc/nixos/configuration.nix instead.
4 | { config, lib, pkgs, modulesPath, ... }:
5 |
6 | {
7 | imports =
8 | [ (modulesPath + "/installer/scan/not-detected.nix")
9 | ];
10 |
11 | boot.initrd.availableKernelModules = [ "usb_storage" ];
12 | boot.initrd.kernelModules = [ ];
13 | boot.kernelModules = [ ];
14 | boot.extraModulePackages = [ ];
15 |
16 | fileSystems."/" =
17 | { device = "/dev/disk/by-uuid/88d505f1-2c45-43d4-b460-59634211e095";
18 | fsType = "ext4";
19 | };
20 |
21 | fileSystems."/boot" =
22 | { device = "/dev/disk/by-uuid/3450-1E1F";
23 | fsType = "vfat";
24 | };
25 |
26 | swapDevices = [ ];
27 |
28 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
29 | # (the default) this is the recommended approach. When using systemd-networkd it's
30 | # still possible to use this option, but it's recommended to use it in conjunction
31 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`.
32 | networking.useDHCP = lib.mkDefault true;
33 | # networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
34 |
35 | nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
36 | powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
37 | }
38 |
--------------------------------------------------------------------------------
/nixos/hardware/monster.nix:
--------------------------------------------------------------------------------
1 | # Do not modify this file! It was generated by ‘nixos-generate-config’
2 | # and may be overwritten by future invocations. Please make changes
3 | # to /etc/nixos/configuration.nix instead.
4 | { config, lib, pkgs, modulesPath, ... }:
5 |
6 | {
7 | imports =
8 | [
9 | (modulesPath + "/installer/scan/not-detected.nix")
10 | ];
11 |
12 | boot.initrd.availableKernelModules = [ "xhci_pci" ];
13 | boot.initrd.kernelModules = [ ];
14 | boot.kernelModules = [ ];
15 | boot.extraModulePackages = [ ];
16 |
17 | fileSystems."/" =
18 | {
19 | device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
20 | fsType = "ext4";
21 | };
22 |
23 | swapDevices = [ ];
24 |
25 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
26 | # (the default) this is the recommended approach. When using systemd-networkd it's
27 | # still possible to use this option, but it's recommended to use it in conjunction
28 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`.
29 | networking.useDHCP = lib.mkDefault true;
30 | # networking.interfaces.eth0.useDHCP = lib.mkDefault true;
31 | # networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
32 |
33 | powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
34 | }
35 |
--------------------------------------------------------------------------------
/nixos/hardware/pachinko.nix:
--------------------------------------------------------------------------------
1 | # Do not modify this file! It was generated by ‘nixos-generate-config’
2 | # and may be overwritten by future invocations. Please make changes
3 | # to /etc/nixos/configuration.nix instead.
4 | { config, lib, pkgs, modulesPath, ... }:
5 |
6 | {
7 | imports =
8 | [ (modulesPath + "/installer/scan/not-detected.nix")
9 | ];
10 |
11 | boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
12 | boot.initrd.kernelModules = [ ];
13 | boot.kernelModules = [ "kvm-intel" ];
14 | boot.extraModulePackages = [ ];
15 |
16 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
17 | # (the default) this is the recommended approach. When using systemd-networkd it's
18 | # still possible to use this option, but it's recommended to use it in conjunction
19 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`.
20 | networking.useDHCP = lib.mkDefault true;
21 | # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
22 | # networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
23 |
24 | nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
25 | hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
26 | }
27 |
--------------------------------------------------------------------------------
/nixos/hardware/thinkpad.nix:
--------------------------------------------------------------------------------
1 | # Do not modify this file! It was generated by ‘nixos-generate-config’
2 | # and may be overwritten by future invocations. Please make changes
3 | # to /etc/nixos/configuration.nix instead.
4 | { config, lib, pkgs, modulesPath, ... }:
5 |
6 | {
7 | imports =
8 | [
9 | (modulesPath + "/installer/scan/not-detected.nix")
10 | ];
11 |
12 | boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ];
13 | boot.initrd.kernelModules = [ ];
14 | boot.kernelModules = [ "kvm-amd" ];
15 | boot.extraModulePackages = [ ];
16 |
17 | fileSystems."/" =
18 | {
19 | device = "/dev/disk/by-uuid/61b06253-6695-48a3-94c9-e27f6afad820";
20 | fsType = "ext4";
21 | };
22 |
23 | boot.initrd.luks.devices."luks-4d4c520a-f5af-4102-b866-d3695dc810ee".device = "/dev/disk/by-uuid/4d4c520a-f5af-4102-b866-d3695dc810ee";
24 |
25 | fileSystems."/boot/efi" =
26 | {
27 | device = "/dev/disk/by-uuid/5AA2-36E5";
28 | fsType = "vfat";
29 | };
30 |
31 | swapDevices =
32 | [{ device = "/dev/disk/by-uuid/a2d53ef7-f474-439f-a868-8289ece32d3b"; }];
33 |
34 | # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
35 | # (the default) this is the recommended approach. When using systemd-networkd it's
36 | # still possible to use this option, but it's recommended to use it in conjunction
37 | # with explicit per-interface declarations with `networking.interfaces..useDHCP`.
38 | networking.useDHCP = lib.mkDefault true;
39 | # networking.interfaces.enp2s0f0.useDHCP = lib.mkDefault true;
40 | # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
41 | # networking.interfaces.wwan0.useDHCP = lib.mkDefault true;
42 |
43 | hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/nixos/ihasa.nix:
--------------------------------------------------------------------------------
1 | # Edit this configuration file to define what should be installed on
2 | # your system. Help is available in the configuration.nix(5) man page
3 | # and in the NixOS manual (accessible by running `nixos-help`).
4 |
5 | { config, lib, pkgs, ... }:
6 |
7 | {
8 | imports =
9 | [
10 | # Include the results of the hardware scan.
11 | ./hardware/ihasa.nix
12 | #
13 | ];
14 |
15 | # Use the systemd-boot EFI boot loader.
16 | boot.loader.systemd-boot.enable = true;
17 | boot.loader.efi.canTouchEfiVariables = false;
18 | #hardware.asahi.pkgsSystem = "x86_64-linux";
19 | # hardware.asahi.peripheralFirmwareDirectory = ../asahi/firmware;
20 | hardware.asahi.addEdgeKernelConfig = false;
21 | hardware.asahi.use4KPages = false;
22 | networking.hostName = "ihasa"; # Define your hostname.
23 | # Pick only one of the below networking options.
24 | # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
25 | networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
26 |
27 | # Set your time zone.
28 | # time.timeZone = "Europe/Amsterdam";
29 |
30 | # Configure network proxy if necessary
31 | # networking.proxy.default = "http://user:password@proxy:port/";
32 | # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
33 |
34 | # Select internationalisation properties.
35 | # i18n.defaultLocale = "en_US.UTF-8";
36 | # console = {
37 | # font = "Lat2-Terminus16";
38 | # keyMap = "us";
39 | # useXkbConfig = true; # use xkbOptions in tty.
40 | # };
41 |
42 | # Enable the X11 windowing system.
43 | #services.xserver.enable = true;
44 | #services.xserver.displayManager.sddm.enable = true;
45 | #services.xserver.desktopManager.plasma5.enable = true;
46 |
47 |
48 |
49 |
50 | # Configure keymap in X11
51 | # services.xserver.layout = "us";
52 | # services.xserver.xkbOptions = "eurosign:e,caps:escape";
53 |
54 | # Enable CUPS to print documents.
55 | # services.printing.enable = true;
56 |
57 | # Enable sound.
58 | # sound.enable = true;
59 | # hardware.pulseaudio.enable = true;
60 |
61 | # Enable touchpad support (enabled default in most desktopManager).
62 | # services.xserver.libinput.enable = true;
63 |
64 | # Define a user account. Don't forget to set a password with ‘passwd’.
65 | # users.users.alice = {
66 | # isNormalUser = true;
67 | # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
68 | # packages = with pkgs; [
69 | # firefox
70 | # tree
71 | # ];
72 | # };
73 |
74 | # List packages installed in system profile. To search, run:
75 | # $ nix search wget
76 | environment.systemPackages = with pkgs; [
77 | vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
78 | git
79 | firefox
80 | xfce.thunar
81 | xfce.thunar-volman
82 | ];
83 |
84 | # Some programs need SUID wrappers, can be configured further or are
85 | # started in user sessions.
86 | # programs.mtr.enable = true;
87 | # programs.gnupg.agent = {
88 | # enable = true;
89 | # enableSSHSupport = true;
90 | # };
91 |
92 | # List services that you want to enable:
93 |
94 | # Enable the OpenSSH daemon.
95 | # services.openssh.enable = true;
96 |
97 | # Open ports in the firewall.
98 | # networking.firewall.allowedTCPPorts = [ ... ];
99 | # networking.firewall.allowedUDPPorts = [ ... ];
100 | # Or disable the firewall altogether.
101 | # networking.firewall.enable = false;
102 |
103 | # Copy the NixOS configuration file and link it from the resulting system
104 | # (/run/current-system/configuration.nix). This is useful in case you
105 | # accidentally delete configuration.nix.
106 | # system.copySystemConfiguration = true;
107 |
108 | # This value determines the NixOS release from which the default
109 | # settings for stateful data, like file locations and database versions
110 | # on your system were taken. It's perfectly fine and recommended to leave
111 | # this value at the release version of the first install of this system.
112 | # Before changing this value read the documentation for this option
113 | # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
114 | system.stateVersion = "23.11"; # Did you read the comment?
115 | services.pipewire = {
116 | enable = true;
117 | alsa.enable = true;
118 | pulse.enable = true;
119 | };
120 | programs.dconf.enable = true;
121 |
122 | services.tlp.enable = true;
123 |
124 | security.polkit.enable = true;
125 | services.dbus.enable = true;
126 | xdg.portal = {
127 | enable = true;
128 | wlr.enable = true;
129 | extraPortals = [pkgs.xdg-desktop-portal-gtk];
130 | };
131 | hardware.opengl.enable = true;
132 | }
133 |
134 |
--------------------------------------------------------------------------------
/nixos/modules/adguard.nix:
--------------------------------------------------------------------------------
1 | {...}: {
2 |
3 | networking.networkmanager.insertNameservers = [ "192.168.2.133" ];
4 | networking.firewall.allowedTCPPorts = [ 67 ];
5 | networking.firewall.allowedUDPPorts = [ 53 67 ];
6 | services.adguardhome = {
7 | enable = true;
8 | openFirewall = true;
9 | allowDHCP = true;
10 | port = 8080;
11 | };
12 | }
13 |
--------------------------------------------------------------------------------
/nixos/modules/alvr.nix:
--------------------------------------------------------------------------------
1 | { ... }:
2 | {
3 | programs.alvr.enable = true;
4 | programs.alvr.openFirewall = true;
5 | }
6 |
--------------------------------------------------------------------------------
/nixos/modules/caddy.nix:
--------------------------------------------------------------------------------
1 | {...}: {
2 |
3 | networking.firewall.allowedTCPPorts = [ 80 443 ];
4 |
5 | services.caddy = {
6 | enable = true;
7 | virtualHosts = {
8 | "adguard.home" = {
9 | serverAliases = [ "www.adguard.home" ];
10 | extraConfig = ''
11 | reverse_proxy localhost:8080
12 | tls internal
13 | '';
14 | };
15 | "http://ha.home" = {
16 | serverAliases = [ "http://www.ha.home" ];
17 | extraConfig = ''
18 | reverse_proxy localhost:8123
19 | # tls internal
20 | '';
21 | };
22 |
23 | "zwave.home" = {
24 | serverAliases = [ "www.zwave.home" ];
25 | extraConfig = ''
26 | reverse_proxy localhost:8091
27 | tls internal
28 | '';
29 | };
30 |
31 | "znc.home" = {
32 | serverAliases = [ "www.znc.home" ];
33 | extraConfig = ''
34 | reverse_proxy localhost:5000
35 | tls internal
36 | '';
37 | };
38 |
39 | "rss.home" = {
40 | serverAliases = [ "www.rss.home" ];
41 | extraConfig = ''
42 | root * /var/lib/tt-rss/www
43 | file_server
44 | php_fastcgi unix//run/phpfpm/tt-rss.sock
45 | tls internal
46 | '';
47 | };
48 |
49 | "git.home" = {
50 | serverAliases = [ "www.git.home" ];
51 | extraConfig = ''
52 | tls internal
53 | reverse_proxy localhost:3333
54 | '';
55 | };
56 |
57 | "grafana.home" = {
58 | serverAliases = [ "www.grafana.home" ];
59 | extraConfig = ''
60 | tls internal
61 | reverse_proxy localhost:3000
62 | '';
63 | };
64 |
65 | "http://audiobookshelf.home" = {
66 | serverAliases = [ "http://www.audiobookshelf.home" ];
67 | extraConfig = ''
68 | encode zstd gzip
69 | reverse_proxy localhost:8724
70 | '';
71 | };
72 |
73 | "pachinko.taila4d46.ts.net" = {
74 | serverAliases = [ "https://pachinko.taila4d46.ts.net" ];
75 | extraConfig = ''
76 | encode zstd gzip
77 | reverse_proxy localhost:8724
78 | '';
79 | };
80 |
81 | "http://calibre.home" = {
82 | serverAliases = [ "http://www.calibre.home" ];
83 | extraConfig = ''
84 | encode zstd gzip
85 | reverse_proxy localhost:8725
86 | '';
87 | };
88 | };
89 |
90 | };
91 | }
92 |
--------------------------------------------------------------------------------
/nixos/modules/common.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | {
3 | environment.systemPackages = [
4 | pkgs.ffmpeg
5 | ];
6 |
7 | services.avahi = {
8 | enable = true;
9 | nssmdns4 = true;
10 | openFirewall = true;
11 | };
12 | hardware.sane = {
13 | enable = true;
14 | };
15 |
16 | programs.git = {
17 | enable = true;
18 | config = {
19 | http = {
20 | "https://git.home" = {
21 | sslVerify = false;
22 | };
23 | };
24 | };
25 |
26 | };
27 |
28 |
29 | security.polkit.enable = true;
30 |
31 | system.activationScripts.diff = ''
32 | ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig"
33 | '';
34 |
35 | programs.kdeconnect.enable = true;
36 |
37 | imports = [
38 | ./ssh.nix
39 | ./user.nix
40 | ./fonts.nix
41 | ./locale.nix
42 | ./thunar.nix
43 | ./pipewire.nix
44 | ./tailscale.nix
45 | ./nix-options.nix
46 | ./linux-kernel.nix
47 | ./upgrades.nix
48 | ];
49 | }
50 |
--------------------------------------------------------------------------------
/nixos/modules/disko/desktop.nix:
--------------------------------------------------------------------------------
1 | { disks, ... }: {
2 | disk = {
3 | x = {
4 | type = "disk";
5 | device = "/dev/nvme0n1";
6 | content = {
7 | type = "gpt";
8 | partitions = {
9 | GRUB = {
10 | size = "1M";
11 | type = "EF02";
12 | };
13 | ESP = {
14 | size = "1G";
15 | type = "EA00";
16 | content = {
17 | type = "filesystem";
18 | format = "vfat";
19 | mountpoint = "/boot";
20 | };
21 | };
22 | zfs = {
23 | end = "-16G";
24 | content = {
25 | type = "zfs";
26 | pool = "rpool";
27 | };
28 | };
29 | swap = {
30 | size = "100%";
31 | content = {
32 | type = "swap";
33 | randomEncryption = true;
34 | resumeDevice = true;
35 | };
36 | };
37 | };
38 | };
39 | };
40 | y = {
41 | type = "disk";
42 | device = "/dev/sda";
43 | content = {
44 | type = "gpt";
45 | partitions = {
46 | mdadm = {
47 | size = "100%";
48 | content = {
49 | type = "mdraid";
50 | name = "raid0";
51 | };
52 | };
53 | };
54 | };
55 | };
56 | z = {
57 | type = "disk";
58 | device = "/dev/sdb";
59 | content = {
60 | type = "gpt";
61 | partitions = {
62 | mdadm = {
63 | size = "100%";
64 | content = {
65 | type = "mdraid";
66 | name = "raid0";
67 | };
68 | };
69 | };
70 | };
71 | };
72 | };
73 | mdadm = {
74 | "raid0" = {
75 | type = "mdadm";
76 | level = 0;
77 | content = {
78 | type = "gpt";
79 | partitions = {
80 | primary = {
81 | size = "100%";
82 | content = {
83 | type = "zfs";
84 | pool = "rpool";
85 | };
86 | };
87 | };
88 | };
89 | };
90 | };
91 | zpool = {
92 | rpool = {
93 | type = "zpool";
94 | rootFsOptions = {
95 | compression = "zstd";
96 | };
97 |
98 | datasets = {
99 | "root" = {
100 | type = "zfs_fs";
101 | options.mountpoint = "none";
102 | options.encryption = "aes-256-gcm";
103 | options.keyformat = "passphrase";
104 | options.keylocation = "file:///tmp/secret.key";
105 | postCreateHook = ''
106 | zfs set keylocation="prompt" "rpool/$name";
107 | '';
108 | };
109 | "root/nixos" = {
110 | type = "zfs_fs";
111 | options.mountpoint = "legacy";
112 | mountpoint = "/";
113 | postCreateHook = ''
114 | zfs snapshot rpool/root/nixos@blank;
115 | '';
116 | };
117 | "root/nix" = {
118 | mountpoint = "/nix";
119 | type = "zfs_fs";
120 | options.mountpoint = "legacy";
121 | };
122 | "root/persist" = {
123 | mountpoint = "/persist";
124 | type = "zfs_fs";
125 | options.mountpoint = "legacy";
126 | };
127 | };
128 | };
129 | };
130 | }
131 |
132 |
--------------------------------------------------------------------------------
/nixos/modules/disko/pachinko.nix:
--------------------------------------------------------------------------------
1 | # USAGE in your configuration.nix.
2 | # Update devices to match your hardware.
3 | # {
4 | # imports = [ ./disko-config.nix ];
5 | # disko.devices.disk.main.device = "/dev/sda";
6 | # }
7 | {
8 | disko.devices = {
9 | disk = {
10 | main = {
11 | type = "disk";
12 | device = "/dev/nvme0n1";
13 | content = {
14 | type = "gpt";
15 | partitions = {
16 | boot = {
17 | size = "1M";
18 | type = "EF02"; # for grub MBR
19 | };
20 | ESP = {
21 | size = "1G";
22 | type = "EF00";
23 | content = {
24 | type = "filesystem";
25 | format = "vfat";
26 | mountpoint = "/boot";
27 | };
28 | };
29 | root = {
30 | size = "100%";
31 | content = {
32 | type = "filesystem";
33 | format = "ext4";
34 | mountpoint = "/";
35 | };
36 | };
37 | };
38 | };
39 | };
40 | };
41 | };
42 | }
43 |
--------------------------------------------------------------------------------
/nixos/modules/fonts.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | fonts.fontDir.enable = true;
5 | fonts.packages = with pkgs; [
6 | noto-fonts
7 | noto-fonts-cjk-sans
8 | noto-fonts-emoji
9 | font-awesome # installed for waybar icons
10 | # (nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
11 | nerd-fonts.jetbrains-mono
12 | ];
13 | }
14 |
--------------------------------------------------------------------------------
/nixos/modules/forgejo.nix:
--------------------------------------------------------------------------------
1 | { pkgs, inputs, ... }: {
2 |
3 | services.forgejo = {
4 | enable = true;
5 | package = inputs.nixpkgs.legacyPackages.${pkgs.system}.forgejo;
6 | dump = {
7 | enable = true;
8 | type = "tar.gz";
9 | backupDir = "/auto/forgejo_backups/";
10 | interval = "hourly";
11 | };
12 | settings = {
13 | server.ROOT_URL = "https://git.home";
14 | server.DOMAIN = "git.home";
15 | server.SSH_PORT = 22;
16 | server.HTTP_PORT = 3333;
17 | };
18 | };
19 |
20 |
21 | services.autofs = {
22 | enable = true;
23 | debug = false;
24 | autoMaster = ''
25 | /auto /etc/auto.Nextcloud.mount
26 | '';
27 | };
28 |
29 | # find /auto/forgejo_backups/ -maxdepth 1 -mtime 1 -type f -delete
30 |
31 | systemd.services.removeOldForgejoBackups = {
32 | script = "find /auto/forgejo_backups/ -maxdepth 1 -mtime 14 -type f -delete"; # remove older than 14 days
33 | serviceConfig = {
34 | Type = "oneshot";
35 | };
36 | };
37 |
38 | systemd.timers.removeOldForgejoBackups = {
39 | timerConfig = {
40 | OnCalendar = "Daily";
41 | Persistent = "true";
42 | };
43 | wantedBy = [ "multi-user.target" ];
44 | };
45 |
46 |
47 | services.gitea-actions-runner = {
48 | package = pkgs.forgejo-runner;
49 | instances = {
50 | test = {
51 | enable = true;
52 | token = "KBxpGnOLRY9uH0yFRKLgEl5wnJIKg6aYCLzUtonV";
53 | url = "http://192.168.2.133:3333";
54 | name = "local";
55 | hostPackages = [
56 | pkgs.bash
57 | pkgs.coreutils
58 | pkgs.curl
59 | pkgs.gawk
60 | pkgs.gitMinimal
61 | pkgs.gnused
62 | pkgs.nodejs
63 | pkgs.wget
64 | pkgs.nix
65 | ];
66 | labels = [
67 | # provide a debian base with nodejs for actions
68 | "debian-latest:docker://node:18-bullseye"
69 | # fake the ubuntu name, because node provides no ubuntu builds
70 | "ubuntu-latest:docker://node:18-bullseye"
71 | # provide native execution on the host
72 | "native:host"
73 | ];
74 | };
75 | };
76 | };
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/nixos/modules/grafana.nix:
--------------------------------------------------------------------------------
1 | { config, lib, ... }:
2 | {
3 | services.grafana = {
4 | enable = true;
5 | settings = {
6 | security = {
7 | admin_user = "admin";
8 | admin_password = lib.mkForce "$__file{${config.age.secrets.grafana_admin_password.path}}";
9 | };
10 | };
11 | };
12 |
13 | services.prometheus = {
14 | enable = true;
15 | remoteWrite = [{
16 | url = "https://prometheus-prod-24-prod-eu-west-2.grafana.net/api/prom/push";
17 | basic_auth = {
18 | username = "1571875";
19 | password_file = config.age.secrets.prometheus_push_password.path;
20 | };
21 | }];
22 | scrapeConfigs = [{
23 | job_name = "node";
24 | static_configs = [{
25 | targets = [ "localhost:9100" ];
26 | }];
27 | }];
28 | exporters = {
29 | node.enable = true;
30 | node.enabledCollectors = [ "systemd" "processes" ];
31 | };
32 | };
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/nixos/modules/home-assistant.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, ... }:
2 | {
3 |
4 | # services.home-assistant = {
5 | # enable = true;
6 | # extraComponents = [
7 | # "person"
8 | # # "image"
9 | # "onboarding"
10 | # "frontend"
11 | # "cloud"
12 | # "samsungtv"
13 | # ];
14 | # package = (pkgs.home-assistant).overrideAttrs (oldAttrs: { doInstallCheck = false; });
15 | # config = {
16 | # default_config = { };
17 | # frontend = { };
18 | # config = { };
19 | # mobile_app = { };
20 | # backup = { };
21 | # zwave_js = { };
22 | # automation = "!include automations.yaml";
23 | # intent_script = {
24 | # TurnOnTree = {
25 | # speech.text = "Turned on the Tree";
26 | # action = {
27 | # service = "switch.turn_on";
28 | # target.device_id = "f6e0a0e09447e0f32cdc0b27b25338dc";
29 | # };
30 | # };
31 | # TurnOffTree = {
32 | # speech.text = "Turned off the Tree";
33 | # action = {
34 | # service = "switch.turn_off";
35 | # target.device_id = "f6e0a0e09447e0f32cdc0b27b25338dc";
36 | # };
37 | # };
38 | # };
39 | # conversation = {
40 | # intents = {
41 | # TurnOnTree = [ "Turn on the tree" ];
42 | # TurnOffTree = [ "Turn off the tree" ];
43 | # };
44 | # };
45 | # };
46 | # configWritable = true;
47 | # openFirewall = true;
48 | # };
49 |
50 | networking.firewall.allowedTCPPorts = [ 67 68 80 443 2222 ];
51 | networking.firewall.allowedUDPPorts = [ 53 67 ];
52 | networking.networkmanager.insertNameservers = [ "192.168.2.133" ];
53 | virtualisation.oci-containers = {
54 | containers.home-assistant = {
55 | volumes = [ "/etc/home-assistant:/config" ];
56 | image = "ghcr.io/home-assistant/home-assistant:stable";
57 | autoStart = true;
58 | ports = [
59 | "8123:8123"
60 | ];
61 | extraOptions = [
62 | #"--network=host"
63 | #"--restart-unless-stopped"
64 | "--privileged"
65 | ];
66 | };
67 |
68 | };
69 |
70 |
71 | }
72 |
73 |
--------------------------------------------------------------------------------
/nixos/modules/homelab.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, ... }:
2 | {
3 | imports = [
4 | ./home-assistant.nix
5 | ./unbound.nix
6 | ./caddy.nix
7 | ./adguard.nix
8 | ./zwave_ui.nix
9 | ./znc.nix
10 | ./forgejo.nix
11 | ./sponsorblock.nix
12 | ./ttrss.nix
13 | ./grafana.nix
14 | ];
15 |
16 | services.audiobookshelf = {
17 | enable = true;
18 | port = 8724;
19 | };
20 |
21 | services.calibre-server.enable = true;
22 | services.calibre-server.port = 8725;
23 | services.calibre-server.extraFlags = [
24 | "--enable-local-write"
25 | ];
26 | }
27 |
--------------------------------------------------------------------------------
/nixos/modules/i3.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | {
3 | environment.systemPackages = [
4 | pkgs.xautolock
5 | pkgs.lm_sensors
6 | pkgs.i3blocks
7 | ];
8 | environment.xfce.excludePackages = [
9 | pkgs.xfce.xfce4-power-manager
10 | ];
11 | programs.i3lock = {
12 | enable = true;
13 | u2fSupport = true;
14 | };
15 |
16 | services = {
17 | libinput = {
18 | enable = true;
19 | mouse = {
20 | accelSpeed = "-0.8";
21 | accelProfile = "flat";
22 | };
23 | };
24 | };
25 | services.xserver = {
26 | enable = true;
27 | excludePackages = with pkgs; [ xterm ];
28 | xkb = {
29 | layout = "gb,us";
30 | variant = ",dvp";
31 | options = "caps:escape,compose:ralt,grp:ctrls_toggle";
32 | };
33 |
34 | exportConfiguration = true;
35 | windowManager.i3 = {
36 | enable = true;
37 | extraPackages = with pkgs; [
38 | dmenu
39 | i3status
40 | ];
41 | };
42 |
43 | desktopManager = {
44 | xterm.enable = false;
45 | xfce = {
46 | enable = true;
47 | noDesktop = true;
48 | enableXfwm = false;
49 | enableScreensaver = false;
50 | };
51 | };
52 | displayManager = {
53 | lightdm.enable = true;
54 | };
55 | };
56 | services.displayManager.defaultSession = "xfce+i3";
57 | }
58 |
--------------------------------------------------------------------------------
/nixos/modules/impermanence/desktop.nix:
--------------------------------------------------------------------------------
1 | # Edit this configuration file to define what should be installed on
2 | # your system. Help is available in the configuration.nix(5) man page
3 | # and in the NixOS manual (accessible by running `nixos-help`).
4 |
5 | { ... }:
6 | {
7 | environment.persistence."/persist/system" = {
8 | directories = [
9 | "/etc/ssh"
10 | "/etc/nixos"
11 | "/var/log"
12 | "/var/lib"
13 | "/var/lib/nixos"
14 | "/etc/sponsorblocktv"
15 | ];
16 | files = [
17 | "/etc/machine-id"
18 | ];
19 | users.kidsan = {
20 | directories = [
21 | { directory = ".config/discord"; mode = "0700"; user = "kidsan"; }
22 | { directory = ".config/systemd"; user = "kidsan"; }
23 | { directory = ".config/Element"; user = "kidsan"; }
24 | { directory = ".config/weechat"; user = "kidsan"; }
25 | { directory = ".config/spotify"; user = "kidsan"; }
26 | { directory = ".config/Signal"; user = "kidsan"; }
27 | { directory = ".config/openxr"; user = "kidsan"; }
28 | { directory = ".config/openvr"; user = "kidsan"; }
29 | { directory = ".config/BeatSaberModManager"; user = "kidsan"; }
30 | { directory = ".config/Valve"; user = "kidsan"; }
31 | { directory = ".config/alvr"; user = "kidsan"; }
32 | { directory = ".config/dconf"; user = "kidsan"; }
33 | { directory = ".config/sunshine"; user = "kidsan"; }
34 | { directory = ".config/easyeffects"; user = "kidsan"; }
35 | { directory = ".config/obs-studio"; user = "kidsan"; }
36 | { directory = ".config/github-copilot"; user = "kidsan"; }
37 | { directory = "Games"; user = "kidsan"; }
38 | { directory = ".config/i3"; user = "kidsan"; }
39 | { directory = ".config/vlc"; user = "kidsan"; }
40 | { directory = ".config/xfce4"; user = "kidsan"; }
41 | { directory = ".local/share/direnv"; user = "kidsan"; }
42 | { directory = ".local/share/keyrings"; user = "kidsan"; }
43 | { directory = ".local/share/lutris"; user = "kidsan"; }
44 | { directory = ".local/share/nvim"; user = "kidsan"; }
45 | { directory = ".local/share/Steam"; user = "kidsan"; }
46 | { directory = ".local/share/ALVR-Launcher"; user = "kidsan"; }
47 | { directory = ".local/state/nix"; mode = "0700"; user = "kidsan"; }
48 | { directory = ".mozilla"; mode = "0700"; user = "kidsan"; }
49 | { directory = ".factorio"; user = "kidsan"; }
50 | { directory = ".ssh"; user = "kidsan"; }
51 | { directory = "nixos-config"; user = "kidsan"; }
52 | { directory = "workspace"; user = "kidsan"; }
53 | { directory = ".config/i3blocks"; user = "kidsan"; }
54 | { directory = ".ollama"; user = "kidsan"; }
55 | { directory = "Videos/replay"; user = "kidsan"; }
56 | { directory = "Zomboid"; user = "kidsan"; }
57 | { directory = ".supermaven"; user = "kidsan"; }
58 | { directory = ".config/exercism"; user = "kidsan"; }
59 | ];
60 | files = [
61 | { file = ".local/share/rippkgs-index.sqlite"; }
62 | { file = ".bash_history"; }
63 | { file = ".config/nushell/history.txt"; }
64 | ];
65 | };
66 | };
67 | fileSystems."/persist".neededForBoot = true;
68 |
69 | programs.fuse.userAllowOther = true; # requied for home-manager impermanence
70 |
71 | security.sudo.extraConfig = ''
72 | # rollback results in sudo lectures after each reboot
73 | Defaults lecture = never
74 | '';
75 | }
76 |
77 |
--------------------------------------------------------------------------------
/nixos/modules/linux-kernel.nix:
--------------------------------------------------------------------------------
1 | { pkgs, lib, config, ... }:
2 | let
3 | host = config.networking.hostName;
4 | in
5 | lib.mkMerge [
6 | (lib.mkIf (host == "desktop") {
7 | boot.kernelPackages = pkgs.linuxPackages_6_13;
8 | })
9 | (lib.mkIf (host != "desktop") {
10 | boot.kernelPackages = pkgs.linuxPackages_latest;
11 | })
12 | ]
13 |
--------------------------------------------------------------------------------
/nixos/modules/locale.nix:
--------------------------------------------------------------------------------
1 | _:
2 |
3 | {
4 | time.timeZone = "Europe/Berlin";
5 |
6 | i18n.defaultLocale = "en_GB.UTF-8";
7 | i18n.supportedLocales = [ "all" ];
8 |
9 | i18n.extraLocaleSettings = {
10 | LANGUAGE = "en_GB.UTF-8";
11 | LC_ADDRESS = "de_DE.UTF-8";
12 | LC_IDENTIFICATION = "de_DE.UTF-8";
13 | LC_MEASUREMENT = "de_DE.UTF-8";
14 | LC_MONETARY = "de_DE.UTF-8";
15 | LC_NAME = "de_DE.UTF-8";
16 | LC_NUMERIC = "de_DE.UTF-8";
17 | LC_PAPER = "de_DE.UTF-8";
18 | LC_TELEPHONE = "de_DE.UTF-8";
19 | LC_TIME = "de_DE.UTF-8";
20 | };
21 |
22 | # Configure console keymap
23 | console.keyMap = "uk";
24 | }
25 |
--------------------------------------------------------------------------------
/nixos/modules/networkmanager.nix:
--------------------------------------------------------------------------------
1 | { lib, ... }:
2 | {
3 |
4 | networking.networkmanager.enable = true;
5 | systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
6 | systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
7 | systemd.network.wait-online.enable = false;
8 | networking.firewall.allowedTCPPorts = [ 11434 ];
9 | }
10 |
--------------------------------------------------------------------------------
/nixos/modules/nix-options.nix:
--------------------------------------------------------------------------------
1 | { lib
2 | , context
3 | , pkgs
4 | , config
5 | , nixpkgs
6 | , ...
7 | }:
8 |
9 | {
10 | # Allow unfree packages
11 | # nixpkgs.config.allowUnfree = true;
12 |
13 | nix = {
14 | package = pkgs.nixVersions.latest;
15 | gc = {
16 | automatic = true;
17 | dates = "weekly";
18 | options = "--delete-older-than 10d";
19 | };
20 | extraOptions = /* toml */ ''
21 | bash-prompt = "\[nix-develop\]$ ";
22 | experimental-features = nix-command flakes
23 | auto-optimise-store = true
24 | min-free = ${toString (100 * 1024 * 1024)}
25 | max-free = ${toString (1024 * 1024 * 1024)}
26 | keep-outputs = true
27 | keep-derivations = true
28 | '';
29 | settings = {
30 | substituters = [
31 | "https://nix-community.cachix.org"
32 | "https://nixpkgs-wayland.cachix.org"
33 | "https://cache.nixos.org/"
34 | "https://nixos-raspberrypi.cachix.org"
35 | ];
36 | trusted-public-keys = [
37 | "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
38 | "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
39 | "nixos-raspberrypi.cachix.org-1:4iMO9LXa8BqhU+Rpg6LQKiGa2lsNh/j2oiYLNOQ5sPI="
40 | ];
41 | };
42 | };
43 |
44 | documentation.nixos.enable = false;
45 | }
46 |
--------------------------------------------------------------------------------
/nixos/modules/ollama.nix:
--------------------------------------------------------------------------------
1 | { config, pkgs, lib, ... }:
2 | {
3 | services.ollama = {
4 | enable = true;
5 | acceleration = "cuda";
6 | listenAddress = "0.0.0.0:11434";
7 | };
8 | networking.firewall.allowedTCPPorts = [ 11434 ];
9 | }
10 |
--------------------------------------------------------------------------------
/nixos/modules/pipewire.nix:
--------------------------------------------------------------------------------
1 | _:
2 | {
3 | # Enable sound with pipewire.
4 | # sound.enable = true;
5 | services.pulseaudio.enable = false;
6 | security.rtkit.enable = true;
7 | services.pipewire = {
8 | enable = true;
9 | alsa.enable = true;
10 | alsa.support32Bit = true;
11 | pulse.enable = true;
12 | };
13 | programs.dconf.enable = true;
14 | }
15 |
--------------------------------------------------------------------------------
/nixos/modules/sponsorblock.nix:
--------------------------------------------------------------------------------
1 | {...}: {
2 |
3 | virtualisation.oci-containers = {
4 | containers.isponsorblock = {
5 | volumes = [ "/etc/sponsorblocktv:/app/data" ];
6 | image = "ghcr.io/dmunozv04/isponsorblocktv:latest";
7 | ports = [ ];
8 | autoStart = true;
9 | extraOptions = [
10 | "--net=host"
11 | ];
12 | };
13 | };
14 | }
15 |
--------------------------------------------------------------------------------
/nixos/modules/ssh.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | {
3 | services.openssh = {
4 | enable = true;
5 | settings = {
6 | X11Forwarding = true;
7 | PermitRootLogin = "yes";
8 | PasswordAuthentication = false;
9 | };
10 | };
11 | programs.ssh.extraConfig = ''
12 | IPQoS none
13 | '';
14 |
15 | systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
16 | }
17 |
--------------------------------------------------------------------------------
/nixos/modules/steam.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | environment.systemPackages = [ pkgs.mangohud ]; # used for limiting fps via steam command parameters
5 | programs.steam = {
6 | enable = true;
7 | remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
8 | dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
9 | package = with pkgs; steam.override { extraPkgs = pkgs: [ attr ]; };
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/nixos/modules/sunshine.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 |
3 | {
4 | services.sunshine = {
5 | enable = true;
6 | package = pkgs.sunshine.override { cudaSupport = true; };
7 | openFirewall = true;
8 | capSysAdmin = true;
9 | };
10 | }
11 |
--------------------------------------------------------------------------------
/nixos/modules/tailscale.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | {
3 | services.tailscale.enable = true;
4 | services.tailscale.useRoutingFeatures = "both";
5 | services.tailscale.permitCertUid = "caddy";
6 | networking.firewall.checkReversePath = "loose";
7 | }
8 |
--------------------------------------------------------------------------------
/nixos/modules/thunar.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | {
3 | programs.thunar.plugins = with pkgs.xfce; [
4 | thunar-archive-plugin
5 | thunar-volman
6 | ];
7 |
8 | services.gvfs.enable = true;
9 | services.tumbler.enable = true;
10 | }
11 |
--------------------------------------------------------------------------------
/nixos/modules/ttrss.nix:
--------------------------------------------------------------------------------
1 | { lib,... }:
2 | {
3 | services.tt-rss = {
4 | enable = false;
5 | singleUserMode = true;
6 | selfUrlPath = "https://rss.home";
7 | };
8 | services.nginx.enable = lib.mkForce false;
9 | }
10 |
--------------------------------------------------------------------------------
/nixos/modules/unbound.nix:
--------------------------------------------------------------------------------
1 | {...}: {
2 | services.unbound = {
3 | enable = true;
4 | checkconf = true;
5 | resolveLocalQueries = true;
6 |
7 | settings = {
8 | server = {
9 | verbosity = 0;
10 |
11 | interface = "127.0.0.1";
12 | port = 5335;
13 | do-ip4 = true;
14 | do-udp = true;
15 | do-tcp = true;
16 |
17 | # May be set to yes if you have IPv6 connectivity
18 | do-ip6 = false;
19 |
20 | # You want to leave this to no unless you have *native* IPv6. With 6to4 and
21 | # Terredo tunnels your web browser should favor IPv4 for the same reasons
22 | prefer-ip6 = false;
23 |
24 | # Use this only when you downloaded the list of primary root servers!
25 | # If you use the default dns-root-data package, unbound will find it automatically
26 | #root-hints: "/var/lib/unbound/root.hints"
27 |
28 | # Trust glue only if it is within the server's authority
29 | harden-glue = true;
30 |
31 | # Require DNSSEC data for trust-anchored zones, if such data is absent, the zone becomes BOGUS
32 | harden-dnssec-stripped = true;
33 |
34 | # Don't use Capitalization randomization as it known to cause DNSSEC issues sometimes
35 | # see https://discourse.pi-hole.net/t/unbound-stubby-or-dnscrypt-proxy/9378 for further details
36 | use-caps-for-id = false;
37 |
38 | # Reduce EDNS reassembly buffer size.
39 | # IP fragmentation is unreliable on the Internet today, and can cause
40 | # transmission failures when large DNS messages are sent via UDP. Even
41 | # when fragmentation does work, it may not be secure; it is theoretically
42 | # possible to spoof parts of a fragmented DNS message, without easy
43 | # detection at the receiving end. Recently, there was an excellent study
44 | # >>> Defragmenting DNS - Determining the optimal maximum UDP response size for DNS <<<
45 | # by Axel Koolhaas, and Tjeerd Slokker (https://indico.dns-oarc.net/event/36/contributions/776/)
46 | # in collaboration with NLnet Labs explored DNS using real world data from the
47 | # the RIPE Atlas probes and the researchers suggested different values for
48 | # IPv4 and IPv6 and in different scenarios. They advise that servers should
49 | # be configured to limit DNS messages sent over UDP to a size that will not
50 | # trigger fragmentation on typical network links. DNS servers can switch
51 | # from UDP to TCP when a DNS response is too big to fit in this limited
52 | # buffer size. This value has also been suggested in DNS Flag Day 2020.
53 | edns-buffer-size = 1232;
54 |
55 | # Perform prefetching of close to expired message cache entries
56 | # This only applies to domains that have been frequently queried
57 | prefetch = true;
58 |
59 | # One thread should be sufficient, can be increased on beefy machines. In reality for most users running on small networks or on a single machine, it should be unnecessary to seek performance enhancement by increasing num-threads above 1.
60 | num-threads = 2;
61 |
62 | # Ensure kernel buffer is large enough to not lose messages in traffic spikes
63 | so-rcvbuf = "1m";
64 |
65 | # Ensure privacy of local IP ranges
66 | private-address = [
67 | "192.168.0.0/16"
68 | "169.254.0.0/16"
69 | "172.16.0.0/12"
70 | "10.0.0.0/8"
71 | "fd00::/8"
72 | "fe80::/10"
73 | ];
74 | };
75 |
76 |
77 | };
78 |
79 | };
80 | }
81 |
--------------------------------------------------------------------------------
/nixos/modules/upgrades.nix:
--------------------------------------------------------------------------------
1 | { ... }:
2 |
3 | {
4 | system.autoUpgrade = {
5 | enable = true;
6 | dates = "10:30";
7 | randomizedDelaySec = "10min";
8 | persistent = true;
9 | flake = "git+https://git.home/kidsan/nixos-config";
10 | };
11 | }
12 |
--------------------------------------------------------------------------------
/nixos/modules/user.nix:
--------------------------------------------------------------------------------
1 | _:
2 | {
3 | users.users.kidsan = {
4 | isNormalUser = true;
5 | description = "kidsan";
6 | extraGroups = [ "networkmanager" "wheel" "docker" "video" ];
7 | openssh.authorizedKeys.keys = [
8 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKas9qjJOceFVG6IS3LgH1RL0EBNZ66LFeLrsOqT31IL kidsan@thinkpad"
9 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMAhyQg3HIZZ+XcpmIEzNkmbMUQwXX2YyjX+RTYAY6cG kidsan@phone"
10 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPUoDNMX11//LajxTS4G0Ndj84jwh1mxn38J4g1CULhN kidsan@desktop"
11 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDj31MXtyzN28GceFMNpvXoTioUl3r+aaw4CUQuvAUm/ kidsan@macbookair"
12 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIfLqsgzH8AdYco3e1LbE+gkIIaey/h9QgJevlEC0i67"
13 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAUGx9cSW8Ot5r4xA+8HG0snCtKtBrhdbEQBCJ2/uQG1 kidsan@framework"
14 | ];
15 | };
16 | }
17 |
--------------------------------------------------------------------------------
/nixos/modules/virtualization.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | {
3 | environment.systemPackages = with pkgs; [
4 | win-virtio
5 | win-spice
6 | ];
7 |
8 | users.users."kidsan".extraGroups = [ "libvirtd" ];
9 |
10 | virtualisation = {
11 | libvirtd = {
12 | enable = true;
13 | qemu = {
14 | swtpm.enable = true;
15 | ovmf = {
16 | enable = true;
17 | packages = [ pkgs.OVMFFull.fd ];
18 | };
19 | };
20 | };
21 | };
22 | }
23 |
--------------------------------------------------------------------------------
/nixos/modules/xdg.nix:
--------------------------------------------------------------------------------
1 | { pkgs, ... }:
2 | {
3 | xdg = {
4 | portal = {
5 | enable = true;
6 | config.common.default = "*";
7 | wlr.enable = true;
8 | extraPortals = with pkgs; [
9 | xdg-desktop-portal-wlr
10 | xdg-desktop-portal-gtk
11 | ];
12 | };
13 | };
14 | }
15 |
--------------------------------------------------------------------------------
/nixos/modules/znc.nix:
--------------------------------------------------------------------------------
1 | {config,...}: {
2 |
3 | services.znc = {
4 | enable = true;
5 | mutable = true;
6 | useLegacyConfig = false;
7 | openFirewall = true;
8 | confOptions.useSSL = false;
9 | configFile = config.age.secrets.znc.path;
10 | };
11 | }
12 |
13 |
--------------------------------------------------------------------------------
/nixos/modules/zwave_ui.nix:
--------------------------------------------------------------------------------
1 | {...}: {
2 |
3 | virtualisation.oci-containers = {
4 | containers.zwave_ui = {
5 | volumes = [ "/var/lib/zwavejs/store:/usr/src/app/store" ];
6 | image = "zwavejs/zwave-js-ui:latest";
7 | ports = [ "3003:3000" "8091:8091" ];
8 | autoStart = true;
9 | extraOptions = [
10 | "--privileged"
11 | "--device=/dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_c20e71c99174ec11b89da55019c2d21c-if00-port0:/dev/zwave"
12 | ];
13 | };
14 | };
15 | }
16 |
--------------------------------------------------------------------------------
/nixos/monster.nix:
--------------------------------------------------------------------------------
1 | { config, libs, pkgs, secrets, ... }:
2 |
3 | {
4 | environment.systemPackages = with pkgs; [
5 | weechat
6 | vim
7 | git
8 | ];
9 |
10 | system.stateVersion = "22.05";
11 | imports = [
12 | ./hardware/monster.nix
13 | ./modules/ssh.nix
14 | ./modules/home-assistant.nix
15 | ./modules/ttrss.nix
16 | ];
17 |
18 | boot = {
19 | loader.grub.enable = false;
20 | loader.generic-extlinux-compatible.enable = true;
21 | kernelPackages = pkgs.linuxPackages_rpi4;
22 | initrd.availableKernelModules = [ "usbhid" "usb_storage" ];
23 | };
24 |
25 | console = {
26 | font = "Lat2-Terminus16";
27 | keyMap = "uk";
28 | };
29 |
30 | networking = {
31 | hostName = "monster";
32 | useDHCP = false;
33 | wireless = {
34 | enable = true;
35 | };
36 |
37 | defaultGateway = "192.168.2.1";
38 | nameservers = [ "192.168.2.100" ];
39 |
40 | interfaces = {
41 | wlan0.ipv4.addresses = [{ address = "192.168.2.156"; prefixLength = 24; }];
42 | eth0.useDHCP = true;
43 | };
44 | };
45 |
46 | #networking.networkmanager.enable = true;
47 |
48 | systemd.services.sshd.wantedBy = pkgs.lib.mkForce
49 | [ "multi-user.target" ];
50 |
51 | users.users.lobster = {
52 | isNormalUser = true;
53 | home = "/home/lobster";
54 | extraGroups = [ "wheel" "networkmanager" "docker" ];
55 | openssh.authorizedKeys.keys = [
56 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKas9qjJOceFVG6IS3LgH1RL0EBNZ66LFeLrsOqT31IL kidsan@thinkpad"
57 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMAhyQg3HIZZ+XcpmIEzNkmbMUQwXX2YyjX+RTYAY6cG kidsan@phone"
58 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPUoDNMX11//LajxTS4G0Ndj84jwh1mxn38J4g1CULhN kidsan@desktop"
59 | ];
60 | };
61 |
62 | # Required for the Wireless firmware
63 | hardware.enableRedistributableFirmware = true;
64 |
65 | nix = {
66 | settings = {
67 | auto-optimise-store = true;
68 | trusted-users = [ "kidsan" "lobster" ];
69 | };
70 | gc = {
71 | automatic = true;
72 | dates = "weekly";
73 | options = "--delete-older-than 30d";
74 | };
75 | # Free up to 1GiB whenever there is less than 100MiB left.
76 | extraOptions = ''
77 | experimental-features = nix-command flakes
78 | min-free = ${toString (100 * 1024 * 1024)}
79 | max-free = ${toString (1024 * 1024 * 1024)}
80 | '';
81 | };
82 |
83 | services.tailscale.enable = true;
84 | networking.firewall.checkReversePath = "loose";
85 | virtualisation.docker.enable = true;
86 |
87 | services.znc = {
88 | enable = true;
89 | mutable = true;
90 | useLegacyConfig = false;
91 | openFirewall = true;
92 | confOptions.useSSL = false;
93 |
94 | configFile = config.age.secrets.znc.path;
95 | };
96 | documentation.nixos.enable = false;
97 | }
98 |
--------------------------------------------------------------------------------
/nixos/pachinko.nix:
--------------------------------------------------------------------------------
1 | { config, lib, pkgs, ... }:
2 |
3 | {
4 | imports =
5 | [
6 | ./hardware/pachinko.nix
7 | ./modules/disko/pachinko.nix
8 |
9 | ./modules/tailscale.nix
10 | ./modules/nix-options.nix
11 | ./modules/linux-kernel.nix
12 | ./modules/upgrades.nix
13 | ./modules/ssh.nix
14 | ./modules/user.nix
15 | ./modules/homelab.nix
16 | ];
17 |
18 | networking.firewall.allowedTCPPorts = [22];
19 | boot.loader.efi.canTouchEfiVariables = true;
20 | boot.loader.grub.enable = true;
21 | boot.loader.grub.efiSupport = true;
22 |
23 | environment.shells = [ pkgs.nushell ];
24 |
25 | networking.hostName = "pachinko"; # Define your hostname.
26 | networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
27 |
28 | environment.systemPackages = [
29 | pkgs.vim
30 | ];
31 |
32 | users.users.kidsan = {
33 | shell = pkgs.nushell;
34 | packages = with pkgs; [
35 | vim
36 | curl
37 | git
38 | zip
39 | ];
40 | };
41 |
42 | services.openssh.enable = true;
43 |
44 | system.stateVersion = "24.05"; # Did you read the comment?
45 |
46 | virtualisation.docker.enable = true;
47 | virtualisation.oci-containers = {
48 | backend = "docker";
49 | };
50 |
51 | services.davfs2 = {
52 | enable = true;
53 | };
54 |
55 | systemd.services.NetworkManager-wait-online.enable = lib.mkForce false;
56 | systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
57 | systemd.network.wait-online.enable = false;
58 |
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/nixos/thinkpad.nix:
--------------------------------------------------------------------------------
1 | { pkgs, config, ... }:
2 |
3 | {
4 | imports =
5 | [
6 | ./hardware/thinkpad.nix
7 | ./modules/common.nix
8 | ./modules/networkmanager.nix
9 | ./modules/xdg.nix
10 | ];
11 |
12 | # Bootloader.
13 | boot.loader.systemd-boot.enable = true;
14 | boot.loader.efi.canTouchEfiVariables = true;
15 | boot.loader.efi.efiSysMountPoint = "/boot/efi";
16 | boot.binfmt.emulatedSystems = [ "aarch64-linux" "armv7l-linux" ];
17 |
18 | # Setup keyfile
19 | boot.initrd.secrets = {
20 | "/crypto_keyfile.bin" = null;
21 | };
22 |
23 | # Enable swap on luks
24 | boot.initrd.luks.devices."luks-c797edd5-61ec-43fa-9df2-59a91f5aeb9a".device = "/dev/disk/by-uuid/c797edd5-61ec-43fa-9df2-59a91f5aeb9a";
25 | boot.initrd.luks.devices."luks-c797edd5-61ec-43fa-9df2-59a91f5aeb9a".keyFile = "/crypto_keyfile.bin";
26 |
27 | networking.hostName = "thinkpad"; # Define your hostname.
28 |
29 | # Enable CUPS to print documents.
30 | services.printing.enable = true;
31 | hardware.bluetooth.enable = true;
32 |
33 | # Wayland stuff
34 | security.pam.services.swaylock = { }; # allows swaylock check if password is correct
35 | environment.sessionVariables.NIXOS_OZONE_WL = "1";
36 | environment.shells = [
37 | pkgs.nushell
38 | ];
39 |
40 | # List packages installed in system profile. To search, run:
41 | # $ nix search wget
42 | environment.systemPackages = with pkgs; [
43 | vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
44 | nushell
45 | wget
46 | slack
47 | thunderbird
48 | ntfs3g
49 | exfat
50 | cachix
51 | xfce.thunar
52 | xfce.thunar-volman
53 | virt-manager
54 | ];
55 | programs.dconf.enable = true;
56 | users.users.kidsan.extraGroups = [ "libvirtd" "lp" "scanner" ];
57 | users.users.kidsan.shell = pkgs.nushell;
58 | virtualisation.libvirtd.enable = true;
59 |
60 | environment.pathsToLink = [ "/share/bash-completion" ];
61 |
62 | # This value determines the NixOS release from which the default
63 | # settings for stateful data, like file locations and database versions
64 | # on your system were taken. It‘s perfectly fine and recommended to leave
65 | # this value at the release version of the first install of this system.
66 | # Before changing this value read the documentation for this option
67 | # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
68 | system.stateVersion = "22.05"; # Did you read the comment?
69 |
70 | virtualisation.docker.enable = true;
71 |
72 | hardware.graphics.enable = true;
73 | # gpu accelerated video playback
74 | hardware.graphics.extraPackages = [
75 | pkgs.libvdpau-va-gl
76 | pkgs.vaapiVdpau
77 | ];
78 | services.tlp.enable = true;
79 | }
80 |
--------------------------------------------------------------------------------
/overlays/nvim-treesitter.nix:
--------------------------------------------------------------------------------
1 | self: super: {
2 | vimPlugins = super.vimPlugins.extend (self': super': {
3 | nvim-treesitter = super'.nvim-treesitter.overrideAttrs (old: {
4 | version = "nightly";
5 | src = super.fetchFromGitHub {
6 | owner = "nvim-treesitter";
7 | repo = "nvim-treesitter";
8 | rev = "e1e3108cd23d7f967842261bd66126b6734d8907";
9 | sha256 = "sha256-XwVT04ZLuAIsR+l0HlZm9lFMiWsdwgkvaTdJNk78UGc=";
10 | };
11 | });
12 | });
13 | }
14 |
15 |
--------------------------------------------------------------------------------
/overlays/transcribe.nix:
--------------------------------------------------------------------------------
1 | self: super: {
2 | transcribe = super.transcribe.overrideAttrs {
3 | version = "9.41.2";
4 | src = super.fetchzip
5 | {
6 | url = "https://www.seventhstring.com/xscribe/downlo/xscsetup-9.41.2.tar.gz";
7 | sha256 = "sha256-VWfjtNbwK9ZiWgs161ubRy+IjSXXk3FEfMkmA6Jhz8A=";
8 | };
9 | };
10 | }
11 |
12 |
--------------------------------------------------------------------------------
/overlays/weechat.nix:
--------------------------------------------------------------------------------
1 | self: super: {
2 | weechat = super.weechat.override {
3 | configure = { availablePlugins, ... }: {
4 | scripts = with super.weechatScripts; [
5 | weechat-notify-send
6 | weechat-autosort
7 | ];
8 | };
9 | };
10 | }
11 |
12 |
--------------------------------------------------------------------------------