mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 15:30:14 +00:00
Compare commits
490 Commits
neovim-lua
...
fa03e51d37
Author | SHA1 | Date | |
---|---|---|---|
fa03e51d37 | |||
fe1a4c2c29 | |||
26afa49879 | |||
94bc6662ed | |||
06c1f5c372 | |||
4dd94ee59d | |||
69dd348c92 | |||
d823b2a49e | |||
756177826c | |||
c60632a37f | |||
324956c091 | |||
68c5816d4d | |||
643b722eb4 | |||
db0b2b147c | |||
b382bc9fbb | |||
454accd742 | |||
088de57cab | |||
5a992d6d5a | |||
f44cf65c43 | |||
46f3a459b6 | |||
161c1f46b0 | |||
fc2484227a | |||
e7bbf68dde | |||
10f7b97b64 | |||
c8a8b7a897 | |||
6560d2f9a2 | |||
3be397429a | |||
8b17fd035b | |||
8da8fe7efb | |||
59111f5da6 | |||
95e8d5c268 | |||
56d2c95c64 | |||
602d411bad | |||
4cd9572993 | |||
84d7fc9892 | |||
dab40e081a | |||
984a47d3b1 | |||
48cd96858a | |||
2cce4c572f | |||
2f783f2ba3 | |||
1ee22e3a9a | |||
450b211e7e | |||
19f3147f25 | |||
5d6d6fc68e | |||
ec55658fd1 | |||
d25b189952 | |||
a8b07cc365 | |||
70a30ac056 | |||
cfe1f1d1e2 | |||
3396918793 | |||
3ef842f359 | |||
e87cb5981c | |||
6e9419ed92 | |||
ab4e516ba8 | |||
5d2d26b3d9 | |||
50e16f9413 | |||
4653037f1e | |||
f192e53e7a | |||
b5a9da8011 | |||
cbbfb8724b | |||
0bbfe0b6b5 | |||
cc714dd898 | |||
4964e56298 | |||
fafd56612e | |||
3042a0ac19 | |||
9d2a423011 | |||
276c2024b4 | |||
81cffd471d | |||
61a808bad4 | |||
48045c0fee | |||
ef6964f3b4 | |||
7b7f426624 | |||
d1c0472b77 | |||
e6fd6128f4 | |||
e72be000b0 | |||
f50ddd48c8 | |||
3a2d5e2da6 | |||
c929bc6440 | |||
09563de935 | |||
a5615da7dc | |||
6babfae211 | |||
b471d0fa7a | |||
cf7d1b50f8 | |||
ddb5dc39aa | |||
3fd95643b0 | |||
d128511a21 | |||
5709afd835 | |||
f828c1c200 | |||
77708aebd9 | |||
f9ac9b1063 | |||
bdd6c603c4 | |||
31e607d0ad | |||
b2337d3c39 | |||
6428d4fa62 | |||
db315b31b4 | |||
340a64b87a | |||
89b5183f22 | |||
b4c08adea4 | |||
13972b1d66 | |||
352f515798 | |||
d84be966fc | |||
c9aa20c703 | |||
771d41254f | |||
90092c48ec | |||
159a6efe09 | |||
0008de7434 | |||
9826178c0e | |||
d2b1d95281 | |||
4c71797818 | |||
dba975fe86 | |||
1a9ab975d1 | |||
67251a6d8d | |||
967175df70 | |||
5561c85b43 | |||
05a8f4a49b | |||
a1f651010b | |||
3cecb8810c | |||
af753153f1 | |||
d2afdd56ae | |||
18fec1d058 | |||
6a0e70568a | |||
9b44d8f171 | |||
1cf3405103 | |||
7439d4bf39 | |||
316c33e66c | |||
c845ae2fd4 | |||
5bc10bef87 | |||
f0e1fc740f | |||
5826877ad2 | |||
d3b0f21313 | |||
b7d1921c4d | |||
de1337bf58 | |||
3cff7e090c | |||
21794891e7 | |||
20e5d7fef5 | |||
b6a6c761e9 | |||
fc4bd9e4a8 | |||
25e3de5058 | |||
9694467ba0 | |||
71e6780439 | |||
e6d0852be0 | |||
00564c0c40 | |||
57b38a417e | |||
7f9ce5925e | |||
5ce9a26441 | |||
73680961a0 | |||
c59e914430 | |||
e194003f8d | |||
3d6f57c324 | |||
ef2ee7b871 | |||
fc867d60cd | |||
d395347a29 | |||
080f7395e0 | |||
1475172bdb | |||
5d6dab3cab | |||
3e6232cbee | |||
8d72216f13 | |||
dd36a3bd82 | |||
0ed3633404 | |||
95e04de763 | |||
b1ebca57d2 | |||
939d17ada1 | |||
dfd52e2cd5 | |||
b589ba5d8a | |||
200f790ea1 | |||
9f561c822c | |||
1f0b04b89b | |||
38892b1135 | |||
9c2e004c8b | |||
bbb210ec4f | |||
984fca2021 | |||
b284b333c5 | |||
3aef23b746 | |||
5f36508d2b | |||
3387bea109 | |||
6f59ea9f22 | |||
8d09544663 | |||
cb15cc209b | |||
b390fff749 | |||
20456b444b | |||
cce6f6573f | |||
52b86efbb1 | |||
f41774f641 | |||
22cba9acac | |||
9e8bac6834 | |||
b07a8f5e20 | |||
8eb7ef0be7 | |||
22ab2acf66 | |||
d85e4b1593 | |||
6ea99eca5d | |||
60e779085e | |||
6abcdfa3bd | |||
0f0a64b5c4 | |||
edb4ec77ca | |||
3cc264a857 | |||
76a7480a1d | |||
9d4bf082c7 | |||
e86b2f184f | |||
d14054ab17 | |||
9b3d2e39c9 | |||
5a1a843ecd | |||
2ddd980436 | |||
febf1071af | |||
05adc8a221 | |||
a463212023 | |||
2457ade6eb | |||
88d52614a9 | |||
2c663347ee | |||
02fc29c482 | |||
21cbe29bd8 | |||
c0da8391ef | |||
d4e203a04c | |||
38480e0c0c | |||
ee58f7a4ee | |||
4c4e250fa1 | |||
ffe867e6a8 | |||
b599162090 | |||
4b0d68089a | |||
b304e529b4 | |||
2b0f03ba1f | |||
2c4f215b6e | |||
066ea8e440 | |||
cd0c93c6d9 | |||
78e9c817d0 | |||
53a8cc83ea | |||
1cf5f46adf | |||
5348cbdf61 | |||
140b410ea0 | |||
b282e76be4 | |||
a26f5dc2b5 | |||
b0fcee6707 | |||
46e633c8b9 | |||
7a74f0a504 | |||
bacf1ab1fa | |||
ddf48998db | |||
23f72c3c2e | |||
77d81742a9 | |||
13c7859a78 | |||
0f4914db95 | |||
25e56b7421 | |||
a6ec04db7e | |||
2a56c04e17 | |||
894a22cb2d | |||
eefed57929 | |||
494cf355e9 | |||
c88718b649 | |||
790cb4a9d0 | |||
e3d4b36613 | |||
18154b6579 | |||
fb44473d22 | |||
c1e89fb20e | |||
04e8b8834e | |||
472a2b965c | |||
79eba7f333 | |||
28418c4e37 | |||
fa797c81f8 | |||
d243d68c72 | |||
f4f5f19183 | |||
3a40bb7485 | |||
e8456e131b | |||
8d8dd8ad62 | |||
bad49cb2c3 | |||
c052813f6d | |||
ed19eaafd1 | |||
09de243bd3 | |||
82a1954c26 | |||
6815af21dc | |||
3269d5e247 | |||
d337ffff51 | |||
df5fba19f8 | |||
8cc158221d | |||
f391433584 | |||
241b2deb49 | |||
605824c1a4 | |||
e8f4ee52c3 | |||
6518db291f | |||
a6551ce043 | |||
b089ec4668 | |||
5970555572 | |||
1083ee4ff8 | |||
a2bbcf7f55 | |||
f388aee56c | |||
958ab8a96b | |||
3059241c1c | |||
fe938ec713 | |||
05f705d794 | |||
f67a44fa87 | |||
713b835f70 | |||
480d515302 | |||
2337db0bda | |||
1510c8c31f | |||
8f8012e435 | |||
8d389013ad | |||
d013f980a7 | |||
3c51dd0db6 | |||
7f0600580f | |||
05d5fcb8f9 | |||
ca7a4ed408 | |||
cf73ce8136 | |||
82344372dd | |||
34cf2a4483 | |||
efb3933f5a | |||
cd067cce69 | |||
0d9df06bce | |||
b4e5852f48 | |||
1a60c5e9db | |||
2d8a84c286 | |||
319106364a | |||
fd5d6ab141 | |||
4df1132eb7 | |||
f4d9897f21 | |||
634baf0a7e | |||
600fd06974 | |||
c9ab46696d | |||
b5790a2795 | |||
61f26315d5 | |||
4fefe54435 | |||
0833a0009c | |||
e349ac35b8 | |||
49c2c013a2 | |||
985b8bf13b | |||
8283480fd1 | |||
d6611ca7a2 | |||
a13083a264 | |||
ff4db1463e | |||
afedfcf187 | |||
2e3c376d73 | |||
59824adb3a | |||
8e32c16fd3 | |||
76c80dd31d | |||
57de089baf | |||
f9c09deb2a | |||
b06b6490f4 | |||
514244476d | |||
47590abc3a | |||
f69d233c39 | |||
9b97c9ac84 | |||
bda59eeb4a | |||
e7468ecc46 | |||
1b798f5af0 | |||
4406116203 | |||
c53f1470ee | |||
da89732001 | |||
2176a53c4a | |||
28576c1b8f | |||
64590c539b | |||
78b364afd7 | |||
f219ce45c8 | |||
5002c881f7 | |||
5859377802 | |||
e6dbed2e17 | |||
86076f0844 | |||
2aea76c0e3 | |||
42a5ad40de | |||
d4fa322fb1 | |||
3d73f8cab4 | |||
0df8af607d | |||
61d9b103b0 | |||
71d0d3ca14 | |||
d5b0405b99 | |||
3cad3d2fb0 | |||
2acd9b3478 | |||
bf4be11718 | |||
4d38d1094f | |||
183babd2f0 | |||
12682a57e1 | |||
31170a616f | |||
4502c5ff62 | |||
59bd3590a4 | |||
ebacff7250 | |||
763f0bbdda | |||
18505d4cbb | |||
a7c04b59ed | |||
d46e6dad6b | |||
5e4642b92e | |||
7ab78767d4 | |||
366a7f6157 | |||
fb47302f3b | |||
cda3ee0a4c | |||
0ed11de174 | |||
ab6f80fc18 | |||
d1f21ec874 | |||
cdcc90f85d | |||
f5674134fc | |||
d37cabfd9a | |||
6e117769c6 | |||
f648e92c28 | |||
43343b2824 | |||
ab9136af2c | |||
a7fe90b236 | |||
5557065c8b | |||
de1fae2baf | |||
2c310fd2f2 | |||
aa4dc4a0c2 | |||
44821ea344 | |||
cb60542980 | |||
3fe6911e2d | |||
afa62c5510 | |||
fea0396dce | |||
13014e6cc1 | |||
640e447006 | |||
595a02383e | |||
3689f8ef52 | |||
ab6a339c34 | |||
e6456d7f02 | |||
fb74122458 | |||
d56a48cf65 | |||
30fe7c2d18 | |||
08716d1c98 | |||
60b68785a9 | |||
c360460d80 | |||
b1b5e77f47 | |||
67af160088 | |||
80d0451ff3 | |||
0ba2492c61 | |||
3dd7fa12b0 | |||
741692e6f1 | |||
7a547f99c0 | |||
18c9e1efc8 | |||
ac3d5e495c | |||
252b3d5dac | |||
6d0b0e3560 | |||
48d33a9ef5 | |||
c08f08692b | |||
a8d1369c49 | |||
450118d234 | |||
cc84f1d37a | |||
ded498f4c9 | |||
0d0ee1fc5a | |||
251dce68bb | |||
448c97665b | |||
86aa02aae4 | |||
6cd22bc7ce | |||
048de4772c | |||
700e59e6c8 | |||
07e0afa1e9 | |||
6577b9e49b | |||
58a0e6166d | |||
e8c5a10df7 | |||
37fa835c66 | |||
fa69557ced | |||
a9a06fb5fc | |||
ceaad9d186 | |||
521937e366 | |||
8915f17ea3 | |||
17799909b2 | |||
7a4c3b930d | |||
e7bbee5da0 | |||
2dda6a31bd | |||
e4d76189e6 | |||
0bc8a233d8 | |||
524a5aa347 | |||
b4ddb149cc | |||
d021baa1bb | |||
7063bd5f7a | |||
d040077d3a | |||
bf1d2f1e9e | |||
fd7c523ebd | |||
1b32457956 | |||
50acdd0c58 | |||
a0c99a8449 | |||
d1b144f441 | |||
adb7956213 | |||
e011a1c6f1 | |||
1d8638777c | |||
2620b43925 | |||
7d53a80d49 | |||
9b12369e43 | |||
427bd1a421 | |||
74e346fa63 | |||
4a803427fb | |||
d127ccacb0 | |||
54e89d3acd | |||
b258a40181 | |||
dfacb580ae | |||
650d1e91a2 | |||
397b08fab4 | |||
33e8a6bc9b | |||
7a39acef1a | |||
3438446347 | |||
dee7c7302a | |||
0d052a6463 | |||
8b98b8f29d | |||
96c64c4da1 | |||
47a1823af4 | |||
d86534727e | |||
13e5b9ddc5 | |||
bb200016cb | |||
dc00ef26b5 | |||
cf62184744 |
20
.github/workflows/check.yml
vendored
Normal file
20
.github/workflows/check.yml
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
name: Check Build
|
||||
|
||||
on:
|
||||
workflow_dispatch: # allows manual triggering
|
||||
|
||||
jobs:
|
||||
check:
|
||||
name: Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@v4
|
||||
- name: Check Nixpkgs Inputs
|
||||
uses: DeterminateSystems/flake-checker-action@v5
|
||||
- name: Add Nix Cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@v2
|
||||
- name: Check the Flake
|
||||
run: nix flake check
|
69
.github/workflows/update.yml
vendored
Normal file
69
.github/workflows/update.yml
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
name: Update Flake
|
||||
|
||||
on:
|
||||
workflow_dispatch: # allows manual triggering
|
||||
schedule:
|
||||
- cron: '33 3 * * 0' # runs weekly on Sunday at 03:33
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
checks: write
|
||||
|
||||
jobs:
|
||||
lockfile:
|
||||
name: Lockfile
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v3
|
||||
- name: Install Nix
|
||||
uses: DeterminateSystems/nix-installer-action@v4
|
||||
- name: Check Nixpkgs Inputs
|
||||
uses: DeterminateSystems/flake-checker-action@v5
|
||||
- name: Add Nix Cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@v2
|
||||
- name: Update flake.lock
|
||||
uses: DeterminateSystems/update-flake-lock@v19
|
||||
id: update
|
||||
with:
|
||||
pr-title: "Update flake.lock" # Title of PR to be created
|
||||
pr-labels: | # Labels to be set on the PR
|
||||
dependencies
|
||||
automated
|
||||
pr-body: |
|
||||
Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action.
|
||||
|
||||
```
|
||||
{{ env.GIT_COMMIT_MESSAGE }}
|
||||
```
|
||||
- name: Check the Flake
|
||||
id: check
|
||||
run: nix flake check
|
||||
- name: Update Check Status
|
||||
uses: LouisBrunner/checks-action@v1.6.1
|
||||
if: always()
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: Update Flake
|
||||
conclusion: ${{ job.status }}
|
||||
output: |
|
||||
{"summary":"${{ steps.check.outputs.stdout }}"}
|
||||
- name: Enable Pull Request Automerge
|
||||
if: success()
|
||||
run: |
|
||||
gh pr merge \
|
||||
--rebase \
|
||||
--auto \
|
||||
${{ steps.update.outputs.pull-request-number }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
- name: Close Pull Request If Failed
|
||||
if: failure()
|
||||
run: |
|
||||
gh pr close \
|
||||
--comment "Auto-closing pull request" \
|
||||
--delete-branch \
|
||||
${{ steps.update.outputs.pull-request-number }}
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -3,7 +3,6 @@
|
||||
*.db
|
||||
**/.direnv/**
|
||||
result
|
||||
.luarc.json
|
||||
private/**
|
||||
templates/**/flake.lock
|
||||
!private/**.age
|
||||
!private/**.sha512
|
||||
|
142
README.md
142
README.md
@ -1,99 +1,93 @@
|
||||
# System Configurations
|
||||
|
||||
This repository contains configuration files for my NixOS, macOS, and WSL
|
||||
hosts.
|
||||
|
||||
They are organized and managed by [Nix](https://nixos.org), so some of the
|
||||
configuration may be difficult to translate to a non-Nix system.
|
||||
|
||||
However, some of the configurations are easier to lift directly:
|
||||
## System Features
|
||||
|
||||
- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/neovim/lua)
|
||||
- [Fish functions](https://github.com/nmasur/dotfiles/tree/master/modules/shell/fish/functions)
|
||||
- [More fish aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/fish/default.nix)
|
||||
- [Git aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/git.nix)
|
||||
- [Hammerspoon](https://github.com/nmasur/dotfiles/tree/master/modules/darwin/hammerspoon)
|
||||
| Feature | Program | Configuration |
|
||||
| --- | --- | --- |
|
||||
| OS | [NixOS](https://nixos.org) | [Link](./modules/nixos) |
|
||||
| Display Server | [X11](https://www.x.org/wiki/) | [Link](./modules/nixos/graphical/xorg.nix) |
|
||||
| Compositor | [Picom](https://github.com/yshui/picom) | [Link](./modules/nixos/graphical/picom.nix) |
|
||||
| Window Manager | [i3](https://i3wm.org/) | [Link](./modules/nixos/graphical/i3.nix) |
|
||||
| Panel | [Polybar](https://polybar.github.io/) | [Link](./modules/nixos/graphical/polybar.nix) |
|
||||
| Font | [Victor Mono](https://rubjo.github.io/victor-mono/) | [Link](./modules/nixos/graphical/fonts.nix) |
|
||||
| Launcher | [Rofi](https://github.com/davatorium/rofi) | [Link](./modules/nixos/graphical/rofi.nix) |
|
||||
|
||||
## User Features
|
||||
|
||||
| Feature | Program | Configuration |
|
||||
| --- | --- | --- |
|
||||
| Dotfiles | [Home-Manager](https://github.com/nix-community/home-manager) | [Link](./modules/common) |
|
||||
| Terminal | [Kitty](https://sw.kovidgoyal.net/kitty/) | [Link](./modules/common/applications/kitty.nix) |
|
||||
| Shell | [Fish](https://fishshell.com/) | [Link](./modules/common/shell/fish) |
|
||||
| Shell Prompt | [Starship](https://starship.rs/) | [Link](./modules/common/shell/starhip.nix) |
|
||||
| Colorscheme | [Gruvbox](https://github.com/morhetz/gruvbox) | [Link](./colorscheme/gruvbox/default.nix) |
|
||||
| Wallpaper | [Road](https://gitlab.com/exorcist365/wallpapers/-/blob/master/gruvbox/road.jpg) | [Link](./hosts/tempest/default.nix) |
|
||||
| Text Editor | [Neovim](https://neovim.io/) | [Link](./modules/common/neovim/config) |
|
||||
| Browser | [Firefox](https://www.mozilla.org/en-US/firefox/new/) | [Link](./modules/common/applications/firefox.nix) |
|
||||
| E-Mail | [Aerc](https://aerc-mail.org/) | [Link](./modules/common/mail/aerc.nix) |
|
||||
| File Manager | [Nautilus](https://wiki.gnome.org/action/show/Apps/Files) | [Link](./modules/common/applications/nautilus.nix) |
|
||||
| PDF Reader | [Zathura](https://pwmt.org/projects/zathura/) | [Link](./modules/common/applications/media.nix) |
|
||||
| Video Player | [mpv](https://mpv.io/) | [Link](./modules/common/applications/media.nix) |
|
||||
|
||||
## macOS Features
|
||||
|
||||
| Feature | Program | Configuration |
|
||||
| --- | --- | --- |
|
||||
| Keybinds | [Hammerspoon](https://www.hammerspoon.org/) | [Link](./modules/darwin/hammerspoon) |
|
||||
|
||||
# Diagram
|
||||
|
||||

|
||||
|
||||
- [flake.nix](./flake.nix)
|
||||
- [hosts](./hosts/)
|
||||
- [modules](./modules/)
|
||||
|
||||
---
|
||||
|
||||
# Unique Configurations
|
||||
|
||||
This repo contains a few more elaborate elements of configuration.
|
||||
|
||||
- [Neovim config](./modules/common/neovim/default.nix) generated with Nix2Vim
|
||||
and source-controlled plugins, differing based on installed LSPs, for example.
|
||||
- [Caddy JSON](./modules/nixos/services/caddy.nix) file (routes, etc.) based
|
||||
dynamically on enabled services rendered with Nix.
|
||||
- [Grafana config](./modules/nixos/services/grafana.nix) rendered with Nix.
|
||||
- Custom [secrets deployment](./modules/nixos/services/secrets.nix) similar to
|
||||
agenix.
|
||||
- Base16 [colorschemes](./colorscheme/) applied to multiple applications,
|
||||
including Firefox userChrome.
|
||||
|
||||
---
|
||||
|
||||
# Installation
|
||||
|
||||
## NixOS - From Live Disk
|
||||
Click [here](./docs/installation.md) for detailed installation instructions.
|
||||
|
||||
Format drives and build system from any NixOS host, including the live
|
||||
installer disk:
|
||||
# Neovim
|
||||
|
||||
**This will erase your drives; use at your own risk!**
|
||||
Try out my Neovim config with nix:
|
||||
|
||||
```bash
|
||||
lsblk # Choose the disk you want to wipe
|
||||
nix-shell -p nixVersions.stable
|
||||
nix run github:nmasur/dotfiles#installer -- nvme0n1 desktop
|
||||
nix run github:nmasur/dotfiles#neovim
|
||||
```
|
||||
|
||||
## NixOS - From Existing System
|
||||
|
||||
If you're already running NixOS, you can switch to this configuration with the
|
||||
following command:
|
||||
Or build it as a package:
|
||||
|
||||
```bash
|
||||
nix-shell -p nixVersions.stable
|
||||
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#desktop
|
||||
nix build github:nmasur/dotfiles#neovim
|
||||
```
|
||||
|
||||
## Windows - From NixOS WSL
|
||||
|
||||
After [installing NixOS on
|
||||
WSL](https://xeiaso.net/blog/nix-flakes-4-wsl-2022-05-01), you can switch to
|
||||
the WSL configuration:
|
||||
|
||||
```
|
||||
nix-shell -p nixVersions.stable
|
||||
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#wsl
|
||||
```
|
||||
|
||||
You should also download the
|
||||
[FiraCode](https://github.com/ryanoasis/nerd-fonts/releases/download/v2.2.2/FiraCode.zip)
|
||||
font and install it on Windows. Install [Alacritty](https://alacritty.org/) and
|
||||
move the `windows/alacritty.yml` file to
|
||||
`C:\Users\<user>\AppData\Roaming\alacritty`.
|
||||
|
||||
## macOS
|
||||
|
||||
To get started on a bare macOS installation, first install Nix:
|
||||
|
||||
```bash
|
||||
sh -c "$(curl -L https://nixos.org/nix/install)"
|
||||
```
|
||||
|
||||
Then use Nix to build nix-darwin:
|
||||
|
||||
```bash
|
||||
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
|
||||
./result/bin/darwin-installer
|
||||
```
|
||||
|
||||
Then switch to the macOS configuration:
|
||||
|
||||
```bash
|
||||
darwin-rebuild switch --flake github:nmasur/dotfiles#macbook
|
||||
```
|
||||
|
||||
### Dealing with corporate MITM SSL certificates:
|
||||
|
||||
```bash
|
||||
# Get the certificates
|
||||
openssl s_client -showcerts -verify 5 -connect cache.nixos.org:443 < /dev/null
|
||||
|
||||
# Paste them in here
|
||||
sudo nvim $NIX_SSL_CERT_FILE
|
||||
```
|
||||
|
||||
### Dealing with Neovim issues:
|
||||
|
||||
Update Neovim Packer plugins: `:PackerSync`
|
||||
|
||||
Update TreeSitter languages: `:TSUpdateSync`
|
||||
|
||||
---
|
||||
If you already have a Neovim configuration, you may need to move it out of
|
||||
`~/.config/nvim` or set `XDG_CONFIG_HOME` to another value; otherwise both
|
||||
configs might conflict with each other.
|
||||
|
||||
# Flake Templates
|
||||
|
||||
|
9
apps/README.md
Normal file
9
apps/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Apps
|
||||
|
||||
These are all my miscellaneous utilies and scripts to accompany this project.
|
||||
|
||||
They can be run with:
|
||||
|
||||
```
|
||||
nix run github:nmasur/dotfiles#appname
|
||||
```
|
@ -1,13 +1,20 @@
|
||||
{ pkgs, ... }: rec {
|
||||
|
||||
default = readme;
|
||||
# Show quick helper
|
||||
default = import ./help.nix { inherit pkgs; };
|
||||
|
||||
# Format and install from nothing
|
||||
# Format primary disk
|
||||
format-root = import ./format-root.nix { inherit pkgs; };
|
||||
|
||||
# Format and install from nothing (deprecated)
|
||||
installer = import ./installer.nix { inherit pkgs; };
|
||||
|
||||
# Display the readme for this repository
|
||||
readme = import ./readme.nix { inherit pkgs; };
|
||||
|
||||
# Rebuild
|
||||
rebuild = import ./rebuild.nix { inherit pkgs; };
|
||||
|
||||
# Load the SSH key for this machine
|
||||
loadkey = import ./loadkey.nix { inherit pkgs; };
|
||||
|
||||
@ -20,4 +27,8 @@
|
||||
# Connect machine metrics to Netdata Cloud
|
||||
netdata = import ./netdata-cloud.nix { inherit pkgs; };
|
||||
|
||||
# Run neovim as an app
|
||||
neovim = import ./neovim.nix { inherit pkgs; };
|
||||
nvim = neovim;
|
||||
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
tmpfile=$(mktemp)
|
||||
echo "''${secret}" > ''${tmpfile}
|
||||
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
|
||||
builtins.toString ../hosts/public-keys
|
||||
builtins.toString ../misc/public-keys
|
||||
} $tmpfile
|
||||
rm $tmpfile
|
||||
'');
|
||||
|
39
apps/format-root.nix
Normal file
39
apps/format-root.nix
Normal file
@ -0,0 +1,39 @@
|
||||
{ pkgs, ... }: {
|
||||
|
||||
# This script will partition and format drives; use at your own risk!
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (pkgs.writeShellScript "format-root" ''
|
||||
set -e
|
||||
|
||||
DISK=$1
|
||||
|
||||
if [ -z "''${DISK}" ]; then
|
||||
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
|
||||
--foreground "#fb4934" \
|
||||
"Missing required parameter." \
|
||||
"Usage: format-root -- <disk>" \
|
||||
"Flake example: nix run github:nmasur/dotfiles#format-root -- nvme0n1"
|
||||
echo "(exiting)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
${pkgs.disko-packaged}/bin/disko \
|
||||
--mode create \
|
||||
--dry-run \
|
||||
--flake "path:$(pwd)#root" \
|
||||
--arg disk \""/dev/''${DISK}"\"
|
||||
|
||||
${pkgs.gum}/bin/gum confirm \
|
||||
"This will ERASE ALL DATA on the disk /dev/''${DISK}. Are you sure you want to continue?" \
|
||||
--default=false
|
||||
|
||||
${pkgs.disko-packaged}/bin/disko \
|
||||
--mode create \
|
||||
--flake "path:$(pwd)#root" \
|
||||
--arg disk "/dev/''${DISK}"
|
||||
|
||||
'');
|
||||
|
||||
}
|
23
apps/help.nix
Normal file
23
apps/help.nix
Normal file
@ -0,0 +1,23 @@
|
||||
{ pkgs, ... }: {
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (pkgs.writeShellScript "default" ''
|
||||
${pkgs.gum}/bin/gum style --margin "1 2" --padding "0 2" --foreground "15" --background "55" "Options"
|
||||
${pkgs.gum}/bin/gum format --type=template -- ' {{ Italic "Run with" }} {{ Color "15" "69" " nix run github:nmasur/dotfiles#" }}{{ Color "15" "62" "someoption" }}{{ Color "15" "69" " " }}.'
|
||||
echo ""
|
||||
echo ""
|
||||
${pkgs.gum}/bin/gum format --type=template -- \
|
||||
' • {{ Color "15" "57" " readme " }} {{ Italic "Documentation for this repository." }}' \
|
||||
' • {{ Color "15" "57" " rebuild " }} {{ Italic "Switch to this configuration." }}' \
|
||||
' • {{ Color "15" "57" " installer " }} {{ Italic "Format and install from nothing." }}' \
|
||||
' • {{ Color "15" "57" " neovim " }} {{ Italic "Test out the Neovim package." }}' \
|
||||
' • {{ Color "15" "57" " loadkey " }} {{ Italic "Load an ssh key for this machine using melt." }}' \
|
||||
' • {{ Color "15" "57" " encrypt-secret " }} {{ Italic "Encrypt a secret for all machines." }}' \
|
||||
' • {{ Color "15" "57" " reencrypt-secrets " }} {{ Italic "Reencrypt all secrets when new machine is added." }}' \
|
||||
' • {{ Color "15" "57" " netdata " }} {{ Italic "Connect a machine to Netdata cloud." }}'
|
||||
echo ""
|
||||
echo ""
|
||||
'');
|
||||
|
||||
}
|
@ -17,8 +17,8 @@
|
||||
--foreground "#fb4934" \
|
||||
"Missing required parameter." \
|
||||
"Usage: installer -- <disk> <host>" \
|
||||
"Example: installer -- nvme0n1 desktop" \
|
||||
"Flake example: nix run github:nmasur/dotfiles#installer -- nvme0n1 desktop"
|
||||
"Example: installer -- nvme0n1 tempest" \
|
||||
"Flake example: nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest"
|
||||
echo "(exiting)"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -5,6 +5,7 @@
|
||||
program = builtins.toString (pkgs.writeShellScript "loadkey" ''
|
||||
printf "\nEnter the seed phrase for your SSH key...\n"
|
||||
printf "\nThen press ^D when complete.\n\n"
|
||||
mkdir -p ~/.ssh/
|
||||
${pkgs.melt}/bin/melt restore ~/.ssh/id_ed25519
|
||||
printf "\n\nContinuing activation.\n\n"
|
||||
'');
|
||||
|
12
apps/neovim.nix
Normal file
12
apps/neovim.nix
Normal file
@ -0,0 +1,12 @@
|
||||
{ pkgs, ... }: {
|
||||
|
||||
type = "app";
|
||||
|
||||
program = "${
|
||||
(import ../modules/common/neovim/package {
|
||||
inherit pkgs;
|
||||
colors = (import ../colorscheme/nord).dark;
|
||||
})
|
||||
}/bin/nvim";
|
||||
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (pkgs.writeShellScript "readme" ''
|
||||
${pkgs.glow}/bin/glow ${builtins.toString ../README.md}
|
||||
${pkgs.glow}/bin/glow --pager ${builtins.toString ../README.md}
|
||||
'');
|
||||
|
||||
}
|
||||
|
15
apps/rebuild.nix
Normal file
15
apps/rebuild.nix
Normal file
@ -0,0 +1,15 @@
|
||||
{ pkgs, ... }: {
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (pkgs.writeShellScript "rebuild" ''
|
||||
echo ${pkgs.system}
|
||||
SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"}
|
||||
if [ "$SYSTEM" == "darwin" ]; then
|
||||
sudo darwin-rebuild switch --flake ${builtins.toString ../.}
|
||||
else
|
||||
doas nixos-rebuild switch --flake ${builtins.toString ../.}
|
||||
fi
|
||||
'');
|
||||
|
||||
}
|
@ -17,7 +17,7 @@
|
||||
--identity ~/.ssh/id_ed25519 $encryptedfile > $tmpfile
|
||||
echo "Encrypting ''${encryptedfile}..."
|
||||
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
|
||||
builtins.toString ../hosts/public-keys
|
||||
builtins.toString ../misc/public-keys
|
||||
} $tmpfile > $encryptedfile
|
||||
rm $tmpfile
|
||||
done
|
||||
|
5
colorscheme/README.md
Normal file
5
colorscheme/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Colorschemes
|
||||
|
||||
Color information for different themes is found here. The colors are sourced
|
||||
and used with [base16](https://github.com/chriskempson/base16) format
|
||||
consistently across the system.
|
24
colorscheme/everforest/default.nix
Normal file
24
colorscheme/everforest/default.nix
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
name = "everforest"; # dark, hard
|
||||
author = "Sainnhe Park";
|
||||
dark = {
|
||||
base00 = "#2b3339"; # Default Background
|
||||
base01 = "#323c41"; # Lighter Background
|
||||
base02 = "#503946"; # Selection Background
|
||||
base03 = "#868d80"; # Comments, Invisibles, Line Highlighting
|
||||
base04 = "#d3c6aa"; # Dark Foreground (Used for status bars)
|
||||
base05 = "#d3c6aa"; # Default Foreground, Caret, Delimiters, Operators
|
||||
base06 = "#e9e8d2"; # Light Foreground (Not often used)
|
||||
base07 = "#fff9e8"; # Light Background (Not often used)
|
||||
base08 = "#7fbbb3"; # Variables, XML Tags, Markup Link Text, ...
|
||||
base09 = "#d699b6"; # Integers, Boolean, Constants, ...
|
||||
base0A = "#83c092"; # Classes, Markup Bold, Search Text Background
|
||||
base0B = "#dbbc7f"; # Strings, Inherited Class, Markup Code, Diff Inserted
|
||||
base0C = "#e69875"; # Support, Regular Expressions, Escape Characters, ...
|
||||
base0D = "#a7c080"; # Functions, Methods, Attribute IDs, Headings
|
||||
base0E =
|
||||
"#e67e80"; # Keywords, Storage, Selector, Markup Italic, Diff Changed
|
||||
base0F =
|
||||
"#d699b6"; # Deprecated, Opening/Closing Embedded Language Tags, ...
|
||||
};
|
||||
}
|
45
colorscheme/gruvbox-dark/default.nix
Normal file
45
colorscheme/gruvbox-dark/default.nix
Normal file
@ -0,0 +1,45 @@
|
||||
# Gruvbox with a darker background for greater contrast
|
||||
|
||||
{
|
||||
name = "gruvbox-dark"; # Dark, Medium
|
||||
author =
|
||||
"Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox), ElRastaOk (https://www.reddit.com/user/ElRastaOk)";
|
||||
dark = {
|
||||
base00 = "#1D2122"; # ---- This is the change from normal gruvbox
|
||||
base01 = "#3c3836"; # ---
|
||||
base02 = "#504945"; # --
|
||||
base03 = "#665c54"; # -
|
||||
base04 = "#bdae93"; # +
|
||||
base05 = "#d5c4a1"; # ++
|
||||
base06 = "#ebdbb2"; # +++
|
||||
base07 = "#fbf1c7"; # ++++
|
||||
base08 = "#fb4934"; # red
|
||||
base09 = "#fe8019"; # orange
|
||||
base0A = "#fabd2f"; # yellow
|
||||
base0B = "#b8bb26"; # green
|
||||
base0C = "#8ec07c"; # aqua/cyan
|
||||
base0D = "#83a598"; # blue
|
||||
base0E = "#d3869b"; # purple
|
||||
base0F = "#d65d0e"; # brown
|
||||
batTheme = "gruvbox-dark";
|
||||
};
|
||||
light = {
|
||||
base00 = "#fbf1c7"; # ----
|
||||
base01 = "#ebdbb2"; # ---
|
||||
base02 = "#d5c4a1"; # --
|
||||
base03 = "#bdae93"; # -
|
||||
base04 = "#665c54"; # +
|
||||
base05 = "#504945"; # ++
|
||||
base06 = "#3c3836"; # +++
|
||||
base07 = "#1D2122"; # ++++ Adjusted darker here
|
||||
base08 = "#9d0006"; # red
|
||||
base09 = "#af3a03"; # orange
|
||||
base0A = "#b57614"; # yellow
|
||||
base0B = "#79740e"; # green
|
||||
base0C = "#427b58"; # aqua/cyan
|
||||
base0D = "#076678"; # blue
|
||||
base0E = "#8f3f71"; # purple
|
||||
base0F = "#d65d0e"; # brown
|
||||
batTheme = "gruvbox-light";
|
||||
};
|
||||
}
|
@ -19,7 +19,6 @@
|
||||
base0D = "#83a598"; # blue
|
||||
base0E = "#d3869b"; # purple
|
||||
base0F = "#d65d0e"; # brown
|
||||
neovimConfig = ./neovim.lua;
|
||||
batTheme = "gruvbox-dark";
|
||||
};
|
||||
light = {
|
||||
@ -39,7 +38,6 @@
|
||||
base0D = "#076678"; # blue
|
||||
base0E = "#8f3f71"; # purple
|
||||
base0F = "#d65d0e"; # brown
|
||||
neovimConfig = ./neovim.lua;
|
||||
batTheme = "gruvbox-light";
|
||||
};
|
||||
}
|
23
colorscheme/nord/default.nix
Normal file
23
colorscheme/nord/default.nix
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
name = "nord";
|
||||
author = "arcticicestudio";
|
||||
dark = {
|
||||
base00 = "#2E3440";
|
||||
base01 = "#3B4252";
|
||||
base02 = "#434C5E";
|
||||
base03 = "#4C566A";
|
||||
base04 = "#D8DEE9";
|
||||
base05 = "#E5E9F0";
|
||||
base06 = "#ECEFF4";
|
||||
base07 = "#8FBCBB";
|
||||
base08 = "#88C0D0";
|
||||
base09 = "#81A1C1";
|
||||
base0A = "#5E81AC";
|
||||
base0B = "#BF616A";
|
||||
base0C = "#D08770";
|
||||
base0D = "#EBCB8B";
|
||||
base0E = "#A3BE8C";
|
||||
base0F = "#B48EAD";
|
||||
batTheme = "nord";
|
||||
};
|
||||
}
|
5
disks/README.md
Normal file
5
disks/README.md
Normal file
@ -0,0 +1,5 @@
|
||||
# Disks
|
||||
|
||||
These are my [disko](https://github.com/nix-community/disko) configurations,
|
||||
which allow me to save desired disk formatting layouts as a declarative file so
|
||||
I don't have to remember how to format my disks later on.
|
42
disks/root.nix
Normal file
42
disks/root.nix
Normal file
@ -0,0 +1,42 @@
|
||||
{ disk, ... }: {
|
||||
disk = {
|
||||
boot = {
|
||||
type = "disk";
|
||||
device = disk;
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
# Boot partition
|
||||
{
|
||||
name = "ESP";
|
||||
start = "0";
|
||||
end = "512MiB";
|
||||
fs-type = "fat32";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
extraArgs = [ "-n boot" ];
|
||||
};
|
||||
}
|
||||
# Root partition ext4
|
||||
{
|
||||
name = "root";
|
||||
start = "512MiB";
|
||||
end = "100%";
|
||||
part-type = "primary";
|
||||
bootable = true;
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
extraArgs = [ "-L nixos" ];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
95
disks/zfs.nix
Normal file
95
disks/zfs.nix
Normal file
@ -0,0 +1,95 @@
|
||||
{ pool, disks, ... }: {
|
||||
disk = lib.genAttrs disks (disk: {
|
||||
"${disk}" = {
|
||||
type = "disk";
|
||||
device = "/dev/${disk}";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [{
|
||||
type = "partition";
|
||||
name = "zfs";
|
||||
start = "128MiB";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = pool;
|
||||
};
|
||||
}];
|
||||
};
|
||||
};
|
||||
});
|
||||
zpool = {
|
||||
"${pool}" = {
|
||||
type = "zpool";
|
||||
mode = "raidz1";
|
||||
rootFsOptions = {
|
||||
compression = "on"; # lz4 by default
|
||||
"com.sun:auto-snapshot" = "false";
|
||||
ashift = "12";
|
||||
};
|
||||
# mountpoint = "/";
|
||||
|
||||
datasets = {
|
||||
root = {
|
||||
zfs_type = "filesystem";
|
||||
mountpoint = null;
|
||||
options."com.sun:auto-snapshot" = "false";
|
||||
};
|
||||
# "media/movies" = {
|
||||
# zfs_type = "filesystem";
|
||||
# mountpoint = "/media/movies";
|
||||
# options.recordsize = "1M";
|
||||
# };
|
||||
# "media/tv" = {
|
||||
# zfs_type = "filesystem";
|
||||
# mountpoint = "/media/tv";
|
||||
# options.recordsize = "1M";
|
||||
# };
|
||||
# "media/books" = {
|
||||
# zfs_type = "filesystem";
|
||||
# mountpoint = "/media/books";
|
||||
# };
|
||||
# archive = {
|
||||
# zfs_type = "filesystem";
|
||||
# mountpoint = "/archive";
|
||||
# options.compression = "zstd";
|
||||
# options."com.sun:auto-snapshot" = "true";
|
||||
# };
|
||||
# zfs_unmounted_fs = {
|
||||
# zfs_type = "filesystem";
|
||||
# options.mountpoint = "none";
|
||||
# };
|
||||
# zfs_legacy_fs = {
|
||||
# zfs_type = "filesystem";
|
||||
# options.mountpoint = "legacy";
|
||||
# mountpoint = "/zfs_legacy_fs";
|
||||
# };
|
||||
# zfs_testvolume = {
|
||||
# zfs_type = "volume";
|
||||
# size = "10M";
|
||||
# content = {
|
||||
# type = "filesystem";
|
||||
# format = "ext4";
|
||||
# mountpoint = "/ext4onzfs";
|
||||
# };
|
||||
# };
|
||||
# encrypted = {
|
||||
# zfs_type = "filesystem";
|
||||
# size = "20M";
|
||||
# options = {
|
||||
# mountpoint = "none";
|
||||
# encryption = "aes-256-gcm";
|
||||
# keyformat = "passphrase";
|
||||
# keylocation = "file:///tmp/secret.key";
|
||||
# };
|
||||
# };
|
||||
# "encrypted/test" = {
|
||||
# zfs_type = "filesystem";
|
||||
# size = "2M";
|
||||
# mountpoint = "/zfs_crypted";
|
||||
# };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
4
docs/README.md
Normal file
4
docs/README.md
Normal file
@ -0,0 +1,4 @@
|
||||
# Documentation
|
||||
|
||||
Reference documents for some of the more complicated services and maintenance
|
||||
tasks.
|
72
docs/installation.md
Normal file
72
docs/installation.md
Normal file
@ -0,0 +1,72 @@
|
||||
[Back to README](../README.md)
|
||||
|
||||
---
|
||||
|
||||
# Installation
|
||||
|
||||
## NixOS - From Live Disk
|
||||
|
||||
Format drives and build system from any NixOS host, including the live
|
||||
installer disk:
|
||||
|
||||
**This will erase your drives; use at your own risk!**
|
||||
|
||||
```bash
|
||||
lsblk # Choose the disk you want to wipe
|
||||
nix-shell -p nixVersions.stable
|
||||
nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest
|
||||
```
|
||||
|
||||
## NixOS - From Existing System
|
||||
|
||||
If you're already running NixOS, you can switch to this configuration with the
|
||||
following command:
|
||||
|
||||
```bash
|
||||
nix-shell -p nixVersions.stable
|
||||
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#tempest
|
||||
```
|
||||
|
||||
## Windows - From NixOS WSL
|
||||
|
||||
After [installing NixOS on
|
||||
WSL](https://xeiaso.net/blog/nix-flakes-4-wsl-2022-05-01), you can switch to
|
||||
the WSL configuration:
|
||||
|
||||
```
|
||||
nix-shell -p nixVersions.stable
|
||||
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#hydra
|
||||
```
|
||||
|
||||
You should also download the
|
||||
[FiraCode](https://github.com/ryanoasis/nerd-fonts/releases/download/v2.2.2/FiraCode.zip)
|
||||
font and install it on Windows. Install [Alacritty](https://alacritty.org/) and
|
||||
move the `windows/alacritty.yml` file to
|
||||
`C:\Users\<user>\AppData\Roaming\alacritty`.
|
||||
|
||||
## macOS
|
||||
|
||||
To get started on a bare macOS installation, first install Nix:
|
||||
|
||||
```bash
|
||||
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
|
||||
```
|
||||
|
||||
Launch a new shell. Then use Nix to switch to the macOS configuration:
|
||||
|
||||
```bash
|
||||
sudo rm /etc/bashrc
|
||||
sudo rm /etc/nix/nix.conf
|
||||
nix \
|
||||
--extra-experimental-features flakes \
|
||||
--extra-experimental-features nix-command \
|
||||
run nix-darwin -- switch \
|
||||
--flake github:nmasur/dotfiles#lookingglass
|
||||
```
|
||||
|
||||
Once installed, you can continue to update the macOS configuration:
|
||||
|
||||
```bash
|
||||
darwin-rebuild switch --flake ~/dev/personal/dotfiles
|
||||
```
|
||||
|
65
docs/repair-nextcloud.md
Normal file
65
docs/repair-nextcloud.md
Normal file
@ -0,0 +1,65 @@
|
||||
# Repairing Nextcloud
|
||||
|
||||
You can run the maintenance commands like this:
|
||||
|
||||
```
|
||||
sudo -u nextcloud nextcloud-occ maintenance:mode --on
|
||||
sudo -u nextcloud nextcloud-occ maintenance:repair
|
||||
sudo -u nextcloud nextcloud-occ maintenance:mode --off
|
||||
```
|
||||
|
||||
## Rescan Files
|
||||
|
||||
```
|
||||
sudo -u nextcloud nextcloud-occ files:scan --all
|
||||
```
|
||||
|
||||
## Converting from SQLite to MySQL (mariadb)
|
||||
|
||||
First: keep Nextcloud set to SQLite as its dbtype, and separately launch MySQL
|
||||
as a service by copying the configuration found
|
||||
[here](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/web-apps/nextcloud.nix).
|
||||
|
||||
No password is necessary, since the user-based auth works with UNIX sockets.
|
||||
|
||||
You can connect to the MySQL instance like this:
|
||||
|
||||
```
|
||||
sudo -u nextcloud mysql -S /run/mysqld/mysqld.sock
|
||||
```
|
||||
|
||||
Create a blank database for Nextcloud:
|
||||
|
||||
```sql
|
||||
create database nextcloud;
|
||||
```
|
||||
|
||||
Now setup the [conversion](https://docs.nextcloud.com/server/17/admin_manual/configuration_database/db_conversion.html):
|
||||
|
||||
```
|
||||
sudo -u nextcloud nextcloud-occ db:convert-type mysql nextcloud localhost nextcloud
|
||||
```
|
||||
|
||||
Ignore the password prompt. Proceed with the conversion.
|
||||
|
||||
Now `config.php` will be updated but the override config from NixOS will not
|
||||
be. Now update your NixOS configuration:
|
||||
|
||||
- Remove the `mysql` service you created.
|
||||
- Set `dbtype` to `mysql`.
|
||||
- Set `database.createLocally` to `true`.
|
||||
|
||||
Rebuild your configuration.
|
||||
|
||||
Now, make sure to enable [4-byte
|
||||
support](https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/mysql_4byte_support.html)
|
||||
in the database.
|
||||
|
||||
## Backing Up MySQL Database
|
||||
|
||||
Use this mysqldump command:
|
||||
|
||||
```
|
||||
sudo -u nextcloud mysqldump -S /run/mysqld/mysqld.sock --default-character-set=utf8mb4 nextcloud > backup.sql
|
||||
```
|
||||
|
23
docs/restore-calibre.md
Normal file
23
docs/restore-calibre.md
Normal file
@ -0,0 +1,23 @@
|
||||
# Restoring Calibre From Backup
|
||||
|
||||
The `metadata.db` holds the library and `app.db` and `gdrive.db` contain the
|
||||
web/account information.
|
||||
|
||||
Place books directories in `/data/books/`.
|
||||
|
||||
Place `metadata.db` in `/var/lib/calibre-web-db/`.
|
||||
|
||||
Symlink `metadata.db` to the library:
|
||||
|
||||
```
|
||||
sudo ln -s /var/lib/calibre-web-db/metadata.db /data/books/metadata.db
|
||||
```
|
||||
|
||||
Place `app.db` and `gdrive.db` in `/var/lib/calibre-web/`.
|
||||
|
||||
Restart Calibre:
|
||||
|
||||
```
|
||||
sudo systemctl restart calibre-web.service
|
||||
```
|
||||
|
45
docs/zfs.md
Normal file
45
docs/zfs.md
Normal file
@ -0,0 +1,45 @@
|
||||
# ZFS
|
||||
|
||||
Swan runs its root on ext4. The ZFS drives are managed imperatively (this
|
||||
[disko configuration](../disks/zfs.nix) is an unused work-in-progress).
|
||||
|
||||
The basic ZFS settings are managed [here](../modules/nixos/hardware/zfs.nix).
|
||||
|
||||
## Creating a New Dataset
|
||||
|
||||
```
|
||||
sudo zfs create tank/mydataset
|
||||
sudo zfs set compression=zstd tank/myzstddataset
|
||||
sudo zfs set mountpoint=/data/mydataset tank/mydataset
|
||||
```
|
||||
|
||||
## Maintenance
|
||||
|
||||
### Get Status
|
||||
|
||||
```
|
||||
sudo zpool status
|
||||
```
|
||||
|
||||
### Replace Disk
|
||||
|
||||
```
|
||||
sudo zdb
|
||||
sudo zpool status -g # Show by GUID
|
||||
sudo zpool offline tank <GUID>
|
||||
sudo zpool status
|
||||
# Remove old disk, insert new disk
|
||||
sudo zdb
|
||||
sudo zpool replace tank <OLD GUID> /dev/disk/by-id/<NEW PATH>
|
||||
sudo zpool status
|
||||
```
|
||||
|
||||
## Initial Setup
|
||||
|
||||
```
|
||||
sudo zpool create tank raidz1 sda sdb sdc
|
||||
sudo zpool set ashift=12 tank
|
||||
sudo zpool set autoexpand=on tank
|
||||
sudo zpool set compression=on tank
|
||||
```
|
||||
|
664
flake.lock
generated
664
flake.lock
generated
@ -1,5 +1,87 @@
|
||||
{
|
||||
"nodes": {
|
||||
"Comment-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1681214440,
|
||||
"narHash": "sha256-48hy+hiaDJLlgWqC7IeZI3dT+VwWkRo4atQbyPxu/ys=",
|
||||
"owner": "numToStr",
|
||||
"repo": "Comment.nvim",
|
||||
"rev": "e51f2b142d88bb666dcaa77d93a07f4b419aca70",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numToStr",
|
||||
"ref": "v0.8.0",
|
||||
"repo": "Comment.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"baleia-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1704551058,
|
||||
"narHash": "sha256-0NmiGzMFvL1awYOVtiaSd+O4sAR524x68xwWLgArlqs=",
|
||||
"owner": "m00qek",
|
||||
"repo": "baleia.nvim",
|
||||
"rev": "6d9cbdaca3a428bc7296f838fdfce3ad01ee7495",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "m00qek",
|
||||
"repo": "baleia.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"bufferline-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706180994,
|
||||
"narHash": "sha256-/iGzUDJaodkUyWpwim8UtwaRuarfu/Nk6wxVApk+QxY=",
|
||||
"owner": "akinsho",
|
||||
"repo": "bufferline.nvim",
|
||||
"rev": "d6cb9b7cac52887bcac65f8698e67479553c0748",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "akinsho",
|
||||
"ref": "v4.5.0",
|
||||
"repo": "bufferline.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"bypass-paywalls-clean": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706005203,
|
||||
"narHash": "sha256-9vku2FK5dXAnb2R/YHTKIHgc+Ckqza1qAH0kOw0Uryg=",
|
||||
"owner": "magnolia1234",
|
||||
"repo": "bpc-uploads",
|
||||
"rev": "245899e6b06e30ce36f26b37b8045b6c5b0ac8de",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"owner": "magnolia1234",
|
||||
"repo": "bpc-uploads",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"cmp-nvim-lsp-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1702205473,
|
||||
"narHash": "sha256-/0sh9vJBD9pUuD7q3tNSQ1YLvxFMNykdg5eG+LjZAA8=",
|
||||
"owner": "hrsh7th",
|
||||
"repo": "cmp-nvim-lsp",
|
||||
"rev": "5af77f54de1b16c34b23cba810150689a3a90312",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hrsh7th",
|
||||
"repo": "cmp-nvim-lsp",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@ -7,11 +89,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1666776005,
|
||||
"narHash": "sha256-HwSMF19PpczfqNHKcFsA6cF4PVbG00uUSdbq6q3jB5o=",
|
||||
"lastModified": 1706405065,
|
||||
"narHash": "sha256-femlVBNWgr9a6HfBUzhBF/9S8VBlaHDKcEm8B89O+zc=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "f6648ca0698d1611d7eadfa72b122252b833f86c",
|
||||
"rev": "0108864c15bb68ad57d17fb2e7d3a3e025751d79",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -21,16 +103,55 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"firefox-darwin": {
|
||||
"disko": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1668992358,
|
||||
"narHash": "sha256-24iH+wIbE1bKCFmqslwOpfrDypJ40mk1uGIqRUxDXxY=",
|
||||
"lastModified": 1706302763,
|
||||
"narHash": "sha256-Le1wk75qlzOSfzDk8vqYxSdoEyr/ORIbMhziltVNGYw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "f7424625dc1f2e4eceac3009cbd1203d566feebc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"fidget-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1704696337,
|
||||
"narHash": "sha256-uAX/RGfOmsUIUaDepNwUpK8MBaTMBJ4rLZ69y0MwpNE=",
|
||||
"owner": "j-hui",
|
||||
"repo": "fidget.nvim",
|
||||
"rev": "3a93300c076109d86c7ce35ec67a8034ae6ba9db",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "j-hui",
|
||||
"ref": "v1.2.0",
|
||||
"repo": "fidget.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"firefox-darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1706402627,
|
||||
"narHash": "sha256-lq2g41A527U2qJ1A9socjFPBOJ1/PM+Mftj3t7D/lhM=",
|
||||
"owner": "bandithedoge",
|
||||
"repo": "nixpkgs-firefox-darwin",
|
||||
"rev": "066d4fd658acd075b45405eda9e3bca6a71a47b1",
|
||||
"rev": "912228b33c72703badb20a309518e1e09af302c3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -42,11 +163,11 @@
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1650374568,
|
||||
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
|
||||
"lastModified": 1696426674,
|
||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
|
||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -56,12 +177,15 @@
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1659877975,
|
||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
||||
"lastModified": 1705309234,
|
||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -70,19 +194,52 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1705309234,
|
||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hmts-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1693226725,
|
||||
"narHash": "sha256-jUuztOqNBltC3axa7s3CPJz9Cmukfwkf846+Z/gAxCU=",
|
||||
"owner": "calops",
|
||||
"repo": "hmts.nvim",
|
||||
"rev": "14fd941d7ec2bb98314a1aacaa2573d97f1629ab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "calops",
|
||||
"repo": "hmts.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"utils": "utils"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1666903647,
|
||||
"narHash": "sha256-sFI1Gh9DTGzHnBINondupUGYbe+T0wZcpcZjkW0qffM=",
|
||||
"lastModified": 1706306660,
|
||||
"narHash": "sha256-lZvgkHtVeduGByPb0Tz9LpAi4olfkEm8XPgv0o7GRsk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "213a06295dff96668a1d673b9fd1c03ce1de6745",
|
||||
"rev": "b2f56952074cb46e93902ecaabfb04dd93733434",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -92,13 +249,102 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"kitty-scrollback-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706493612,
|
||||
"narHash": "sha256-hv3o5k85hBaGk8OBRLP7Rf0O9dxiKot6F7/EQelJHHg=",
|
||||
"owner": "mikesmithgh",
|
||||
"repo": "kitty-scrollback.nvim",
|
||||
"rev": "bb5332b8ec0763b9e611f8cabf4165ed8c3893f5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "mikesmithgh",
|
||||
"repo": "kitty-scrollback.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nextcloud-cookbook": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1702545935,
|
||||
"narHash": "sha256-19LN1nYJJ0RMWj6DrYPvHzocTyhMfYdpdhBFch3fpHE=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/christianlupus-nextcloud/cookbook-releases/releases/download/v0.11.0/cookbook-0.11.0.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/christianlupus-nextcloud/cookbook-releases/releases/download/v0.11.0/cookbook-0.11.0.tar.gz"
|
||||
}
|
||||
},
|
||||
"nextcloud-external": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1699624334,
|
||||
"narHash": "sha256-RCL2RP5twRDLxI/KfAX6QLYQOzqZmSWsfrC5ZQIwTD4=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nextcloud-releases/external/releases/download/v5.3.1/external-v5.3.1.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nextcloud-releases/external/releases/download/v5.3.1/external-v5.3.1.tar.gz"
|
||||
}
|
||||
},
|
||||
"nextcloud-news": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1703426420,
|
||||
"narHash": "sha256-AENBJH/bEob5JQvw4WEi864mdLYJ5Mqe78HJH6ceCpI=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nextcloud/news/releases/download/25.0.0-alpha3/news.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nextcloud/news/releases/download/25.0.0-alpha3/news.tar.gz"
|
||||
}
|
||||
},
|
||||
"nextcloud-snappymail": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706414864,
|
||||
"narHash": "sha256-UeZXoZFEPJj7zEVNTXJ3IYNt/wI7VFq3Pjh1ubMHCBo=",
|
||||
"type": "tarball",
|
||||
"url": "https://snappymail.eu/repository/nextcloud/snappymail-2.32.0-nextcloud.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://snappymail.eu/repository/nextcloud/snappymail-2.32.0-nextcloud.tar.gz"
|
||||
}
|
||||
},
|
||||
"nix2vim": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1706407735,
|
||||
"narHash": "sha256-Q5Lv4FlKVmMXd91ujh6FUxCsoAU2Q8KPU+ipTZPkTjE=",
|
||||
"owner": "gytis-ivaskevicius",
|
||||
"repo": "nix2vim",
|
||||
"rev": "84584da274869fb8177e8ef2d0b9d975bbb82489",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "gytis-ivaskevicius",
|
||||
"repo": "nix2vim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixlib": {
|
||||
"locked": {
|
||||
"lastModified": 1636849918,
|
||||
"narHash": "sha256-nzUK6dPcTmNVrgTAC1EOybSMsrcx+QrVPyqRdyKLkjA=",
|
||||
"lastModified": 1693701915,
|
||||
"narHash": "sha256-waHPLdDYUOHSEtMKKabcKIMhlUOHPOOPQ9UyFeEoovs=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "28a5b0557f14124608db68d3ee1f77e9329e9dd5",
|
||||
"rev": "f5af57d3ef9947a70ac86e42695231ac1ad00c25",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -115,11 +361,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1666812839,
|
||||
"narHash": "sha256-0nBDgjPU+iDsvz89W+cDEyhnFGSwCJmwDl/gMGqYiU0=",
|
||||
"lastModified": 1706085261,
|
||||
"narHash": "sha256-7PgpHRHyShINcqgevPP1fJ6N8kM5ZSOJnk3QZBrOCQ0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-generators",
|
||||
"rev": "41f3518bc194389df22a3d198215eae75e6b5ab9",
|
||||
"rev": "896f6589db5b25023b812bbb6c1f5d3a499b1132",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -130,27 +376,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1639237670,
|
||||
"narHash": "sha256-RTdL4rEQcgaZGpvtDgkp3oK/V+1LM3I53n0ACPSroAQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "edfb969386ebe6c3cf8f878775a7975cd88f926d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "master",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1666959691,
|
||||
"narHash": "sha256-TRpWA3t8ata79HOGtFd5dDCl1kJQmIE16PDF53/Hcxo=",
|
||||
"lastModified": 1706191920,
|
||||
"narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "448a599c49978c2794401bfc3a2e1fba1a8663be",
|
||||
"rev": "ae5c332cbb5827f6b1f02572496b141021de335f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -160,28 +390,29 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"null-ls-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1660318005,
|
||||
"narHash": "sha256-g9WCa9lVUmOV6dYRbEPjv/TLOR5hamjeCcKExVGS3OQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5c211b47aeadcc178c5320afd4e74c7eed5c389f",
|
||||
"lastModified": 1691810493,
|
||||
"narHash": "sha256-cWA0rzkOp/ekVKaFee7iea1lhnqKtWUIU+fW5M950wI=",
|
||||
"owner": "jose-elias-alvarez",
|
||||
"repo": "null-ls.nvim",
|
||||
"rev": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixos-22.05",
|
||||
"type": "indirect"
|
||||
"owner": "jose-elias-alvarez",
|
||||
"repo": "null-ls.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1667025500,
|
||||
"narHash": "sha256-88akaieCIrqta3Uyha7Zv3FJWzKJebb2BrOdZba1zdI=",
|
||||
"lastModified": 1706405996,
|
||||
"narHash": "sha256-hJbt3cTW0ma3k/kZ51F/T9MijyJxR1S3ZIeQHL2JPYw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nur",
|
||||
"rev": "21dd192519af12a01f1348bbfa86cde47f7aa392",
|
||||
"rev": "ab8cf147ee2254ef91e87ff7272524975fcbba3f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -190,30 +421,303 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim-lspconfig-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1701687137,
|
||||
"narHash": "sha256-qFjFofA2LoD4yRfx4KGfSCpR3mDkpFaagcm+TVNPqco=",
|
||||
"owner": "neovim",
|
||||
"repo": "nvim-lspconfig",
|
||||
"rev": "cf3dd4a290084a868fac0e2e876039321d57111c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "neovim",
|
||||
"ref": "v0.1.7",
|
||||
"repo": "nvim-lspconfig",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim-tree-lua-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705818283,
|
||||
"narHash": "sha256-EKAzWIT2Qs65Il1pwgpkFsCogFViapUiSHcZgVy+QsY=",
|
||||
"owner": "kyazdani42",
|
||||
"repo": "nvim-tree.lua",
|
||||
"rev": "7bdb220d0fe604a77361e92cdbc7af1b8a412126",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "kyazdani42",
|
||||
"repo": "nvim-tree.lua",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim-treesitter-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706392286,
|
||||
"narHash": "sha256-JWGTIuhyTUok4QsML63eUragDoqKkyk5tBuv25lmbg8=",
|
||||
"owner": "nvim-treesitter",
|
||||
"repo": "nvim-treesitter",
|
||||
"rev": "458ce4d16c1771fc601ec10a87820acae9981f6d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nvim-treesitter",
|
||||
"ref": "master",
|
||||
"repo": "nvim-treesitter",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"proton-ge": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1700610476,
|
||||
"narHash": "sha256-IoClZ6hl2lsz9OGfFgnz7vEAGlSY2+1K2lDEEsJQOfU=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton8-25/GE-Proton8-25.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton8-25/GE-Proton8-25.tar.gz"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"Comment-nvim-src": "Comment-nvim-src",
|
||||
"baleia-nvim-src": "baleia-nvim-src",
|
||||
"bufferline-nvim-src": "bufferline-nvim-src",
|
||||
"bypass-paywalls-clean": "bypass-paywalls-clean",
|
||||
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
|
||||
"darwin": "darwin",
|
||||
"disko": "disko",
|
||||
"fidget-nvim-src": "fidget-nvim-src",
|
||||
"firefox-darwin": "firefox-darwin",
|
||||
"hmts-nvim-src": "hmts-nvim-src",
|
||||
"home-manager": "home-manager",
|
||||
"kitty-scrollback-nvim-src": "kitty-scrollback-nvim-src",
|
||||
"nextcloud-cookbook": "nextcloud-cookbook",
|
||||
"nextcloud-external": "nextcloud-external",
|
||||
"nextcloud-news": "nextcloud-news",
|
||||
"nextcloud-snappymail": "nextcloud-snappymail",
|
||||
"nix2vim": "nix2vim",
|
||||
"nixos-generators": "nixos-generators",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"null-ls-nvim-src": "null-ls-nvim-src",
|
||||
"nur": "nur",
|
||||
"nvim-lspconfig-src": "nvim-lspconfig-src",
|
||||
"nvim-tree-lua-src": "nvim-tree-lua-src",
|
||||
"nvim-treesitter-src": "nvim-treesitter-src",
|
||||
"proton-ge": "proton-ge",
|
||||
"telescope-nvim-src": "telescope-nvim-src",
|
||||
"telescope-project-nvim-src": "telescope-project-nvim-src",
|
||||
"toggleterm-nvim-src": "toggleterm-nvim-src",
|
||||
"tree-sitter-bash": "tree-sitter-bash",
|
||||
"tree-sitter-ini": "tree-sitter-ini",
|
||||
"tree-sitter-lua": "tree-sitter-lua",
|
||||
"tree-sitter-puppet": "tree-sitter-puppet",
|
||||
"tree-sitter-python": "tree-sitter-python",
|
||||
"tree-sitter-rasi": "tree-sitter-rasi",
|
||||
"tree-sitter-vimdoc": "tree-sitter-vimdoc",
|
||||
"wallpapers": "wallpapers",
|
||||
"wsl": "wsl"
|
||||
"wsl": "wsl",
|
||||
"zenyd-mpv-scripts": "zenyd-mpv-scripts"
|
||||
}
|
||||
},
|
||||
"utils": {
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1659877975,
|
||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"telescope-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1701167040,
|
||||
"narHash": "sha256-H5RpyWMluE+Yxg7xFX43AZTVW+Yg70DF3FmEGXBUSNg=",
|
||||
"owner": "nvim-telescope",
|
||||
"repo": "telescope.nvim",
|
||||
"rev": "d90956833d7c27e73c621a61f20b29fdb7122709",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nvim-telescope",
|
||||
"ref": "0.1.5",
|
||||
"repo": "telescope.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"telescope-project-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1701464478,
|
||||
"narHash": "sha256-touMCltcnqkrQYV1NtNeWLQeFVGt+WM3aIWIdKilA7w=",
|
||||
"owner": "nvim-telescope",
|
||||
"repo": "telescope-project.nvim",
|
||||
"rev": "1aaf16580a614601a7f7077d9639aeb457dc5559",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nvim-telescope",
|
||||
"repo": "telescope-project.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"toggleterm-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1701858874,
|
||||
"narHash": "sha256-vJApw7XY2wOX9InfWcah+hkNxBfS1+kQUWr4ITxRmgA=",
|
||||
"owner": "akinsho",
|
||||
"repo": "toggleterm.nvim",
|
||||
"rev": "cbd041d91b90cd3c02df03fe6133208888f8e008",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "akinsho",
|
||||
"ref": "v2.9.0",
|
||||
"repo": "toggleterm.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-bash": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705686017,
|
||||
"narHash": "sha256-+Mpks0FyQLl26TX63J6WhaAl/QDUR1k9wSUY5SFwL+w=",
|
||||
"owner": "tree-sitter",
|
||||
"repo": "tree-sitter-bash",
|
||||
"rev": "f7239f638d3dc16762563a9027faeee518ce1bd9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "tree-sitter",
|
||||
"ref": "master",
|
||||
"repo": "tree-sitter-bash",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-ini": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1699877527,
|
||||
"narHash": "sha256-dYPeVTNWO4apY5dsjsKViavU7YtLeGTp6BzEemXhsEU=",
|
||||
"owner": "justinmk",
|
||||
"repo": "tree-sitter-ini",
|
||||
"rev": "bcb84a2d4bcd6f55b911c42deade75c8f90cb0c5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "justinmk",
|
||||
"repo": "tree-sitter-ini",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-lua": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1694072484,
|
||||
"narHash": "sha256-5t5w8KqbefInNbA12/jpNzmky/uOUhsLjKdEqpl1GEc=",
|
||||
"owner": "MunifTanjim",
|
||||
"repo": "tree-sitter-lua",
|
||||
"rev": "9668709211b2e683f27f414454a8b51bf0a6bda1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "MunifTanjim",
|
||||
"ref": "main",
|
||||
"repo": "tree-sitter-lua",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-puppet": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1690231696,
|
||||
"narHash": "sha256-YEjjy9WLwITERYqoeSVrRYnwVBIAwdc4o0lvAK9wizw=",
|
||||
"owner": "amaanq",
|
||||
"repo": "tree-sitter-puppet",
|
||||
"rev": "9ce9a5f7d64528572aaa8d59459ba869e634086b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "amaanq",
|
||||
"repo": "tree-sitter-puppet",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-python": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1700218345,
|
||||
"narHash": "sha256-hXNxa895SyNOG7PH2vAIkWbcMjZDjWYDsCafBZuvnT0=",
|
||||
"owner": "tree-sitter",
|
||||
"repo": "tree-sitter-python",
|
||||
"rev": "4bfdd9033a2225cc95032ce77066b7aeca9e2efc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "tree-sitter",
|
||||
"ref": "master",
|
||||
"repo": "tree-sitter-python",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-rasi": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1678701563,
|
||||
"narHash": "sha256-2nYZoLcrxxxiOJEySwHUm93lzMg8mU+V7LIP63ntFdA=",
|
||||
"owner": "Fymyte",
|
||||
"repo": "tree-sitter-rasi",
|
||||
"rev": "371dac6bcce0df5566c1cfebde69d90ecbeefd2d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Fymyte",
|
||||
"repo": "tree-sitter-rasi",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-vimdoc": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705491128,
|
||||
"narHash": "sha256-q5Ln8WPFrtKBfZnaAAlMh3Q/eczEt6wCMZAtx+ISCKg=",
|
||||
"owner": "neovim",
|
||||
"repo": "tree-sitter-vimdoc",
|
||||
"rev": "ed8695ad8de39c3f073da130156f00b1148e2891",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "neovim",
|
||||
"repo": "tree-sitter-vimdoc",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
@ -236,15 +740,17 @@
|
||||
"wsl": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1666720338,
|
||||
"narHash": "sha256-7V91ZtTz7zDXb6hivktQ9RlBglP+WEkYFSciPJHwMJw=",
|
||||
"lastModified": 1706071294,
|
||||
"narHash": "sha256-mpt86O5GQxKQoIg4nzKz810PeXjGSEFb4rW+shXbRco=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "7bfb8f5aa91fee30a189eae32cda8ddc465076df",
|
||||
"rev": "31346e340e828f79be23d9c83ec1674b152f17bc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -252,6 +758,22 @@
|
||||
"repo": "NixOS-WSL",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"zenyd-mpv-scripts": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1706283438,
|
||||
"narHash": "sha256-hpLZDtt5q18aZ8d9LHfT852wtBosKUTJ7Bx+cbjBLcg=",
|
||||
"owner": "zenyd",
|
||||
"repo": "mpv-scripts",
|
||||
"rev": "7100d19d18d111ce77fc9e6e8947c0d542a86397",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "zenyd",
|
||||
"repo": "mpv-scripts",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
307
flake.nix
307
flake.nix
@ -9,25 +9,37 @@
|
||||
|
||||
# Used for MacOS system config
|
||||
darwin = {
|
||||
url = "github:/lnl7/nix-darwin/master";
|
||||
url = "github:lnl7/nix-darwin/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Used for Windows Subsystem for Linux compatibility
|
||||
wsl.url = "github:nix-community/NixOS-WSL";
|
||||
wsl = {
|
||||
url = "github:nix-community/NixOS-WSL";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Used for user packages
|
||||
# Used for user packages and dotfiles
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/master";
|
||||
inputs.nixpkgs.follows =
|
||||
"nixpkgs"; # Use system packages list where available
|
||||
"nixpkgs"; # Use system packages list for their inputs
|
||||
};
|
||||
|
||||
# Community packages; used for Firefox extensions
|
||||
nur.url = "github:nix-community/nur";
|
||||
|
||||
# Use official Firefox binary for macOS
|
||||
firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
|
||||
firefox-darwin = {
|
||||
url = "github:bandithedoge/nixpkgs-firefox-darwin";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Manage disk format and partitioning
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Wallpapers
|
||||
wallpapers = {
|
||||
@ -41,22 +53,205 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Convert Nix to Neovim config
|
||||
nix2vim = {
|
||||
url = "github:gytis-ivaskevicius/nix2vim";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Neovim plugins
|
||||
nvim-lspconfig-src = {
|
||||
# https://github.com/neovim/nvim-lspconfig/tags
|
||||
url = "github:neovim/nvim-lspconfig/v0.1.7";
|
||||
flake = false;
|
||||
};
|
||||
cmp-nvim-lsp-src = {
|
||||
url = "github:hrsh7th/cmp-nvim-lsp";
|
||||
flake = false;
|
||||
};
|
||||
null-ls-nvim-src = {
|
||||
url = "github:jose-elias-alvarez/null-ls.nvim";
|
||||
flake = false;
|
||||
};
|
||||
baleia-nvim-src = {
|
||||
# https://github.com/m00qek/baleia.nvim/tags
|
||||
url = "github:m00qek/baleia.nvim";
|
||||
flake = false;
|
||||
};
|
||||
Comment-nvim-src = {
|
||||
# https://github.com/numToStr/Comment.nvim/releases
|
||||
url = "github:numToStr/Comment.nvim/v0.8.0";
|
||||
flake = false;
|
||||
};
|
||||
nvim-treesitter-src = {
|
||||
# https://github.com/nvim-treesitter/nvim-treesitter/tags
|
||||
url = "github:nvim-treesitter/nvim-treesitter/master";
|
||||
flake = false;
|
||||
};
|
||||
telescope-nvim-src = {
|
||||
# https://github.com/nvim-telescope/telescope.nvim/releases
|
||||
url = "github:nvim-telescope/telescope.nvim/0.1.5";
|
||||
flake = false;
|
||||
};
|
||||
telescope-project-nvim-src = {
|
||||
url = "github:nvim-telescope/telescope-project.nvim";
|
||||
flake = false;
|
||||
};
|
||||
toggleterm-nvim-src = {
|
||||
# https://github.com/akinsho/toggleterm.nvim/tags
|
||||
url = "github:akinsho/toggleterm.nvim/v2.9.0";
|
||||
flake = false;
|
||||
};
|
||||
bufferline-nvim-src = {
|
||||
# https://github.com/akinsho/bufferline.nvim/releases
|
||||
url = "github:akinsho/bufferline.nvim/v4.5.0";
|
||||
flake = false;
|
||||
};
|
||||
nvim-tree-lua-src = {
|
||||
url = "github:kyazdani42/nvim-tree.lua";
|
||||
flake = false;
|
||||
};
|
||||
hmts-nvim-src = {
|
||||
url = "github:calops/hmts.nvim";
|
||||
flake = false;
|
||||
};
|
||||
fidget-nvim-src = {
|
||||
# https://github.com/j-hui/fidget.nvim/tags
|
||||
url = "github:j-hui/fidget.nvim/v1.2.0";
|
||||
flake = false;
|
||||
};
|
||||
kitty-scrollback-nvim-src = {
|
||||
url = "github:mikesmithgh/kitty-scrollback.nvim";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Tree-Sitter Grammars
|
||||
tree-sitter-bash = {
|
||||
url = "github:tree-sitter/tree-sitter-bash/master";
|
||||
flake = false;
|
||||
};
|
||||
tree-sitter-python = {
|
||||
url = "github:tree-sitter/tree-sitter-python/master";
|
||||
flake = false;
|
||||
};
|
||||
tree-sitter-lua = {
|
||||
url = "github:MunifTanjim/tree-sitter-lua/main";
|
||||
flake = false;
|
||||
};
|
||||
tree-sitter-ini = {
|
||||
url = "github:justinmk/tree-sitter-ini";
|
||||
flake = false;
|
||||
};
|
||||
tree-sitter-puppet = {
|
||||
url = "github:amaanq/tree-sitter-puppet";
|
||||
flake = false;
|
||||
};
|
||||
tree-sitter-rasi = {
|
||||
url = "github:Fymyte/tree-sitter-rasi";
|
||||
flake = false;
|
||||
};
|
||||
tree-sitter-vimdoc = {
|
||||
url = "github:neovim/tree-sitter-vimdoc";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# MPV Scripts
|
||||
zenyd-mpv-scripts = {
|
||||
url = "github:zenyd/mpv-scripts";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# GE version of Proton for game compatibility
|
||||
# Alternatively, could consider using https://github.com/fufexan/nix-gaming
|
||||
proton-ge = {
|
||||
# https://github.com/GloriousEggroll/proton-ge-custom/releases
|
||||
url =
|
||||
"https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton8-25/GE-Proton8-25.tar.gz";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Firefox addon from outside the extension store
|
||||
bypass-paywalls-clean = {
|
||||
# https://gitlab.com/magnolia1234/bpc-uploads/-/commits/master/?ref_type=HEADS
|
||||
url = "gitlab:magnolia1234/bpc-uploads";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Nextcloud Apps
|
||||
nextcloud-news = {
|
||||
# https://github.com/nextcloud/news/releases
|
||||
url =
|
||||
"https://github.com/nextcloud/news/releases/download/25.0.0-alpha3/news.tar.gz";
|
||||
flake = false;
|
||||
};
|
||||
nextcloud-external = {
|
||||
# https://github.com/nextcloud-releases/external/releases
|
||||
url =
|
||||
"https://github.com/nextcloud-releases/external/releases/download/v5.3.1/external-v5.3.1.tar.gz";
|
||||
flake = false;
|
||||
};
|
||||
nextcloud-cookbook = {
|
||||
# https://github.com/christianlupus-nextcloud/cookbook-releases/releases/
|
||||
url =
|
||||
"https://github.com/christianlupus-nextcloud/cookbook-releases/releases/download/v0.11.0/cookbook-0.11.0.tar.gz";
|
||||
flake = false;
|
||||
};
|
||||
nextcloud-snappymail = {
|
||||
# https://github.com/the-djmaze/snappymail/releases
|
||||
url =
|
||||
"https://snappymail.eu/repository/nextcloud/snappymail-2.32.0-nextcloud.tar.gz";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, ... }@inputs:
|
||||
outputs = { nixpkgs, ... }@inputs:
|
||||
|
||||
let
|
||||
|
||||
# Global configuration for my systems
|
||||
globals = rec {
|
||||
globals = let baseName = "masu.rs";
|
||||
in rec {
|
||||
user = "noah";
|
||||
fullName = "Noah Masur";
|
||||
gitName = fullName;
|
||||
gitEmail = "7386960+nmasur@users.noreply.github.com";
|
||||
mailServer = "noahmasur.com";
|
||||
dotfilesRepo = "git@github.com:nmasur/dotfiles";
|
||||
mail.server = "noahmasur.com";
|
||||
mail.imapHost = "imap.purelymail.com";
|
||||
mail.smtpHost = "smtp.purelymail.com";
|
||||
dotfilesRepo = "https://github.com/nmasur/dotfiles";
|
||||
hostnames = {
|
||||
git = "git.${baseName}";
|
||||
influxdb = "influxdb.${baseName}";
|
||||
metrics = "metrics.${baseName}";
|
||||
prometheus = "prom.${baseName}";
|
||||
paperless = "paper.${baseName}";
|
||||
secrets = "vault.${baseName}";
|
||||
stream = "stream.${baseName}";
|
||||
content = "cloud.${baseName}";
|
||||
books = "books.${baseName}";
|
||||
download = "download.${baseName}";
|
||||
};
|
||||
};
|
||||
|
||||
# Common overlays to always use
|
||||
overlays = [
|
||||
inputs.nur.overlay
|
||||
inputs.nix2vim.overlay
|
||||
(import ./overlays/neovim-plugins.nix inputs)
|
||||
(import ./overlays/calibre-web.nix)
|
||||
(import ./overlays/disko.nix inputs)
|
||||
(import ./overlays/tree-sitter.nix inputs)
|
||||
(import ./overlays/caddy.nix inputs)
|
||||
(import ./overlays/mpv-scripts.nix inputs)
|
||||
(import ./overlays/nextcloud-apps.nix inputs)
|
||||
(import ./overlays/betterlockscreen.nix)
|
||||
(import ./overlays/proton-ge.nix inputs)
|
||||
(import ./overlays/gh-collaborators.nix)
|
||||
(import ./overlays/bypass-paywalls-clean.nix inputs)
|
||||
(import ./overlays/terraform.nix)
|
||||
];
|
||||
|
||||
# System types to support.
|
||||
supportedSystems =
|
||||
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
||||
@ -66,37 +261,64 @@
|
||||
|
||||
in rec {
|
||||
|
||||
# Contains my full system builds, including home-manager
|
||||
# nixos-rebuild switch --flake .#tempest
|
||||
nixosConfigurations = {
|
||||
desktop = import ./hosts/desktop { inherit inputs globals; };
|
||||
wsl = import ./hosts/wsl { inherit inputs globals; };
|
||||
oracle = import ./hosts/oracle { inherit inputs globals; };
|
||||
tempest = import ./hosts/tempest { inherit inputs globals overlays; };
|
||||
hydra = import ./hosts/hydra { inherit inputs globals overlays; };
|
||||
flame = import ./hosts/flame { inherit inputs globals overlays; };
|
||||
swan = import ./hosts/swan { inherit inputs globals overlays; };
|
||||
};
|
||||
|
||||
# Contains my full Mac system builds, including home-manager
|
||||
# darwin-rebuild switch --flake .#lookingglass
|
||||
darwinConfigurations = {
|
||||
macbook = import ./hosts/macbook { inherit inputs globals; };
|
||||
lookingglass =
|
||||
import ./hosts/lookingglass { inherit inputs globals overlays; };
|
||||
};
|
||||
|
||||
# For quickly applying local settings with:
|
||||
# home-manager switch --flake .#desktop
|
||||
# For quickly applying home-manager settings with:
|
||||
# home-manager switch --flake .#tempest
|
||||
homeConfigurations = {
|
||||
desktop =
|
||||
nixosConfigurations.desktop.config.home-manager.users.${globals.user}.home;
|
||||
macbook =
|
||||
darwinConfigurations.macbook.config.home-manager.users."Noah.Masur".home;
|
||||
tempest =
|
||||
nixosConfigurations.tempest.config.home-manager.users.${globals.user}.home;
|
||||
lookingglass =
|
||||
darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
|
||||
};
|
||||
|
||||
# Package servers into images with a generator
|
||||
packages.aws = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ]
|
||||
(system: {
|
||||
"${system}" = import ./hosts/aws { inherit inputs globals system; };
|
||||
});
|
||||
# Disk formatting, only used once
|
||||
diskoConfigurations = { root = import ./disks/root.nix; };
|
||||
|
||||
packages = let
|
||||
aws = system:
|
||||
import ./hosts/aws { inherit inputs globals overlays system; };
|
||||
staff = system:
|
||||
import ./hosts/staff { inherit inputs globals overlays system; };
|
||||
neovim = system:
|
||||
let pkgs = import nixpkgs { inherit system overlays; };
|
||||
in import ./modules/common/neovim/package {
|
||||
inherit pkgs;
|
||||
colors = (import ./colorscheme/gruvbox-dark).dark;
|
||||
};
|
||||
in {
|
||||
x86_64-linux.aws = aws "x86_64-linux";
|
||||
x86_64-linux.staff = staff "x86_64-linux";
|
||||
|
||||
# Package Neovim config into standalone package
|
||||
x86_64-linux.neovim = neovim "x86_64-linux";
|
||||
x86_64-darwin.neovim = neovim "x86_64-darwin";
|
||||
aarch64-linux.neovim = neovim "aarch64-linux";
|
||||
aarch64-darwin.neovim = neovim "aarch64-darwin";
|
||||
};
|
||||
|
||||
# Programs that can be run by calling this flake
|
||||
apps = forAllSystems (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
let pkgs = import nixpkgs { inherit system overlays; };
|
||||
in import ./apps { inherit pkgs; });
|
||||
|
||||
# Development environments
|
||||
devShells = forAllSystems (system:
|
||||
let pkgs = import nixpkgs { inherit system; };
|
||||
let pkgs = import nixpkgs { inherit system overlays; };
|
||||
in {
|
||||
|
||||
# Used to run commands and edit files in this repo
|
||||
@ -104,23 +326,24 @@
|
||||
buildInputs = with pkgs; [ git stylua nixfmt shfmt shellcheck ];
|
||||
};
|
||||
|
||||
# Used for cloud and systems development and administration
|
||||
devops = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
git
|
||||
terraform
|
||||
consul
|
||||
vault
|
||||
awscli2
|
||||
google-cloud-sdk
|
||||
ansible
|
||||
kubectl
|
||||
kubernetes-helm
|
||||
kustomize
|
||||
fluxcd
|
||||
];
|
||||
};
|
||||
});
|
||||
|
||||
checks = forAllSystems (system:
|
||||
let pkgs = import nixpkgs { inherit system overlays; };
|
||||
in {
|
||||
neovim = pkgs.runCommand "neovim-check-health" {
|
||||
buildInputs = [ inputs.self.packages.${system}.neovim ];
|
||||
} ''
|
||||
mkdir -p $out
|
||||
export HOME=$TMPDIR
|
||||
nvim -c "checkhealth" -c "write $out/health.log" -c "quitall"
|
||||
|
||||
# Check for errors inside the health log
|
||||
if $(grep "ERROR" $out/health.log); then
|
||||
cat $out/health.log
|
||||
exit 1
|
||||
fi
|
||||
'';
|
||||
});
|
||||
|
||||
# Templates for starting other projects quickly
|
||||
|
26
hosts/README.md
Normal file
26
hosts/README.md
Normal file
@ -0,0 +1,26 @@
|
||||
# Hosts
|
||||
|
||||
These are the individual machines managed by this flake.
|
||||
|
||||
| Host | Purpose |
|
||||
| --- | --- |
|
||||
| [aws](./aws/default.nix) | AWS AMI |
|
||||
| [staff](./staff/default.nix) | Live USB stick |
|
||||
| [flame](./flame/default.nix) | Oracle cloud server |
|
||||
| [hydra](./hydra/default.nix) | WSL config |
|
||||
| [lookingglass](./lookingglass/default.nix) | Work MacBook |
|
||||
| [swan](./swan/default.nix) | Home server |
|
||||
| [tempest](./tempest/default.nix) | Linux desktop |
|
||||
|
||||
## NixOS Workflow
|
||||
|
||||
Each hosts file is imported into [nixosConfigurations](../flake.nix) and passed
|
||||
the arguments from the flake (inputs, globals, overlays). The `nixosSystem`
|
||||
function in that hosts file will be called by the NixOS module system during a
|
||||
nixos-rebuild.
|
||||
|
||||
Each module in the each host's `modules` list is either a function or an
|
||||
attrset. The attrsets will simply apply values to options that have been
|
||||
declared in the config by other modules. Meanwhile, the functions will be
|
||||
passed various arguments, several of which you will see listed at the top of
|
||||
each of their files.
|
@ -1,30 +1,25 @@
|
||||
{ inputs, globals, ... }:
|
||||
{ inputs, system, globals, overlays, ... }:
|
||||
|
||||
with inputs;
|
||||
|
||||
nixos-generators.nixosGenerate {
|
||||
inputs.nixos-generators.nixosGenerate {
|
||||
inherit system;
|
||||
format = "amazon";
|
||||
modules = [
|
||||
home-manager.nixosModules.home-manager
|
||||
globals
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
user = globals.user;
|
||||
fullName = globals.fullName;
|
||||
dotfilesRepo = globals.dotfilesRepo;
|
||||
gitName = globals.gitName;
|
||||
gitEmail = globals.gitEmail;
|
||||
nixpkgs.overlays = overlays;
|
||||
networking.hostName = "sheep";
|
||||
gui.enable = false;
|
||||
colorscheme = (import ../modules/colorscheme/gruvbox);
|
||||
theme.colors = (import ../../colorscheme/gruvbox).dark;
|
||||
passwordHash = null;
|
||||
publicKey =
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||
# AWS settings require this
|
||||
permitRootLogin = "prohibit-password";
|
||||
}
|
||||
../../hosts/common.nix
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
../../modules/services/sshd.nix
|
||||
../../modules/nixos/services/sshd.nix
|
||||
] ++ [
|
||||
# Required to fix diskSize errors during build
|
||||
({ ... }: { amazonImage.sizeMB = 16 * 1024; })
|
||||
|
@ -26,7 +26,7 @@ data "aws_iam_policy_document" "vmimport" {
|
||||
actions = [
|
||||
"s3:GetBucketLocation",
|
||||
"s3:GetObject",
|
||||
"s3:ListBucket",
|
||||
"s3:ListBucket",
|
||||
]
|
||||
resources = [
|
||||
"arn:aws:s3:::${aws_s3_object.image.bucket}",
|
||||
|
@ -1,7 +1,6 @@
|
||||
name: 'Terraform'
|
||||
env:
|
||||
|
||||
|
||||
AWS_ACCOUNT_NUMBER: ''
|
||||
AWS_PLAN_ROLE_NAME: github_actions_plan
|
||||
AWS_APPLY_ROLE_NAME: github_actions_admin
|
||||
@ -82,15 +81,14 @@ jobs:
|
||||
|
||||
# Downloads the current repo code to the runner.
|
||||
- name: Checkout Repo Code
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Install Nix
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v17
|
||||
|
||||
# Build the image
|
||||
- name: Build Image
|
||||
run: nix build .#aws
|
||||
# Enable access to KVM, required to build an image
|
||||
- name: Enable KVM group perms
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
|
||||
# Login to AWS
|
||||
- name: AWS Assume Role
|
||||
@ -99,6 +97,28 @@ jobs:
|
||||
role-to-assume: ${{ env.AWS_ROLE_ARN }}
|
||||
aws-region: ${{ env.AWS_REGION }}
|
||||
|
||||
# Install Nix
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v17
|
||||
with:
|
||||
extra_nix_config: |
|
||||
substituters = s3://insert-cache-bucket https://cache.nixos.org/
|
||||
trusted-public-keys = insert-cache-bucket:M6PsZjHXcLvbQyPUBLICKEYGVoNwI84g1FBQzouRU= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
|
||||
|
||||
# Build the image
|
||||
- name: Build Image
|
||||
run: nix build .#aws
|
||||
|
||||
# Copy the image to S3
|
||||
- name: Upload Image to Cache
|
||||
env:
|
||||
NIX_CACHE_PRIVATE_KEY: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
|
||||
run: |
|
||||
echo "$NIX_CACHE_PRIVATE_KEY" > cache.key
|
||||
nix store sign --key-file cache.key $(readlink result)
|
||||
nix copy --to s3://t2-aws-nixos-test $(readlink result)
|
||||
rm cache.key
|
||||
|
||||
# Exports all GitHub Secrets as environment variables prefixed by
|
||||
# "TF_VAR_", which exposes them to Terraform. The name of each GitHub
|
||||
# Secret must match its Terraform variable name exactly.
|
||||
|
@ -1,48 +0,0 @@
|
||||
{ inputs, globals, ... }:
|
||||
|
||||
with inputs;
|
||||
|
||||
# System configuration for my desktop
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
globals
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
networking.hostName = "desktop";
|
||||
nixpkgs.overlays = [ nur.overlay ];
|
||||
# Set registry to flake packages, used for nix X commands
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||
gui.enable = true;
|
||||
theme = {
|
||||
colors = (import ../../modules/colorscheme/gruvbox).dark;
|
||||
dark = true;
|
||||
};
|
||||
wallpaper = "${wallpapers}/gruvbox/road.jpg";
|
||||
gtk.theme.name = nixpkgs.lib.mkDefault "Adwaita-dark";
|
||||
passwordHash = nixpkgs.lib.fileContents ../../private/password.sha512;
|
||||
}
|
||||
|
||||
./hardware-configuration.nix
|
||||
../common.nix
|
||||
../../modules/hardware
|
||||
../../modules/nixos
|
||||
../../modules/graphical
|
||||
../../modules/applications/media.nix
|
||||
../../modules/applications/firefox.nix
|
||||
../../modules/applications/kitty.nix
|
||||
../../modules/applications/1password.nix
|
||||
../../modules/applications/discord.nix
|
||||
../../modules/applications/nautilus.nix
|
||||
../../modules/applications/obsidian.nix
|
||||
../../modules/mail
|
||||
../../modules/gaming/steam.nix
|
||||
../../modules/gaming/legendary.nix
|
||||
../../modules/repositories/notes.nix
|
||||
../../modules/services/keybase.nix
|
||||
../../modules/services/mullvad.nix
|
||||
../../modules/programming/nix.nix
|
||||
];
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules =
|
||||
[ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
hardware.cpu.intel.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
120
hosts/flame/default.nix
Normal file
120
hosts/flame/default.nix
Normal file
@ -0,0 +1,120 @@
|
||||
# The Flame
|
||||
# System configuration for an Oracle free server
|
||||
|
||||
# See [readme](../README.md) to explain how this file works.
|
||||
|
||||
# How to install:
|
||||
# https://blog.korfuri.fr/posts/2022/08/nixos-on-an-oracle-free-tier-ampere-machine/
|
||||
# These days, probably use nixos-anywhere instead.
|
||||
|
||||
{ inputs, globals, overlays, ... }:
|
||||
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
globals
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
{
|
||||
nixpkgs.overlays = overlays;
|
||||
|
||||
# Hardware
|
||||
server = true;
|
||||
networking.hostName = "flame";
|
||||
|
||||
# Not sure what's necessary but too afraid to remove anything
|
||||
imports = [ (inputs.nixpkgs + "/nixos/modules/profiles/qemu-guest.nix") ];
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" ];
|
||||
|
||||
# File systems must be declared in order to boot
|
||||
|
||||
# This is the root filesystem containing NixOS
|
||||
# I forgot to set a clean label for it
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/e1b6bd50-306d-429a-9f45-78f57bc597c3";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# This is the boot filesystem for systemd-boot
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/D5CA-237A";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
# Theming
|
||||
|
||||
# Server doesn't require GUI
|
||||
gui.enable = false;
|
||||
|
||||
# Still require colors for programs like Neovim, K9S
|
||||
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
||||
|
||||
# Programs and services
|
||||
atuin.enable = true;
|
||||
cloudflare.enable = true; # Proxy traffic with Cloudflare
|
||||
dotfiles.enable = true; # Clone dotfiles
|
||||
neovim.enable = true;
|
||||
giteaRunner.enable = true;
|
||||
services.caddy.enable = true;
|
||||
services.grafana.enable = true;
|
||||
services.openssh.enable = true;
|
||||
services.victoriametrics.enable = true;
|
||||
services.influxdb2.enable = true;
|
||||
services.gitea.enable = true;
|
||||
services.vaultwarden.enable = true;
|
||||
services.minecraft-server.enable = true; # Setup Minecraft server
|
||||
|
||||
# Allows private remote access over the internet
|
||||
cloudflareTunnel = {
|
||||
enable = true;
|
||||
id = "bd250ee1-ed2e-42d2-b627-039f1eb5a4d2";
|
||||
credentialsFile = ../../private/cloudflared-flame.age;
|
||||
ca =
|
||||
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org";
|
||||
};
|
||||
|
||||
# Nextcloud backup config
|
||||
backup.s3 = {
|
||||
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||
bucket = "noahmasur-backup";
|
||||
accessKeyId = "0026b0e73b2e2c80000000005";
|
||||
};
|
||||
|
||||
# Disable passwords, only use SSH key
|
||||
publicKey =
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||
|
||||
# # Wireguard config for Transmission
|
||||
# wireguard.enable = true;
|
||||
# networking.wireguard.interfaces.wg0 = {
|
||||
#
|
||||
# # The local IPs for this machine within the Wireguard network
|
||||
# # Any inbound traffic bound for these IPs should be kept on localhost
|
||||
# ips = [ "10.66.13.200/32" "fc00:bbbb:bbbb:bb01::3:dc7/128" ];
|
||||
#
|
||||
# peers = [{
|
||||
#
|
||||
# # Identity of Wireguard target peer (VPN)
|
||||
# publicKey = "bOOP5lIjqCdDx5t+mP/kEcSbHS4cZqE0rMlBI178lyY=";
|
||||
#
|
||||
# # The public internet address of the target peer
|
||||
# endpoint = "86.106.143.132:51820";
|
||||
#
|
||||
# # Which outgoing IP ranges should be sent through Wireguard
|
||||
# allowedIPs = [ "0.0.0.0/0" "::0/0" ];
|
||||
#
|
||||
# # Send heartbeat signal within the network
|
||||
# persistentKeepalive = 25;
|
||||
#
|
||||
# }];
|
||||
#
|
||||
# };
|
||||
|
||||
# # VPN port forwarding
|
||||
# services.transmission.settings.peer-port = 57599;
|
||||
|
||||
}
|
||||
];
|
||||
}
|
48
hosts/hydra/default.nix
Normal file
48
hosts/hydra/default.nix
Normal file
@ -0,0 +1,48 @@
|
||||
# The Hydra
|
||||
# System configuration for WSL
|
||||
|
||||
# See [readme](../README.md) to explain how this file works.
|
||||
|
||||
{ inputs, globals, overlays, ... }:
|
||||
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
../../modules/wsl
|
||||
globals
|
||||
inputs.wsl.nixosModules.wsl
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
networking.hostName = "hydra";
|
||||
nixpkgs.overlays = overlays;
|
||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||
gui.enable = false;
|
||||
theme = {
|
||||
colors = (import ../../colorscheme/gruvbox).dark;
|
||||
dark = true;
|
||||
};
|
||||
passwordHash = inputs.nixpkgs.lib.fileContents ../../misc/password.sha512;
|
||||
wsl = {
|
||||
enable = true;
|
||||
wslConf.automount.root = "/mnt";
|
||||
defaultUser = globals.user;
|
||||
startMenuLaunchers = true;
|
||||
nativeSystemd = true;
|
||||
wslConf.network.generateResolvConf = true; # Turn off if it breaks VPN
|
||||
interop.includePath =
|
||||
false; # Including Windows PATH will slow down Neovim command mode
|
||||
};
|
||||
|
||||
neovim.enable = true;
|
||||
mail.enable = true;
|
||||
mail.aerc.enable = true;
|
||||
mail.himalaya.enable = true;
|
||||
dotfiles.enable = true;
|
||||
nixlang.enable = true;
|
||||
lua.enable = true;
|
||||
}
|
||||
];
|
||||
}
|
49
hosts/lookingglass/default.nix
Normal file
49
hosts/lookingglass/default.nix
Normal file
@ -0,0 +1,49 @@
|
||||
# The Looking Glass
|
||||
# System configuration for my work Macbook
|
||||
|
||||
{ inputs, globals, overlays, ... }:
|
||||
|
||||
inputs.darwin.lib.darwinSystem {
|
||||
system = "aarch64-darwin";
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
../../modules/common
|
||||
../../modules/darwin
|
||||
(globals // rec {
|
||||
user = "Noah.Masur";
|
||||
gitName = "Noah-Masur_1701";
|
||||
gitEmail = "${user}@take2games.com";
|
||||
})
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
{
|
||||
nixpkgs.overlays = [ inputs.firefox-darwin.overlay ] ++ overlays;
|
||||
networking.hostName = "lookingglass";
|
||||
identityFile = "/Users/Noah.Masur/.ssh/id_ed25519";
|
||||
gui.enable = true;
|
||||
theme = {
|
||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
||||
dark = true;
|
||||
};
|
||||
mail.user = globals.user;
|
||||
atuin.enable = true;
|
||||
charm.enable = true;
|
||||
neovim.enable = true;
|
||||
mail.enable = true;
|
||||
mail.aerc.enable = true;
|
||||
mail.himalaya.enable = false;
|
||||
kitty.enable = true;
|
||||
discord.enable = true;
|
||||
firefox.enable = true;
|
||||
dotfiles.enable = true;
|
||||
nixlang.enable = true;
|
||||
terraform.enable = true;
|
||||
python.enable = true;
|
||||
rust.enable = true;
|
||||
lua.enable = true;
|
||||
obsidian.enable = true;
|
||||
kubernetes.enable = true;
|
||||
_1password.enable = true;
|
||||
slack.enable = true;
|
||||
}
|
||||
];
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
{ inputs, globals, ... }:
|
||||
|
||||
with inputs;
|
||||
|
||||
# System configuration for my work MacBook
|
||||
darwin.lib.darwinSystem {
|
||||
system = "x86_64-darwin";
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
(globals // {
|
||||
user = "Noah.Masur";
|
||||
gitName = "Noah-Masur_1701";
|
||||
gitEmail = "Noah.Masur@take2games.com";
|
||||
})
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
identityFile = "/Users/Noah.Masur/.ssh/id_ed25519";
|
||||
gui.enable = true;
|
||||
theme = {
|
||||
colors = (import ../../modules/colorscheme/gruvbox).dark;
|
||||
dark = true;
|
||||
};
|
||||
mailUser = globals.user;
|
||||
networking.hostName = "noah-masur-mac";
|
||||
nixpkgs.overlays = [ nur.overlay firefox-darwin.overlay ];
|
||||
# Set registry to flake packages, used for nix X commands
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
}
|
||||
../common.nix
|
||||
../../modules/darwin
|
||||
../../modules/mail
|
||||
../../modules/applications/alacritty.nix
|
||||
../../modules/applications/kitty.nix
|
||||
../../modules/applications/discord.nix
|
||||
../../modules/applications/firefox.nix
|
||||
../../modules/repositories/notes.nix
|
||||
../../modules/programming/nix.nix
|
||||
../../modules/programming/terraform.nix
|
||||
../../modules/programming/python.nix
|
||||
../../modules/programming/lua.nix
|
||||
../../modules/programming/kubernetes.nix
|
||||
];
|
||||
}
|
@ -1,90 +0,0 @@
|
||||
{ inputs, globals, ... }:
|
||||
|
||||
with inputs;
|
||||
|
||||
# System configuration for an Oracle free server
|
||||
|
||||
# How to install:
|
||||
# https://blog.korfuri.fr/posts/2022/08/nixos-on-an-oracle-free-tier-ampere-machine/
|
||||
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
(removeAttrs globals [ "mailServer" ])
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
gui.enable = false;
|
||||
colorscheme = (import ../../modules/colorscheme/gruvbox);
|
||||
|
||||
# FQDNs for various services
|
||||
networking.hostName = "oracle";
|
||||
bookServer = "books.masu.rs";
|
||||
streamServer = "stream.masu.rs";
|
||||
nextcloudServer = "cloud.masu.rs";
|
||||
transmissionServer = "download.masu.rs";
|
||||
metricsServer = "metrics.masu.rs";
|
||||
vaultwardenServer = "vault.masu.rs";
|
||||
giteaServer = "git.masu.rs";
|
||||
|
||||
# Disable passwords, only use SSH key
|
||||
publicKey =
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||
|
||||
# Nextcloud backup config
|
||||
backupS3 = {
|
||||
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||
bucket = "noahmasur-backup";
|
||||
accessKeyId = "0026b0e73b2e2c80000000005";
|
||||
};
|
||||
|
||||
# Grant access to Jellyfin directories from Nextcloud
|
||||
users.users.nextcloud.extraGroups = [ "jellyfin" ];
|
||||
|
||||
# Wireguard config for Transmission
|
||||
networking.wireguard.interfaces.wg0 = {
|
||||
|
||||
# The local IPs for this machine within the Wireguard network
|
||||
# Any inbound traffic bound for these IPs should be kept on localhost
|
||||
ips = [ "10.66.13.200/32" "fc00:bbbb:bbbb:bb01::3:dc7/128" ];
|
||||
|
||||
peers = [{
|
||||
|
||||
# Identity of Wireguard target peer (VPN)
|
||||
publicKey = "bOOP5lIjqCdDx5t+mP/kEcSbHS4cZqE0rMlBI178lyY=";
|
||||
|
||||
# The public internet address of the target peer
|
||||
endpoint = "86.106.143.132:51820";
|
||||
|
||||
# Which outgoing IP ranges should be sent through Wireguard
|
||||
allowedIPs = [ "0.0.0.0/0" "::0/0" ];
|
||||
|
||||
# Send heartbeat signal within the network
|
||||
persistentKeepalive = 25;
|
||||
|
||||
}];
|
||||
|
||||
};
|
||||
|
||||
# VPN port forwarding
|
||||
services.transmission.settings.peer-port = 57599;
|
||||
|
||||
# Grant access to Transmission directories from Jellyfin
|
||||
users.users.jellyfin.extraGroups = [ "transmission" ];
|
||||
}
|
||||
./hardware-configuration.nix
|
||||
../common.nix
|
||||
../../modules/nixos
|
||||
../../modules/hardware/server.nix
|
||||
../../modules/services/sshd.nix
|
||||
../../modules/services/calibre.nix
|
||||
../../modules/services/jellyfin.nix
|
||||
../../modules/services/nextcloud.nix
|
||||
../../modules/services/cloudflare.nix
|
||||
../../modules/services/transmission.nix
|
||||
../../modules/services/prometheus.nix
|
||||
../../modules/services/vaultwarden.nix
|
||||
../../modules/services/gitea.nix
|
||||
../../modules/gaming/minecraft-server.nix
|
||||
];
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/e1b6bd50-306d-429a-9f45-78f57bc597c3";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/D5CA-237A";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.eth0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
# Scan hosts: ssh-keyscan -t ed25519 <hostnames>
|
||||
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s noah
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHVknmPi7sG6ES0G0jcsvebzKGWWaMfJTYgvOue6EULI oracle.masu.rs
|
43
hosts/staff/default.nix
Normal file
43
hosts/staff/default.nix
Normal file
@ -0,0 +1,43 @@
|
||||
# The Staff
|
||||
# ISO configuration for my USB drive
|
||||
|
||||
{ inputs, system, overlays, ... }:
|
||||
|
||||
inputs.nixos-generators.nixosGenerate {
|
||||
inherit system;
|
||||
format = "install-iso";
|
||||
modules = [{
|
||||
nixpkgs.overlays = overlays;
|
||||
networking.hostName = "staff";
|
||||
users.extraUsers.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"
|
||||
];
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 22 ];
|
||||
allowSFTP = true;
|
||||
settings = {
|
||||
GatewayPorts = "no";
|
||||
X11Forwarding = false;
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "yes";
|
||||
};
|
||||
};
|
||||
environment.systemPackages =
|
||||
let pkgs = import inputs.nixpkgs { inherit system overlays; };
|
||||
in with pkgs; [
|
||||
git
|
||||
vim
|
||||
wget
|
||||
curl
|
||||
(import ../../modules/common/neovim/package {
|
||||
inherit pkgs;
|
||||
colors = (import ../../colorscheme/gruvbox).dark;
|
||||
})
|
||||
];
|
||||
nix.extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
warn-dirty = false
|
||||
'';
|
||||
}];
|
||||
}
|
109
hosts/swan/default.nix
Normal file
109
hosts/swan/default.nix
Normal file
@ -0,0 +1,109 @@
|
||||
# The Swan
|
||||
# System configuration for my home NAS server
|
||||
|
||||
# See [readme](../README.md) to explain how this file works.
|
||||
|
||||
{ inputs, globals, overlays, ... }:
|
||||
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
globals
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.disko.nixosModules.disko
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
{
|
||||
nixpkgs.overlays = overlays;
|
||||
|
||||
# Hardware
|
||||
server = true;
|
||||
physical = true;
|
||||
networking.hostName = "swan";
|
||||
|
||||
# Not sure what's necessary but too afraid to remove anything
|
||||
boot.initrd.availableKernelModules =
|
||||
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
||||
|
||||
# Required for transcoding
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelParams = [
|
||||
"radeon.si_support=0"
|
||||
"amdgpu.si_support=1"
|
||||
"radeon.cik_support=0"
|
||||
"amdgpu.cik_support=1"
|
||||
"amdgpu.dc=1"
|
||||
];
|
||||
|
||||
# Required binary blobs to boot on this machine
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# Prioritize efficiency over performance
|
||||
powerManagement.cpuFreqGovernor = "powersave";
|
||||
|
||||
# Allow firmware updates
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
# ZFS
|
||||
zfs.enable = true;
|
||||
# Generated with: head -c 8 /etc/machine-id
|
||||
networking.hostId = "600279f4"; # Random ID required for ZFS
|
||||
|
||||
# Sets root ext4 filesystem instead of declaring it manually
|
||||
disko = {
|
||||
enableConfig = true;
|
||||
devices = (import ../../disks/root.nix { disk = "/dev/nvme0n1"; });
|
||||
};
|
||||
|
||||
# Automatically load the ZFS pool on boot
|
||||
boot.zfs.extraPools = [ "tank" ];
|
||||
|
||||
# Theming
|
||||
|
||||
# Server doesn't require GUI
|
||||
gui.enable = false;
|
||||
|
||||
# Still require colors for programs like Neovim, K9S
|
||||
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
||||
|
||||
# Programs and services
|
||||
atuin.enable = true;
|
||||
neovim.enable = true;
|
||||
cloudflare.enable = true;
|
||||
dotfiles.enable = true;
|
||||
arrs.enable = true;
|
||||
services.bind.enable = true;
|
||||
services.caddy.enable = true;
|
||||
services.jellyfin.enable = true;
|
||||
services.nextcloud.enable = true;
|
||||
services.calibre-web.enable = true;
|
||||
services.openssh.enable = true;
|
||||
services.prometheus.enable = false;
|
||||
services.vmagent.enable = true;
|
||||
services.samba.enable = true;
|
||||
services.paperless.enable = true;
|
||||
services.postgresql.enable = true;
|
||||
|
||||
# Allows private remote access over the internet
|
||||
cloudflareTunnel = {
|
||||
enable = true;
|
||||
id = "646754ac-2149-4a58-b51a-e1d0a1f3ade2";
|
||||
credentialsFile = ../../private/cloudflared-swan.age;
|
||||
ca =
|
||||
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCHF/UMtJqPFrf6f6GRY0ZFnkCW7b6sYgUTjTtNfRj1RdmNic1NoJZql7y6BrqQinZvy7nsr1UFDNWoHn6ah3tg= open-ssh-ca@cloudflareaccess.org";
|
||||
};
|
||||
|
||||
# Send regular backups and litestream for DBs to an S3-like bucket
|
||||
backup.s3 = {
|
||||
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||
bucket = "noahmasur-backup";
|
||||
accessKeyId = "0026b0e73b2e2c80000000005";
|
||||
};
|
||||
|
||||
# Disable passwords, only use SSH key
|
||||
publicKey =
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||
}
|
||||
];
|
||||
}
|
136
hosts/tempest/default.nix
Normal file
136
hosts/tempest/default.nix
Normal file
@ -0,0 +1,136 @@
|
||||
# The Tempest
|
||||
# System configuration for my desktop
|
||||
|
||||
# See [readme](../README.md) to explain how this file works.
|
||||
|
||||
{ inputs, globals, overlays, ... }:
|
||||
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
globals
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
{
|
||||
nixpkgs.overlays = overlays;
|
||||
|
||||
# Hardware
|
||||
physical = true;
|
||||
networking.hostName = "tempest";
|
||||
|
||||
# Not sure what's necessary but too afraid to remove anything
|
||||
boot.initrd.availableKernelModules =
|
||||
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
||||
|
||||
# Graphics and VMs
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
|
||||
# Required binary blobs to boot on this machine
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# Prioritize performance over efficiency
|
||||
powerManagement.cpuFreqGovernor = "performance";
|
||||
|
||||
# Allow firmware updates
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
|
||||
# Helps reduce GPU fan noise under idle loads
|
||||
hardware.fancontrol.enable = true;
|
||||
hardware.fancontrol.config = ''
|
||||
# Configuration file generated by pwmconfig, changes will be lost
|
||||
INTERVAL=10
|
||||
DEVPATH=hwmon0=devices/pci0000:00/0000:00:03.1/0000:06:00.0/0000:07:00.0/0000:08:00.0
|
||||
DEVNAME=hwmon0=amdgpu
|
||||
FCTEMPS=hwmon0/pwm1=hwmon0/temp1_input
|
||||
FCFANS= hwmon0/pwm1=hwmon0/fan1_input
|
||||
MINTEMP=hwmon0/pwm1=50
|
||||
MAXTEMP=hwmon0/pwm1=70
|
||||
MINSTART=hwmon0/pwm1=100
|
||||
MINSTOP=hwmon0/pwm1=10
|
||||
MINPWM=hwmon0/pwm1=10
|
||||
MAXPWM=hwmon0/pwm1=240
|
||||
'';
|
||||
|
||||
# File systems must be declared in order to boot
|
||||
|
||||
# This is the root filesystem containing NixOS
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# This is the boot filesystem for Grub
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
# Secrets must be prepared ahead before deploying
|
||||
passwordHash = inputs.nixpkgs.lib.fileContents ../../misc/password.sha512;
|
||||
|
||||
# Theming
|
||||
|
||||
# Turn on all features related to desktop and graphical applications
|
||||
gui.enable = true;
|
||||
|
||||
# Set the system-wide theme, also used for non-graphical programs
|
||||
theme = {
|
||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
||||
dark = true;
|
||||
};
|
||||
wallpaper = "${inputs.wallpapers}/gruvbox/road.jpg";
|
||||
gtk.theme.name = inputs.nixpkgs.lib.mkDefault "Adwaita-dark";
|
||||
|
||||
# Programs and services
|
||||
atuin.enable = true;
|
||||
charm.enable = true;
|
||||
neovim.enable = true;
|
||||
media.enable = true;
|
||||
dotfiles.enable = true;
|
||||
firefox.enable = true;
|
||||
kitty.enable = true;
|
||||
_1password.enable = true;
|
||||
discord.enable = true;
|
||||
nautilus.enable = true;
|
||||
obsidian.enable = true;
|
||||
mail.enable = true;
|
||||
mail.aerc.enable = true;
|
||||
mail.himalaya.enable = true;
|
||||
keybase.enable = true;
|
||||
mullvad.enable = false;
|
||||
nixlang.enable = true;
|
||||
rust.enable = true;
|
||||
yt-dlp.enable = true;
|
||||
gaming = {
|
||||
dwarf-fortress.enable = true;
|
||||
enable = true;
|
||||
steam.enable = true;
|
||||
legendary.enable = true;
|
||||
lutris.enable = true;
|
||||
leagueoflegends.enable = true;
|
||||
ryujinx.enable = true;
|
||||
};
|
||||
services.vmagent.enable = true; # Enables Prometheus metrics
|
||||
services.openssh.enable =
|
||||
true; # Required for Cloudflare tunnel and identity file
|
||||
|
||||
# Allows private remote access over the internet
|
||||
cloudflareTunnel = {
|
||||
enable = true;
|
||||
id = "ac133a82-31fb-480c-942a-cdbcd4c58173";
|
||||
credentialsFile = ../../private/cloudflared-tempest.age;
|
||||
ca =
|
||||
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org";
|
||||
};
|
||||
|
||||
# Allows requests to force machine to wake up
|
||||
# This network interface might change, needs to be set specifically for each machine.
|
||||
# Or set usePredictableInterfaceNames = false
|
||||
networking.interfaces.enp5s0.wakeOnLan.enable = true;
|
||||
|
||||
}
|
||||
];
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
{ inputs, globals, ... }:
|
||||
|
||||
with inputs;
|
||||
|
||||
# System configuration for WSL
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
globals
|
||||
wsl.nixosModules.wsl
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
networking.hostName = "wsl";
|
||||
# Set registry to flake packages, used for nix X commands
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||
gui.enable = false;
|
||||
theme = {
|
||||
colors = (import ../../modules/colorscheme/gruvbox).dark;
|
||||
dark = true;
|
||||
};
|
||||
passwordHash = nixpkgs.lib.fileContents ../../private/password.sha512;
|
||||
wsl = {
|
||||
enable = true;
|
||||
automountPath = "/mnt";
|
||||
defaultUser = globals.user;
|
||||
startMenuLaunchers = true;
|
||||
wslConf.network.generateResolvConf = true; # Turn off if it breaks VPN
|
||||
interop.includePath =
|
||||
false; # Including Windows PATH will slow down Neovim command mode
|
||||
};
|
||||
}
|
||||
../common.nix
|
||||
../../modules/wsl
|
||||
../../modules/nixos
|
||||
../../modules/mail
|
||||
../../modules/repositories/notes.nix
|
||||
../../modules/programming/nix.nix
|
||||
../../modules/programming/lua.nix
|
||||
];
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
#!/usr/local/bin/nu
|
||||
|
||||
ls | sort-by size | reverse | keep 10
|
||||
|
@ -1,3 +0,0 @@
|
||||
#!/usr/local/bin/nu
|
||||
|
||||
ls **/* | where type == File | sort-by size | reverse | keep 10
|
@ -1,37 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Adapted from: https://seb.jambor.dev/posts/improving-shell-workflows-with-fzf/
|
||||
# Requires the following variables to be set:
|
||||
# - ATLASSIAN_EMAIL
|
||||
# - ATLASSIAN_API_TOKEN
|
||||
# - JIRA_HOSTNAME
|
||||
# - JIRA_PROJECT
|
||||
|
||||
choose_issue() {
|
||||
jq_template='"\(.key): \(.fields.summary)"'
|
||||
query="project=$JIRA_PROJECT AND status not in (\"Done\") AND assignee=currentUser()"
|
||||
|
||||
branch_name=$(
|
||||
curl \
|
||||
--data-urlencode "jql=$query" \
|
||||
--get \
|
||||
--user "$ATLASSIAN_EMAIL:$ATLASSIAN_API_TOKEN" \
|
||||
--silent \
|
||||
--compressed \
|
||||
"https://$JIRA_HOSTNAME/rest/api/2/search" |
|
||||
jq ".issues[] | $jq_template" |
|
||||
sed -e 's/"\(.*\)"/\1/' |
|
||||
fzf \
|
||||
--preview='jira-details {1}' \
|
||||
--preview-window=top:wrap |
|
||||
sed -e 's/: /:/' -e 's/[^a-zA-Z0-9:]/-/g' |
|
||||
awk -F ":" '{printf "%s/%s", $1, tolower($2)}'
|
||||
)
|
||||
|
||||
echo "$branch_name"
|
||||
}
|
||||
|
||||
issue_branch=$(choose_issue)
|
||||
if [ -n "$issue_branch" ]; then
|
||||
echo "git checkout -b \"$issue_branch\""
|
||||
fi
|
@ -1,38 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Adapted from: https://seb.jambor.dev/posts/improving-shell-workflows-with-fzf/
|
||||
# Requires the following variables to be set:
|
||||
# - ATLASSIAN_EMAIL
|
||||
# - ATLASSIAN_API_TOKEN
|
||||
# - JIRA_HOSTNAME
|
||||
# - JIRA_PROJECT (for other script)
|
||||
|
||||
issue_details() {
|
||||
jira_key=$(echo "$1" | cut -d":" -f1)
|
||||
jq_template='"'\
|
||||
'# \(.key): \(.fields.summary)\n'\
|
||||
'\n'\
|
||||
'*Created*: \(.fields.created)\n'\
|
||||
'*Status*: \(.fields.status.statusCategory.name)\n'\
|
||||
'*Reporter*: \(.fields.reporter.displayName)\n'\
|
||||
'*Priority*: \(.fields.priority.name)\n'\
|
||||
"*Epic*: https://$JIRA_HOSTNAME/browse/\(.fields.customfield_10014)\n"\
|
||||
'\n'\
|
||||
'## Link\n\n'\
|
||||
"https://$JIRA_HOSTNAME/browse/\(.key)\n"\
|
||||
'\n'\
|
||||
'## Description\n\n'\
|
||||
'\(.fields.description)'\
|
||||
'"'
|
||||
curl \
|
||||
--get \
|
||||
--user "$ATLASSIAN_EMAIL:$ATLASSIAN_API_TOKEN" \
|
||||
--silent \
|
||||
--compressed \
|
||||
"https://$JIRA_HOSTNAME/rest/api/2/issue/$jira_key" |
|
||||
jq "$jq_template" |
|
||||
xargs printf |
|
||||
bat -l md --color always --style plain
|
||||
}
|
||||
|
||||
issue_details "$1"
|
@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
kubectl -n kube-system get secret "$(
|
||||
kubectl -n kube-system get secret |
|
||||
grep dashboard-admin |
|
||||
awk '{print $1}'
|
||||
)" -o json |
|
||||
jq -j --raw-output '.data.token' |
|
||||
base64 --decode |
|
||||
pbcopy
|
||||
|
||||
open http://localhost:8001/api/v1/namespaces/default/services/https:kubernetes-dashboard:https/proxy/#!/login
|
||||
|
||||
kubectl proxy
|
@ -1,3 +0,0 @@
|
||||
#!/usr/local/bin/nu
|
||||
|
||||
ls | sort-by modified | reverse | keep 5
|
@ -1,3 +0,0 @@
|
||||
#!/usr/local/bin/nu
|
||||
|
||||
ls | sort-by modified | keep 5
|
@ -1,16 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Credit: https://github.com/junegunn/fzf/blob/master/ADVANCED.md
|
||||
|
||||
read -ra tokens < <(
|
||||
kubectl get pods --all-namespaces |
|
||||
fzf --info=inline --layout=reverse --header-lines=1 --border \
|
||||
--prompt "$(kubectl config current-context | sed 's/-context$//')> " \
|
||||
--header $'Press CTRL-O to open log in editor\n\n' \
|
||||
--bind ctrl-/:toggle-preview \
|
||||
--bind "ctrl-o:execute:${EDITOR:-vim} <(kubectl logs --namespace {1} {2}) > /dev/tty" \
|
||||
--preview-window up,follow \
|
||||
--preview 'kubectl logs --follow --tail=100000 --namespace {1} {2}' "$@"
|
||||
)
|
||||
[ ${#tokens} -gt 1 ] &&
|
||||
kubectl exec -it --namespace "${tokens[0]}" "${tokens[1]}" -- /bin/sh
|
@ -1,3 +0,0 @@
|
||||
#!/usr/local/bin/nu
|
||||
|
||||
ls -al | where type == Symlink | select name target
|
@ -1,5 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
|
||||
|
||||
urldecode "$@"
|
@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>com.noah.newsboat</string>
|
||||
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/usr/local/bin/newsboat -x reload</string>
|
||||
</array>
|
||||
|
||||
<key>Nice</key>
|
||||
<integer>1</integer>
|
||||
|
||||
<key>StartInterval</key>
|
||||
<integer>1800</integer>
|
||||
|
||||
<key>RunAtLoad</key>
|
||||
<false/>
|
||||
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/tmp/newsboat.err</string>
|
||||
|
||||
<key>StandardOutPath</key>
|
||||
<string>/tmp/newsboat.out</string>
|
||||
</dict>
|
||||
</plist>
|
@ -1,40 +0,0 @@
|
||||
browser "$BROWSER %u"
|
||||
prepopulate-query-feeds yes
|
||||
feed-sort-order lastupdated
|
||||
reload-only-visible-feeds yes
|
||||
text-width 72
|
||||
|
||||
bind-key j down
|
||||
bind-key k up
|
||||
bind-key j next articlelist
|
||||
bind-key k prev articlelist
|
||||
bind-key G end
|
||||
bind-key g home
|
||||
bind-key d pagedown
|
||||
bind-key u pageup
|
||||
bind-key n next-unread
|
||||
bind-key p prev-unread
|
||||
bind-key ; macro-prefix
|
||||
bind-key B bookmark
|
||||
bind-key f edit-flags
|
||||
|
||||
macro v set browser "mpv %u"; open-in-browser; set browser "$BROWSER %u"
|
||||
macro p set browser "echo %u"; one; set browser "$BROWSER %u"
|
||||
macro H set browser "clx view $(echo %u | cut -d '=' -f2)"; one; set browser "$BROWSER %u"
|
||||
macro h set browser "clx view $(echo %u | cut -d '=' -f2)"; two; set browser "$BROWSER %u"
|
||||
macro w set browser "w3m -o confirm_qq=false %u"; open-in-browser; set browser "$BROWSER %u"
|
||||
macro r set browser "url-markdown %u | glow -p -w 72 -"; open-in-browser; set browser "$BROWSER %u"
|
||||
macro d set browser "youtube-dl -o ~/Downloads/%(title)s.%(ext)s %u &"; open-in-browser-noninteractively; set browser "$BROWSER %u"
|
||||
macro n set-tag News; reload-all
|
||||
macro a set-tag All
|
||||
macro e set-tag Reddit; reload-all
|
||||
macro y set-tag YouTube; reload-all
|
||||
|
||||
bookmark-cmd "bookmark"
|
||||
|
||||
highlight article "^(Feed|Title|Author|Link|Date):.*" color243 default
|
||||
highlight article "^(Links):.*" color243 default
|
||||
highlight article "^(\\[[0-9]+\\]):.*" color243 default
|
||||
highlight article "^(\\[[0-9]+\\])" color243 default
|
||||
highlight article "^\\[.*\\]$" color243 default
|
||||
highlight article "^(Title:).*" color249 default
|
@ -1,137 +0,0 @@
|
||||
# Setup Nix
|
||||
|
||||
# We need to distinguish between single-user and multi-user installs.
|
||||
# This is difficult because there's no official way to do this.
|
||||
# We could look for the presence of /nix/var/nix/daemon-socket/socket but this will fail if the
|
||||
# daemon hasn't started yet. /nix/var/nix/daemon-socket will exist if the daemon has ever run, but
|
||||
# I don't think there's any protection against accidentally running `nix-daemon` as a user.
|
||||
# We also can't just look for /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh because
|
||||
# older single-user installs used the default profile instead of a per-user profile.
|
||||
# We can still check for it first, because all multi-user installs should have it, and so if it's
|
||||
# not present that's a pretty big indicator that this is a single-user install. If it does exist,
|
||||
# we still need to verify the install type. To that end we'll look for a root owner and sticky bit
|
||||
# on /nix/store. Multi-user installs set both, single-user installs don't. It's certainly possible
|
||||
# someone could do a single-user install as root and then manually set the sticky bit but that
|
||||
# would be extremely unusual.
|
||||
|
||||
set -l nix_profile_path /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
set -l single_user_profile_path ~/.nix-profile/etc/profile.d/nix.sh
|
||||
if test -e $nix_profile_path
|
||||
# The path exists. Double-check that this is a multi-user install.
|
||||
# We can't just check for ~/.nix-profile/… because this may be a single-user install running as
|
||||
# the wrong user.
|
||||
|
||||
# stat is not portable. Splitting the output of ls -nd is reliable on most platforms.
|
||||
set -l owner (string split -n ' ' (command ls -nd /nix/store 2>/dev/null))[3]
|
||||
if not test -k /nix/store -a $owner -eq 0
|
||||
# /nix/store is either not owned by root or not sticky. Assume single-user.
|
||||
set nix_profile_path $single_user_profile_path
|
||||
end
|
||||
else
|
||||
# The path doesn't exist. Assume single-user
|
||||
set nix_profile_path $single_user_profile_path
|
||||
end
|
||||
|
||||
if test -e $nix_profile_path
|
||||
# Source the nix setup script
|
||||
# We're going to run the regular Nix profile under bash and then print out a few variables
|
||||
for line in (command env -u BASH_ENV bash -c '. "$0"; for name in PATH "${!NIX_@}"; do printf "%s=%s\0" "$name" "${!name}"; done' $nix_profile_path | string split0)
|
||||
set -xg (string split -m 1 = $line)
|
||||
end
|
||||
|
||||
# Insert Nix's fish share directories into fish's special variables.
|
||||
# nixpkgs-installed fish tries to set these up already if NIX_PROFILES is defined, which won't
|
||||
# be the case when sourcing $__fish_data_dir/share/config.fish normally, but might be for a
|
||||
# recursive invocation. To guard against that, we'll only insert paths that don't already exit.
|
||||
# Furthermore, for the vendor_conf.d sourcing, we'll use the pre-existing presence of a path in
|
||||
# $fish_function_path to determine whether we want to source the relevant vendor_conf.d folder.
|
||||
|
||||
# To start, let's locally define NIX_PROFILES if it doesn't already exist.
|
||||
set -al NIX_PROFILES
|
||||
if test (count $NIX_PROFILES) -eq 0
|
||||
set -a NIX_PROFILES $HOME/.nix-profile
|
||||
end
|
||||
# Replicate the logic from nixpkgs version of $__fish_data_dir/__fish_build_paths.fish.
|
||||
set -l __nix_profile_paths (string split ' ' -- $NIX_PROFILES)[-1..1]
|
||||
set -l __extra_completionsdir \
|
||||
$__nix_profile_paths/etc/fish/completions \
|
||||
$__nix_profile_paths/share/fish/vendor_completions.d
|
||||
set -l __extra_functionsdir \
|
||||
$__nix_profile_paths/etc/fish/functions \
|
||||
$__nix_profile_paths/share/fish/vendor_functions.d
|
||||
set -l __extra_confdir \
|
||||
$__nix_profile_paths/etc/fish/conf.d \
|
||||
$__nix_profile_paths/share/fish/vendor_conf.d
|
||||
### Configure fish_function_path ###
|
||||
# Remove any of our extra paths that may already exist.
|
||||
# Record the equivalent __extra_confdir path for any function path that exists.
|
||||
set -l existing_conf_paths
|
||||
for path in $__extra_functionsdir
|
||||
if set -l idx (contains --index -- $path $fish_function_path)
|
||||
set -e fish_function_path[$idx]
|
||||
set -a existing_conf_paths $__extra_confdir[(contains --index -- $path $__extra_functionsdir)]
|
||||
end
|
||||
end
|
||||
# Insert the paths before $__fish_data_dir.
|
||||
if set -l idx (contains --index -- $__fish_data_dir/functions $fish_function_path)
|
||||
# Fish has no way to simply insert into the middle of an array.
|
||||
set -l new_path $fish_function_path[1..$idx]
|
||||
set -e new_path[$idx]
|
||||
set -a new_path $__extra_functionsdir
|
||||
set fish_function_path $new_path $fish_function_path[$idx..-1]
|
||||
else
|
||||
set -a fish_function_path $__extra_functionsdir
|
||||
end
|
||||
|
||||
### Configure fish_complete_path ###
|
||||
# Remove any of our extra paths that may already exist.
|
||||
for path in $__extra_completionsdir
|
||||
if set -l idx (contains --index -- $path $fish_complete_path)
|
||||
set -e fish_complete_path[$idx]
|
||||
end
|
||||
end
|
||||
# Insert the paths before $__fish_data_dir.
|
||||
if set -l idx (contains --index -- $__fish_data_dir/completions $fish_complete_path)
|
||||
set -l new_path $fish_complete_path[1..$idx]
|
||||
set -e new_path[$idx]
|
||||
set -a new_path $__extra_completionsdir
|
||||
set fish_complete_path $new_path $fish_complete_path[$idx..-1]
|
||||
else
|
||||
set -a fish_complete_path $__extra_completionsdir
|
||||
end
|
||||
|
||||
### Source conf directories ###
|
||||
# The built-in directories were already sourced during shell initialization.
|
||||
# Any __extra_confdir that came from $__fish_data_dir/__fish_build_paths.fish was also sourced.
|
||||
# As explained above, we're using the presence of pre-existing paths in $fish_function_path as a
|
||||
# signal that the corresponding conf dir has also already been sourced.
|
||||
# In order to simulate this, we'll run through the same algorithm as found in
|
||||
# $__fish_data_dir/config.fish except we'll avoid sourcing the file if it comes from an
|
||||
# already-sourced location.
|
||||
# Caveats:
|
||||
# * Files will be sourced in a different order than we'd ideally do (because we're coming in
|
||||
# after the fact to source them).
|
||||
# * If there are existing extra conf paths, files in them may have been sourced that should have
|
||||
# been suppressed by paths we're inserting in front.
|
||||
# * Similarly any files in $__fish_data_dir/vendor_conf.d that should have been suppressed won't
|
||||
# have been.
|
||||
set -l sourcelist
|
||||
for file in $__fish_config_dir/conf.d/*.fish $__fish_sysconf_dir/conf.d/*.fish
|
||||
# We know these paths were sourced already. Just record them.
|
||||
set -l basename (string replace -r '^.*/' '' -- $file)
|
||||
contains -- $basename $sourcelist
|
||||
or set -a sourcelist $basename
|
||||
end
|
||||
for root in $__extra_confdir
|
||||
for file in $root/*.fish
|
||||
set -l basename (string replace -r '^.*/' '' -- $file)
|
||||
contains -- $basename $sourcelist
|
||||
and continue
|
||||
set -a sourcelist $basename
|
||||
contains -- $root $existing_conf_paths
|
||||
and continue # this is a pre-existing path, it will have been sourced already
|
||||
[ -f $file -a -r $file ]
|
||||
and source $file
|
||||
end
|
||||
end
|
||||
end
|
@ -1,168 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)"
|
||||
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
|
||||
|
||||
echo "Automatically show and hide the dock"
|
||||
defaults write com.apple.dock autohide -bool true
|
||||
|
||||
echo "Automatically show and hide the menu bar"
|
||||
defaults write NSGlobalDomain _HIHideMenuBar -bool true
|
||||
|
||||
echo "Make Dock icons of hidden applications translucent"
|
||||
defaults write com.apple.dock showhidden -bool true
|
||||
|
||||
echo "Use current directory as default search scope in Finder"
|
||||
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
|
||||
|
||||
echo "Expand save panel by default"
|
||||
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
|
||||
|
||||
echo "Expand print panel by default"
|
||||
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
|
||||
|
||||
echo "Disable the \"Are you sure you want to open this application?\" dialog"
|
||||
defaults write com.apple.LaunchServices LSQuarantine -bool false
|
||||
|
||||
echo "Enable highlight hover effect for the grid view of a stack (Dock)"
|
||||
defaults write com.apple.dock mouse-over-hilte-stack -bool true
|
||||
|
||||
echo "Enable spring loading for all Dock items"
|
||||
defaults write enable-spring-load-actions-on-all-items -bool true
|
||||
|
||||
echo "Disable press-and-hold for keys in favor of key repeat"
|
||||
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
|
||||
defaults write -g ApplePressAndHoldEnabled -bool false
|
||||
|
||||
echo "Set a blazingly fast keyboard repeat rate"
|
||||
defaults write NSGlobalDomain KeyRepeat -int 2
|
||||
|
||||
echo "Set a shorter Delay until key repeat"
|
||||
defaults write NSGlobalDomain InitialKeyRepeat -int 12
|
||||
|
||||
echo "Disable disk image verification"
|
||||
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
||||
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
||||
|
||||
echo "Avoid creating .DS_Store files on network volumes"
|
||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
||||
|
||||
echo "Disable the warning when changing a file extension"
|
||||
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
|
||||
|
||||
# echo "Enable snap-to-grid for desktop icons"
|
||||
# /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
||||
|
||||
echo "Disable the warning before emptying the Trash"
|
||||
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
||||
|
||||
echo "Disable tap to click (Trackpad)"
|
||||
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool false
|
||||
|
||||
echo "Enable Safari’s debug menu"
|
||||
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
|
||||
|
||||
echo "Make Safari’s search banners default to Contains instead of Starts With"
|
||||
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
|
||||
|
||||
echo "Add a context menu item for showing the Web Inspector in web views"
|
||||
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
|
||||
|
||||
echo "Save to disk (not to iCloud) by default"
|
||||
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
|
||||
|
||||
echo "Disable automatic capitalization as it’s annoying when typing code"
|
||||
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
|
||||
|
||||
echo "Disable smart dashes as they’re annoying when typing code"
|
||||
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
|
||||
|
||||
echo "Disable automatic period substitution as it’s annoying when typing code"
|
||||
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
|
||||
|
||||
echo "Disable smart quotes as they’re annoying when typing code"
|
||||
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
|
||||
|
||||
echo "Disable auto-correct"
|
||||
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
|
||||
|
||||
echo "Use scroll gesture with the Ctrl (^) modifier key to zoom"
|
||||
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
|
||||
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
|
||||
echo "Follow the keyboard focus while zoomed in"
|
||||
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
|
||||
|
||||
echo "Require password immediately after sleep or screen saver begins"
|
||||
defaults write com.apple.screensaver askForPassword -int 1
|
||||
defaults write com.apple.screensaver askForPasswordDelay -int 0
|
||||
|
||||
echo "Save screenshots to downloads"
|
||||
defaults write com.apple.screencapture location -string "${HOME}/Downloads"
|
||||
|
||||
echo "Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons"
|
||||
defaults write com.apple.finder QuitMenuItem -bool true
|
||||
|
||||
echo "Show the ~/Library folder"
|
||||
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
|
||||
|
||||
# Noah Prefs
|
||||
echo "Enable dock magnification"
|
||||
defaults write com.apple.dock magnification -bool true
|
||||
|
||||
echo "Set dock size"
|
||||
defaults write com.apple.dock largesize -int 48
|
||||
defaults write com.apple.dock tilesize -int 44
|
||||
|
||||
echo "Choose and order dock icons"
|
||||
__dock_item() {
|
||||
printf '%s%s%s%s%s' \
|
||||
'<dict><key>tile-data</key><dict><key>file-data</key><dict>' \
|
||||
'<key>_CFURLString</key><string>' \
|
||||
"$1" \
|
||||
'</string><key>_CFURLStringType</key><integer>0</integer>' \
|
||||
'</dict></dict></dict>'
|
||||
}
|
||||
|
||||
defaults write com.apple.dock persistent-apps -array \
|
||||
"$(__dock_item /Applications/1Password\ 7.app)" \
|
||||
"$(__dock_item /Applications/Slack.app)" \
|
||||
"$(__dock_item /System/Applications/Calendar.app)" \
|
||||
"$(__dock_item /Applications/Firefox.app)" \
|
||||
"$(__dock_item /System/Applications/Messages.app)" \
|
||||
"$(__dock_item /System/Applications/Mail.app)" \
|
||||
"$(__dock_item /Applications/Mimestream.app)" \
|
||||
"$(__dock_item /Applications/zoom.us.app)" \
|
||||
"$(__dock_item /Applications/Obsidian.app)" \
|
||||
"$(__dock_item /Applications/Alacritty.app)" \
|
||||
"$(__dock_item /System/Applications/System\ Preferences.app)"
|
||||
|
||||
echo "No recent items in dock"
|
||||
defaults write com.apple.dock show-recents -bool FALSE
|
||||
|
||||
echo "Switch to dark mode"
|
||||
defaults write "Apple Global Domain" "AppleInterfaceStyle" "Dark"
|
||||
|
||||
echo "Turn on Scroll Reverser"
|
||||
open /Applications/Scroll\ Reverser.app
|
||||
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Scroll Reverser.app", hidden:false}'
|
||||
|
||||
echo "Allow apps from anywhere"
|
||||
SPCTL=$(spctl --status)
|
||||
if ! [ "$SPCTL" = "assessments disabled" ]
|
||||
then
|
||||
sudo spctl --master-disable
|
||||
fi
|
||||
|
||||
# ---
|
||||
|
||||
echo "Reset Launchpad"
|
||||
# [ -e ~/Library/Application\ Support/Dock/*.db ] && rm ~/Library/Application\ Support/Dock/*.db
|
||||
rm ~/Library/Application\ Support/Dock/*.db
|
||||
|
||||
echo "Show the ~/Library folder"
|
||||
chflags nohidden ~/Library
|
||||
|
||||
# Clean up
|
||||
echo "Kill affected applications"
|
||||
for app in Safari Finder Dock Mail SystemUIServer; do killall "$app" >/dev/null 2>&1; done
|
@ -1,5 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
npm update -g
|
||||
npm install -g pyright
|
||||
npm install -g diagnostic-languageserver
|
@ -1,48 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
install_rust() {
|
||||
if ! (which ~/.cargo/bin/rustup > /dev/null)
|
||||
then
|
||||
echo "installing rustup"
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||
fi
|
||||
|
||||
echo "rustup ✓"
|
||||
}
|
||||
|
||||
update_rust() {
|
||||
~/.cargo/bin/rustup update > /dev/null 2>&1
|
||||
rust_version=$(~/.cargo/bin/rustc --version | awk '{print $2}')
|
||||
|
||||
echo "latest rust: $rust_version ✓"
|
||||
}
|
||||
|
||||
download_rust_analyzer() {
|
||||
if ! (which rust-analyzer > /dev/null)
|
||||
then
|
||||
echo "downloading rust analyzer"
|
||||
rust_analyzer_bin=/usr/local/bin/rust-analyzer
|
||||
curl -s -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-mac -o $rust_analyzer_bin
|
||||
chmod +x $rust_analyzer_bin
|
||||
fi
|
||||
|
||||
echo "rust-analyzer ✓"
|
||||
}
|
||||
|
||||
# cargo-edit: quickly add and remove packages
|
||||
# whatfeatures: see optional features for a package
|
||||
install_cargos() {
|
||||
set -- \
|
||||
'cargo-edit' \
|
||||
'cargo-whatfeatures'
|
||||
for program do
|
||||
cargo install "$program"
|
||||
done
|
||||
|
||||
echo "cargos ✓"
|
||||
}
|
||||
|
||||
install_rust
|
||||
update_rust
|
||||
download_rust_analyzer
|
||||
install_cargos
|
@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "downloading cheatsheet"
|
||||
curl https://cht.sh/:cht.sh > ~/.local/bin/cheat
|
||||
chmod 755 ~/.local/bin/cheat
|
||||
echo "cheatsheet ✓"
|
@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
set -U FISH_DIR (readlink ~/.config/fish) # Used for getting to this repo
|
||||
set -Ux DOTS (dirname $FISH_DIR) # Directory of this config repo
|
||||
set -U CDPATH . $HOME # Directories available for immediate cd
|
||||
set -Ux EDITOR nvim # Preferred text editor
|
||||
set -U PROJ $HOME/dev/work # Projects directory
|
||||
set -Ux NOTES_PATH "$HOME/dev/personal/notes" # Notes directory
|
||||
set -Ux MANPAGER "nvim +Man!" # Used for reading man pages
|
||||
set -Ux DIRENV_LOG_FORMAT "" # Disable direnv output
|
||||
set -Ux BROWSER "/Applications/Firefox.app/Contents/MacOS/firefox"
|
||||
|
||||
# Load abbreviations
|
||||
abbrs
|
||||
|
||||
# Turn off greeting
|
||||
set -U fish_greeting ""
|
||||
|
||||
# Set colors (Base16 Eighties)
|
||||
set -U fish_color_normal normal
|
||||
set -U fish_color_command 99cc99
|
||||
set -U fish_color_quote ffcc66
|
||||
set -U fish_color_redirection d3d0c8
|
||||
set -U fish_color_end cc99cc
|
||||
set -U fish_color_error f2777a
|
||||
set -U fish_color_selection white --bold --background=brblack
|
||||
set -U fish_color_search_match bryellow --background=brblack
|
||||
set -U fish_color_history_current --bold
|
||||
set -U fish_color_operator 6699cc
|
||||
set -U fish_color_escape 66cccc
|
||||
set -U fish_color_cwd green
|
||||
set -U fish_color_cwd_root red
|
||||
set -U fish_color_valid_path --underline
|
||||
set -U fish_color_autosuggestion 747369
|
||||
set -U fish_color_user brgreen
|
||||
set -U fish_color_host normal
|
||||
set -U fish_color_cancel -r
|
||||
set -U fish_pager_color_completion normal
|
||||
set -U fish_pager_color_description B3A06D yellow
|
||||
set -U fish_pager_color_prefix white --bold --underline
|
||||
set -U fish_pager_color_progress brwhite --background=cyan
|
||||
set -U fish_color_comment ffcc66
|
||||
set -U fish_color_param d3d0c8
|
||||
set -U fish_color_match 6699cc
|
||||
|
||||
echo "fish setup ✓"
|
@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "downloading ytfzf"
|
||||
mkdir -p ~/.local/bin
|
||||
curl -sL "https://raw.githubusercontent.com/pystardust/ytfzf/master/ytfzf" >~/.local/bin/ytfzf
|
||||
chmod 755 ~/.local/bin/ytfzf
|
||||
echo "ytfzf ✓"
|
@ -1,8 +0,0 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name:
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources:
|
||||
verbs: []
|
@ -1,12 +0,0 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name:
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name:
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name:
|
||||
namespace: default
|
@ -1,8 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
||||
annotations:
|
||||
replicator.v1.mittwald.de/replicate-to: ".*"
|
||||
data:
|
@ -1,33 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app:
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app:
|
||||
spec:
|
||||
serviceAccountName:
|
||||
containers:
|
||||
- name:
|
||||
image:
|
||||
imagePullPolicy: Always
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name:
|
||||
- secretRef:
|
||||
name:
|
||||
ports:
|
||||
- containerPort:
|
||||
protocol: TCP
|
||||
resources:
|
||||
limits:
|
||||
cpu:
|
||||
requests:
|
||||
cpu:
|
@ -1,21 +0,0 @@
|
||||
apiVersion: networking.k8s.io/v1beta1 # must be beta until k8s 1.19
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: alb
|
||||
alb.ingress.kubernetes.io/group.name:
|
||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
|
||||
alb.ingress.kubernetes.io/scheme: internet-facing
|
||||
alb.ingress.kubernetes.io/security-groups:
|
||||
alb.ingress.kubernetes.io/tags: Project=
|
||||
alb.ingress.kubernetes.io/target-type: instance
|
||||
name:
|
||||
namespace:
|
||||
spec:
|
||||
rules:
|
||||
- host:
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName:
|
||||
servicePort:
|
@ -1,10 +0,0 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resourceNames:
|
||||
resources:
|
||||
verbs:
|
@ -1,13 +0,0 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
||||
roleRef:
|
||||
kind:
|
||||
name:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
subjects:
|
||||
- kind:
|
||||
name:
|
||||
apiGroup: rbac.authorization.k8s.io
|
@ -1,8 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
||||
annotations:
|
||||
replicator.v1.mittwald.de/replicate-to: ".*"
|
||||
data:
|
@ -1,15 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
annotations:
|
||||
alb.ingress.kubernetes.io/healthcheck-path:
|
||||
name:
|
||||
namespace: default
|
||||
spec:
|
||||
ports:
|
||||
- port: 443
|
||||
protocol: TCP
|
||||
targetPort: 80
|
||||
selector:
|
||||
app:
|
||||
type: NodePort
|
@ -1,5 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name:
|
||||
namespace: default
|
@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
"""
|
||||
Program
|
||||
"""
|
||||
|
||||
def main():
|
||||
"""Run the program"""
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
@ -1,8 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
|
||||
cat <<EOH
|
||||
Help text
|
||||
EOH
|
||||
exit
|
||||
fi
|
21
misc/README.md
Normal file
21
misc/README.md
Normal file
@ -0,0 +1,21 @@
|
||||
# Miscellaneous
|
||||
|
||||
These files contain important data sourced by the configuration, or simply
|
||||
information to store for safekeeping later.
|
||||
|
||||
---
|
||||
|
||||
Creating hashed password for [password.sha512](./password.sha512):
|
||||
|
||||
```
|
||||
mkpasswd -m sha-512
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Getting key for [public-keys](./public-keys):
|
||||
|
||||
```
|
||||
ssh-keyscan -t ed25519 <hostname>
|
||||
```
|
||||
|
23
misc/libratbag-profile
Normal file
23
misc/libratbag-profile
Normal file
@ -0,0 +1,23 @@
|
||||
Profile 1: (active)
|
||||
Name: n/a
|
||||
Report Rate: 1000Hz
|
||||
Resolutions:
|
||||
0: 400dpi (active) (default)
|
||||
1: 800dpi
|
||||
2: 1600dpi
|
||||
3: 2400dpi
|
||||
4: 0dpi
|
||||
Button: 0 is mapped to 'button 1'
|
||||
Button: 1 is mapped to 'button 2'
|
||||
Button: 2 is mapped to 'button 3'
|
||||
Button: 3 is mapped to 'button 4'
|
||||
Button: 4 is mapped to 'button 5'
|
||||
Button: 5 is mapped to macro '↕F11'
|
||||
Button: 6 is mapped to macro '↕VOLUMEDOWN'
|
||||
Button: 7 is mapped to macro '↕VOLUMEUP'
|
||||
Button: 8 is mapped to 'unknown'
|
||||
Button: 9 is mapped to 'wheel-right'
|
||||
Button: 10 is mapped to 'wheel-left'
|
||||
LED: 0, depth: monochrome, mode: on, color: 000000
|
||||
LED: 1, depth: monochrome, mode: on, color: 000000
|
||||
LED: 2, depth: monochrome, mode: on, color: 000000
|
6
misc/public-keys
Normal file
6
misc/public-keys
Normal file
@ -0,0 +1,6 @@
|
||||
# Scan hosts: ssh-keyscan -t ed25519 <hostnames>
|
||||
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHVknmPi7sG6ES0G0jcsvebzKGWWaMfJTYgvOue6EULI flame
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ9mwXlZnIALt9SnH3FOZvdgHLM5ZqwYUERXBbM7Rwh6 swan
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC3yHivgEXr2ecwe58h9bkhwTYivf3GwL8xenQKMeiUb tempest
|
9
modules/README.md
Normal file
9
modules/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Modules
|
||||
|
||||
| Module | Purpose |
|
||||
| --- | --- |
|
||||
| [common](./common/default.nix) | User programs and OS-agnostic configuration |
|
||||
| [darwin](./darwin/default.nix) | macOS-specific configuration |
|
||||
| [nixos](./nixos/default.nix) | NixOS-specific configuration |
|
||||
| [wsl](./wsl/default.nix) | WSL-specific configuration |
|
||||
|
@ -1,10 +0,0 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
unfreePackages = [ "1password" "_1password-gui" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ _1password-gui ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
home-manager.users.${config.user}.home.packages = with pkgs; [
|
||||
mpv # Video viewer
|
||||
sxiv # Image viewer
|
||||
mupdf # PDF viewer
|
||||
zathura # PDF viewer
|
||||
];
|
||||
};
|
||||
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
# Install Nautilus file manager
|
||||
config = lib.mkIf config.gui.enable {
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [
|
||||
gnome.nautilus
|
||||
gnome.sushi # Quick preview with spacebar
|
||||
];
|
||||
|
||||
programs.fish.functions = {
|
||||
qr = {
|
||||
body =
|
||||
"${pkgs.qrencode}/bin/qrencode $argv[1] -o /tmp/qr.png | ${pkgs.gnome.sushi}/bin/sushi /tmp/qr.png";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
unfreePackages = [ "obsidian" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ obsidian ];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [ qbittorrent ];
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
{
|
||||
name = "everforest"; # dark, hard
|
||||
author = "Sainnhe Park";
|
||||
base00 = "#2b3339"; # Default Background
|
||||
base01 = "#323c41"; # Lighter Background
|
||||
base02 = "#503946"; # Selection Background
|
||||
base03 = "#868d80"; # Comments, Invisibles, Line Highlighting
|
||||
base04 = "#d3c6aa"; # Dark Foreground (Used for status bars)
|
||||
base05 = "#d3c6aa"; # Default Foreground, Caret, Delimiters, Operators
|
||||
base06 = "#e9e8d2"; # Light Foreground (Not often used)
|
||||
base07 = "#fff9e8"; # Light Background (Not often used)
|
||||
base08 = "#7fbbb3"; # Variables, XML Tags, Markup Link Text, ...
|
||||
base09 = "#d699b6"; # Integers, Boolean, Constants, ...
|
||||
base0A = "#83c092"; # Classes, Markup Bold, Search Text Background
|
||||
base0B = "#dbbc7f"; # Strings, Inherited Class, Markup Code, Diff Inserted
|
||||
base0C = "#e69875"; # Support, Regular Expressions, Escape Characters, ...
|
||||
base0D = "#a7c080"; # Functions, Methods, Attribute IDs, Headings
|
||||
base0E = "#e67e80"; # Keywords, Storage, Selector, Markup Italic, Diff Changed
|
||||
base0F = "#d699b6"; # Deprecated, Opening/Closing Embedded Language Tags, ...
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
M.packer = function(use)
|
||||
use({
|
||||
"lifepillar/vim-gruvbox8",
|
||||
config = function()
|
||||
vim.g.gruvbox_italicize_strings = 0
|
||||
vim.cmd("colorscheme gruvbox8")
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
@ -1,21 +0,0 @@
|
||||
{
|
||||
name = "nord";
|
||||
author = "arcticicestudio";
|
||||
base00 = "#2E3440";
|
||||
base01 = "#3B4252";
|
||||
base02 = "#434C5E";
|
||||
base03 = "#4C566A";
|
||||
base04 = "#D8DEE9";
|
||||
base05 = "#E5E9F0";
|
||||
base06 = "#ECEFF4";
|
||||
base07 = "#8FBCBB";
|
||||
base08 = "#88C0D0";
|
||||
base09 = "#81A1C1";
|
||||
base0A = "#5E81AC";
|
||||
base0B = "#BF616A";
|
||||
base0C = "#D08770";
|
||||
base0D = "#EBCB8B";
|
||||
base0E = "#A3BE8C";
|
||||
base0F = "#B48EAD";
|
||||
neovimConfig = ./neovim.lua;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
M.packer = function(use)
|
||||
use({
|
||||
"shaunsingh/nord.nvim",
|
||||
config = function()
|
||||
vim.g.nord_italic = true
|
||||
vim.cmd("colorscheme nord")
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
30
modules/common/applications/1password.nix
Normal file
30
modules/common/applications/1password.nix
Normal file
@ -0,0 +1,30 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
options = {
|
||||
_1password = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable 1Password.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config._1password.enable) {
|
||||
unfreePackages = [ "1password" "_1password-gui" "1password-cli" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ _1password-gui ];
|
||||
};
|
||||
|
||||
# https://1password.community/discussion/135462/firefox-extension-does-not-connect-to-linux-app
|
||||
# On Mac, does not apply: https://1password.community/discussion/142794/app-and-browser-integration
|
||||
# However, the button doesn't work either:
|
||||
# https://1password.community/discussion/140735/extending-support-for-trusted-web-browsers
|
||||
environment.etc."1password/custom_allowed_browsers".text = ''
|
||||
${
|
||||
config.home-manager.users.${config.user}.programs.firefox.package
|
||||
}/Applications/Firefox.app/Contents/MacOS/firefox
|
||||
firefox
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
@ -1,6 +1,15 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
options = {
|
||||
alacritty = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Alacritty.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.alacritty.enable) {
|
||||
home-manager.users.${config.user} = {
|
||||
xsession.windowManager.i3.config.terminal = "alacritty";
|
||||
programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty";
|
@ -3,14 +3,14 @@
|
||||
imports = [
|
||||
./1password.nix
|
||||
./alacritty.nix
|
||||
./calibre.nix
|
||||
./discord.nix
|
||||
./firefox.nix
|
||||
./kitty.nix
|
||||
./media.nix
|
||||
./obsidian.nix
|
||||
./qbittorrent.nix
|
||||
./nautilus.nix
|
||||
./slack.nix
|
||||
./yt-dlp.nix
|
||||
];
|
||||
|
||||
}
|
@ -1,6 +1,15 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
options = {
|
||||
discord = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Discord.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.discord.enable) {
|
||||
unfreePackages = [ "discord" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ discord ];
|
@ -1,45 +1,69 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
config = lib.mkIf config.gui.enable {
|
||||
|
||||
unfreePackages = [ "onepassword-password-manager" "okta-browser-plugin" ];
|
||||
options = {
|
||||
firefox = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Firefox.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.firefox.enable) {
|
||||
|
||||
unfreePackages = [
|
||||
(lib.mkIf config._1password.enable "onepassword-password-manager")
|
||||
"okta-browser-plugin"
|
||||
"wappalyzer"
|
||||
];
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = lib.mkIf pkgs.stdenv.isDarwin pkgs.firefox-bin;
|
||||
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
ublock-origin
|
||||
vimium
|
||||
multi-account-containers
|
||||
facebook-container
|
||||
temporary-containers
|
||||
onepassword-password-manager
|
||||
okta-browser-plugin
|
||||
sponsorblock
|
||||
reddit-enhancement-suite
|
||||
bypass-paywalls-clean
|
||||
markdownload
|
||||
darkreader
|
||||
snowflake
|
||||
don-t-fuck-with-paste
|
||||
i-dont-care-about-cookies
|
||||
];
|
||||
profiles.Profile0 = {
|
||||
package =
|
||||
if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
||||
profiles.default = {
|
||||
id = 0;
|
||||
name = "default";
|
||||
isDefault = true;
|
||||
# https://nur.nix-community.org/repos/rycee/
|
||||
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
(lib.mkIf config._1password.enable onepassword-password-manager)
|
||||
pkgs.bypass-paywalls-clean
|
||||
darkreader
|
||||
don-t-fuck-with-paste
|
||||
facebook-container
|
||||
markdownload
|
||||
multi-account-containers
|
||||
okta-browser-plugin
|
||||
reddit-enhancement-suite
|
||||
return-youtube-dislikes
|
||||
snowflake
|
||||
sponsorblock
|
||||
ublock-origin
|
||||
ublacklist
|
||||
vimium
|
||||
wappalyzer
|
||||
];
|
||||
settings = {
|
||||
"app.update.auto" = false;
|
||||
"browser.aboutConfig.showWarning" = false;
|
||||
"browser.warnOnQuit" = false;
|
||||
"browser.quitShortcut.disabled" = true;
|
||||
"browser.quitShortcut.disabled" =
|
||||
if pkgs.stdenv.isLinux then true else false;
|
||||
"browser.theme.dark-private-windows" = true;
|
||||
"browser.toolbars.bookmarks.visibility" = "newtab";
|
||||
"browser.toolbars.bookmarks.visibility" = false;
|
||||
"browser.startup.page" = 3; # Restore previous session
|
||||
"browser.newtabpage.enabled" = false; # Make new tabs blank
|
||||
"trailhead.firstrun.didSeeAboutWelcome" =
|
||||
true; # Disable welcome splash
|
||||
"dom.forms.autocomplete.formautofill" = false; # Disable autofill
|
||||
"extensions.formautofill.creditCards.enabled" =
|
||||
false; # Disable credit cards
|
||||
"dom.payments.defaults.saveAddress" = false; # Disable address save
|
||||
"general.autoScroll" = true; # Drag middle-mouse to scroll
|
||||
"services.sync.prefs.sync.general.autoScroll" =
|
||||
false; # Prevent disabling autoscroll
|
||||
@ -49,6 +73,12 @@
|
||||
"layout.css.color-mix.enabled" = true;
|
||||
"ui.systemUsesDarkTheme" =
|
||||
if config.theme.dark == true then 1 else 0;
|
||||
"media.ffmpeg.vaapi.enabled" =
|
||||
true; # Enable hardware video acceleration
|
||||
"cookiebanners.ui.desktop.enabled" = true; # Reject cookie popups
|
||||
"devtools.command-button-screenshot.enabled" =
|
||||
true; # Scrolling screenshot of entire page
|
||||
"svg.context-properties.content.enabled" = true; # Sidebery styling
|
||||
};
|
||||
userChrome = ''
|
||||
:root {
|
||||
@ -60,6 +90,22 @@
|
||||
.toolbar-items {
|
||||
background-color: ${config.theme.colors.base00} !important;
|
||||
}
|
||||
/* Extra tab bar sides on macOS */
|
||||
.titlebar-spacer {
|
||||
background-color: ${config.theme.colors.base00} !important;
|
||||
}
|
||||
.titlebar-buttonbox-container {
|
||||
background-color: ${config.theme.colors.base00} !important;
|
||||
}
|
||||
#tabbrowser-tabs {
|
||||
border-inline-start: 0 !important;
|
||||
}
|
||||
/* Private Browsing indicator on macOS */
|
||||
#private-browsing-indicator-with-label {
|
||||
background-color: ${config.theme.colors.base00} !important;
|
||||
margin-inline: 0 !important;
|
||||
padding-inline: 7px;
|
||||
}
|
||||
/* Tabs themselves */
|
||||
.tabbrowser-tab .tab-stack {
|
||||
border-radius: 5px 5px 0 0;
|
||||
@ -73,7 +119,7 @@
|
||||
background-color: ${config.theme.colors.base00};
|
||||
color: ${config.theme.colors.base06} !important;
|
||||
}
|
||||
.tab-content[selected=true] {
|
||||
.tab-content[selected] {
|
||||
border-bottom: 2px solid color-mix(in srgb, var(--identity-tab-color) 25%, transparent);
|
||||
background-color: ${config.theme.colors.base01} !important;
|
||||
color: ${config.theme.colors.base07} !important;
|
||||
@ -119,6 +165,24 @@
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
xsession.windowManager.i3.config.keybindings =
|
||||
lib.mkIf pkgs.stdenv.isLinux {
|
||||
"${
|
||||
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
||||
}+Shift+b" = "exec ${
|
||||
# Don't name the script `firefox` or it will affect grep
|
||||
builtins.toString (pkgs.writeShellScript "focus-ff.sh" ''
|
||||
count=$(ps aux | grep -c firefox)
|
||||
if [ "$count" -eq 1 ]; then
|
||||
i3-msg "exec --no-startup-id firefox"
|
||||
sleep 0.5
|
||||
fi
|
||||
i3-msg "[class=firefox] focus"
|
||||
'')
|
||||
}";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
@ -1,20 +1,64 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
config = lib.mkIf config.gui.enable {
|
||||
options = {
|
||||
kitty = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Kitty.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.kitty.enable) {
|
||||
|
||||
# Set the Rofi-Systemd terminal for viewing logs
|
||||
# Using optionalAttrs because only available in NixOS
|
||||
environment = { } // lib.attrsets.optionalAttrs
|
||||
(builtins.hasAttr "sessionVariables" config.environment) {
|
||||
sessionVariables.ROFI_SYSTEMD_TERM = "${pkgs.kitty}/bin/kitty";
|
||||
};
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
# xsession.windowManager.i3.config.terminal = "kitty";
|
||||
# programs.rofi.terminal = "${pkgs.kitty}/bin/kitty";
|
||||
|
||||
# Set the i3 terminal
|
||||
xsession.windowManager.i3.config.terminal =
|
||||
lib.mkIf pkgs.stdenv.isLinux "kitty";
|
||||
|
||||
# Set the Rofi terminal for running programs
|
||||
programs.rofi.terminal =
|
||||
lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty";
|
||||
|
||||
# Display images in the terminal
|
||||
programs.fish.shellAliases = {
|
||||
icat = "kitty +kitten icat";
|
||||
ssh = "kitty +kitten ssh";
|
||||
};
|
||||
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
environment = { };
|
||||
extraConfig = "";
|
||||
font.size = 14;
|
||||
keybindings = {
|
||||
# Use shift+enter to complete text suggestions in fish
|
||||
"shift+enter" = "send_text all \\x1F";
|
||||
|
||||
# Easy fullscreen toggle (for macOS)
|
||||
"super+f" = "toggle_fullscreen";
|
||||
|
||||
# Kitty scrollback nvim
|
||||
"kitty_mod+h" = "kitty_scrollback_nvim";
|
||||
"kitty_mod+g" =
|
||||
"kitty_scrollback_nvim --config ksb_builtin_last_cmd_output";
|
||||
};
|
||||
settings = {
|
||||
|
||||
# Required for kitty-scrollback.nvim
|
||||
allow_remote_control = "socket-only";
|
||||
listen_on = "unix:/tmp/kitty";
|
||||
action_alias =
|
||||
"kitty_scrollback_nvim kitten ${pkgs.kitty-scrollback-nvim}/python/kitty_scrollback_nvim.py";
|
||||
|
||||
# Colors (adapted from: https://github.com/kdrag0n/base16-kitty/blob/master/templates/default-256.mustache)
|
||||
background = config.theme.colors.base00;
|
||||
foreground = config.theme.colors.base05;
|
||||
@ -61,8 +105,6 @@
|
||||
# Scrollback
|
||||
scrolling_lines = 10000;
|
||||
scrollback_pager_history_size = 10; # MB
|
||||
scrollback_pager = ''
|
||||
${pkgs.neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
|
||||
|
||||
# Window
|
||||
window_padding_width = 6;
|
||||
@ -70,7 +112,7 @@
|
||||
tab_bar_edge = "top";
|
||||
tab_bar_style = "slant";
|
||||
|
||||
# Audio
|
||||
# Disable audio
|
||||
enable_audio_bell = false;
|
||||
};
|
||||
};
|
59
modules/common/applications/media.nix
Normal file
59
modules/common/applications/media.nix
Normal file
@ -0,0 +1,59 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
options = {
|
||||
media = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable media programs.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.media.enable) {
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [
|
||||
nsxiv # Image viewer
|
||||
mupdf # PDF viewer
|
||||
zathura # PDF viewer
|
||||
];
|
||||
|
||||
# Video player
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
bindings = { };
|
||||
config = {
|
||||
image-display-duration = 2; # For cycling through images
|
||||
hwdec = "auto-safe"; # Attempt to use GPU decoding for video
|
||||
};
|
||||
scripts = [
|
||||
|
||||
# Automatically load playlist entries before and after current file
|
||||
pkgs.mpvScripts.autoload
|
||||
|
||||
# Delete current file after quitting
|
||||
pkgs.mpvScripts.mpv-delete-file
|
||||
];
|
||||
};
|
||||
|
||||
# Set default programs for opening PDFs and other media
|
||||
xdg.mimeApps = {
|
||||
associations.added = {
|
||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||
"image/jpeg" = [ "nsxiv.desktop" ];
|
||||
"image/*" = [ "nsxiv.desktop" ];
|
||||
};
|
||||
associations.removed = {
|
||||
"application/pdf" = [ "mupdf.desktop" "wine-extension-pdf.desktop" ];
|
||||
};
|
||||
defaultApplications = {
|
||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||
"image/jpeg" = [ "nsxiv.desktop" ];
|
||||
"image/*" = [ "nsxiv.desktop" ];
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
24
modules/common/applications/obsidian.nix
Normal file
24
modules/common/applications/obsidian.nix
Normal file
@ -0,0 +1,24 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
options = {
|
||||
obsidian = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Obsidian.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.obsidian.enable) {
|
||||
unfreePackages = [ "obsidian" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ obsidian ];
|
||||
};
|
||||
|
||||
# Broken on 2023-12-11
|
||||
# https://forum.obsidian.md/t/electron-25-is-now-eol-please-upgrade-to-a-newer-version/72878/8
|
||||
nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ];
|
||||
|
||||
};
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user