Compare commits
229 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
68b8da0c8f
|
|||
|
495224528e
|
|||
|
50c4b43391
|
|||
|
8e15ae90db
|
|||
|
a53f2a9a1e
|
|||
|
29f2fa44fb
|
|||
|
f667e77cdb
|
|||
|
e55dcc2584
|
|||
|
07ef7a596a
|
|||
|
07b522969e
|
|||
|
9567f3177a
|
|||
|
e39821c15a
|
|||
|
f38c03d787
|
|||
|
68594651ac
|
|||
|
f85ed829a9
|
|||
|
479434f156
|
|||
|
1f43c4a4ba
|
|||
|
eb6ae1a054
|
|||
|
959e0a5a22
|
|||
|
7e3c6e4d45
|
|||
|
48ea97af39
|
|||
|
e465db8888
|
|||
|
bc1800a1de
|
|||
|
b1d84ce0c6
|
|||
|
039822db24
|
|||
|
4de32aabb3
|
|||
|
f78b7be4f4
|
|||
|
c429cdf347
|
|||
|
7ca3b76226
|
|||
|
2eef271389
|
|||
|
0a74f8f058
|
|||
|
64c4c8f121
|
|||
|
342b08c4a2
|
|||
|
655438a544
|
|||
|
f55dbaf984
|
|||
|
a99a522f41
|
|||
|
ed946ece62
|
|||
|
85b7aab992
|
|||
|
29eeccdd2f
|
|||
|
fa5b61f3f8
|
|||
|
1f2d983f43
|
|||
|
70356efa1a
|
|||
|
18e932be29
|
|||
|
9c26c25419
|
|||
|
9e34c0cd86
|
|||
|
3dcd926d8b
|
|||
|
13d2ca8338
|
|||
|
0f9e01d288
|
|||
|
77e580c918
|
|||
|
3c34a1a854
|
|||
|
6f3ee68430
|
|||
|
a30b0f2423
|
|||
|
b33aa09212
|
|||
|
f929d267ba
|
|||
|
4d21a1325c
|
|||
|
5f751ffa5b
|
|||
|
f87d54e83b
|
|||
|
c2398ba93b
|
|||
|
cfd3f364a3
|
|||
|
48ac907d9e
|
|||
|
c374c8916e
|
|||
|
91cc7b69aa
|
|||
|
81730e52c4
|
|||
|
dac61b76cd
|
|||
|
e541f67ecf
|
|||
|
65d8f6b7b3
|
|||
|
3ff2fbc293
|
|||
|
9fd4401c88
|
|||
|
b810921f8b
|
|||
|
4cef1e6a53
|
|||
|
03be7baf9f
|
|||
|
123bb9a769
|
|||
|
faaebbedca
|
|||
|
6924ad447c
|
|||
|
5cb5595012
|
|||
|
c941b24880
|
|||
|
9616b3ffeb
|
|||
|
a943a9a1a6
|
|||
|
64b1be2a3c
|
|||
|
9ae857fb74
|
|||
|
770fd05e26
|
|||
|
f216517412
|
|||
|
24572e5055
|
|||
|
66abe25322
|
|||
|
ad9ebff11f
|
|||
|
da55b9e803
|
|||
|
ee369aa153
|
|||
|
d9b81a8457
|
|||
|
31b14ad781
|
|||
|
d8b10d9aa6
|
|||
|
dc66ec321a
|
|||
|
ea11dbb6ae
|
|||
|
12a1f5deea
|
|||
|
1b1fd42b61
|
|||
|
0b24782307
|
|||
|
307d1e9217
|
|||
|
1307e2908e
|
|||
|
67f257c027
|
|||
|
4874b74060
|
|||
|
0930701e43
|
|||
|
ee60382833
|
|||
|
b3cd28d215
|
|||
|
deb4dc24ea
|
|||
|
3a857a6df5
|
|||
|
a2f54a8f72
|
|||
|
7a2155b30c
|
|||
|
f765e90de2
|
|||
|
e298262966
|
|||
|
3269834e3f
|
|||
|
a04c13b8d9
|
|||
|
7189c245b5
|
|||
|
f09a1ee2d0
|
|||
|
a552a0d60d
|
|||
|
d65f7eebda
|
|||
|
a36869282a
|
|||
|
e32051c662
|
|||
|
1454a1dcd6
|
|||
|
ca3ecd39ee
|
|||
|
11119d0a79
|
|||
|
2d3e7f8825
|
|||
|
5cebcf6a60
|
|||
|
ec670da983
|
|||
|
0580da2dca
|
|||
|
8897177f51
|
|||
|
adcb61bc09
|
|||
|
548b4a26df
|
|||
|
3ab68507c1
|
|||
|
3d22177948
|
|||
|
21ee8bb547
|
|||
|
9675ab4f15
|
|||
|
e1e9e7a398
|
|||
|
8e5e6d7a44
|
|||
|
661d2e0010
|
|||
|
dc87ac678f
|
|||
|
433b8b46a8
|
|||
|
f80069b1a0
|
|||
|
cce75f872f
|
|||
|
00c97b8da1
|
|||
|
5197de939a
|
|||
|
1c71991f09
|
|||
|
824d964d61
|
|||
|
a1e5d18687
|
|||
|
33fb8a9209
|
|||
|
ac657c4a82
|
|||
|
21187f3fb8
|
|||
|
6200f89ef7
|
|||
|
cdefda67de
|
|||
|
5a50e7fd02
|
|||
|
80668c0fd3
|
|||
|
881c5f3633
|
|||
|
c885d4f515
|
|||
|
6633ff106c
|
|||
|
e6f84b1a68
|
|||
|
2a53c6b420
|
|||
|
c68a6515ef
|
|||
|
ccc72027c5
|
|||
|
a11ba13813
|
|||
|
edec7f8e9b
|
|||
|
bcf29eb442
|
|||
|
f8a11ae4fb
|
|||
|
583db61b3f
|
|||
|
bbaf7eb9e2
|
|||
|
e275f2ff72
|
|||
|
8bc4caac12
|
|||
|
a5c5350f80
|
|||
|
a1a98fc580
|
|||
|
2e83ced9a0
|
|||
|
c1dcf35d63
|
|||
|
317e729844
|
|||
|
fba3b614bd
|
|||
|
e46453cdeb
|
|||
|
edff5b3313
|
|||
|
5a168a6e5d
|
|||
|
b2e9ae5130
|
|||
|
9772592ea7
|
|||
|
ea12f16718
|
|||
|
0bd882eb1a
|
|||
|
8471c5139e
|
|||
|
2dac13a50f
|
|||
|
67ecc9552a
|
|||
|
4cf009d5ce
|
|||
|
350654cd03
|
|||
|
2ab3e40dbd
|
|||
|
d91827be7e
|
|||
|
b1f2e24b2b
|
|||
|
6cacc32ec7
|
|||
|
27e4978f8a
|
|||
|
3cc4b1473e
|
|||
|
6a0f5c8686
|
|||
|
9aaea1c28e
|
|||
|
39e718701b
|
|||
|
d0d9238c2c
|
|||
|
6475f80982
|
|||
|
dc4284a1a0
|
|||
|
fdf5f47462
|
|||
|
2d7577ee99
|
|||
|
e42f0db2dc
|
|||
|
fbf3a6bc29
|
|||
|
55582df9f1
|
|||
|
a42e66b9a5
|
|||
|
bc3e2e648f
|
|||
|
a9565942fd
|
|||
|
77fa595e86
|
|||
|
0e81a9bc81
|
|||
|
029196bc84
|
|||
|
54c53130bd
|
|||
|
a369c33a44
|
|||
|
096783c00a
|
|||
|
b3cd1f66f0
|
|||
|
f3727dc392
|
|||
|
6d86cce0ff
|
|||
|
f5ca2d5050
|
|||
|
8a4a6fc2e3
|
|||
|
637234c492
|
|||
|
0e169d4a26
|
|||
|
4f04827b14
|
|||
|
cd906a2075
|
|||
|
dd1b1dae8b
|
|||
|
502503add8
|
|||
|
e4fe666d29
|
|||
|
ac8e5dfe8c
|
|||
|
2b9b14b0c1
|
|||
|
163085a548
|
|||
|
28469c1876
|
|||
|
4e98f67748
|
|||
|
102df55379
|
|||
|
7293373b25
|
|||
|
130c794082
|
|||
|
3becdc7da4
|
+4
-10
@@ -2,10 +2,10 @@ keys:
|
||||
- &gpg_h7x4 F7D37890228A907440E1FD4846B9228E814A2AAC
|
||||
- &host_tsuki age1c92j4w0gqh32hwssl5m2mfrggssxax9pge8qxwytv9lmrnfttcvqdrgsst
|
||||
- &host_kasei age1eu2a6m3adakfzelfa9pqpl74a5dz0wkyr0v7gegm5ajnx7aqmqcqsp2ftc
|
||||
- &host_dosei age179y7apa80p9unvyjtsphpzyhve90ex986vlxkx43xt9n6m7en3csqnug7c
|
||||
- &host_europa age14mer45e52r2q4uz8n3fmv69tvk8gvwany4m4ndudud8ajv3jm4nqdj9m6a
|
||||
- &host_dosei age1s6s4w7cdfgajm30z9gy8va8pvs2lrzk5gnsg0hmn5z2sl8z36seqej406r
|
||||
- &host_xps16 age1np3fg9ue2tp4l47x7waapvjxh5zcaye2j54laapy7uklamve2c4qv3gytm
|
||||
- &home age10f4a5acpar8vwz3v298r3nv7gggfpmyh4wxpkc2hwq9paq0scf8qee8lau
|
||||
- &home_dosei age17acs5lw7npma4sughxq3wj3cs5gjkenqdzscyvaks0er33n8gupsce7jlp
|
||||
|
||||
creation_rules:
|
||||
- path_regex: secrets/common.yaml
|
||||
@@ -16,9 +16,9 @@ creation_rules:
|
||||
- *host_tsuki
|
||||
- *host_kasei
|
||||
- *host_dosei
|
||||
- *host_europa
|
||||
- *host_xps16
|
||||
- *home
|
||||
- *home_dosei
|
||||
|
||||
- path_regex: secrets/home.yaml
|
||||
key_groups:
|
||||
@@ -26,6 +26,7 @@ creation_rules:
|
||||
- *gpg_h7x4
|
||||
age:
|
||||
- *home
|
||||
- *home_dosei
|
||||
|
||||
- path_regex: secrets/xps16.yaml
|
||||
key_groups:
|
||||
@@ -54,10 +55,3 @@ creation_rules:
|
||||
- *gpg_h7x4
|
||||
age:
|
||||
- *host_dosei
|
||||
|
||||
- path_regex: secrets/europa.yaml
|
||||
key_groups:
|
||||
- pgp:
|
||||
- *gpg_h7x4
|
||||
age:
|
||||
- *host_europa
|
||||
|
||||
@@ -25,7 +25,6 @@ Here are some of the interesting files and dirs:
|
||||
| `Tsuki` | Dell Poweredge r710 server | Data storage / Build server / Selfhosted services. This server hosts a wide variety of services, including websites, matrix server, git repos, CI/CD and more. **This is probably the most interesting machine to pick config from** |
|
||||
| `Kasei` | AMD Zen 2 CPU / AMD GPU - desktop computer | Semi-daily driver. This is my main computer at home. |
|
||||
| `Dosei` | Dell Optiplex | Work computer, mostly used for development and testing. |
|
||||
| `Europa` | Dell Optiplex | Other work computer, used as nix builder for `Dosei`. |
|
||||
|
||||
|
||||
## home-manager configuration
|
||||
@@ -60,6 +59,52 @@ Re-encrypt sops secrets with new key:
|
||||
sops updatekeys secrets/hosts/file.yml
|
||||
```
|
||||
|
||||
## Setting up a new machine
|
||||
|
||||
### 1. Move gpg keys to
|
||||
|
||||
```console
|
||||
# Export on some machine
|
||||
gpg --export-secret-keys --armor nani.wtf > ~/SD/gpg_keys.pem
|
||||
|
||||
# Import
|
||||
gpg --import ~/SD/gpg_keys.pem
|
||||
```
|
||||
|
||||
### 2. Generating host keys, and converting to age keys for nix-sops host secrets
|
||||
|
||||
```console
|
||||
# Create host keys
|
||||
ssh-keygen -A
|
||||
|
||||
# Convert public key to age format
|
||||
nix-shell -p ssh-to-age --run 'cat /etc/ssh/ssh_host_ed25519_key.pub | ssh-to-age'
|
||||
|
||||
# Register this key in `.sops.yaml`
|
||||
$EDITOR .sops.yaml
|
||||
|
||||
# Update keys
|
||||
sops updatekeys secrets/common.yaml
|
||||
sops updatekeys secrets/$(hostname).yaml # if present
|
||||
```
|
||||
|
||||
### 3. Creating new ssh key for nix-sops home secrets
|
||||
|
||||
```console
|
||||
# Create new key
|
||||
ssh-keygen -t ed25519 -b 4096 -C "sops-nix home key" -f ~/.ssh/id_ed25519_home_sops -N ''
|
||||
|
||||
# Convert public key to age format
|
||||
nix-shell -p ssh-to-age --run 'cat ~/.ssh/id_ed25519_home_sops.pub | ssh-to-age'
|
||||
|
||||
# Register this key in `.sops.yaml`
|
||||
$EDITOR .sops.yaml
|
||||
|
||||
# Update keys
|
||||
sops updatekeys secrets/common.yaml
|
||||
sops updatekeys secrets/home.yaml
|
||||
```
|
||||
|
||||
|
||||
[home-manager]: https://github.com/nix-community/home-manager
|
||||
[nixos-search]: https://search.nixos.org/options
|
||||
|
||||
Generated
+94
-90
@@ -1,30 +1,36 @@
|
||||
{
|
||||
"nodes": {
|
||||
"dotfiles": {
|
||||
"flake": false,
|
||||
"anyrun": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1654179945,
|
||||
"narHash": "sha256-vnD7vu/hRBPoqL6Wse9CELitW30a9P++QTPnNm1qHjE=",
|
||||
"ref": "master",
|
||||
"rev": "37bdd48de4bfa8e03a8ab5ef840b2509e193e6a1",
|
||||
"revCount": 96,
|
||||
"type": "git",
|
||||
"url": "https://git.pvv.ntnu.no/oysteikt/dotfiles"
|
||||
"lastModified": 1743762088,
|
||||
"narHash": "sha256-f+oXT9b3xuBDmm4v4nDqJvlHabxxZRB6+pay4Ub/NvA=",
|
||||
"owner": "anyrun-org",
|
||||
"repo": "anyrun",
|
||||
"rev": "786f539d69d5abcefa68978dbaa964ac14536a00",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "anyrun-org",
|
||||
"ref": "master",
|
||||
"type": "git",
|
||||
"url": "https://git.pvv.ntnu.no/oysteikt/dotfiles"
|
||||
"repo": "anyrun",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1673956053,
|
||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||
"lastModified": 1733328505,
|
||||
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -33,34 +39,37 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"anyrun",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1743550720,
|
||||
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1681202837,
|
||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1681202837,
|
||||
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -76,11 +85,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733050161,
|
||||
"narHash": "sha256-lYnT+EYE47f5yY3KS/Kd4pJ6CO9fhCqumkYYkQ3TK20=",
|
||||
"lastModified": 1745557122,
|
||||
"narHash": "sha256-eqSo9ugzsqhFgaDFYUZj943nurlX4L6f+AW0skJ4W+M=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "62d536255879be574ebfe9b87c4ac194febf47c5",
|
||||
"rev": "dd26f75fb4ec1c731d4b1396eaf4439ce40a91c1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -97,16 +106,16 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1717234745,
|
||||
"narHash": "sha256-MFyKRdw4WQD6V3vRGbP6MYbtJhZp712zwzjW6YiOBYM=",
|
||||
"lastModified": 1735857245,
|
||||
"narHash": "sha256-AKLLPrgXTxgzll3DqVUMa4QlPlRN3QceutgFBmEf8Nk=",
|
||||
"owner": "dali99",
|
||||
"repo": "nixos-matrix-modules",
|
||||
"rev": "d7dc42c9bbb155c5e4aa2f0985d0df75ce978456",
|
||||
"rev": "da9dc0479ffe22362793c87dc089035facf6ec4d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "dali99",
|
||||
"ref": "v0.6.0",
|
||||
"ref": "0.7.0",
|
||||
"repo": "nixos-matrix-modules",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -158,26 +167,27 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733363776,
|
||||
"narHash": "sha256-3EZvm60PErALa91el3zRl+cJCuHmJfqiBzK+EEPnf84=",
|
||||
"lastModified": 1745805739,
|
||||
"narHash": "sha256-ryJ95o+w0hSVm5LkW5dxTbL2e1HCHCPcpNh627D3KHU=",
|
||||
"owner": "infinidoge",
|
||||
"repo": "nix-minecraft",
|
||||
"rev": "46d4b9024ccd2b36012ba074b330fd955a22295b",
|
||||
"rev": "ea8fa40a5fbf2762c41efc913c03aed3587ec7fa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "infinidoge",
|
||||
"ref": "master",
|
||||
"repo": "nix-minecraft",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-hardware": {
|
||||
"locked": {
|
||||
"lastModified": 1733217105,
|
||||
"narHash": "sha256-fc6jTzIwCIVWTX50FtW6AZpuukuQWSEbPiyg6ZRGWFY=",
|
||||
"lastModified": 1745503349,
|
||||
"narHash": "sha256-bUGjvaPVsOfQeTz9/rLTNLDyqbzhl0CQtJJlhFPhIYw=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "cceee0a31d2f01bcc98b2fbd591327c06a4ea4f9",
|
||||
"rev": "f7bee55a5e551bd8e7b5b82c9bc559bc50d868d1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -189,11 +199,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1733261153,
|
||||
"narHash": "sha256-eq51hyiaIwtWo19fPEeE0Zr2s83DYMKJoukNLgGGpek=",
|
||||
"lastModified": 1745742390,
|
||||
"narHash": "sha256-1rqa/XPSJqJg21BKWjzJZC7yU0l/YTVtjRi0RJmipus=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b681065d0919f7eb5309a93cea2cfa84dec9aa88",
|
||||
"rev": "26245db0cb552047418cfcef9a25da91b222d6c7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -204,11 +214,26 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1733390065,
|
||||
"narHash": "sha256-iB3dHF25/3kwBLwOHJaMp2JPq3iBLkcnHxWfemykRsg=",
|
||||
"lastModified": 1745377448,
|
||||
"narHash": "sha256-jhZDfXVKdD7TSEGgzFJQvEEZ2K65UMiqW5YJ2aIqxMA=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "59e0687dfe83e658efb399f903970abbf3a6730e",
|
||||
"rev": "507b63021ada5fee621b6ca371c4fca9ca46f52c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs-yet-unstabler": {
|
||||
"locked": {
|
||||
"lastModified": 1745831704,
|
||||
"narHash": "sha256-HMoKsZr3POMhCCIN1sFbPmYZ5ZBT/pCeyZnUXnJchdc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7aa91c307d9af07d6900b337cecd02da067e8433",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -225,11 +250,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1672838459,
|
||||
"narHash": "sha256-SIXzj9fbSvr/jfhhil+0cS7I6KONijdH80PFGxJi+CA=",
|
||||
"lastModified": 1684092181,
|
||||
"narHash": "sha256-Oi6G8Jx2RkEMi3UndtAnZw61hfgKGEe7l/ILdB9ump4=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "392fb541ce39f1f52908eee336d5ed409cd798ed",
|
||||
"revCount": 42,
|
||||
"rev": "028ed8774d1cf4650fc15253146cf14451eb608c",
|
||||
"revCount": 43,
|
||||
"type": "git",
|
||||
"url": "file:///home/h7x4/git/osuchan-line-bot"
|
||||
},
|
||||
@@ -240,7 +265,7 @@
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"dotfiles": "dotfiles",
|
||||
"anyrun": "anyrun",
|
||||
"home-manager": "home-manager",
|
||||
"matrix-synapse-next": "matrix-synapse-next",
|
||||
"maunium-stickerpicker": "maunium-stickerpicker",
|
||||
@@ -248,9 +273,9 @@
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"nixpkgs-yet-unstabler": "nixpkgs-yet-unstabler",
|
||||
"osuchan": "osuchan",
|
||||
"sops-nix": "sops-nix",
|
||||
"vscode-server": "vscode-server"
|
||||
"sops-nix": "sops-nix"
|
||||
}
|
||||
},
|
||||
"sops-nix": {
|
||||
@@ -260,11 +285,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1733128155,
|
||||
"narHash": "sha256-m6/qwJAJYcidGMEdLqjKzRIjapK4nUfMq7rDCTmZajc=",
|
||||
"lastModified": 1745310711,
|
||||
"narHash": "sha256-ePyTpKEJTgX0gvgNQWd7tQYQ3glIkbqcW778RpHlqgA=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "c6134b6fff6bda95a1ac872a2a9d5f32e3c37856",
|
||||
"rev": "5e3e92b16d6fdf9923425a8d4df7496b2434f39c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -275,16 +300,16 @@
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"lastModified": 1689347949,
|
||||
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"repo": "default-linux",
|
||||
"rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"repo": "default-linux",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
@@ -302,27 +327,6 @@
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"vscode-server": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1729422940,
|
||||
"narHash": "sha256-DlvJv33ml5UTKgu4b0HauOfFIoDx6QXtbqUF3vWeRCY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-vscode-server",
|
||||
"rev": "8b6db451de46ecf9b4ab3d01ef76e59957ff549f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-vscode-server",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-24.11";
|
||||
# nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
|
||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/master";
|
||||
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
|
||||
nixpkgs-yet-unstabler.url = "github:NixOS/nixpkgs/master";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-24.11";
|
||||
@@ -11,11 +11,6 @@
|
||||
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
|
||||
dotfiles = {
|
||||
url = "git+https://git.pvv.ntnu.no/oysteikt/dotfiles?ref=master";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -26,30 +21,23 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# TODO: fix website
|
||||
# website = {
|
||||
# url = "git+https://git.pvv.ntnu.no/oysteikt/nani.wtf?ref=main";
|
||||
# url = "path:/home/h7x4/git/nani.wtf";
|
||||
# inputs.nixpkgs.follows = "nixpkgs";
|
||||
# };
|
||||
|
||||
maunium-stickerpicker = {
|
||||
url = "github:h7x4/maunium-stickerpicker-nix/0.1.0";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
minecraft = {
|
||||
url = "github:infinidoge/nix-minecraft";
|
||||
url = "github:infinidoge/nix-minecraft/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
|
||||
matrix-synapse-next = {
|
||||
url = "github:dali99/nixos-matrix-modules/v0.6.0";
|
||||
url = "github:dali99/nixos-matrix-modules/0.7.0";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
vscode-server = {
|
||||
url = "github:nix-community/nixos-vscode-server";
|
||||
anyrun = {
|
||||
url = "github:anyrun-org/anyrun/master";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
@@ -58,17 +46,16 @@
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
nixpkgs-yet-unstabler,
|
||||
home-manager,
|
||||
nixos-hardware,
|
||||
|
||||
dotfiles,
|
||||
matrix-synapse-next,
|
||||
maunium-stickerpicker,
|
||||
minecraft,
|
||||
osuchan,
|
||||
sops-nix,
|
||||
vscode-server,
|
||||
# website
|
||||
anyrun,
|
||||
}: let
|
||||
system = "x86_64-linux";
|
||||
|
||||
@@ -81,36 +68,99 @@
|
||||
segger-jlink.acceptLicense = true;
|
||||
permittedInsecurePackages = [
|
||||
"segger-jlink-qt4-796s"
|
||||
"dotnet-core-combined"
|
||||
"dotnet-sdk-6.0.428"
|
||||
"dotnet-sdk-wrapped-6.0.428"
|
||||
];
|
||||
};
|
||||
|
||||
overlays = let
|
||||
nonrecursive-unstable-pkgs = import nixpkgs-unstable {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
config.segger-jlink.acceptLicense = true;
|
||||
config.permittedInsecurePackages = [
|
||||
"segger-jlink-qt4-796s"
|
||||
];
|
||||
};
|
||||
in [
|
||||
(import ./overlays/wayland-ime-integration.nix)
|
||||
overlays = [
|
||||
self.overlays.pcloud
|
||||
self.overlays.unstableLinuxPackages
|
||||
self.overlays.waylandImeIntegration
|
||||
self.overlays.gitoxide
|
||||
|
||||
minecraft.overlays.default
|
||||
osuchan.overlays.default
|
||||
];
|
||||
};
|
||||
|
||||
pkgs = import nixpkgs pkgs-config;
|
||||
unstable-pkgs = import nixpkgs-unstable pkgs-config;
|
||||
yet-unstabler-pkgs = import nixpkgs-yet-unstabler pkgs-config;
|
||||
in {
|
||||
extendedLib = import ./lib { stdlib = pkgs.lib; };
|
||||
|
||||
inherit pkgs;
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
extendedLib = import ./lib { stdlib = pkgs.lib; };
|
||||
|
||||
inputs = pkgs.lib.mapAttrs (_: src: src.outPath) inputs;
|
||||
|
||||
devShells.${system}.default = pkgs.mkShell {
|
||||
devShells.${system}.default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [ sops ];
|
||||
};
|
||||
|
||||
packages.${system} = {
|
||||
bcachefsInstallerIso = let
|
||||
nixosSystem = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix"
|
||||
({ lib, pkgs, ... }: {
|
||||
boot.supportedFilesystems = [ "bcachefs" ];
|
||||
boot.kernelPackages = lib.mkOverride 0 pkgs.linuxPackages_latest;
|
||||
})
|
||||
];
|
||||
};
|
||||
in nixosSystem.config.system.build.isoImage;
|
||||
};
|
||||
|
||||
overlays = let
|
||||
nonrecursive-unstable-pkgs = import nixpkgs-unstable {
|
||||
inherit system;
|
||||
config.allowUnfree = true;
|
||||
config.segger-jlink.acceptLicense = true;
|
||||
config.permittedInsecurePackages = [
|
||||
"segger-jlink-qt4-796s"
|
||||
];
|
||||
};
|
||||
in {
|
||||
pcloud = import ./overlays/pcloud.nix {
|
||||
inherit (nixpkgs) lib;
|
||||
pkgs = nonrecursive-unstable-pkgs;
|
||||
};
|
||||
|
||||
gitoxide = _: _: {
|
||||
gitoxide = nonrecursive-unstable-pkgs.gitoxide;
|
||||
};
|
||||
|
||||
unstableLinuxPackages = _: _: {
|
||||
linuxPackages_latest = nonrecursive-unstable-pkgs.linuxPackages_latest;
|
||||
};
|
||||
|
||||
waylandImeIntegration = import ./overlays/wayland-ime-integration.nix;
|
||||
};
|
||||
|
||||
nixosModules = {
|
||||
machineVars = ./modules/machineVars.nix;
|
||||
socketActivation = ./modules/socketActivation.nix;
|
||||
};
|
||||
|
||||
homeModules = {
|
||||
cargo = ./home/modules/programs/cargo;
|
||||
colors = ./home/modules/colors.nix;
|
||||
direnv-auto-prune = ./home/modules/programs/direnv/auto-prune.nix;
|
||||
gpg = ./home/modules/programs/gpg;
|
||||
mpd-auto-updater = ./home/modules/services/mpd.nix;
|
||||
neovim-auto-clean-swapfiles = ./home/modules/programs/neovim/auto-clean-swapfiles.nix;
|
||||
newsboat = ./home/modules/programs/newsboat;
|
||||
nix-index-auto-update-database = ./home/modules/programs/nix-index/auto-update-database.nix;
|
||||
prism-launcher = ./home/modules/programs/prism-launcher;
|
||||
shellAliases = ./home/modules/shellAliases.nix;
|
||||
systemd-tmpfiles = ./home/modules/systemd-tmpfiles.nix;
|
||||
uidGid = ./home/modules/uidGid.nix;
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
h7x4 = home-manager.lib.homeManagerConfiguration {
|
||||
inherit system;
|
||||
@@ -118,12 +168,12 @@
|
||||
|
||||
username = "h7x4";
|
||||
homeDirectory = "/home/h7x4";
|
||||
stateVersion = "22.05";
|
||||
stateVersion = "25.05";
|
||||
configuration = {
|
||||
imports = [
|
||||
./home/home.nix
|
||||
./modules/machineVars.nix
|
||||
];
|
||||
] ++ (builtins.attrValues self.homeModules);
|
||||
|
||||
machineVars = {
|
||||
headless = false;
|
||||
@@ -147,6 +197,7 @@
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
inherit unstable-pkgs;
|
||||
inherit yet-unstabler-pkgs;
|
||||
inherit (self) extendedLib;
|
||||
} // (extraConfig.specialArgs or { });
|
||||
|
||||
@@ -168,13 +219,16 @@
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
inherit unstable-pkgs;
|
||||
inherit yet-unstabler-pkgs;
|
||||
inherit (self) extendedLib;
|
||||
inherit (config) machineVars;
|
||||
machineName = name;
|
||||
};
|
||||
|
||||
sharedModules = [
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
];
|
||||
inputs.anyrun.homeManagerModules.default
|
||||
] ++ (builtins.attrValues self.homeModules);
|
||||
|
||||
users.h7x4.imports = [
|
||||
./home/home.nix
|
||||
@@ -193,7 +247,7 @@
|
||||
dosei = nixSys "dosei" {
|
||||
modules = [
|
||||
{
|
||||
home-manager.users.h7x4.home.uid = 1001;
|
||||
home-manager.users.h7x4.home.uid = 1000;
|
||||
}
|
||||
|
||||
nixos-hardware.nixosModules.common-pc
|
||||
@@ -202,7 +256,15 @@
|
||||
nixos-hardware.nixosModules.common-gpu-intel
|
||||
];
|
||||
};
|
||||
kasei = nixSys "kasei" { };
|
||||
kasei = nixSys "kasei" {
|
||||
modules = [
|
||||
nixos-hardware.nixosModules.common-pc
|
||||
nixos-hardware.nixosModules.common-pc-ssd
|
||||
nixos-hardware.nixosModules.common-cpu-amd
|
||||
nixos-hardware.nixosModules.common-cpu-amd-pstate
|
||||
nixos-hardware.nixosModules.common-gpu-nvidia-nonprime
|
||||
];
|
||||
};
|
||||
xps16 = nixSys "xps16" {
|
||||
modules = [
|
||||
nixos-hardware.nixosModules.common-hidpi
|
||||
@@ -212,19 +274,10 @@
|
||||
nixos-hardware.nixosModules.common-gpu-intel
|
||||
];
|
||||
};
|
||||
europa = nixSys "europa" {
|
||||
modules = [
|
||||
nixos-hardware.nixosModules.common-pc
|
||||
nixos-hardware.nixosModules.common-pc-ssd
|
||||
nixos-hardware.nixosModules.common-cpu-intel
|
||||
nixos-hardware.nixosModules.common-gpu-intel
|
||||
];
|
||||
};
|
||||
tsuki = nixSys "tsuki" {
|
||||
modules = [
|
||||
matrix-synapse-next.nixosModules.default
|
||||
osuchan.outputs.nixosModules.default
|
||||
vscode-server.nixosModules.default
|
||||
maunium-stickerpicker.nixosModules.default
|
||||
|
||||
(args: import minecraft.outputs.nixosModules.minecraft-servers (args // {
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
home = config.home.homeDirectory;
|
||||
user = config.home.username;
|
||||
in {
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"d ${home}/SD - ${user} - - -"
|
||||
"d ${home}/ctf - ${user} - - -"
|
||||
"d ${home}/git - ${user} - - -"
|
||||
"d ${home}/pvv - ${user} - - -"
|
||||
"d ${home}/work - ${user} - - -"
|
||||
|
||||
"d ${home}/pictures/icons - ${user} - - -"
|
||||
"d ${home}/pictures/photos - ${user} - - -"
|
||||
"d ${home}/pictures/screenshots - ${user} - - -"
|
||||
"d ${home}/pictures/stickers - ${user} - - -"
|
||||
"d ${home}/pictures/wallpapers - ${user} - - -"
|
||||
|
||||
"d ${home}/documents/books - ${user} - - -"
|
||||
"d ${home}/documents/scans - ${user} - - -"
|
||||
|
||||
"L ${home}/Downloads - ${user} - - ${home}/downloads"
|
||||
|
||||
"L ${config.xdg.dataHome}/wallpapers - ${user} - - ${home}/pictures/wallpapers"
|
||||
"L ${config.home.sessionVariables.TEXMFHOME} - ${user} - - ${home}/git/texmf"
|
||||
];
|
||||
}
|
||||
+11
-8
@@ -2,17 +2,18 @@
|
||||
{
|
||||
gtk = pkgs.lib.mkIf (!machineVars.headless) {
|
||||
enable = true;
|
||||
font = {
|
||||
name = "Droid Sans";
|
||||
};
|
||||
font.name = "Droid Sans";
|
||||
|
||||
iconTheme = {
|
||||
package = pkgs.papirus-icon-theme;
|
||||
name = "Papirus";
|
||||
package = pkgs.papirus-icon-theme;
|
||||
};
|
||||
|
||||
theme = {
|
||||
package = pkgs.vimix-gtk-themes;
|
||||
name = "VimixDark";
|
||||
name = "Adwaita-dark";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
|
||||
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
|
||||
gtk3.bookmarks = map (s: "file://${config.home.homeDirectory}/${s}") [
|
||||
@@ -22,10 +23,12 @@
|
||||
"music"
|
||||
".config"
|
||||
".local/share"
|
||||
# "Dropbox"
|
||||
"SD"
|
||||
"git"
|
||||
"git/pvv"
|
||||
"pvv"
|
||||
"nix"
|
||||
"work"
|
||||
"ctf"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
{
|
||||
nix.settings.use-xdg-base-directories = true;
|
||||
|
||||
home.preferXdgDirectories = true;
|
||||
|
||||
home.sessionVariables = let
|
||||
inherit (config.xdg) dataHome cacheHome configHome userDirs;
|
||||
runtimeDir = "/run/user/${toString config.home.uid}";
|
||||
@@ -10,46 +12,76 @@
|
||||
TEXMFVAR = "${cacheHome}/texlive";
|
||||
TEXMFCONFIG = "${configHome}/texlive";
|
||||
|
||||
EM_CONFIG = "${configHome}/emscripten/config";
|
||||
EM_CACHE = "${cacheHome}/emscripten/cache";
|
||||
EM_PORTS = "${dataHome}/emscripten/cache";
|
||||
|
||||
PSQL_HISTORY = "${dataHome}/psql_history";
|
||||
SQLITE_HISTORY= "${dataHome}/sqlite_history";
|
||||
MYSQL_HISTFILE = "${dataHome}/mysql_history";
|
||||
NODE_REPL_HISTORY = "${dataHome}/node_repl_history";
|
||||
GDB_HISTFILE = "${dataHome}/gdb_history";
|
||||
PYTHON_HISTORY = "${dataHome}/python_history";
|
||||
HISTFILE = "${dataHome}/bash_history";
|
||||
CALCHISTFILE = "${dataHome}/calc_history";
|
||||
|
||||
GHCUP_USE_XDG_DIRS = "true";
|
||||
MIX_XDG = "true";
|
||||
|
||||
__GL_SHADER_DISK_CACHE_PATH = "${cacheHome}/nv";
|
||||
_JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${configHome}/java";
|
||||
ANDROID_USER_HOME = "${dataHome}/android";
|
||||
AZURE_CONFIG_DIR = "${dataHome}/azure";
|
||||
BZRPATH = "${configHome}/bazaar";
|
||||
BZR_PLUGIN_PATH = "${dataHome}/bazaar";
|
||||
BZR_HOME = "${cacheHome}/bazaar";
|
||||
CARGO_HOME = "${dataHome}/cargo";
|
||||
CUDA_CACHE_PATH = "${cacheHome}/nv";
|
||||
DISCORD_USER_DATA_DIR = "${dataHome}/discord";
|
||||
DOCKER_CONFIG = "${configHome}/docker";
|
||||
DOTNET_CLI_HOME = "${dataHome}/dotnet";
|
||||
DOT_SAGE = "${configHome}/sagemath";
|
||||
ELM_HOME = "${configHome}/";
|
||||
FFMPEG_DATADIR = "${configHome}/ffmpeg";
|
||||
GOCACHE = "${cacheHome}/go/build";
|
||||
GOMODCACHE = "${cacheHome}/go/mod";
|
||||
GOPATH = "${dataHome}/go";
|
||||
GRIPHOME = "${configHome}/grip";
|
||||
GRADLE_USER_HOME = "${dataHome}/gradle";
|
||||
ICEAUTHORITY = "${cacheHome}/ICEauthority";
|
||||
NIMBLE_DIR = "${dataHome}/nimble";
|
||||
NLTK_DATA = "${dataHome}/nltk_data";
|
||||
NPM_CONFIG_CACHE="${cacheHome}/npm";
|
||||
NPM_CONFIG_INIT_MODULE="${configHome}/npm/config/npm-init.js";
|
||||
NPM_CONFIG_TMP="${runtimeDir}/npm";
|
||||
NPM_CONFIG_CACHE = "${cacheHome}/npm";
|
||||
NPM_CONFIG_INIT_MODULE = "${configHome}/npm/config/npm-init.js";
|
||||
NPM_CONFIG_TMP = "${runtimeDir}/npm";
|
||||
NODE_COMPILE_CACHE = "${cacheHome}/node-compile-cache";
|
||||
NRFUTIL_HOME = "${dataHome}/nrfutil";
|
||||
NUGET_PACKAGES = "${cacheHome}/nuget-packages";
|
||||
PARALLEL_HOME = "${configHome}/parallel";
|
||||
PGPASSFILE = "${configHome}/pg/pgpass";
|
||||
PSQLRC = "${configHome}/pg/psqlrc";
|
||||
PYENV_ROOT = "${dataHome}/pyenv";
|
||||
RUFF_CACHE_DIR = "${cacheHome}/ruff";
|
||||
RUSTUP_HOME = "${dataHome}/rustup";
|
||||
RYE_HOME = "${dataHome}/rye";
|
||||
STACK_ROOT = "${dataHome}/stack";
|
||||
W3M_DIR = "${dataHome}/w3m";
|
||||
WINEPREFIX = "${dataHome}/wine";
|
||||
|
||||
SBT_OPTS = lib.concatStringsSep " " [
|
||||
"-Dsbt.ivy.home=${cacheHome}/ivy"
|
||||
"-Dsbt.boot.directory=${cacheHome}/sbt/boot"
|
||||
"-Dsbt.preloaded=${cacheHome}/sbt/preloaded"
|
||||
"-Dsbt.global.base=${cacheHome}/sbt"
|
||||
"-Dsbt.global.staging=${cacheHome}/sbt/staging"
|
||||
"-Dsbt.global.zinc=${cacheHome}/sbt/zinc"
|
||||
"-Dsbt.dependency.base=${cacheHome}/sbt/dependency"
|
||||
"-Dsbt.repository.config=${configHome}/sbt/repositories"
|
||||
"-Dsbt.global.settings=${configHome}/sbt/global"
|
||||
"-Dsbt.global.plugins=${configHome}/sbt/plugins"
|
||||
"-Dmaven.repo.local=${cacheHome}/maven/repository"
|
||||
"-Divy.settings.dir=${configHome}/ivy2"
|
||||
"-Divy.home=${cacheHome}/ivy2"
|
||||
"-Divy.cache.dir=${cacheHome}/ivy2/cache"
|
||||
];
|
||||
|
||||
# TODO: these needs to be set before the user session has fully initialized
|
||||
# XINITRC = "$XDG_CONFIG_HOME/x11/initrc";
|
||||
# XAUTHORITY
|
||||
|
||||
@@ -61,6 +61,26 @@ let
|
||||
woff2 = "font/woff2";
|
||||
};
|
||||
|
||||
archive = {
|
||||
"7z" = "application/x-7z-compressed";
|
||||
ar = "application/x-archive";
|
||||
bz2 = "application/x-bzip2";
|
||||
deb = "application/x-debian-package";
|
||||
gzip = "application/gzip";
|
||||
lz = "application/x-lzip";
|
||||
lzma = "application/x-lzma";
|
||||
lzo = "application/x-lzop";
|
||||
rar = "application/vnd.rar";
|
||||
rar-compressed = "application/x-rar-compressed";
|
||||
tar = "application/x-tar";
|
||||
tar-compressed = "application/x-gtar";
|
||||
x-zip = "multipart/x-zip";
|
||||
xz = "application/x-xz";
|
||||
zip = "application/zip";
|
||||
zip-compressed = "application/x-zip-compressed";
|
||||
zst = "application/zstd";
|
||||
};
|
||||
|
||||
documents = {
|
||||
azv = "application/vnd.amazon.ebook";
|
||||
cbr = "application/vnd.comicbook+rar";
|
||||
@@ -72,31 +92,98 @@ let
|
||||
pdf = "application/pdf";
|
||||
};
|
||||
|
||||
office = {
|
||||
doc = "application/msword";
|
||||
docm = "application/vnd.ms-word.document.macroEnabled.12";
|
||||
docx = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
||||
dot = "application/msword";
|
||||
dotm = "application/vnd.ms-word.template.macroEnabled.12";
|
||||
dotx = "application/vnd.openxmlformats-officedocument.wordprocessingml.template";
|
||||
mdb = "application/vnd.ms-access";
|
||||
pot = "application/vnd.ms-powerpoint";
|
||||
potm = "application/vnd.ms-powerpoint.template.macroEnabled.12";
|
||||
potx = "application/vnd.openxmlformats-officedocument.presentationml.template";
|
||||
ppa = "application/vnd.ms-powerpoint";
|
||||
ppam = "application/vnd.ms-powerpoint.addin.macroEnabled.12";
|
||||
pps = "application/vnd.ms-powerpoint";
|
||||
ppsm = "application/vnd.ms-powerpoint.slideshow.macroEnabled.12";
|
||||
ppsx = "application/vnd.openxmlformats-officedocument.presentationml.slideshow";
|
||||
ppt = "application/vnd.ms-powerpoint";
|
||||
pptm = "application/vnd.ms-powerpoint.presentation.macroEnabled.12";
|
||||
pptx = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
||||
xla = "application/vnd.ms-excel";
|
||||
xlam = "application/vnd.ms-excel.addin.macroEnabled.12";
|
||||
xls = "application/vnd.ms-excel";
|
||||
xlsb = "application/vnd.ms-excel.sheet.binary.macroEnabled.12";
|
||||
xlsm = "application/vnd.ms-excel.sheet.macroEnabled.12";
|
||||
xlsx = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
||||
xlt = "application/vnd.ms-excel";
|
||||
xltm = "application/vnd.ms-excel.template.macroEnabled.12";
|
||||
xltx = "application/vnd.openxmlformats-officedocument.spreadsheetml.template";
|
||||
|
||||
odc = "application/vnd.oasis.opendocument.chart";
|
||||
odf = "application/vnd.oasis.opendocument.formula";
|
||||
odg = "application/vnd.oasis.opendocument.graphics";
|
||||
odi = "application/vnd.oasis.opendocument.image";
|
||||
odm = "application/vnd.oasis.opendocument.text-master";
|
||||
odp = "application/vnd.oasis.opendocument.presentation";
|
||||
odt = "application/vnd.oasis.opendocument.text";
|
||||
otg = "application/vnd.oasis.opendocument.graphics-template";
|
||||
oth = "application/vnd.oasis.opendocument.text-web";
|
||||
otm = "application/vnd.oasis.opendocument.text-master-template";
|
||||
otp = "application/vnd.oasis.opendocument.presentation-template";
|
||||
ots = "application/vnd.oasis.opendocument.spreadsheet-template";
|
||||
ott = "application/vnd.oasis.opendocument.text-template";
|
||||
};
|
||||
|
||||
code = {
|
||||
css = "text/css";
|
||||
csv = "text/csv";
|
||||
html = "text/html";
|
||||
js = "application/x-javascript";
|
||||
latex = "application/x-latex";
|
||||
php = "application/x-httpd-php";
|
||||
pl = "application/x-perl";
|
||||
rtf = "application/rtf";
|
||||
sh = "application/x-sh";
|
||||
tex = "application/x-tex";
|
||||
txt = "text/plain";
|
||||
xhtml = "application/xhtml+xml";
|
||||
xml = "text/xml";
|
||||
};
|
||||
|
||||
misc = {
|
||||
web = {
|
||||
about = "x-scheme-handler/about";
|
||||
chrome = "x-scheme-handler/chrome";
|
||||
html = "text/html";
|
||||
http = "x-scheme-handler/http";
|
||||
https = "x-scheme-handler/https";
|
||||
wine-ini = "application/x-wine-extension-ini";
|
||||
mxwinurl = "application/x-mswinurl";
|
||||
unknown = "x-scheme-handler/unknown";
|
||||
x-htm = "application/x-extension-htm";
|
||||
x-html = "application/x-extension-html";
|
||||
x-shtml = "application/x-extension-shtml";
|
||||
x-xht = "application/x-extension-xht";
|
||||
x-xhtml = "application/x-extension-xhtml";
|
||||
xhtml-xml = "application/xhtml+xml";
|
||||
};
|
||||
|
||||
misc = {
|
||||
ics = "text/calendar";
|
||||
url = "application/x-mswinurl";
|
||||
wine-ini = "application/x-wine-extension-ini";
|
||||
wine-osz = "application/x-wine-extension-osz";
|
||||
};
|
||||
};
|
||||
|
||||
# Applications
|
||||
ark = "org.kde.ark.desktop";
|
||||
firefox = "firefox.desktop";
|
||||
vscode = "code.desktop";
|
||||
zed = "dev.zed.Zed.desktop";
|
||||
mpv = "mpv.desktop";
|
||||
zathura = "org.pwmt.zathura.desktop";
|
||||
nsxiv = "nsxiv.desktop";
|
||||
font-viewer = "org.gnome.font-viewer.desktop";
|
||||
libreoffice = "startcenter.desktop";
|
||||
in {
|
||||
xdg.configFile."mimeapps.list".force = true;
|
||||
xdg.mimeApps = {
|
||||
@@ -108,14 +195,14 @@ in {
|
||||
// (lib.mapAttrs' (_: v: lib.nameValuePair v mpv) mime.audio)
|
||||
// (lib.mapAttrs' (_: v: lib.nameValuePair v mpv) mime.video)
|
||||
// (lib.mapAttrs' (_: v: lib.nameValuePair v font-viewer) mime.font)
|
||||
// (lib.mapAttrs' (_: v: lib.nameValuePair v libreoffice) mime.office)
|
||||
// (lib.mapAttrs' (_: v: lib.nameValuePair v zathura) mime.documents)
|
||||
// (lib.mapAttrs' (_: v: lib.nameValuePair v vscode) mime.code)
|
||||
// (lib.mapAttrs' (_: v: lib.nameValuePair v zed) mime.code)
|
||||
// (lib.mapAttrs' (_: v: lib.nameValuePair v ark) mime.archive)
|
||||
// (lib.mapAttrs' (_: v: lib.nameValuePair v firefox) mime.web)
|
||||
// {
|
||||
${mime.misc.http} = firefox;
|
||||
${mime.misc.https} = firefox;
|
||||
${mime.misc.wine-ini} = vscode;
|
||||
${mime.misc.ics} = vscode;
|
||||
${mime.misc.url} = firefox;
|
||||
${mime.misc.wine-ini} = zed;
|
||||
${mime.misc.ics} = zed;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
+24
-31
@@ -7,6 +7,7 @@ in {
|
||||
./packages.nix
|
||||
|
||||
./config/xdg
|
||||
./config/ensure-homedir-structure.nix
|
||||
|
||||
./programs/aria2.nix
|
||||
./programs/atuin.nix
|
||||
@@ -14,6 +15,7 @@ in {
|
||||
./programs/bat.nix
|
||||
./programs/beets.nix
|
||||
./programs/bottom.nix
|
||||
./programs/cargo.nix
|
||||
./programs/comma.nix
|
||||
./programs/direnv
|
||||
./programs/eza.nix
|
||||
@@ -22,30 +24,32 @@ in {
|
||||
./programs/gh-dash.nix
|
||||
./programs/gh.nix
|
||||
./programs/git
|
||||
./programs/gpg
|
||||
./programs/gpg.nix
|
||||
./programs/home-manager.nix
|
||||
./programs/jq.nix
|
||||
./programs/less.nix
|
||||
./programs/man.nix
|
||||
./programs/neovim
|
||||
./programs/nix-index
|
||||
./programs/nix.nix
|
||||
./programs/nushell.nix
|
||||
./programs/pandoc.nix
|
||||
./programs/python.nix
|
||||
./programs/ripgrep.nix
|
||||
./programs/skim.nix
|
||||
./programs/sqlite.nix
|
||||
./programs/ssh
|
||||
./programs/tealdeer
|
||||
./programs/texlive.nix
|
||||
./programs/thunderbird.nix
|
||||
./programs/tmux
|
||||
./programs/uv.nix
|
||||
./programs/yt-dlp.nix
|
||||
./programs/zoxide.nix
|
||||
./programs/zsh
|
||||
|
||||
./services/nix-channel-update.nix
|
||||
./services/pueue.nix
|
||||
|
||||
./modules/colors.nix
|
||||
./modules/shellAliases.nix
|
||||
./modules/uidGid.nix
|
||||
] ++ (optionals graphics [
|
||||
./config/gtk.nix
|
||||
|
||||
@@ -57,12 +61,13 @@ in {
|
||||
./programs/ncmpcpp.nix
|
||||
./programs/newsboat
|
||||
./programs/obs-studio.nix
|
||||
./programs/prism-launcher.nix
|
||||
./programs/qutebrowser.nix
|
||||
./programs/rofi.nix
|
||||
./programs/rofi
|
||||
./programs/taskwarrior.nix
|
||||
./programs/vscode
|
||||
./programs/zathura.nix
|
||||
# ./programs/zed
|
||||
./programs/zed
|
||||
|
||||
./services/copyq.nix
|
||||
./services/dunst.nix
|
||||
@@ -70,12 +75,14 @@ in {
|
||||
./services/gnome-keyring.nix
|
||||
./services/keybase.nix
|
||||
./services/mpd.nix
|
||||
./services/mpris-proxy.nix
|
||||
./services/network-manager.nix
|
||||
./services/psd.nix
|
||||
./services/tumblerd.nix
|
||||
]) ++ (optionals machineVars.wayland [
|
||||
./programs/hyprland.nix
|
||||
./programs/waybar.nix
|
||||
./programs/anyrun
|
||||
]) ++ (optionals (!machineVars.wayland) [
|
||||
./programs/xmonad
|
||||
# ./programs/xmobar
|
||||
@@ -90,17 +97,6 @@ in {
|
||||
sops.defaultSopsFile = ../secrets/home.yaml;
|
||||
sops.age.sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519_home_sops" ];
|
||||
|
||||
sops.secrets."nix/access-tokens" = {
|
||||
sopsFile = ../secrets/common.yaml;
|
||||
};
|
||||
|
||||
nix = {
|
||||
settings.use-xdg-base-directories = true;
|
||||
extraOptions = ''
|
||||
!include ${config.sops.secrets."nix/access-tokens".path}
|
||||
'';
|
||||
};
|
||||
|
||||
home = {
|
||||
username = "h7x4";
|
||||
homeDirectory = "/home/h7x4";
|
||||
@@ -119,19 +115,26 @@ in {
|
||||
package = pkgs.capitaine-cursors;
|
||||
name = "capitaine-cursors";
|
||||
size = 16;
|
||||
# TODO: enable in 25.05
|
||||
# dotIcons = false;
|
||||
};
|
||||
|
||||
keyboard.options = [ "caps:escape" ];
|
||||
|
||||
sessionVariables = {
|
||||
CARGO_NET_GIT_FETCH_WITH_CLI = "true";
|
||||
PYTHONSTARTUP = "${config.xdg.configHome}/python/pyrc";
|
||||
DO_NOT_TRACK = "1";
|
||||
_JAVA_AWT_WM_NONREPARENTING = "1";
|
||||
};
|
||||
};
|
||||
|
||||
dconf.settings = mkIf graphics {
|
||||
"org/gnome/desktop/interface" = {
|
||||
color-scheme = "prefer-dark";
|
||||
};
|
||||
};
|
||||
|
||||
xsession = {
|
||||
enable = true;
|
||||
enable = !machineVars.wayland;
|
||||
# TODO: declare using xdg config home
|
||||
scriptPath = ".config/X11/xsession";
|
||||
profilePath = ".config/X11/xprofile";
|
||||
@@ -141,16 +144,6 @@ in {
|
||||
"ghc/ghci.conf".text = ''
|
||||
:set prompt "${extendedLib.termColors.front.magenta "[GHCi]λ"} "
|
||||
'';
|
||||
|
||||
"python/pyrc".text = ''
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
|
||||
# You also need \x01 and \x02 to separate escape sequence, due to:
|
||||
# https://stackoverflow.com/a/9468954/1147688
|
||||
sys.ps1='\x01\x1b${extendedLib.termColors.front.blue "[Python]> "}\x02>>>\x01\x1b[0m\x02 ' # bright yellow
|
||||
sys.ps2='\x01\x1b[1;49;31m\x02...\x01\x1b[0m\x02 ' # bright red
|
||||
'';
|
||||
};
|
||||
|
||||
news.display = "silent";
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.programs.cargo;
|
||||
format = pkgs.formats.toml { };
|
||||
cargoHome = config.home.sessionVariables.CARGO_HOME or "${config.home.homeDirectory}/.cargo";
|
||||
relativeCargoHome = lib.strings.removePrefix config.home.homeDirectory cargoHome;
|
||||
in
|
||||
{
|
||||
options.programs.cargo = {
|
||||
enable = lib.mkEnableOption "cargo, the rust package manager and build tool";
|
||||
|
||||
package = lib.mkPackageOption pkgs "cargo" { };
|
||||
|
||||
addPackageToEnvironment = lib.mkOption {
|
||||
description = "Whether to add cargo to the user's environment.";
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
|
||||
settings = lib.mkOption {
|
||||
description = "cargo settings";
|
||||
type = lib.types.submodule {
|
||||
freeformType = format.type;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home = {
|
||||
sessionVariables.CARGO_HOME = lib.mkIf config.home.preferXdgDirectories (lib.mkDefault "${config.xdg.dataHome}/cargo");
|
||||
|
||||
packages = lib.mkIf cfg.addPackageToEnvironment [ cfg.package ];
|
||||
|
||||
file."${relativeCargoHome}/config.toml" = lib.mkIf (cfg.settings != { }) {
|
||||
source = format.generate "cargo-config.toml" cfg.settings;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -3,8 +3,20 @@ let
|
||||
cfg = config.programs.direnv;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
systemd.user.services.prune-allowed-direnv-dirs = {
|
||||
options.programs.direnv.auto-prune-allowed-dirs = {
|
||||
enable = lib.mkEnableOption "automatic pruning of direnv dirs";
|
||||
|
||||
onCalendar = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "daily";
|
||||
example = "weekly";
|
||||
# TODO: link to systemd manpage for format.
|
||||
description = "How often to prune dirs.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.auto-prune-allowed-dirs.enable {
|
||||
systemd.user.services.direnv-auto-prune-allowed-dirs = {
|
||||
Unit = {
|
||||
Description = "Prune unused allowed directories for direnv";
|
||||
Documentation = [ "man:direnv(1)" ];
|
||||
@@ -19,15 +31,15 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.prune-allowed-direnv-dirs = {
|
||||
systemd.user.timers.direnv-auto-prune-allowed-dirs = {
|
||||
Unit = {
|
||||
Description = "Prune unused allowed directories for direnv";
|
||||
Documentation = [ "man:direnv(1)" ];
|
||||
};
|
||||
|
||||
Timer = {
|
||||
Unit = "prune-allowed-direnv-dirs.service";
|
||||
OnCalendar = "daily";
|
||||
Unit = "direnv-auto-prune-allowed-dirs.service";
|
||||
OnCalendar = cfg.auto-prune-allowed-dirs.onCalendar;
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./auto-refresh-keys.nix
|
||||
./auto-update-trust-db.nix
|
||||
|
||||
# ./key-fetchers/declarative-github-key-fetcher.nix # WIP
|
||||
./key-fetchers/declarative-keyserver-key-fetcher.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.programs.gpg;
|
||||
in
|
||||
{
|
||||
# TODO: Create proper descriptions
|
||||
options = {
|
||||
programs.gpg.key-fetchers.github = {
|
||||
enable = lib.mkEnableOption "auto fetching of gpg keys by github username";
|
||||
|
||||
useGh = lib.mkEnableOption "" // {
|
||||
description = "Whether to use the GitHub API through the gh tools to fetch GPG keys";
|
||||
default = config.programs.gh.enable;
|
||||
defaultText = lib.literalExpression "config.programs.gh.enable";
|
||||
};
|
||||
|
||||
keys = lib.mkOption {
|
||||
description = "";
|
||||
default = { };
|
||||
type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: {
|
||||
options = {
|
||||
# id = lib.mkOption {
|
||||
# description = "";
|
||||
# default = name;
|
||||
# example = "";
|
||||
# type = lib.types.str;
|
||||
# };
|
||||
|
||||
username = lib.mkOption {
|
||||
description = "";
|
||||
default = name;
|
||||
type = lib.types.nonEmptyStr;
|
||||
};
|
||||
|
||||
trust = lib.mkOption {
|
||||
description = "If marked as null, it's mutable";
|
||||
default = null;
|
||||
example = 4;
|
||||
type = with lib.types; nullOr (ints.between 1 5);
|
||||
};
|
||||
};
|
||||
}));
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.key-fetchers.github.enable {
|
||||
systemd.user.services."gpg-fetch-github-key@" = {
|
||||
description = "Fetch GPG keys for GitHub user %i";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
|
||||
# TODO: warn if user or key does not exist
|
||||
ExecStart = let
|
||||
ghScript = pkgs.writeShellApplication {
|
||||
name = "fetch-github-gpg-keys";
|
||||
runtimeInputs = [
|
||||
config.programs.gh.package
|
||||
pkgs.jq
|
||||
cfg.package
|
||||
];
|
||||
text = ''
|
||||
gh api users/''${1}/gpg_keys | jq -r '.[].raw_key' | gpg --import
|
||||
'';
|
||||
};
|
||||
|
||||
curlScript = pkgs.writeShellApplication {
|
||||
name = "fetch-github-gpg-keys";
|
||||
runtimeInputs = [
|
||||
pkgs.curl
|
||||
pkgs.jq
|
||||
cfg.package
|
||||
];
|
||||
text = ''
|
||||
curl -s https://api.github.com/users/''${1}/gpg_keys | jq -r '.[].raw_key' | gpg --import
|
||||
'';
|
||||
};
|
||||
in if cfg.key-fetchers.github.useGh then ghScript else curlScript;
|
||||
|
||||
Restart = "on-failure";
|
||||
RestartSec = "10s";
|
||||
Environment = [
|
||||
"GNUPGHOME=${cfg.homedir}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# systemd.user.timers =
|
||||
};
|
||||
}
|
||||
+6
-6
@@ -3,9 +3,10 @@ let
|
||||
cfg = config.programs.gpg;
|
||||
in
|
||||
{
|
||||
# TODO: per-key timers
|
||||
# TODO: Create proper descriptions
|
||||
options = {
|
||||
programs.gpg.fetch-keys = {
|
||||
programs.gpg.key-fetchers.keyserver = {
|
||||
enable = lib.mkEnableOption "auto fetching of gpg keys by fingerprint";
|
||||
keys = lib.mkOption {
|
||||
description = "";
|
||||
@@ -23,8 +24,7 @@ in
|
||||
description = "If marked as null, use config";
|
||||
default = null;
|
||||
example = "hkps://keys.openpgp.org";
|
||||
type = with lib.types; nullOr str;
|
||||
apply = v: if v == null then "@NULL@" else v;
|
||||
type = with lib.types; coercedTo (nullOr str) (v: if v == null then "@NULL@" else v) str;
|
||||
};
|
||||
|
||||
trust = lib.mkOption {
|
||||
@@ -43,7 +43,7 @@ in
|
||||
# TODO: Fix the module so that this unit runs whenever something changes
|
||||
systemd.user.services.gpg-fetch-keys = let
|
||||
fetchKeysApplication = let
|
||||
recvKeysByKeyserver = lib.pipe cfg.fetch-keys.keys [
|
||||
recvKeysByKeyserver = lib.pipe cfg.key-fetchers.keyserver.keys [
|
||||
lib.attrValues
|
||||
(lib.foldl (acc: key: acc // {
|
||||
${key.keyserver} = (acc.${key.keyserver} or []) ++ [ key.id ];
|
||||
@@ -69,7 +69,7 @@ in
|
||||
}
|
||||
'';
|
||||
|
||||
trustKeys = lib.pipe cfg.fetch-keys.keys [
|
||||
trustKeys = lib.pipe cfg.key-fetchers.keyserver.keys [
|
||||
lib.attrValues
|
||||
(lib.filter (key: key.trust != null))
|
||||
(map ({ id, trust, ... }: "importTrust '${id}' '${toString trust}'"))
|
||||
@@ -84,7 +84,7 @@ in
|
||||
trustKeys
|
||||
];
|
||||
};
|
||||
in lib.mkIf cfg.fetch-keys.enable {
|
||||
in lib.mkIf cfg.key-fetchers.keyserver.enable {
|
||||
Unit = {
|
||||
Description = "Fetch declaratively listed gpg keys";
|
||||
Documentation = [ "man:gpg(1)" ];
|
||||
+23
-3
@@ -1,9 +1,29 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
daysBeforeDeletion = 2;
|
||||
cfg = config.programs.neovim.auto-clean-swapfiles;
|
||||
in
|
||||
{
|
||||
config = {
|
||||
options.programs.neovim.auto-clean-swapfiles = {
|
||||
enable = lib.mkEnableOption "automatic cleanup of neovim swapfiles";
|
||||
|
||||
daysBeforeDeletion = lib.mkOption {
|
||||
type = lib.types.ints.positive;
|
||||
default = 2;
|
||||
example = 7;
|
||||
description = "How long many days old the swapfile should be before it gets cleaned up";
|
||||
};
|
||||
|
||||
onCalendar = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "daily";
|
||||
example = "weekly";
|
||||
# TODO: link to systemd manpage for format.
|
||||
description = "How often to run the cleanup.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
systemd.user.services.clean-neovim-swap-files = {
|
||||
Unit = {
|
||||
Description = "Clean old swap files for neovim";
|
||||
@@ -19,7 +39,7 @@ in
|
||||
text = ''
|
||||
echo "Cleaning old swap files for neovim"
|
||||
|
||||
OLD_SWAPFILES=$(find "${config.xdg.stateHome}/nvim/swap" -type f -name '*.swp' -mtime +${toString daysBeforeDeletion})
|
||||
OLD_SWAPFILES=$(find "${config.xdg.stateHome}/nvim/swap" -type f -name '*.swp' -mtime +${toString cfg.daysBeforeDeletion})
|
||||
|
||||
if [ -z "$OLD_SWAPFILES" ]; then
|
||||
echo "No old swap files found"
|
||||
@@ -44,7 +64,7 @@ in
|
||||
|
||||
Timer = {
|
||||
Unit = "clean-neovim-swap-files.service";
|
||||
OnCalendar = "daily";
|
||||
OnCalendar = cfg.onCalendar;
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./vacuum.nix
|
||||
./fetch-articles.nix
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.programs.newsboat;
|
||||
package = pkgs.newsboat;
|
||||
in
|
||||
{
|
||||
options.programs.newsboat.fetch-articles = {
|
||||
enable = lib.mkEnableOption "automatic article fetcher for newsboat";
|
||||
|
||||
onCalendar = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "daily";
|
||||
example = "weekly";
|
||||
# TODO: link to systemd manpage for format.
|
||||
description = "How often to fetch new articles.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.fetch-articles.enable {
|
||||
# TODO: wait for internet
|
||||
systemd.user.services.newsboat-fetch-articles = {
|
||||
Unit = {
|
||||
Description = "Automatically fetch new articles for newsboat";
|
||||
Documentation = [ "man:newsboat(1)" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${lib.getExe pkgs.flock} %t/newsboat.lock ${lib.getExe package} --execute=reload";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.newsboat-fetch-articles = {
|
||||
Unit = {
|
||||
Description = "Automatically fetch new articles for newsboat";
|
||||
Documentation = [ "man:newsboat(1)" ];
|
||||
After = [ "network.target" ];
|
||||
};
|
||||
|
||||
Timer = {
|
||||
Unit = "newsboat-fetch-articles.service";
|
||||
OnCalendar = cfg.fetch-articles.onCalendar;
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.programs.newsboat;
|
||||
package = pkgs.newsboat;
|
||||
in
|
||||
{
|
||||
options.programs.newsboat.vacuum = {
|
||||
enable = lib.mkEnableOption "automatic cleaning of the newsboat cache";
|
||||
|
||||
onCalendar = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "weekly";
|
||||
example = "monthly";
|
||||
# TODO: link to systemd manpage for format.
|
||||
description = "How often to run the cleaning.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.vacuum.enable {
|
||||
systemd.user.services.newsboat-vacuum = {
|
||||
Unit = {
|
||||
Description = "Automatically clean newsboat cache";
|
||||
Documentation = [ "man:newsboat(1)" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${lib.getExe pkgs.flock} %t/newsboat.lock ${lib.getExe package} --vacuum";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.newsboat-vacuum = {
|
||||
Unit = {
|
||||
Description = "Automatically clean newsboat cache";
|
||||
Documentation = [ "man:newsboat(1)" ];
|
||||
};
|
||||
|
||||
Timer = {
|
||||
Unit = "newsboat-vacuum.service";
|
||||
OnCalendar = cfg.vacuum.onCalendar;
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
+20
-5
@@ -1,12 +1,25 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.programs.nix-index;
|
||||
cfg = config.programs.nix-index.autoUpdateDatabase;
|
||||
in
|
||||
{
|
||||
options.programs.nix-index.enableDatabaseFetcher = lib.mkEnableOption "timed unit that fetches an updated database of nixpkgs outputs";
|
||||
options.programs.nix-index.autoUpdateDatabase = {
|
||||
enable = lib.mkEnableOption "timed unit that fetches an updated database of nixpkgs outputs";
|
||||
|
||||
# TODO: let users specify forks and other sources
|
||||
# url = "";
|
||||
|
||||
onCalendar = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "weekly";
|
||||
example = "montly";
|
||||
# TODO: link to systemd manpage for format.
|
||||
description = "How often to update the database.";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
systemd.user.timers.fetch-nix-index-database = lib.mkIf cfg.enableDatabaseFetcher {
|
||||
systemd.user.timers.fetch-nix-index-database = lib.mkIf cfg.enable {
|
||||
Unit = {
|
||||
Description = "Fetch nix-index database";
|
||||
Documentation = [ "https://github.com/nix-community/nix-index-database" ];
|
||||
@@ -14,7 +27,7 @@ in
|
||||
|
||||
Timer = {
|
||||
Unit = "fetch-nix-index-database.service";
|
||||
OnCalendar = "weekly";
|
||||
OnCalendar = cfg.onCalendar;
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
@@ -23,7 +36,7 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.fetch-nix-index-database = lib.mkIf cfg.enableDatabaseFetcher {
|
||||
systemd.user.services.fetch-nix-index-database = lib.mkIf cfg.enable {
|
||||
Unit = {
|
||||
Description = "Fetch nix-index database";
|
||||
Documentation = [ "https://github.com/nix-community/nix-index-database" ];
|
||||
@@ -39,6 +52,8 @@ in
|
||||
wget
|
||||
];
|
||||
|
||||
# TODO: allow fetching with gh + github token
|
||||
|
||||
# Source: https://github.com/nix-community/nix-index-database?tab=readme-ov-file#ad-hoc-download
|
||||
# Slightly modified to satisfy shellcheck
|
||||
text = ''
|
||||
@@ -0,0 +1,103 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.programs.prism-launcher;
|
||||
in
|
||||
{
|
||||
options.programs.prism-launcher = {
|
||||
enable = lib.mkEnableOption "PrismLauncher, an open source minecraft launcher";
|
||||
|
||||
package = lib.mkPackageOption pkgs "prismlauncher" { };
|
||||
|
||||
stateDir = lib.mkOption {
|
||||
description = "The directory where PrismLauncher stores it's state";
|
||||
type = lib.types.path;
|
||||
default = "${config.xdg.dataHome}/PrismLauncher";
|
||||
defaultText = lib.literalExpression ''"''${config.xdg.dataHome}/PrismLauncher"'';
|
||||
};
|
||||
|
||||
screenshotMover = {
|
||||
enable = lib.mkEnableOption "a systemd unit that automatically moves screenshots from all minecraft instances into a common dir";
|
||||
|
||||
screenshotDir = lib.mkOption {
|
||||
description = "Where to move the minecraft screenshots.";
|
||||
type = lib.types.path;
|
||||
default = if config.xdg.userDirs.pictures != null
|
||||
then "${config.xdg.userDirs.pictures}/prismlauncher-screenshots"
|
||||
else "${config.home.homeDirectory}/Pictures";
|
||||
defaultText = lib.literalExpression ''
|
||||
if config.xdg.userDirs.pictures != null
|
||||
then "''${config.xdg.userDirs.pictures}/prismlauncher-screenshots"
|
||||
else "''${config.home.homeDirectory}/Pictures"
|
||||
'';
|
||||
example = lib.literalExpression ''
|
||||
"''${config.home.homeDirectory}/minecraft-screenshots"
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
systemd.user.paths.prismlauncher-move-minecraft-screenshots = lib.mkIf cfg.screenshotMover.enable {
|
||||
Install.WantedBy = [ "paths.target" ];
|
||||
Unit.Description = "Watchdog that moves screenshots from all prismlauncher minecraft instances into a common dir";
|
||||
Path = {
|
||||
PathExistsGlob = [
|
||||
"${cfg.stateDir}/instances/*/.minecraft/screenshots/*.png"
|
||||
"${cfg.stateDir}/instances/*/minecraft/screenshots/*.png"
|
||||
];
|
||||
Unit = "prismlauncher-move-minecraft-screenshots.service";
|
||||
TriggerLimitIntervalSec = "1s";
|
||||
TriggerLimitBurst = "1";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.prismlauncher-move-minecraft-screenshots = lib.mkIf cfg.screenshotMover.enable {
|
||||
Unit.Description = "Watchdog that moves screenshots from all prismlauncher minecraft instances into a common dir";
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = lib.getExe (pkgs.writeShellApplication {
|
||||
name = "prismlauncher-move-minecraft-screenshots.sh";
|
||||
runtimeInputs = with pkgs; [ coreutils findutils ];
|
||||
text = let
|
||||
instancesDir = "${cfg.stateDir}/instances";
|
||||
in ''
|
||||
shopt -s nullglob
|
||||
|
||||
for idir in "${instancesDir}"/*/; do
|
||||
INSTANCE_NAME="''${idir#${instancesDir}/}"
|
||||
INSTANCE_NAME="''${INSTANCE_NAME%'/'}"
|
||||
SCREENSHOT_TARGET_DIR="${cfg.screenshotMover.screenshotDir}/$INSTANCE_NAME"
|
||||
mkdir -p "''${SCREENSHOT_TARGET_DIR}"
|
||||
for variant in minecraft .minecraft; do
|
||||
SCREENSHOT_SOURCE_DIR="${instancesDir}/$INSTANCE_NAME/$variant"/screenshots
|
||||
if [ -d "$SCREENSHOT_SOURCE_DIR" ]; then
|
||||
echo "Scanning for screenshots in $SCREENSHOT_SOURCE_DIR"
|
||||
for screenshot in "$SCREENSHOT_SOURCE_DIR"/*.png; do
|
||||
echo "Moving '$screenshot' -> '$SCREENSHOT_TARGET_DIR'"
|
||||
cp --preserve=all "$screenshot" "$SCREENSHOT_TARGET_DIR"
|
||||
rm "$screenshot"
|
||||
done
|
||||
fi
|
||||
done
|
||||
done
|
||||
'';
|
||||
});
|
||||
|
||||
PrivateUsers = true;
|
||||
PrivateNetwork = true;
|
||||
ProtectSystem = true;
|
||||
NoNewPrivileges = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectControlGroups = true;
|
||||
RestrictAddressFamilies = [ ];
|
||||
RestrictNamespaces = true;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.tmpfiles.rules = lib.mkIf cfg.screenshotMover.enable [
|
||||
"'d' '${cfg.screenshotMover.screenshotDir}' - ${config.home.username} - - -"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{ ... }:
|
||||
{
|
||||
# TODO: create thingamajig that watches ~/Downloads and pulls all new files to
|
||||
# directory specified by systemd %i
|
||||
|
||||
# systemd.services.
|
||||
|
||||
# systemd.paths
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{ ... }:
|
||||
{
|
||||
# TODO: create abstraction over `systemd.path` thingy that looks at incoming files and
|
||||
# sorts them into subdirs by extension.
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.mpd;
|
||||
in
|
||||
{
|
||||
options.services.mpd.autoUpdateDatabase = lib.mkEnableOption "watchdog that updates the mpd database upon file changes";
|
||||
|
||||
config = lib.mkIf cfg.autoUpdateDatabase {
|
||||
systemd.user.paths.mpd-update-database = {
|
||||
Install.WantedBy = [ "paths.target" ];
|
||||
Unit = {
|
||||
Description = "Watchdog that updates the mpd database upon file changes";
|
||||
Documentation = [
|
||||
"man:mpd(1)"
|
||||
"man:mpd.conf(5)"
|
||||
];
|
||||
};
|
||||
Path = {
|
||||
PathChanged = [
|
||||
cfg.musicDirectory
|
||||
cfg.playlistDirectory
|
||||
];
|
||||
Unit = "mpd-update-database.service";
|
||||
TriggerLimitIntervalSec = "1s";
|
||||
TriggerLimitBurst = "1";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.mpd-update-database = {
|
||||
Unit = {
|
||||
Description = "Watchdog that updates the mpd library whenever the files are modified";
|
||||
Documentation = [
|
||||
"man:mpd(1)"
|
||||
"man:mpd.conf(5)"
|
||||
];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${lib.getExe pkgs.mpc-cli} update --wait";
|
||||
|
||||
PrivateUsers = true;
|
||||
ProtectSystem = true;
|
||||
NoNewPrivileges = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectControlGroups = true;
|
||||
RestrictAddressFamilies = [
|
||||
"AF_INET"
|
||||
"AF_UNIX"
|
||||
];
|
||||
RestrictNamespaces = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
+167
-162
@@ -1,50 +1,161 @@
|
||||
{ pkgs, lib, extendedLib, inputs, config, ... }: let
|
||||
inherit (lib) types mkEnableOption mkOption mdDoc;
|
||||
{ config, pkgs, lib, extendedLib, ... }: let
|
||||
cfg = config.local.shell;
|
||||
|
||||
# NOTE:
|
||||
# This module is an over-engineered solution to a non-problem.
|
||||
# It is a fun experiment in using the Nix language to create a
|
||||
# shell alias system that organizes aliases into a tree structure,
|
||||
# with categories and subcategories and subsubcategories and so on.
|
||||
#
|
||||
# It also has a lazy join function that will join a list of commands
|
||||
# with a separator, but render it in a prettier way in a documentation
|
||||
# file that you can print out and read.
|
||||
|
||||
isAlias = v: builtins.isAttrs v && v ? "alias" && v ? "type";
|
||||
in {
|
||||
options.local.shell = {
|
||||
aliases = let
|
||||
|
||||
coerceStrToAlias = str: {
|
||||
type = " ";
|
||||
alias = [ str ];
|
||||
};
|
||||
|
||||
aliasType = (types.coercedTo types.str coerceStrToAlias (types.submodule {
|
||||
options = {
|
||||
type = mkOption {
|
||||
type = types.enum [ "|" "&&" ";" " " ];
|
||||
default = ";";
|
||||
description = ''
|
||||
If the alias is a list of commands, this is the kind of separator that will be used.
|
||||
'';
|
||||
shellAliasesFormat = let
|
||||
formatLib = {
|
||||
functors = let
|
||||
inherit (extendedLib.termColors.front) blue;
|
||||
in
|
||||
{
|
||||
"|" = {
|
||||
apply = f: lib.concatStringsSep " | " f.alias;
|
||||
stringify = f: lib.concatStringsSep (blue "\n| ") f.alias;
|
||||
};
|
||||
alias = mkOption {
|
||||
type = types.listOf types.str;
|
||||
"&&" = {
|
||||
apply = f: lib.concatStringsSep " && " f.alias;
|
||||
stringify = f: lib.concatStringsSep (blue "\n&& ") f.alias;
|
||||
};
|
||||
";" = {
|
||||
apply = f: lib.concatStringsSep "; " f.alias;
|
||||
stringify = f: lib.concatStringsSep (blue ";\n ") f.alias;
|
||||
};
|
||||
" " = {
|
||||
apply = f: lib.concatStringsSep " " f.alias;
|
||||
stringify = f: lib.concatStringsSep " \\\n " f.alias;
|
||||
};
|
||||
};
|
||||
|
||||
isAlias = v: builtins.isAttrs v && v ? "alias" && v ? "type";
|
||||
};
|
||||
in {
|
||||
lib = formatLib;
|
||||
|
||||
type = let
|
||||
rawAliasType = lib.types.submodule {
|
||||
options = {
|
||||
type = lib.mkOption {
|
||||
description = "If the alias is a list of commands, this is the kind of separator that will be used.";
|
||||
type = lib.types.enum (lib.attrNames formatLib.functors);
|
||||
default = ";";
|
||||
example = "&&";
|
||||
};
|
||||
alias = lib.mkOption {
|
||||
description = "List of commands that will be concatenated together.";
|
||||
type = with lib.types; listOf str;
|
||||
example = [
|
||||
"ls"
|
||||
"grep nix"
|
||||
];
|
||||
};
|
||||
};
|
||||
})) // {
|
||||
# NOTE: this check is necessary, because nix will recurse on types.either,
|
||||
# and report that the option does not exist.
|
||||
# See https://discourse.nixos.org/t/problems-with-types-oneof-and-submodules/15197
|
||||
check = v: builtins.isString v || isAlias v;
|
||||
};
|
||||
|
||||
recursingAliasTreeType = types.attrsOf (types.either aliasType recursingAliasTreeType);
|
||||
in mkOption {
|
||||
type = recursingAliasTreeType;
|
||||
coercedAliasType = with lib.types; let
|
||||
coerce = str: {
|
||||
type = " ";
|
||||
alias = [ str ];
|
||||
};
|
||||
in (coercedTo str coerce rawAliasType) // {
|
||||
check = v: builtins.isString v || formatLib.isAlias v;
|
||||
};
|
||||
|
||||
aliasTreeType = with lib.types; attrsOf (either coercedAliasType aliasTreeType);
|
||||
in aliasTreeType;
|
||||
|
||||
# Alias Tree -> { :: Alias }
|
||||
generateAttrs = let
|
||||
inherit (lib) mapAttrs attrValues filterAttrs isAttrs
|
||||
isString concatStringsSep foldr;
|
||||
|
||||
applyFunctor = attrset: formatLib.functors.${attrset.type}.apply attrset;
|
||||
|
||||
# TODO: better naming
|
||||
allAttrValuesAreStrings = attrset: let
|
||||
|
||||
# [ {String} ]
|
||||
filteredAliases = [(filterAttrs (_: isString) attrset)];
|
||||
|
||||
# [ {String} ]
|
||||
remainingFunctors = let
|
||||
functorSet = filterAttrs (_: formatLib.isAlias) attrset;
|
||||
appliedFunctorSet = mapAttrs (_: applyFunctor) functorSet;
|
||||
in [ appliedFunctorSet ];
|
||||
|
||||
# [ {AttrSet} ]
|
||||
remainingAliasSets = attrValues (filterAttrs (_: v: isAttrs v && !formatLib.isAlias v) attrset);
|
||||
|
||||
# [ {String} ]
|
||||
recursedAliasSets = filteredAliases
|
||||
++ (remainingFunctors)
|
||||
++ (map allAttrValuesAreStrings remainingAliasSets);
|
||||
in foldr (a: b: a // b) {} recursedAliasSets;
|
||||
|
||||
in
|
||||
allAttrValuesAreStrings;
|
||||
|
||||
# TODO:
|
||||
# generateAttrs = pipe [
|
||||
# collect leave nodes
|
||||
# map apply functor
|
||||
# ]
|
||||
|
||||
# Alias Tree -> String
|
||||
generateText = aliases: let
|
||||
inherit (extendedLib.termColors.front) red green blue;
|
||||
|
||||
# String -> Alias -> String
|
||||
stringifyAlias = aliasName: alias: let
|
||||
# String -> String
|
||||
removeNixLinks = text: let
|
||||
maybeMatches = lib.match "(|.*[^)])(/nix/store/.*/bin/).*" text;
|
||||
matches = lib.mapNullable (lib.remove "") maybeMatches;
|
||||
in
|
||||
if (maybeMatches == null)
|
||||
then text
|
||||
else lib.replaceStrings matches (lib.replicate (lib.length matches) "") text;
|
||||
|
||||
# Alias -> String
|
||||
applyFunctor = attrset: let
|
||||
applied = formatLib.functors.${attrset.type}.stringify attrset;
|
||||
indent' = lib.strings.replicate (lib.stringLength "${aliasName} -> ") " ";
|
||||
in
|
||||
lib.replaceStrings ["\n"] [("\n" + indent')] applied;
|
||||
in "${red aliasName} -> ${blue "\""}${removeNixLinks (applyFunctor alias)}${blue "\""}";
|
||||
|
||||
# String -> String
|
||||
indent = x: lib.pipe x [
|
||||
(x: "\n" + x)
|
||||
(lib.replaceStrings ["\n"] [("\n" + (lib.strings.replicate 2 " "))])
|
||||
(lib.removePrefix "\n")
|
||||
];
|
||||
|
||||
# String -> { :: Alias | Category } -> String
|
||||
stringifyCategory = categoryName: category: lib.pipe category [
|
||||
(category: let
|
||||
aliases = lib.filterAttrs (_: formatLib.isAlias) category;
|
||||
in {
|
||||
inherit aliases;
|
||||
subcategories = lib.removeAttrs category (lib.attrNames aliases);
|
||||
})
|
||||
({ aliases, subcategories }: {
|
||||
aliases = lib.mapAttrsToList stringifyAlias aliases;
|
||||
subcategories = lib.mapAttrsToList stringifyCategory subcategories;
|
||||
})
|
||||
({ aliases, subcategories }:
|
||||
lib.concatStringsSep "\n" (lib.filter (x: lib.trim x != "") [
|
||||
"[${green categoryName}]"
|
||||
(indent (lib.concatStringsSep "\n" aliases) + "\n")
|
||||
(indent (lib.concatStringsSep "\n" subcategories) + "\n")
|
||||
])
|
||||
)
|
||||
];
|
||||
in (stringifyCategory "Aliases" aliases);
|
||||
};
|
||||
in {
|
||||
options.local.shell = {
|
||||
aliases = lib.mkOption {
|
||||
# TODO: freeformType
|
||||
type = shellAliasesFormat.type;
|
||||
description = "A tree of aliases";
|
||||
default = { };
|
||||
example = {
|
||||
@@ -71,8 +182,8 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
variables = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
variables = lib.mkOption {
|
||||
type = with lib.types; attrsOf str;
|
||||
description = "Environment variables";
|
||||
default = { };
|
||||
};
|
||||
@@ -82,129 +193,19 @@ in {
|
||||
|
||||
# };
|
||||
|
||||
enablePackageManagerLecture = mkEnableOption "distro reminder messages, aliased to common package manager commands";
|
||||
enableAliasOverview = mkEnableOption "`aliases` command that prints out a list of all aliases" // {
|
||||
enablePackageManagerLecture = lib.mkEnableOption "distro reminder messages, aliased to common package manager commands";
|
||||
|
||||
enableAliasOverview = lib.mkEnableOption "`aliases` command that prints out a list of all aliases" // {
|
||||
default = true;
|
||||
example = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = let
|
||||
sedColor =
|
||||
color:
|
||||
inputPattern:
|
||||
outputPattern:
|
||||
"-e \"s|${inputPattern}|${outputPattern.before or ""}$(tput setaf ${toString color})${outputPattern.middle}$(tput op)${outputPattern.after or ""}|g\"";
|
||||
|
||||
colorRed = sedColor 1;
|
||||
|
||||
colorSlashes = colorRed "/" {middle = "/";};
|
||||
|
||||
# Alias type functors
|
||||
# These will help pretty print the commands
|
||||
functors = let
|
||||
inherit (lib.strings) concatStringsSep;
|
||||
inherit (extendedLib.termColors.front) blue;
|
||||
in
|
||||
{
|
||||
"|" = {
|
||||
apply = f: concatStringsSep " | " f.alias;
|
||||
stringify = f: concatStringsSep (blue "\n| ") f.alias;
|
||||
};
|
||||
"&&" = {
|
||||
apply = f: concatStringsSep " && " f.alias;
|
||||
stringify = f: concatStringsSep (blue "\n&& ") f.alias;
|
||||
};
|
||||
";" = {
|
||||
apply = f: concatStringsSep "; " f.alias;
|
||||
stringify = f: concatStringsSep (blue ";\n ") f.alias;
|
||||
};
|
||||
" " = {
|
||||
apply = f: concatStringsSep " " f.alias;
|
||||
stringify = f: concatStringsSep " \\\n " f.alias;
|
||||
};
|
||||
};
|
||||
|
||||
aliasTextOverview = let
|
||||
inherit (lib) stringLength length concatStringsSep replaceStrings
|
||||
attrValues mapAttrs isAttrs remove replicate mapNullable;
|
||||
|
||||
inherit (extendedLib.termColors.front) red green blue;
|
||||
|
||||
# String -> String -> String
|
||||
wrap' = wrapper: str: wrapper + str + wrapper;
|
||||
|
||||
# [String] -> String -> String -> String
|
||||
replaceStrings' = from: to: replaceStrings from (replicate (length from) to);
|
||||
|
||||
# String -> Int -> String
|
||||
repeatString = string: times: concatStringsSep "" (replicate times string);
|
||||
|
||||
# int -> String -> AttrSet -> String
|
||||
stringifyCategory = level: name: category: let
|
||||
title = "${repeatString " " level}[${green name}]";
|
||||
|
||||
commands = attrValues ((lib.flip mapAttrs) category (n: v: let
|
||||
# String
|
||||
indent = repeatString " " level;
|
||||
|
||||
# String -> String
|
||||
removeNixLinks = text: let
|
||||
maybeMatches = builtins.match "(|.*[^)])(/nix/store/.*/bin/).*" text;
|
||||
matches = mapNullable (remove "") maybeMatches;
|
||||
in
|
||||
if (maybeMatches == null)
|
||||
then text
|
||||
else replaceStrings' matches "" text;
|
||||
|
||||
applyFunctor = attrset: let
|
||||
applied = functors.${attrset.type}.stringify attrset;
|
||||
indent' = indent + (repeatString " " ((stringLength " -> \"") + (stringLength n))) + " ";
|
||||
in
|
||||
replaceStrings' ["\n"] ("\n" + indent') applied;
|
||||
|
||||
recurse = stringifyCategory (level + 1) n v;
|
||||
in if isAlias v
|
||||
then "${indent} ${red n} -> ${wrap' (blue "\"") (removeNixLinks (applyFunctor v))}"
|
||||
else recurse
|
||||
));
|
||||
in concatStringsSep "\n" ([title] ++ commands) + "\n";
|
||||
in (stringifyCategory 0 "Aliases" cfg.aliases) + "\n";
|
||||
|
||||
flattenedAliases = let
|
||||
inherit (lib) mapAttrs attrValues filterAttrs isAttrs
|
||||
isString concatStringsSep foldr;
|
||||
|
||||
applyFunctor = attrset: functors.${attrset.type}.apply attrset;
|
||||
|
||||
# TODO: better naming
|
||||
allAttrValuesAreStrings = attrset: let
|
||||
|
||||
# [ {String} ]
|
||||
filteredAliases = [(filterAttrs (n: v: isString v) attrset)];
|
||||
|
||||
# [ {String} ]
|
||||
remainingFunctors = let
|
||||
functorSet = filterAttrs (_: v: isAlias v) attrset;
|
||||
appliedFunctorSet = mapAttrs (n: v: applyFunctor v) functorSet;
|
||||
in [ appliedFunctorSet ];
|
||||
|
||||
# [ {AttrSet} ]
|
||||
remainingAliasSets = attrValues (filterAttrs (_: v: isAttrs v && !isAlias v) attrset);
|
||||
|
||||
# [ {String} ]
|
||||
recursedAliasSets = filteredAliases
|
||||
++ (remainingFunctors)
|
||||
++ (map allAttrValuesAreStrings remainingAliasSets);
|
||||
in foldr (a: b: a // b) {} recursedAliasSets;
|
||||
|
||||
in
|
||||
allAttrValuesAreStrings cfg.aliases;
|
||||
|
||||
in {
|
||||
config = {
|
||||
xdg.dataFile = {
|
||||
aliases.text = aliasTextOverview;
|
||||
packageManagerLecture = lib.mkIf cfg.enablePackageManagerLecture {
|
||||
"aliases".text = shellAliasesFormat.generateText cfg.aliases;
|
||||
|
||||
"packageManagerLecture" = lib.mkIf cfg.enablePackageManagerLecture {
|
||||
target = "package-manager.lecture";
|
||||
text = let
|
||||
inherit (extendedLib.termColors.front) red blue;
|
||||
@@ -242,18 +243,22 @@ in {
|
||||
|
||||
programs = {
|
||||
zsh = {
|
||||
shellAliases = flattenedAliases;
|
||||
shellAliases = shellAliasesFormat.generateAttrs cfg.aliases;
|
||||
sessionVariables = cfg.variables;
|
||||
};
|
||||
bash = {
|
||||
shellAliases = flattenedAliases;
|
||||
shellAliases = shellAliasesFormat.generateAttrs cfg.aliases;
|
||||
sessionVariables = cfg.variables;
|
||||
};
|
||||
fish = {
|
||||
shellAliases = flattenedAliases;
|
||||
shellAliases = shellAliasesFormat.generateAttrs cfg.aliases;
|
||||
# TODO: fish does not support session variables?
|
||||
# localVariables = cfg.variables;
|
||||
};
|
||||
nushell = {
|
||||
shellAliases = shellAliasesFormat.generateAttrs cfg.aliases;
|
||||
environmentVariables = cfg.variables;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
# Taken from nixpkgs: nixos/modules/system/boot/systemd/tmpfiles.nix
|
||||
{ config, pkgs, lib, unstable-pkgs, ... }:
|
||||
let
|
||||
# TODO: 24.05, year of the types.attrsWith
|
||||
inherit (unstable-pkgs.lib) types mkOption;
|
||||
|
||||
cfg = config.systemd.user.tmpfiles;
|
||||
|
||||
attrsWith' =
|
||||
placeholder: elemType:
|
||||
types.attrsWith {
|
||||
inherit elemType;
|
||||
inherit (lib) placeholder;
|
||||
};
|
||||
|
||||
escapeArgument = lib.strings.escapeC [
|
||||
"\t"
|
||||
"\n"
|
||||
"\r"
|
||||
" "
|
||||
"\\"
|
||||
];
|
||||
|
||||
settingsOption = {
|
||||
description = ''
|
||||
Declare systemd-tmpfiles rules to create, delete, and clean up volatile
|
||||
and temporary files and directories.
|
||||
|
||||
Even though the service is called `*tmp*files` you can also create
|
||||
persistent files.
|
||||
'';
|
||||
example = {
|
||||
"10-mypackage" = {
|
||||
"/var/lib/my-service/statefolder".d = {
|
||||
mode = "0755";
|
||||
user = "root";
|
||||
group = "root";
|
||||
};
|
||||
};
|
||||
};
|
||||
default = { };
|
||||
type = attrsWith' "config-name" (
|
||||
attrsWith' "path" (
|
||||
attrsWith' "tmpfiles-type" (
|
||||
lib.types.submodule (
|
||||
{ name, config, ... }:
|
||||
{
|
||||
options.type = mkOption {
|
||||
type = types.str;
|
||||
default = name;
|
||||
defaultText = "‹tmpfiles-type›";
|
||||
example = "d";
|
||||
description = ''
|
||||
The type of operation to perform on the file.
|
||||
|
||||
The type consists of a single letter and optionally one or more
|
||||
modifier characters.
|
||||
|
||||
Please see the upstream documentation for the available types and
|
||||
more details:
|
||||
{manpage}`tmpfiles.d(5)`
|
||||
'';
|
||||
};
|
||||
options.mode = mkOption {
|
||||
type = types.str;
|
||||
default = "-";
|
||||
example = "0755";
|
||||
description = ''
|
||||
The file access mode to use when creating this file or directory.
|
||||
'';
|
||||
};
|
||||
options.user = mkOption {
|
||||
type = types.str;
|
||||
default = "-";
|
||||
example = "root";
|
||||
description = ''
|
||||
The user of the file.
|
||||
|
||||
This may either be a numeric ID or a user/group name.
|
||||
|
||||
If omitted or when set to `"-"`, the user and group of the user who
|
||||
invokes systemd-tmpfiles is used.
|
||||
'';
|
||||
};
|
||||
options.group = mkOption {
|
||||
type = types.str;
|
||||
default = "-";
|
||||
example = "root";
|
||||
description = ''
|
||||
The group of the file.
|
||||
|
||||
This may either be a numeric ID or a user/group name.
|
||||
|
||||
If omitted or when set to `"-"`, the user and group of the user who
|
||||
invokes systemd-tmpfiles is used.
|
||||
'';
|
||||
};
|
||||
options.age = mkOption {
|
||||
type = types.str;
|
||||
default = "-";
|
||||
example = "10d";
|
||||
description = ''
|
||||
Delete a file when it reaches a certain age.
|
||||
|
||||
If a file or directory is older than the current time minus the age
|
||||
field, it is deleted.
|
||||
|
||||
If set to `"-"` no automatic clean-up is done.
|
||||
'';
|
||||
};
|
||||
options.argument = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
example = "";
|
||||
description = ''
|
||||
An argument whose meaning depends on the type of operation.
|
||||
|
||||
Please see the upstream documentation for the meaning of this
|
||||
parameter in different situations:
|
||||
{manpage}`tmpfiles.d(5)`
|
||||
'';
|
||||
};
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
# generates a single entry for a tmpfiles.d rule
|
||||
settingsEntryToRule = path: entry: ''
|
||||
'${entry.type}' '${path}' '${entry.mode}' '${entry.user}' '${entry.group}' '${entry.age}' ${escapeArgument entry.argument}
|
||||
'';
|
||||
|
||||
# generates a list of tmpfiles.d rules from the attrs (paths) under tmpfiles.settings.<name>
|
||||
pathsToRules = lib.mapAttrsToList (
|
||||
path: types: lib.concatStrings (lib.mapAttrsToList (_type: settingsEntryToRule path) types)
|
||||
);
|
||||
|
||||
mkRuleFileContent = paths: lib.concatStrings (pathsToRules paths);
|
||||
in
|
||||
{
|
||||
options.systemd.user.tmpfiles.settings = lib.mkOption settingsOption;
|
||||
|
||||
config = lib.mkIf (cfg.settings != { }) {
|
||||
assertions = [
|
||||
(lib.hm.assertions.assertPlatform "systemd.user.tmpfiles" pkgs
|
||||
lib.platforms.linux)
|
||||
];
|
||||
|
||||
xdg.configFile = {
|
||||
"systemd/user/basic.target.wants/systemd-tmpfiles-setup.service".source =
|
||||
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-setup.service";
|
||||
"systemd/user/systemd-tmpfiles-setup.service".source =
|
||||
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-setup.service";
|
||||
"systemd/user/timers.target.wants/systemd-tmpfiles-clean.timer".source =
|
||||
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-clean.timer";
|
||||
"systemd/user/systemd-tmpfiles-clean.service".source =
|
||||
"${pkgs.systemd}/example/systemd/user/systemd-tmpfiles-clean.service";
|
||||
} // (lib.mapAttrs' (name: paths: {
|
||||
name = "user-tmpfiles.d/${name}.conf";
|
||||
value = {
|
||||
text = mkRuleFileContent paths;
|
||||
onChange = "${pkgs.systemd}/bin/systemd-tmpfiles --user --create";
|
||||
};
|
||||
}) cfg.settings);
|
||||
};
|
||||
}
|
||||
+25
-8
@@ -1,15 +1,20 @@
|
||||
{ pkgs, config, machineVars, ... }:
|
||||
{ pkgs, config, machineVars, machineName, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
bandwhich
|
||||
binutils
|
||||
cloc
|
||||
cyme
|
||||
czkawka
|
||||
difftastic
|
||||
diskonaut
|
||||
duf
|
||||
duff
|
||||
fclones
|
||||
ffmpeg
|
||||
file
|
||||
fselect
|
||||
gitoxide
|
||||
glances
|
||||
gpauth
|
||||
gpclient
|
||||
@@ -17,13 +22,17 @@
|
||||
gping
|
||||
graphviz
|
||||
hexyl
|
||||
htmlq
|
||||
httpie
|
||||
huniq
|
||||
hyperfine
|
||||
imagemagick
|
||||
kepubify
|
||||
keymapviz
|
||||
libwebp
|
||||
lnav
|
||||
lolcat
|
||||
lurk
|
||||
mdcat
|
||||
mediainfo
|
||||
meli
|
||||
@@ -40,23 +49,28 @@
|
||||
nmap
|
||||
ouch
|
||||
parallel
|
||||
pipr
|
||||
progress
|
||||
pwntools
|
||||
python3
|
||||
rclone
|
||||
rip2
|
||||
rnr
|
||||
rsync
|
||||
# sc-im
|
||||
skim
|
||||
slack-term
|
||||
tea
|
||||
terminal-parrot
|
||||
termtosvg
|
||||
toilet
|
||||
tokei
|
||||
trippy
|
||||
unpaper
|
||||
unzip
|
||||
usbutils
|
||||
uutils-coreutils
|
||||
uutils-coreutils-noprefix
|
||||
waifu2x-converter-cpp
|
||||
watchexec
|
||||
wavemon
|
||||
wiki-tui
|
||||
yubico-pam
|
||||
@@ -82,13 +96,14 @@
|
||||
darktable
|
||||
discord
|
||||
element-desktop
|
||||
foliate
|
||||
geogebra
|
||||
ghidra
|
||||
gimp
|
||||
gnome-font-viewer
|
||||
seahorse
|
||||
google-chrome
|
||||
imhex
|
||||
imv
|
||||
inkscape
|
||||
insomnia
|
||||
iwgtk
|
||||
@@ -99,6 +114,7 @@
|
||||
libnotify
|
||||
libreoffice
|
||||
light
|
||||
mission-center
|
||||
mopidy
|
||||
mopidy-mpd
|
||||
mopidy-soundcloud
|
||||
@@ -108,10 +124,10 @@
|
||||
nsxiv
|
||||
nyxt
|
||||
obsidian
|
||||
# pcloud
|
||||
pdfarranger
|
||||
pwvucontrol
|
||||
# scrcpy
|
||||
seahorse
|
||||
shellcheck
|
||||
slack
|
||||
# sublime3
|
||||
@@ -120,6 +136,7 @@
|
||||
|
||||
tenacity
|
||||
# transcribe
|
||||
webcamoid
|
||||
xcalib
|
||||
xclip
|
||||
xdotool
|
||||
@@ -142,14 +159,14 @@
|
||||
] ++ lib.optionals (machineVars.gaming) [
|
||||
desmume
|
||||
osu-lazer
|
||||
(prismlauncher.override {
|
||||
jdk17 = jdk21;
|
||||
})
|
||||
retroarchFull
|
||||
steam
|
||||
steam-tui
|
||||
stepmania
|
||||
taisei
|
||||
] ++ lib.optionals (machineName != "dosei") [
|
||||
# Source blocked by external firewall on dosei
|
||||
pcloud
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
{ pkgs, lib, inputs, ... }:
|
||||
{
|
||||
programs.anyrun = {
|
||||
enable = true;
|
||||
|
||||
config = {
|
||||
y.fraction = 0.3;
|
||||
width.fraction = 0.25;
|
||||
plugins = [
|
||||
inputs.anyrun.packages.${pkgs.system}.applications
|
||||
];
|
||||
hidePluginInfo = true;
|
||||
closeOnClick = true;
|
||||
showResultsImmediately = true;
|
||||
};
|
||||
|
||||
extraCss = builtins.readFile (./. + "/style.css");
|
||||
|
||||
extraConfigFiles."applications.ron".text = let
|
||||
preprocess_script = pkgs.writeShellApplication {
|
||||
name = "anyrun-preprocess-application-exec";
|
||||
runtimeInputs = [ ];
|
||||
text = ''
|
||||
shift # Remove term|no-term
|
||||
echo "uwsm app -- $*"
|
||||
'';
|
||||
};
|
||||
in ''
|
||||
Config(
|
||||
desktop_actions: false,
|
||||
max_entries: 10,
|
||||
preprocess_exec_script: Some("${lib.getExe preprocess_script}"),
|
||||
terminal: Some("${lib.getExe pkgs.alacritty}"),
|
||||
)
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
* {
|
||||
all: unset;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
|
||||
#window,
|
||||
#match,
|
||||
#entry,
|
||||
#plugin,
|
||||
#main {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
#match.activatable {
|
||||
border-radius: 8px;
|
||||
margin: 4px 0;
|
||||
padding: 4px;
|
||||
/* transition: 100ms ease-out; */
|
||||
}
|
||||
#match.activatable:first-child {
|
||||
margin-top: 12px;
|
||||
}
|
||||
#match.activatable:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#match:hover {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
}
|
||||
#match:selected {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
#entry {
|
||||
background: rgba(255, 255, 255, 0.05);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 8px;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
box#main {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
box-shadow:
|
||||
inset 0 0 0 1px rgba(255, 255, 255, 0.1),
|
||||
0 30px 30px 15px rgba(0, 0, 0, 0.5);
|
||||
border-radius: 20px;
|
||||
padding: 12px;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ in
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
enableNushellIntegration = config.programs.nushell.enable;
|
||||
|
||||
settings = {
|
||||
db_path = "${config.xdg.dataHome}/atuin/history.db";
|
||||
|
||||
@@ -7,5 +7,10 @@
|
||||
bashrcExtra = ''
|
||||
source "${config.xdg.configHome}/mutable_env.sh"
|
||||
'';
|
||||
shellOptions = [
|
||||
"histappend"
|
||||
"checkwinsize"
|
||||
"checkjobs"
|
||||
];
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,40 @@
|
||||
{
|
||||
programs.bottom = {
|
||||
enable = true;
|
||||
settings.flags.enable_gpu = true;
|
||||
settings = {
|
||||
flags.enable_gpu = true;
|
||||
|
||||
row = [
|
||||
{
|
||||
ratio = 30;
|
||||
child = [{ type = "cpu"; }];
|
||||
}
|
||||
{
|
||||
ratio = 40;
|
||||
child = [
|
||||
{
|
||||
ratio = 4;
|
||||
type = "mem";
|
||||
}
|
||||
{
|
||||
ratio = 3;
|
||||
type = "disk";
|
||||
}
|
||||
];
|
||||
}
|
||||
{
|
||||
ratio = 30;
|
||||
child = [
|
||||
{
|
||||
type = "net";
|
||||
}
|
||||
{
|
||||
default = true;
|
||||
type = "proc";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
"Amazon.com".metaData.hidden = true;
|
||||
"Bing".metaData.hidden = true;
|
||||
@@ -57,9 +57,29 @@
|
||||
definedAliases = [ "gh" ];
|
||||
};
|
||||
|
||||
"GitHub Nix Configs" = {
|
||||
urls = [{
|
||||
template = "https://github.com/search";
|
||||
params = [
|
||||
{ name = "type"; value = "code"; }
|
||||
{
|
||||
name = "q";
|
||||
value = lib.concatStringsSep " " [
|
||||
"lang:nix"
|
||||
"-is:fork"
|
||||
"-repo:nixos/nixpkgs"
|
||||
"{searchTerms}"
|
||||
];
|
||||
}
|
||||
];
|
||||
}];
|
||||
icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/github.svg";
|
||||
definedAliases = [ "ghn" ];
|
||||
};
|
||||
|
||||
"HomeManager Options" = {
|
||||
urls = [{
|
||||
template = "https://mipmip.github.io/home-manager-option-search/?{searchTerms}";
|
||||
template = "https://mipmip.github.io/home-manager-option-search/?query={searchTerms}";
|
||||
}];
|
||||
icon = "${pkgs.super-tiny-icons}/share/icons/SuperTinyIcons/svg/nixos.svg";
|
||||
definedAliases = [ "hms" ];
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.cargo = {
|
||||
enable = true;
|
||||
settings = {
|
||||
cargo-new.vcs = "git";
|
||||
};
|
||||
};
|
||||
|
||||
home.sessionVariables.CARGO_NET_GIT_FETCH_WITH_CLI = "true";
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
{ ... }:
|
||||
{ config, ... }:
|
||||
{
|
||||
imports = [
|
||||
./auto-prune.nix
|
||||
];
|
||||
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
silent = true;
|
||||
|
||||
nix-direnv.enable = true;
|
||||
|
||||
enableZshIntegration = true;
|
||||
enableNushellIntegration = config.programs.nushell.enable;
|
||||
|
||||
auto-prune-allowed-dirs.enable = true;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{ ... }:
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.eza.enable = true;
|
||||
}
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
icons = "auto";
|
||||
enableNushellIntegration = config.programs.nushell.enable;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
@@ -7,12 +7,61 @@
|
||||
toolbar = true;
|
||||
bookmarks = import ./browser/bookmarks.nix;
|
||||
}];
|
||||
|
||||
search = {
|
||||
default = "Google";
|
||||
engines = import ./browser/engines.nix { inherit pkgs; };
|
||||
engines = import ./browser/engines.nix { inherit pkgs lib; };
|
||||
force = true;
|
||||
};
|
||||
settings = {};
|
||||
|
||||
# TODO: make into structured attrs
|
||||
settings = {
|
||||
# TODO: collect more stuff from here
|
||||
# https://github.com/arkenfox/user.js
|
||||
"browser.aboutConfig.showWarning" = false;
|
||||
"browser.newtabpage.activity-stream.showSponsored" = false;
|
||||
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
|
||||
"browser.newtabpage.activity-stream.feeds.telemetry" = false;
|
||||
"browser.newtabpage.activity-stream.telemetry" = false;
|
||||
"datareporting.policy.dataSubmissionEnabled" = false;
|
||||
"datareporting.healthreport.uploadEnabled" = false;
|
||||
"toolkit.telemetry.unified" = false;
|
||||
"toolkit.telemetry.enabled" = false;
|
||||
"toolkit.telemetry.server" = "data:,";
|
||||
"toolkit.telemetry.archive.enabled" = false;
|
||||
"toolkit.telemetry.newProfilePing.enabled" = false;
|
||||
"toolkit.telemetry.shutdownPingSender.enabled" = false;
|
||||
"toolkit.telemetry.updatePing.enabled" = false;
|
||||
"toolkit.telemetry.bhrPing.enabled" = false;
|
||||
"toolkit.telemetry.firstShutdownPing.enabled" = false;
|
||||
"toolkit.telemetry.coverage.opt-out" = true;
|
||||
"toolkit.coverage.opt-out" = true;
|
||||
"toolkit.coverage.endpoint.base" = "";
|
||||
|
||||
"layout.css.prefers-color-scheme.content-override" = "dark";
|
||||
|
||||
"font.cjk_pref_fallback_order" = lib.concatStringsSep "," [
|
||||
"ja"
|
||||
"zh-cn"
|
||||
"zh-hk"
|
||||
"zh-tw"
|
||||
"ko"
|
||||
];
|
||||
} // (lib.pipe null [
|
||||
(_: {
|
||||
"ja" = "JP";
|
||||
"ko" = "KR";
|
||||
"zh-CN" = "SC";
|
||||
"zh-HK" = "HK";
|
||||
"zh-TW" = "TC";
|
||||
})
|
||||
(lib.mapAttrsToList (lang: notoSuffix: {
|
||||
"font.name.monospace.${lang}" = "Noto Sans Mono CJK ${notoSuffix}";
|
||||
"font.name.sans-serif.${lang}" = "Noto Sans CJK ${notoSuffix}";
|
||||
"font.name.serif.${lang}" = "Noto Serif CJK ${notoSuffix}";
|
||||
}))
|
||||
(lib.foldl lib.mergeAttrs { })
|
||||
]);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
set print demangle on
|
||||
set print sevenbit-strings off
|
||||
set print asm-demangle on
|
||||
set print elements 0
|
||||
set print elements 0
|
||||
|
||||
# Assembly
|
||||
set disassembly-flavor intel
|
||||
|
||||
@@ -14,10 +14,6 @@ let
|
||||
];
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./maintenance-timers.nix
|
||||
];
|
||||
|
||||
# TODO: convert to template once nix-sops supports it in hm module
|
||||
sops.secrets."git/nordicsemi-config" = { };
|
||||
|
||||
@@ -31,9 +27,12 @@ in
|
||||
|
||||
signing = {
|
||||
key = "46B9228E814A2AAC";
|
||||
# format = "openpgp";
|
||||
signByDefault = true;
|
||||
};
|
||||
|
||||
maintenance.enable = true;
|
||||
|
||||
lfs.enable = true;
|
||||
|
||||
delta = {
|
||||
@@ -47,17 +46,18 @@ in
|
||||
|
||||
aliases = {
|
||||
aliases = "!git config --get-regexp alias | sed -re 's/alias\\.(\\S*)\\s(.*)$/\\1 = \\2/g'";
|
||||
delete-merged = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d";
|
||||
forcepush = "push --force-with-lease --force-if-includes";
|
||||
authors = "shortlog --summary --numbered --email";
|
||||
si = "switch-interactive";
|
||||
delete-merged = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d";
|
||||
ff = "fixup-fixup";
|
||||
fi = "fixup-interactive";
|
||||
rf = "rebase-fixups";
|
||||
pp = "post-pr";
|
||||
subs = "submodule update --init --recursive";
|
||||
rebase-author = "rebase -i -x \"git commit --amend --reset-author -CHEAD\"";
|
||||
forcepush = "push --force-with-lease --force-if-includes";
|
||||
git = "!git";
|
||||
pp = "post-pr";
|
||||
rebase-author = "rebase -i -x \"git commit --amend --reset-author -CHEAD\"";
|
||||
reset-to-upstream = "!git reset --hard \"origin/$(git rev-parse --abbrev-ref HEAD)\"";
|
||||
rf = "rebase-fixups";
|
||||
si = "switch-interactive";
|
||||
subs = "submodule update --init --recursive";
|
||||
} // (let
|
||||
c = c: s: "%C(${c})${s}%C(reset)";
|
||||
in {
|
||||
@@ -116,7 +116,12 @@ in
|
||||
|
||||
extraConfig = {
|
||||
core = {
|
||||
whitespace = "space-before-tab,-indent-with-non-tab,trailing-space";
|
||||
whitespace = lib.concatStringsSep "," [
|
||||
"space-before-tab"
|
||||
"-indent-with-non-tab"
|
||||
"trailing-space"
|
||||
"blank-at-eof"
|
||||
];
|
||||
untrackedCache = true;
|
||||
editor = "nvim";
|
||||
};
|
||||
@@ -181,6 +186,7 @@ in
|
||||
diff = {
|
||||
mnemonicPrefix = true;
|
||||
renames = true;
|
||||
compactionHeuristic = true;
|
||||
tool = "nvimdiff";
|
||||
submodule = "log";
|
||||
};
|
||||
@@ -223,6 +229,21 @@ in
|
||||
|
||||
"url \"${lib.head github-uri-prefixes}\"".insteadOf = lib.tail github-uri-prefixes;
|
||||
|
||||
"url \"git@gist.github.com:\"".insteadOf = [
|
||||
"git://gist.github.com/"
|
||||
"https://gist.github.com/"
|
||||
];
|
||||
|
||||
"url \"aur@aur.archlinux.org:\"".insteadOf = [
|
||||
"aur:"
|
||||
"https://aur.archlinux.org/"
|
||||
];
|
||||
|
||||
gc = {
|
||||
reflogExpire = "90 days";
|
||||
reflogExpireUnreachable = "90 days";
|
||||
};
|
||||
|
||||
web.browser = "google-chrome-stable";
|
||||
|
||||
"filter \"lfs\"" = {
|
||||
@@ -292,7 +313,7 @@ in
|
||||
"nrfconnect"
|
||||
"oysteintveit-nordicsemi"
|
||||
];
|
||||
in lib.genAttrs organizations (org: map (uri-prefix: "${uri-prefix}${org}") github-uri-prefixes);
|
||||
in lib.genAttrs organizations (org: map (uri-prefix: "${uri-prefix}${org}") (github-uri-prefixes ++ [ "github-nordicsemi:" ]));
|
||||
in {
|
||||
extraConfig = lib.mergeAttrs
|
||||
{
|
||||
@@ -312,6 +333,35 @@ in
|
||||
})
|
||||
];
|
||||
|
||||
systemd.user.services."git-maintenance@".Service = lib.mkIf cfg.maintenance.enable {
|
||||
ExecStartPre = let
|
||||
repoDirs = lib.escapeShellArgs [
|
||||
"${config.home.homeDirectory}/git"
|
||||
"${config.home.homeDirectory}/work"
|
||||
"${config.home.homeDirectory}/pvv"
|
||||
];
|
||||
|
||||
script = pkgs.writeShellApplication {
|
||||
name = "discover-git-maintenance-repos";
|
||||
text = ''
|
||||
{
|
||||
echo "[maintenance]"
|
||||
for repoLocation in ${repoDirs}; do
|
||||
for repo in "$repoLocation"/*/.git; do
|
||||
echo "repo = $("${pkgs.coreutils}/bin/realpath" "''${repo%"/.git"}")"
|
||||
done
|
||||
done
|
||||
} > "$1"
|
||||
'';
|
||||
};
|
||||
in "${lib.getExe script} %t/maintenance-repos";
|
||||
|
||||
ExecStart = lib.mkForce ''
|
||||
"${lib.getExe cfg.package}" -c include.path="%t/maintenance-repos" for-each-repo --keep-going --config=maintenance.repo maintenance run --schedule=%i
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
home.packages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "git-tcommit";
|
||||
@@ -338,12 +388,12 @@ in
|
||||
})
|
||||
(pkgs.writeShellApplication {
|
||||
name = "git-fixup-interactive";
|
||||
runtimeInputs = with pkgs; [ cfg.package gnused gnugrep fzf ];
|
||||
runtimeInputs = with pkgs; [ cfg.package gnused gnugrep skim ];
|
||||
text = lib.fileContents ./scripts/git-fixup-interactive.sh;
|
||||
})
|
||||
(pkgs.writeShellApplication {
|
||||
name = "git-switch-interactive";
|
||||
runtimeInputs = with pkgs; [ cfg.package fzf gnused coreutils ];
|
||||
runtimeInputs = with pkgs; [ cfg.package skim gnused gnugrep uutils-coreutils-noprefix ];
|
||||
text = lib.fileContents ./scripts/git-switch-interactive.sh;
|
||||
excludeShellChecks = [
|
||||
"SC2001" # (style): See if you can use ${variable//search/replace} instead. (sed invocation)
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.programs.git;
|
||||
in
|
||||
{
|
||||
systemd.user.services."git-maintenance@" = {
|
||||
Unit = {
|
||||
Description = "Optimize Git repositories data";
|
||||
Documentation = [ "man:git-maintenance(1)" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${lib.getExe pkgs.git} for-each-repo --config=maintenance.repo maintenance run --no-quiet --schedule=%i";
|
||||
|
||||
Environment = [
|
||||
"PATH=${lib.makeBinPath (with pkgs; [ cfg.package openssh ])}"
|
||||
];
|
||||
|
||||
LockPersonality = "yes";
|
||||
MemoryDenyWriteExecute = "yes";
|
||||
NoNewPrivileges = "yes";
|
||||
RestrictAddressFamilies = [
|
||||
"AF_UNIX"
|
||||
"AF_INET"
|
||||
"AF_INET6"
|
||||
"AF_VSOCK"
|
||||
];
|
||||
RestrictNamespaces = "yes";
|
||||
RestrictRealtime = "yes";
|
||||
RestrictSUIDSGID = "yes";
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = "@system-service";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers."git-maintenance@" = {
|
||||
Unit = {
|
||||
Description = "Optimize Git repositories data";
|
||||
Documentation = [ "man:git-maintenance(1)" ];
|
||||
};
|
||||
|
||||
Timer = {
|
||||
Persistent = true;
|
||||
OnCalendar = "%i";
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers."git-maintenance@hourly".Timer.OnCalendar = "*-*-* 1..23:05:00";
|
||||
systemd.user.timers."git-maintenance@daily".Timer.OnCalendar = "Tue..Sun *-*-* 0:05:00";
|
||||
systemd.user.timers."git-maintenance@weekly".Timer.OnCalendar = "Mon 0:05:00";
|
||||
}
|
||||
@@ -9,7 +9,7 @@ FORK_POINT=$(git merge-base --fork-point "$TARGET_BRANCH")
|
||||
|
||||
COMMITS_SINCE_FORK_POINT=$(git log --format=format:'%s' "$FORK_POINT"..HEAD | grep -v -E '^fixup!')
|
||||
|
||||
RESULT=$(fzf <<<"$COMMITS_SINCE_FORK_POINT")
|
||||
RESULT=$(sk <<<"$COMMITS_SINCE_FORK_POINT")
|
||||
|
||||
if [ "$RESULT" == "" ]; then
|
||||
echo "Doing nothing..."
|
||||
|
||||
@@ -6,7 +6,7 @@ if [ -n "${1:-}" ]; then
|
||||
fi
|
||||
|
||||
BRANCHES=$(cat <(git branch) <(git branch --remotes) | grep --invert-match '^\*\|HEAD ->' | sed 's|^\s*||')
|
||||
CHOSEN_BRANCH=$(fzf --reverse --info=inline --preview 'git show --color {}' <<<"$BRANCHES")
|
||||
CHOSEN_BRANCH=$(sk --reverse --info=inline --preview 'git show --color {}' <<<"$BRANCHES")
|
||||
|
||||
CLEAN_BRANCH_NAME=$(sed 's|^\s*||' <<<"$CHOSEN_BRANCH")
|
||||
for REMOTE in $(git remote); do
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
{ pkgs, config, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./auto-refresh-keys.nix
|
||||
./auto-update-trust-db.nix
|
||||
./declarative-key-fetcher.nix
|
||||
];
|
||||
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
homedir = "${config.xdg.configHome}/gnupg";
|
||||
@@ -20,7 +14,7 @@
|
||||
];
|
||||
};
|
||||
|
||||
fetch-keys = {
|
||||
key-fetchers.keyserver = {
|
||||
enable = true;
|
||||
keys = {
|
||||
"495A898FC1A0276F51EA3155355E5D82B18F4E71" = { trust = 4; };
|
||||
@@ -36,6 +30,7 @@
|
||||
enableExtraSocket = true;
|
||||
enableSshSupport = true;
|
||||
enableScDaemon = true;
|
||||
enableNushellIntegration = config.programs.nushell.enable;
|
||||
grabKeyboardAndMouse = false;
|
||||
};
|
||||
}
|
||||
+88
-31
@@ -20,12 +20,13 @@ in
|
||||
# QT_QPA_PLATFORMTHEME = "qt6ct";
|
||||
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
||||
|
||||
LIBVA_DRIVER_NAME = "nvidia";
|
||||
GBM_BACKEND = "nvidia-drm";
|
||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
# LIBVA_DRIVER_NAME = "nvidia";
|
||||
# GBM_BACKEND = "nvidia-drm";
|
||||
# __GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
hyprpolkitagent
|
||||
wl-clipboard-rs
|
||||
];
|
||||
|
||||
@@ -34,7 +35,7 @@ in
|
||||
settings = {
|
||||
general = {
|
||||
disable_loading_bar = true;
|
||||
grace = 300;
|
||||
grace = 0;
|
||||
hide_cursor = true;
|
||||
no_fade_in = false;
|
||||
};
|
||||
@@ -62,6 +63,11 @@ in
|
||||
shadow_passes = 2;
|
||||
}
|
||||
];
|
||||
|
||||
auth = {
|
||||
"pam:enabled" = true;
|
||||
"pam:module" = "hyprlock";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -92,12 +98,16 @@ in
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
|
||||
systemd.enable = false;
|
||||
systemd.enableXdgAutostart = false;
|
||||
|
||||
settings = let
|
||||
exe = lib.getExe;
|
||||
scratchpads = [
|
||||
(rec {
|
||||
title = "Floating terminal";
|
||||
class = "floatingTerminal";
|
||||
command = "${pkgs.alacritty}/bin/alacritty --class ${class} -e ${pkgs.tmux}/bin/tmux new-session -A -s f";
|
||||
command = "uwsm app -- ${exe pkgs.alacritty} --class ${class} -e ${exe pkgs.tmux} new-session -A -s f";
|
||||
size = { h = 90; w = 95; };
|
||||
keys = [
|
||||
"$mod, RETURN"
|
||||
@@ -107,7 +117,7 @@ in
|
||||
(rec {
|
||||
title = "Ncmpcpp";
|
||||
class = "floatingNcmpcpp";
|
||||
command = "${pkgs.alacritty}/bin/alacritty --class ${class} -e ${pkgs.ncmpcpp}/bin/ncmpcpp";
|
||||
command = "uwsm app -- ${exe pkgs.alacritty} --class ${class} -e ${exe pkgs.ncmpcpp}";
|
||||
size = { h = 95; w = 95; };
|
||||
keys = [ "$mod, Q" ];
|
||||
})
|
||||
@@ -120,18 +130,19 @@ in
|
||||
|
||||
# https://github.com/xkbcommon/libxkbcommon/blob/master/include/xkbcommon/xkbcommon-keysyms.h
|
||||
bind = [
|
||||
"$mod SHIFT, Q, exit"
|
||||
"$mod, R, exec, ${pkgs.rofi}/bin/rofi -show drun"
|
||||
"$mod SHIFT, Q, exec, ${pkgs.systemd}/bin/loginctl terminate-user \"\""
|
||||
"$mod ALT SHIFT, Q, exec, uwsm stop"
|
||||
"$mod, R, exec, uwsm app -- ${exe config.programs.anyrun.package}"
|
||||
"$mod, T, togglefloating"
|
||||
|
||||
# TODO: fix this for upcoming releases
|
||||
"$mod, F, fullscreen, 2"
|
||||
"$mod, F, fullscreenstate, 1"
|
||||
"$mod SHIFT, F, fullscreenstate, 3"
|
||||
"$mod, C, exec, ${cfg.finalPackage}/bin/hyprctl reload"
|
||||
|
||||
"$mod, BACKSPACE, killactive"
|
||||
|
||||
"$mod SHIFT, RETURN, exec, ${pkgs.alacritty}/bin/alacritty --class termTerminal -e ${pkgs.tmux}/bin/tmux new-session -A -s term"
|
||||
"$mod SHIFT, SPACE, exec, ${pkgs.alacritty}/bin/alacritty --class termTerminal -e ${pkgs.tmux}/bin/tmux new-session -A -s term"
|
||||
"$mod SHIFT, RETURN, exec, uwsm app -- ${exe pkgs.alacritty} --class termTerminal -e ${exe pkgs.tmux} new-session -A -s term"
|
||||
"$mod SHIFT, SPACE, exec, uwsm app -- ${exe pkgs.alacritty} --class termTerminal -e ${exe pkgs.tmux} new-session -A -s term"
|
||||
|
||||
"$mod, j, layoutmsg,cyclenext"
|
||||
"$mod, k, layoutmsg,cycleprev"
|
||||
@@ -162,20 +173,17 @@ in
|
||||
"$mod, n, exec, ${pkgs.fcitx5}/bin/fcitx5-remote -s keyboard-no"
|
||||
"$mod, m, exec, ${pkgs.fcitx5}/bin/fcitx5-remote -s keyboard-us"
|
||||
|
||||
# TODO: ensure exists in environment
|
||||
"$mod, l, exec, ${pkgs.systemd}/bin/loginctl lock-session"
|
||||
|
||||
# TODO: fix
|
||||
# "super + minus" = "${pkgs.xcalib}/bin/xcalib -invert -alter"
|
||||
|
||||
# TODO: fix
|
||||
", Print, exec, ${lib.getExe pkgs.grimblast} copy area"
|
||||
", Print, exec, ${exe pkgs.grimblast} copy area"
|
||||
|
||||
# "SHIFT, Print, exec, ${lib.getExe pkgs.grimblast} copy area"
|
||||
# "shift + @Print" = "${pkgs.maim}/bin/maim --hidecursor --nokeyboard $SCREENSHOT_DIR/$(date +%s).png"
|
||||
|
||||
# TODO: Add boomer as package
|
||||
# "super + @Print" = "boomer"
|
||||
"$mod, Print, exec, ${exe pkgs.woomer}"
|
||||
]
|
||||
++
|
||||
(lib.pipe scratchpads [
|
||||
@@ -210,34 +218,60 @@ in
|
||||
lib.flatten
|
||||
]);
|
||||
|
||||
bindm = [
|
||||
"$mod, mouse:272, movewindow"
|
||||
"$mod, Control_L, movewindow"
|
||||
"$mod, mouse:273, resizewindow"
|
||||
"$mod, ALT_L, resizewindow"
|
||||
];
|
||||
|
||||
bindl = [
|
||||
"$mod, p, exec, ${pkgs.mpc_cli}/bin/mpc toggle"
|
||||
",XF86AudioPlay, exec, ${pkgs.mpc_cli}/bin/mpc toggle"
|
||||
",XF86AudioPrev, exec, ${pkgs.mpc_cli}/bin/mpc prev"
|
||||
",XF86AudioNext, exec, ${pkgs.mpc_cli}/bin/mpc next"
|
||||
"$mod, p, exec, ${exe pkgs.mpc_cli} toggle"
|
||||
",XF86AudioPlay, exec, ${exe pkgs.mpc_cli} toggle"
|
||||
",XF86AudioPrev, exec, ${exe pkgs.mpc_cli} prev"
|
||||
",XF86AudioNext, exec, ${exe pkgs.mpc_cli} next"
|
||||
];
|
||||
|
||||
bindle = [
|
||||
",XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} s +5%"
|
||||
",XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} s 5%-"
|
||||
",XF86MonBrightnessUp, exec, ${exe pkgs.brightnessctl} s +5%"
|
||||
",XF86MonBrightnessDown, exec, ${exe pkgs.brightnessctl} s 5%-"
|
||||
",XF86AudioLowerVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"
|
||||
",XF86AudioRaiseVolume, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+"
|
||||
"$mod ,F7, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%-"
|
||||
"$mod ,F8, exec, ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 2%+"
|
||||
];
|
||||
|
||||
exec-once = [
|
||||
"uwsm finalize"
|
||||
];
|
||||
|
||||
windowrulev2 = [
|
||||
"float,class:(Rofi)"
|
||||
"float, class:^(Rofi)$"
|
||||
"float, class:^(xdg-desktop-portal-gtk)$"
|
||||
"float, title:^(.*Bitwarden Password Manager.*)$"
|
||||
"float, title:^(Picture-in-Picture)$"
|
||||
"tile, class:^(Nsxiv)$"
|
||||
|
||||
"workspace 2,class:(firefox)"
|
||||
"workspace 2,class:(google-chrome)"
|
||||
"float, class: ^(Gimp-2.*)$, title:^(Open Image)$"
|
||||
"size 70%, class: ^(Gimp-2.*)$, title:^(Open Image)$"
|
||||
"center, class: ^(Gimp-2.*)$, title:^(Open Image)$"
|
||||
|
||||
"workspace 3,class:(Emacs)"
|
||||
"workspace 3,class:(Code)"
|
||||
"workspace 3,class:(code-url-handler)"
|
||||
"dimaround, class:^(xdg-desktop-portal-gtk)$"
|
||||
|
||||
"workspace 5,class:(discord)"
|
||||
"workspace 5,class:(Element)"
|
||||
"workspace special silent, title:^(Firefox — Sharing Indicator)$"
|
||||
"workspace special silent, title:^(Zen — Sharing Indicator)$"
|
||||
"workspace special silent, title:^(.*is sharing (your screen|a window)\.)$"
|
||||
|
||||
"workspace 2, class:^(firefox)$"
|
||||
"workspace 2, class:^(google-chrome)$"
|
||||
|
||||
"workspace 3, class:^(Emacs)$"
|
||||
"workspace 3, class:^(code)$"
|
||||
"workspace 3, class:^(code-url-handler)$"
|
||||
"workspace 3, class:^(dev.zed.Zed)$"
|
||||
|
||||
"workspace 5, class:^(discord)$"
|
||||
"workspace 5, class:^(Element)$"
|
||||
]
|
||||
++
|
||||
(lib.pipe scratchpads [
|
||||
@@ -253,6 +287,15 @@ in
|
||||
monitor = [
|
||||
# TODO: host specific
|
||||
"eDP-1, 3840x2400@90.00Hz, 0x0, 2"
|
||||
|
||||
# PVV Demiurgen
|
||||
"desc:Hewlett Packard HP ZR24w CNT01711G6, 1920x1200, 0x-1200, 1"
|
||||
"desc:Hewlett Packard HP ZR24w CNT018103H, 1920x1200, 1920x-1200, 1"
|
||||
|
||||
# PVV Eirin
|
||||
"desc:Hewlett Packard HP ZR24w CNT01710L4, 1920x1200, 0x-1200, 1"
|
||||
"desc:Hewlett Packard HP ZR24w CNT0181039, 1920x1200, 1920x-1200, 1"
|
||||
|
||||
",preferred,auto,1"
|
||||
];
|
||||
|
||||
@@ -320,4 +363,18 @@ in
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.hyprpaper = {
|
||||
enable = true;
|
||||
settings.ipc = true;
|
||||
};
|
||||
|
||||
# UWSM
|
||||
systemd.user.services = {
|
||||
hypridle.Unit.After = lib.mkForce "graphical-session.target";
|
||||
waybar.Unit.After = lib.mkForce "graphical-session.target";
|
||||
network-manager-applet.Unit.After = lib.mkForce "graphical-session.target";
|
||||
fcitx5-daemon.Unit.After = lib.mkForce "graphical-session.target";
|
||||
# hyprpaper.Unit.After = lib.mkForce "graphical-session.target";
|
||||
};
|
||||
}
|
||||
|
||||
+15
-3
@@ -1,4 +1,16 @@
|
||||
{ machineVars, ... }:
|
||||
{ config, lib, machineVars, ... }:
|
||||
{
|
||||
programs.mpv.enable = !machineVars.headless;
|
||||
}
|
||||
programs.mpv = {
|
||||
enable = !machineVars.headless;
|
||||
|
||||
config = {
|
||||
screenshot-directory = "${config.xdg.userDirs.pictures}/mpv-screenshots";
|
||||
|
||||
#https://wiki.nixos.org/wiki/Accelerated_Video_Playback
|
||||
hwdec = "auto-safe";
|
||||
vo = "gpu";
|
||||
profile = "gpu-hq";
|
||||
gpu-context = lib.mkIf machineVars.wayland "wayland";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,26 +1,25 @@
|
||||
{ pkgs, lib, machineVars, ... }:
|
||||
{
|
||||
imports = [
|
||||
./auto-clean-swapfiles.nix
|
||||
];
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
|
||||
auto-clean-swapfiles.enable = true;
|
||||
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
direnv-vim
|
||||
vim-commentary
|
||||
vim-gitgutter
|
||||
fzf-vim
|
||||
vim-which-key
|
||||
vim-commentary
|
||||
vim-css-color
|
||||
vim-fugitive
|
||||
vim-gitgutter
|
||||
vim-nix
|
||||
vim-surround
|
||||
vim-fugitive
|
||||
vim-css-color
|
||||
vim-trailing-whitespace
|
||||
vim-which-key
|
||||
] ++ (lib.optionals machineVars.wayland [
|
||||
vim-wayland-clipboard
|
||||
]) ++ [
|
||||
|
||||
@@ -12,6 +12,10 @@ in {
|
||||
|
||||
programs.newsboat = {
|
||||
enable = true;
|
||||
|
||||
fetch-articles.enable = true;
|
||||
vacuum.enable = true;
|
||||
|
||||
autoReload = true;
|
||||
maxItems = 50;
|
||||
browser = ''"${defaultBrowser}"'';
|
||||
@@ -71,76 +75,10 @@ in {
|
||||
];
|
||||
};
|
||||
|
||||
systemd.user.slices.app-newsboat = {
|
||||
Unit = {
|
||||
Description = "Newsboat automation";
|
||||
Documentation = [ "man:newsboat(1)" ];
|
||||
};
|
||||
};
|
||||
|
||||
# TODO: wait for internet
|
||||
systemd.user.services.newsboat-fetch-articles = {
|
||||
Unit = {
|
||||
Description = "Automatically fetch new articles for newsboat";
|
||||
Documentation = [ "man:newsboat(1)" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "app-newsboat.slice";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${lib.getExe pkgs.flock} %t/newsboat.lock ${lib.getExe package} --execute=reload";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.newsboat-fetch-articles = {
|
||||
Unit = {
|
||||
Description = "Automatically fetch new articles for newsboat";
|
||||
Documentation = [ "man:newsboat(1)" ];
|
||||
After = [ "network.target" ];
|
||||
};
|
||||
|
||||
Timer = {
|
||||
Unit = "newsboat-fetch-articles.service";
|
||||
OnCalendar = lib.mkDefault "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.newsboat-vacuum = {
|
||||
Unit = {
|
||||
Description = "Automatically clean newsboat cache";
|
||||
Documentation = [ "man:newsboat(1)" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
Slice = "app-newsboat.slice";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
ExecStart = "${lib.getExe pkgs.flock} %t/newsboat.lock ${lib.getExe package} --vacuum";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.newsboat-vacuum = {
|
||||
Unit = {
|
||||
Description = "Automatically clean newsboat cache";
|
||||
Documentation = [ "man:newsboat(1)" ];
|
||||
};
|
||||
|
||||
Timer = {
|
||||
Unit = "newsboat-vacuum.service";
|
||||
OnCalendar = lib.mkDefault "weekly";
|
||||
Persistent = true;
|
||||
};
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "timers.target" ];
|
||||
};
|
||||
};
|
||||
# systemd.user.slices.app-newsboat = {
|
||||
# Unit = {
|
||||
# Description = "Newsboat automation";
|
||||
# Documentation = [ "man:newsboat(1)" ];
|
||||
# };
|
||||
# };
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./fetch-nix-index-database.nix ];
|
||||
|
||||
programs.nix-index = {
|
||||
enable = true;
|
||||
enableDatabaseFetcher = true;
|
||||
autoUpdateDatabase.enable = true;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
sops = {
|
||||
secrets = {
|
||||
"nix/access-tokens/github" = { sopsFile = ../../secrets/common.yaml; };
|
||||
"nix/access-tokens/pvv-git" = { sopsFile = ../../secrets/common.yaml; };
|
||||
};
|
||||
templates."nix-access-tokens.conf".content = let
|
||||
inherit (config.sops) placeholder;
|
||||
in ''
|
||||
access-tokens = github.com=${placeholder."nix/access-tokens/github"} git.pvv.ntnu.no=${placeholder."nix/access-tokens/pvv-git"}
|
||||
'';
|
||||
};
|
||||
|
||||
nix = {
|
||||
settings.use-xdg-base-directories = true;
|
||||
extraOptions = ''
|
||||
!include ${config.sops.templates."nix-access-tokens.conf".path}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.prism-launcher = {
|
||||
enable = true;
|
||||
|
||||
package = pkgs.prismlauncher.override {
|
||||
jdk17 = pkgs.jdk21;
|
||||
};
|
||||
|
||||
screenshotMover.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{ config, pkgs, extendedLib, ... }:
|
||||
{
|
||||
# Python for interactive use
|
||||
home.packages = [
|
||||
(pkgs.python3.withPackages (pypkgs: with pypkgs; [
|
||||
requests
|
||||
]))
|
||||
];
|
||||
|
||||
xdg.configFile."python/pyrc".text = ''
|
||||
#!/usr/bin/env python3
|
||||
import sys
|
||||
|
||||
# You also need \x01 and \x02 to separate escape sequence, due to:
|
||||
# https://stackoverflow.com/a/9468954/1147688
|
||||
sys.ps1='\x01\x1b${extendedLib.termColors.front.blue "[Python]> "}\x02>>>\x01\x1b[0m\x02 ' # bright yellow
|
||||
sys.ps2='\x01\x1b[1;49;31m\x02...\x01\x1b[0m\x02 ' # bright red
|
||||
'';
|
||||
|
||||
home.sessionVariables = {
|
||||
PYTHONSTARTUP = "${config.xdg.configHome}/python/pyrc";
|
||||
PYTHON_HISTORY = "${config.xdg.dataHome}/python_history";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
// Based on the glorious dotfiles:
|
||||
// https://github.com/manilarome/the-glorious-dotfiles/blob/master/config/awesome/surreal/configuration/rofi/global/rofi.rasi
|
||||
|
||||
* {
|
||||
transparent: #00000000;
|
||||
foreground: #F2F2F2EE;
|
||||
background-selected: #F2F2F245;
|
||||
background-active: #F2F2F230;
|
||||
background-white: #F2F2F211;
|
||||
background-black: #00000066;
|
||||
urgent: #E91E6366;
|
||||
urgent-selected: #E91E6377;
|
||||
}
|
||||
|
||||
window {
|
||||
transparency: "real";
|
||||
background-color: @transparent;
|
||||
location: center;
|
||||
anchor: center;
|
||||
x-offset: 0px;
|
||||
height: 500px;
|
||||
width: 750px;
|
||||
orientation: vertical;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
prompt {
|
||||
enabled: false;
|
||||
}
|
||||
|
||||
button {
|
||||
action: "ok";
|
||||
str: " ";
|
||||
font: "Droid Sans 12";
|
||||
expand: false;
|
||||
text-color: @foreground;
|
||||
background-color: @transparent;
|
||||
vertical-align: 0.7;
|
||||
horizontal-align: 0.5;
|
||||
}
|
||||
|
||||
entry {
|
||||
font: "Droid Sans 12";
|
||||
background-color: @transparent;
|
||||
text-color: @foreground;
|
||||
expand: true;
|
||||
vertical-align: 0.5;
|
||||
horizontal-align: 0.5;
|
||||
placeholder: "Type to search";
|
||||
placeholder-color: @foreground;
|
||||
blink: true;
|
||||
}
|
||||
|
||||
case-indicator {
|
||||
background-color: @transparent;
|
||||
text-color: @foreground;
|
||||
vertical-align: 0.5;
|
||||
horizontal-align: 0.5;
|
||||
}
|
||||
|
||||
entry-wrapper {
|
||||
orientation: horizontal;
|
||||
vertical-align: 0.5;
|
||||
spacing: 4px;
|
||||
background-color: @transparent;
|
||||
children: [ button, entry, case-indicator ];
|
||||
}
|
||||
|
||||
inputbar {
|
||||
background-color: @background-white;
|
||||
text-color: @foreground;
|
||||
expand: false;
|
||||
border-radius: 24px;
|
||||
margin: 0px 225px 0px 225px;
|
||||
padding: 10px 10px 10px 10px;
|
||||
position: north;
|
||||
children: [ entry-wrapper ];
|
||||
}
|
||||
|
||||
listview {
|
||||
background-color: @transparent;
|
||||
columns: 2;
|
||||
spacing: 5px;
|
||||
cycle: false;
|
||||
dynamic: true;
|
||||
layout: vertical;
|
||||
}
|
||||
|
||||
mainbox {
|
||||
background-color: @background-black;
|
||||
children: [ inputbar, listview ];
|
||||
spacing: 25px;
|
||||
padding: 40px 25px 25px 25px;
|
||||
}
|
||||
|
||||
element {
|
||||
background-color: @transparent;
|
||||
text-color: @foreground;
|
||||
orientation: horizontal;
|
||||
border-radius: 6px;
|
||||
padding: 5px 10px 5px 10px;
|
||||
}
|
||||
|
||||
element-icon {
|
||||
background-color: @transparent;
|
||||
size: 46px;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
element-text {
|
||||
background-color: @transparent;
|
||||
text-color: @foreground;
|
||||
expand: true;
|
||||
horizontal-align: 0;
|
||||
vertical-align: 0.5;
|
||||
margin: 0 10px 0 10px;
|
||||
}
|
||||
|
||||
element normal.urgent,
|
||||
element alternate.urgent {
|
||||
background-color: @urgent;
|
||||
text-color: @foreground;
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
element normal.active,
|
||||
element alternate.active {
|
||||
background-color: @background-active;
|
||||
text-color: @foreground;
|
||||
}
|
||||
|
||||
element selected {
|
||||
background-color: @background-selected;
|
||||
text-color: @foreground;
|
||||
}
|
||||
|
||||
element selected.urgent {
|
||||
background-color: @urgent-selected;
|
||||
text-color: @foreground;
|
||||
}
|
||||
|
||||
element selected.active {
|
||||
background-color: @background-active;
|
||||
color: @foreground-selected;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{pkgs, inputs, ...}:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.rofi = {
|
||||
enable = true;
|
||||
@@ -14,7 +14,7 @@
|
||||
# ];
|
||||
|
||||
font = "Droid Sans 12";
|
||||
theme = "${inputs.dotfiles}/general/.config/rofi/themes/blank.rasi";
|
||||
theme = ./blank.rasi;
|
||||
|
||||
extraConfig = {
|
||||
modi = "window,run,drun,ssh,windowcd";
|
||||
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.skim = {
|
||||
enable = true;
|
||||
defaultCommand = "fd --type f";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
xdg.configFile."sqlite3/sqliterc".text = ''
|
||||
.bail on
|
||||
.changes on
|
||||
.headers on
|
||||
.mode box
|
||||
.nullvalue '<NULL>'
|
||||
.timer on
|
||||
'';
|
||||
|
||||
home.packages = [
|
||||
pkgs.sqlite-interactive
|
||||
];
|
||||
|
||||
home.sessionVariables.SQLITE_HISTORY= "${config.xdg.dataHome}/sqlite_history";
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
{ config, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
runtimeDir = "/run/user/${toString config.home.uid}";
|
||||
controlMastersDir = "${runtimeDir}/ssh";
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./home.nix
|
||||
@@ -14,7 +18,22 @@
|
||||
enable = true;
|
||||
includes = [
|
||||
config.sops.secrets."ssh/secret-config".path
|
||||
"mutable_config"
|
||||
"${config.home.homeDirectory}/.ssh/mutable_config"
|
||||
];
|
||||
|
||||
controlMaster = "auto";
|
||||
controlPersist = "10m";
|
||||
controlPath = "${controlMastersDir}/%n%C";
|
||||
};
|
||||
|
||||
systemd.user.tmpfiles.settings."10-ssh" = {
|
||||
${controlMastersDir}.d = {
|
||||
user = config.home.username;
|
||||
mode = "0700";
|
||||
};
|
||||
"${config.home.homeDirectory}/.ssh/mutable_config".f = {
|
||||
user = config.home.username;
|
||||
mode = "0600";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"github" = {
|
||||
user = "git";
|
||||
hostname = "github.com";
|
||||
identityFile = [ "~/.ssh/id_ed25519" ];
|
||||
identityFile = [ "~/.ssh/id_rsa" ];
|
||||
};
|
||||
"github-nordicsemi" = {
|
||||
user = "git";
|
||||
@@ -31,5 +31,15 @@
|
||||
hostname = "wiki.wackattack.eu";
|
||||
port = 1337;
|
||||
};
|
||||
"garp" = {
|
||||
user = "h7x4";
|
||||
hostname = "garp.pbsds.net";
|
||||
proxyJump = "pvv";
|
||||
};
|
||||
"bolle" = {
|
||||
user = "h7x4";
|
||||
hostname = "bolle.pbsds.net";
|
||||
proxyJump = "pvv";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,11 +23,17 @@ let # http://www.pvv.ntnu.no/pvv/Maskiner
|
||||
"ildkule"
|
||||
"isvegg"
|
||||
"knutsen"
|
||||
[ "microbel" "pvv-users" "pvv-mail" ]
|
||||
"kommode"
|
||||
{
|
||||
names = [ "microbel" "pvv-users" "pvv-mail" ];
|
||||
proxyJump = lib.mkDefault null;
|
||||
addressFamily = "inet";
|
||||
}
|
||||
"orchid"
|
||||
"shark"
|
||||
"tallulah"
|
||||
"tom"
|
||||
"ustetind"
|
||||
"venture"
|
||||
];
|
||||
|
||||
@@ -60,7 +66,7 @@ let # http://www.pvv.ntnu.no/pvv/Maskiner
|
||||
name = builtins.concatStringsSep " " names;
|
||||
value = overrideIfNotExists {
|
||||
hostname = "${builtins.head names}.pvv.ntnu.no";
|
||||
proxyJump = "pvv";
|
||||
proxyJump = "microbel";
|
||||
addressFamily = "inet";
|
||||
} (builtins.removeAttrs orig ["names"]);
|
||||
};
|
||||
@@ -76,7 +82,7 @@ in
|
||||
user = "gitea";
|
||||
addressFamily = "inet";
|
||||
port = 2222;
|
||||
proxyJump = "pvv";
|
||||
proxyJump = "microbel";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
escapeTime = 0;
|
||||
keyMode = "vi";
|
||||
prefix = "C-a";
|
||||
mouse = true;
|
||||
terminal = "screen-256color";
|
||||
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
copycat
|
||||
fingers
|
||||
@@ -19,6 +22,7 @@
|
||||
tmux-fzf
|
||||
urlview
|
||||
];
|
||||
|
||||
extraConfig = let
|
||||
fileContentsWithoutShebang = script: lib.pipe script [
|
||||
lib.fileContents
|
||||
@@ -41,11 +45,8 @@
|
||||
# Don't rename windows automatically after rename with ','
|
||||
set-option -g allow-rename off
|
||||
|
||||
set -g mouse on
|
||||
set -q -g status-utf8 on
|
||||
setw -q -g utf8 on
|
||||
set-option -g default-terminal screen-256color
|
||||
set -g base-index 1 # windows starts at 1
|
||||
setw -g monitor-activity on
|
||||
set -g visual-activity on
|
||||
|
||||
@@ -53,9 +54,6 @@
|
||||
set -g status-left-length 30
|
||||
set -g status-right-length 150
|
||||
|
||||
set -g base-index 1
|
||||
set -g pane-base-index 0
|
||||
|
||||
######################
|
||||
######## KEYS ########
|
||||
######################
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
pkgs.uv
|
||||
];
|
||||
|
||||
# https://docs.astral.sh/uv/configuration/files/
|
||||
# https://docs.astral.sh/uv/reference/settings/
|
||||
xdg.configFile."uv/uv.toml".source = (pkgs.formats.toml { }).generate "uv-config" {
|
||||
python-downloads = "never";
|
||||
python-preference = "only-system";
|
||||
pip.index-url = "https://test.pypi.org/simple";
|
||||
};
|
||||
}
|
||||
@@ -167,6 +167,7 @@ in
|
||||
"telemetry.telemetryLevel" = "off";
|
||||
"terminal.integrated.fontSize" = 14;
|
||||
"vsintellicode.modify.editor.suggestSelection" = "automaticallyOverrodeDefaultValue";
|
||||
"keyboard.dispatch" = "keyCode";
|
||||
"window.zoomLevel" = 1;
|
||||
|
||||
"search.exclude" = {
|
||||
@@ -201,8 +202,6 @@ in
|
||||
"errorLens.errorBackground" = "rgba(240,0,0,0.1)";
|
||||
"errorLens.warningBackground" = "rgba(180,180,0,0.1)";
|
||||
|
||||
"keyboard-quickfix.showActionNotification" = false;
|
||||
|
||||
"liveshare.presence" = true;
|
||||
"liveshare.showInStatusBar" = "whileCollaborating";
|
||||
|
||||
@@ -237,9 +236,15 @@ in
|
||||
|
||||
keybindings = [
|
||||
{
|
||||
key = "ctrl+[Period]";
|
||||
command = "keyboard-quickfix.openQuickFix";
|
||||
when = "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly";
|
||||
key = "alt+k";
|
||||
when = "codeActionMenuVisible";
|
||||
command = "selectPrevCodeAction";
|
||||
}
|
||||
|
||||
{
|
||||
key = "alt+j";
|
||||
when = "codeActionMenuVisible";
|
||||
command = "selectNextCodeAction";
|
||||
}
|
||||
|
||||
{
|
||||
@@ -332,6 +337,7 @@ in
|
||||
ms-vscode.test-adapter-converter
|
||||
visualstudioexptteam.vscodeintellicode
|
||||
tamasfe.even-better-toml
|
||||
maximedenes.vscoq
|
||||
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||
{
|
||||
name = "monokai-st3";
|
||||
|
||||
+151
-17
@@ -1,26 +1,154 @@
|
||||
{ config, pkgs, unstable-pkgs, lib, ... }:
|
||||
{ pkgs, unstable-pkgs, ... }:
|
||||
{
|
||||
home.packages = with unstable-pkgs; [ zed-editor ];
|
||||
programs.zed-editor = {
|
||||
enable = true;
|
||||
|
||||
xdg.configFile."zed/settings.json".source = let
|
||||
format = pkgs.formats.json { };
|
||||
in format.generate "zed-settings.json" {
|
||||
autosave = "off";
|
||||
buffer_font_family = "Fira Code";
|
||||
load_direnv = "shell_hook";
|
||||
format_on_save = "off";
|
||||
package = unstable-pkgs.zed-editor;
|
||||
|
||||
telemetry = {
|
||||
diagnostics = false;
|
||||
metrics = false;
|
||||
userSettings = {
|
||||
load_direnv = "shell_hook";
|
||||
base_keymap = "VSCode";
|
||||
|
||||
autosave = "off";
|
||||
format_on_save = "off";
|
||||
remove_trailing_whitespace_on_save = true;
|
||||
|
||||
tab_size = 2;
|
||||
|
||||
ui_font_family = "Noto Sans";
|
||||
ui_font_size = 18;
|
||||
|
||||
buffer_font_family = "Fira Code";
|
||||
buffer_font_size = 16;
|
||||
|
||||
terminal.font_family = "Fira Code";
|
||||
terminal.font_size = 15;
|
||||
|
||||
file_types = {
|
||||
"Groovy" = [ "Jenkinsfile*" ];
|
||||
"Dockerfile" = [ "Dockerfile*" ];
|
||||
"JSONC" = [ "json5" ];
|
||||
};
|
||||
|
||||
tabs = {
|
||||
file_icons = true;
|
||||
show_close_button = "always";
|
||||
show_diagnostics = "errors";
|
||||
};
|
||||
|
||||
telemetry = {
|
||||
diagnostics = false;
|
||||
metrics = false;
|
||||
};
|
||||
|
||||
diagnostics = {
|
||||
include_warnings = true;
|
||||
inline.enabled = true;
|
||||
update_with_cursor = false;
|
||||
primary_only = false;
|
||||
use_rendered = false;
|
||||
};
|
||||
|
||||
relative_linue_numbers = true;
|
||||
|
||||
vim_mode = true;
|
||||
vim = {
|
||||
toggle_relative_line_numbers = true;
|
||||
};
|
||||
|
||||
theme = {
|
||||
mode = "dark";
|
||||
light = "monokai Classic";
|
||||
dark = "monokai Darker Classic";
|
||||
};
|
||||
|
||||
icon_theme = "Material Icon Theme";
|
||||
|
||||
file_scan_exclusions = [
|
||||
"**/.git"
|
||||
"**/.svn"
|
||||
"**/.hg"
|
||||
"**/.jj"
|
||||
"**/CVS"
|
||||
"**/.DS_Store"
|
||||
"**/Thumbs.db"
|
||||
"**/.classpath"
|
||||
"**/.settings"
|
||||
|
||||
"**/.direnv"
|
||||
];
|
||||
|
||||
git_status = true;
|
||||
git.inline_blame.enabled = false;
|
||||
|
||||
collaboration_panel.button = false;
|
||||
|
||||
preview_tabs.enable = false;
|
||||
|
||||
indent_guides = {
|
||||
enabled = true;
|
||||
coloring = "indent_aware";
|
||||
};
|
||||
|
||||
features.edit_prediction_provider = "copilot";
|
||||
|
||||
languages = {
|
||||
Nix = {
|
||||
tab_size = 2;
|
||||
format_on_save = "off";
|
||||
};
|
||||
};
|
||||
|
||||
lsp = {
|
||||
rust-analyzer.binary.path_lookup = true;
|
||||
nix.binary.path_lookup = true;
|
||||
};
|
||||
};
|
||||
|
||||
vim_mode = true;
|
||||
userKeymaps = [
|
||||
{
|
||||
bindings = {
|
||||
ctrl-b = "workspace::ToggleLeftDock";
|
||||
ctrl-j = "workspace::ToggleBottomDock";
|
||||
ctrl-w = "pane::CloseActiveItem";
|
||||
ctrl-h = "pane::ActivatePreviousItem";
|
||||
ctrl-l = "pane::ActivateNextItem";
|
||||
ctrl-shift-h = "pane::ActivateLastItem";
|
||||
# ctrl-shift-l = "pane::ActivatFirstItem"; # wat?
|
||||
ctrl-shift-o = "workspace::Open";
|
||||
};
|
||||
}
|
||||
];
|
||||
|
||||
theme = {
|
||||
mod = "dark";
|
||||
dark = "monokai Classic";
|
||||
};
|
||||
extensions = [
|
||||
"assembly-syntax"
|
||||
"basher"
|
||||
"dart"
|
||||
"dart"
|
||||
"dockerfile"
|
||||
"env"
|
||||
"git-firefly"
|
||||
"graphql"
|
||||
"groovy"
|
||||
"html"
|
||||
"ini"
|
||||
"just"
|
||||
"latex"
|
||||
"live-server"
|
||||
"log"
|
||||
"make"
|
||||
"material-icon-theme"
|
||||
"mermaid"
|
||||
"neocmake"
|
||||
"nix"
|
||||
"ocaml"
|
||||
"rainbow-csv"
|
||||
"ruff"
|
||||
"sql"
|
||||
"strace"
|
||||
"toml"
|
||||
"typst"
|
||||
];
|
||||
};
|
||||
|
||||
xdg.configFile."zed/themes/monokai.json".source = let
|
||||
@@ -31,4 +159,10 @@
|
||||
hash = "sha256-mlEcgnLStYH1pV3p1iqNSvfVu4MpvpEOc+vxI+90MJs=";
|
||||
};
|
||||
in "${package}/themes/monokai.json";
|
||||
|
||||
programs.zsh.initExtra = ''
|
||||
if [[ "$ZED_TERM" == "true" && -n "$TMUX_PANE" ]]; then
|
||||
unset TMUX_PANE
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{ ... }:
|
||||
{ config, ... }:
|
||||
{
|
||||
programs.zoxide.enable = true;
|
||||
}
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableNushellIntegration = config.programs.nushell.enable;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -128,9 +128,16 @@ in
|
||||
source = "${pkgs.fcitx5-material-color}/share/fcitx5/themes/Material-Color-orange";
|
||||
};
|
||||
|
||||
# TODO: set i18n.inputMethod.fcitx5.waylandFrontend on home-manager 25.05
|
||||
home.sessionVariables = {
|
||||
GTK_IM_MODULE = lib.mkForce "";
|
||||
QT_IM_MODULE = lib.mkForce "";
|
||||
};
|
||||
|
||||
systemd.user.services.fcitx5-daemon = {
|
||||
Service.Restart="on-failure";
|
||||
Service.ExecStart = lib.mkForce "${fcitx5Package}/bin/fcitx5";
|
||||
Service.ExecReload = "/bin/kill -HUP $MAINPID";
|
||||
Install.Alias = "fcitx5.service";
|
||||
};
|
||||
}
|
||||
|
||||
+9
-43
@@ -1,6 +1,7 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.services.mpd;
|
||||
runtimeDir = "/run/user/${toString config.home.uid}/mpd";
|
||||
in
|
||||
{
|
||||
services.mpd = {
|
||||
@@ -9,8 +10,10 @@ in
|
||||
playlistDirectory = "${cfg.musicDirectory}/playlists/MPD";
|
||||
network.startWhenNeeded = true;
|
||||
|
||||
autoUpdateDatabase = true;
|
||||
|
||||
extraConfig = ''
|
||||
pid_file "/run/user/${toString config.home.uid}/mpd/pid"
|
||||
pid_file "${runtimeDir}/pid"
|
||||
|
||||
zeroconf_enabled "no"
|
||||
|
||||
@@ -28,7 +31,7 @@ in
|
||||
audio_output {
|
||||
type "fifo"
|
||||
name "Visualizer feed"
|
||||
path "/run/user/${toString config.home.uid}/mpd/visualizer.fifo"
|
||||
path "${runtimeDir}/visualizer.fifo"
|
||||
format "44100:16:2"
|
||||
}
|
||||
|
||||
@@ -93,49 +96,12 @@ in
|
||||
"AF_UNIX"
|
||||
];
|
||||
RestrictNamespaces = true;
|
||||
RuntimeDirectory = "mpd";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.paths.mpd-update-library = {
|
||||
Unit = {
|
||||
Description = "Watchdog that updates the mpd library whenever the files are modified";
|
||||
Documentation = [
|
||||
"man:mpd(1)"
|
||||
"man:mpd.conf(5)"
|
||||
];
|
||||
WantedBy = [ "paths.target" ];
|
||||
};
|
||||
Path = {
|
||||
PathChanged = cfg.musicDirectory;
|
||||
Unit = "mpd-update-library.service";
|
||||
TriggerLimitIntervalSec = "1s";
|
||||
TriggerLimitBurst = "1";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.mpd-update-library = {
|
||||
Unit = {
|
||||
Description = "Watchdog that updates the mpd library whenever the files are modified";
|
||||
Documentation = [
|
||||
"man:mpd(1)"
|
||||
"man:mpd.conf(5)"
|
||||
];
|
||||
};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${lib.getExe pkgs.mpc-cli} update --wait";
|
||||
|
||||
PrivateUsers = true;
|
||||
ProtectSystem = true;
|
||||
NoNewPrivileges = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectControlGroups = true;
|
||||
RestrictAddressFamilies = [
|
||||
"AF_INET"
|
||||
"AF_UNIX"
|
||||
];
|
||||
RestrictNamespaces = true;
|
||||
};
|
||||
};
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"d ${cfg.dataDir} - ${config.home.username} - - -"
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.mpris-proxy.enable = true;
|
||||
}
|
||||
@@ -25,6 +25,8 @@
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${config.nix.package}/bin/nix-channel --update --verbose";
|
||||
CPUSchedulingPolicy = "idle";
|
||||
IOSchedulingClass = "idle";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
+68
-11
@@ -27,6 +27,14 @@ in {
|
||||
source "${config.sops.secrets."nordicsemi/envvars".path}"
|
||||
'';
|
||||
|
||||
programs.nushell.extraEnv = ''
|
||||
source "${config.sops.secrets."nordicsemi/envvars".path}"
|
||||
'';
|
||||
|
||||
systemd.user.tmpfiles.rules = [
|
||||
"f ${config.xdg.configHome}/mutable_env.sh 0700 ${config.home.username} - - -"
|
||||
];
|
||||
|
||||
local.shell.aliases = {
|
||||
|
||||
# ░█▀▄░█▀▀░█▀█░█░░░█▀█░█▀▀░█▀▀░█▄█░█▀▀░█▀█░▀█▀░█▀▀
|
||||
@@ -38,35 +46,59 @@ in {
|
||||
"System Tool Replacements" = {
|
||||
|
||||
# Convention: if replaced tool is useful in some situations, let it be available
|
||||
# as its own command with its first character doubled.
|
||||
# as its own command with an underscore appended
|
||||
#
|
||||
# Example: cp -> ccp
|
||||
# Example: cp -> cp_
|
||||
|
||||
cd_ = "builtin cd";
|
||||
cd = lib.mkIf config.programs.zoxide.enable "z";
|
||||
|
||||
ccp = "${pkgs.coreutils}/bin/cp";
|
||||
cp = "${p "rsync"} --progress --human-readable";
|
||||
cpr = "${p "rsync"} --progress --human-readable --recursive";
|
||||
cp_ = "${pkgs.coreutils}/bin/cp";
|
||||
cp = p "xcp";
|
||||
|
||||
ccat = "${pkgs.coreutils}/bin/cat";
|
||||
cloc_ = p "cloc";
|
||||
cloc = p "tokei";
|
||||
|
||||
df_ = "${pkgs.coreutils}/bin/df";
|
||||
df = p "duf";
|
||||
|
||||
scp_ = "/run/current-system/sw/bin/scp";
|
||||
scp = "${p "rsync"} --progress --human-readable --recursive";
|
||||
|
||||
cat_ = "${pkgs.coreutils}/bin/cat";
|
||||
cat = p "bat";
|
||||
|
||||
htop = "${pkgs.bottom}/bin/btm";
|
||||
hhtop = p "htop";
|
||||
htop_ = p "htop";
|
||||
htop = p "bottom";
|
||||
|
||||
dig_ = p "dig";
|
||||
dig = p "dogdns";
|
||||
|
||||
man_ = p "man";
|
||||
man = "${pkgs.bat-extras.batman}/bin/batman";
|
||||
|
||||
strace_ = p "strace";
|
||||
strace = p "intentrace";
|
||||
|
||||
lsusb_ = p "usbutils";
|
||||
lsusb = p "cyme";
|
||||
|
||||
# Flags are incompatible, so they are suffixed by -x
|
||||
psx = p "procs";
|
||||
findx = p "fd";
|
||||
|
||||
ag = "${pkgs.ripgrep}/bin/rg";
|
||||
grep_ = p "gnugrep";
|
||||
grep = p "ripgrep";
|
||||
|
||||
lls = "${pkgs.coreutils}/bin/ls --color=always";
|
||||
ag = p "ripgrep";
|
||||
sxiv = p "nsxiv";
|
||||
|
||||
ls_ = "${pkgs.coreutils}/bin/ls --color=always";
|
||||
ls = p "eza";
|
||||
la = "${p "eza"} -lah --changed --time-style long-iso --git --group";
|
||||
lsa = "la";
|
||||
|
||||
killall_ = p "killall";
|
||||
killall = {
|
||||
type = ";";
|
||||
alias = [
|
||||
@@ -74,6 +106,9 @@ in {
|
||||
"pkill -x"
|
||||
];
|
||||
};
|
||||
|
||||
watch_ = "${pkgs.procps}/bin/watch";
|
||||
watch = p "viddy";
|
||||
};
|
||||
|
||||
# ░█▀▀░█▀█░█░░░█▀█░█▀▄░▀█▀░▀▀█░█▀▀░█▀▄
|
||||
@@ -266,9 +301,15 @@ in {
|
||||
];
|
||||
};
|
||||
|
||||
cdtmp = "cd \"$(mktemp -d)\"";
|
||||
|
||||
open = "${pkgs.xdg-utils}/bin/xdg-open";
|
||||
|
||||
e = "$EDITOR";
|
||||
m = p "ncmpcpp";
|
||||
g = "${pkgs.gitoxide}/bin/gix";
|
||||
p = "${pkgs.python3Packages.ipython}/bin/ipython";
|
||||
s = p "sxiv";
|
||||
s = p "nsxiv";
|
||||
v = p "mpv";
|
||||
zt = p "zathura";
|
||||
};
|
||||
@@ -300,6 +341,17 @@ in {
|
||||
];
|
||||
};
|
||||
|
||||
list-applications = {
|
||||
type = ";";
|
||||
alias = map (x: "${p "eza"} -lah ${x}") [
|
||||
"/run/current-system/sw/share/applications"
|
||||
"~/.local/share/applications"
|
||||
"~/.local/state/nix/profiles/home-manager/home-path/share/applications"
|
||||
];
|
||||
};
|
||||
|
||||
cdr = "$(git rev-parse --show-toplevel)";
|
||||
|
||||
view-latex = "${pkgs.texlive.combined.scheme-full}/bin/latexmk -pdf -pvc main.tex";
|
||||
|
||||
reload-tmux = "${p "tmux"} source $HOME/.config/tmux/tmux.conf";
|
||||
@@ -353,6 +405,11 @@ in {
|
||||
# "--pdf-engine=xelatex"
|
||||
# "-o \"$2\""
|
||||
# ];
|
||||
|
||||
# rwhich = functors.shellJoin.wrap [
|
||||
# "which \"$@\""
|
||||
# "xargs realpath --"
|
||||
# ];
|
||||
# };
|
||||
# };
|
||||
|
||||
|
||||
+86
-33
@@ -13,12 +13,15 @@ in {
|
||||
./programs/usbtop.nix
|
||||
./programs/wireshark.nix
|
||||
|
||||
./services/blueman.nix
|
||||
./services/dbus.nix
|
||||
./services/fwupd.nix
|
||||
./services/irqbalance.nix
|
||||
./services/journald.nix
|
||||
./services/libinput.nix
|
||||
./services/locate.nix
|
||||
./services/logind.nix
|
||||
./services/nixseparatedebuginfod.nix
|
||||
./services/openssh.nix
|
||||
./services/pcscd.nix
|
||||
./services/pipewire.nix
|
||||
@@ -26,8 +29,10 @@ in {
|
||||
./services/resolved.nix
|
||||
./services/smartd.nix
|
||||
./services/systemd-lock-handler.nix
|
||||
./services/udisks2.nix
|
||||
./services/uptimed.nix
|
||||
./services/userborn.nix
|
||||
./services/userdbd.nix
|
||||
./services/xserver.nix
|
||||
];
|
||||
|
||||
@@ -48,6 +53,10 @@ in {
|
||||
"1.1.1.1"
|
||||
"8.8.8.8"
|
||||
];
|
||||
hosts = {
|
||||
"127.0.0.1" = [ config.networking.fqdnOrHostName ];
|
||||
"::1" = [ config.networking.fqdnOrHostName ];
|
||||
};
|
||||
};
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
@@ -102,6 +111,7 @@ in {
|
||||
users.h7x4 = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.zsh;
|
||||
uid = 1000;
|
||||
|
||||
extraGroups = [
|
||||
"audio"
|
||||
@@ -141,7 +151,10 @@ in {
|
||||
git.enable = true;
|
||||
tmux.enable = true;
|
||||
zsh.enable = true;
|
||||
hyprland.enable = config.machineVars.wayland;
|
||||
hyprland = lib.mkIf config.machineVars.wayland {
|
||||
enable = true;
|
||||
withUWSM = true;
|
||||
};
|
||||
};
|
||||
|
||||
security.pam.services = lib.mkIf (config.machineVars.wayland) {
|
||||
@@ -190,8 +203,20 @@ in {
|
||||
# Realtime scheduling for pipewire and mpd
|
||||
security.rtkit.enable = !config.machineVars.headless;
|
||||
|
||||
security.tpm2.enable = lib.mkDefault true;
|
||||
security.tpm2.abrmd.enable = lib.mkDefault config.security.tpm2.enable;
|
||||
systemd.tpm2.enable = true;
|
||||
security.tpm2 = {
|
||||
enable = lib.mkDefault true;
|
||||
abrmd.enable = lib.mkDefault config.security.tpm2.enable;
|
||||
pkcs11.enable = lib.mkDefault config.security.tpm2.enable;
|
||||
tctiEnvironment = {
|
||||
enable = lib.mkDefault config.security.tpm2.enable;
|
||||
interface = "tabrmd";
|
||||
};
|
||||
};
|
||||
|
||||
# security.lockKernelModules = true;
|
||||
security.protectKernelImage = true;
|
||||
|
||||
security.sudo.extraConfig = let
|
||||
sudoLecture = pkgs.writeText "sudo-lecture.txt" (extendedLib.termColors.front.red "Be careful or something, idk...\n");
|
||||
in ''
|
||||
@@ -199,36 +224,64 @@ in {
|
||||
Defaults lecture_file = ${sudoLecture}
|
||||
'';
|
||||
|
||||
boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
|
||||
systemd = {
|
||||
sysupdate.enable = true;
|
||||
repart.enable = true;
|
||||
};
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/profiles/hardened.nix
|
||||
boot.blacklistedKernelModules = [
|
||||
# Obscure network protocols
|
||||
"ax25"
|
||||
"netrom"
|
||||
"rose"
|
||||
boot = {
|
||||
kernelPackages = lib.mkDefault pkgs.linuxPackages_latest;
|
||||
loader.systemd-boot.memtest86.enable = true;
|
||||
|
||||
# Old or rare or insufficiently audited filesystems
|
||||
"adfs"
|
||||
"affs"
|
||||
"bfs"
|
||||
"befs"
|
||||
"cramfs"
|
||||
"efs"
|
||||
# "erofs" // used by systemd
|
||||
"exofs"
|
||||
"freevxfs"
|
||||
"f2fs"
|
||||
"hfs"
|
||||
"hpfs"
|
||||
"jfs"
|
||||
"minix"
|
||||
"nilfs2"
|
||||
"ntfs"
|
||||
"omfs"
|
||||
"qnx4"
|
||||
"qnx6"
|
||||
"sysv"
|
||||
"ufs"
|
||||
];
|
||||
tmp.useTmpfs = lib.mkDefault true;
|
||||
|
||||
kernel.sysctl."kernel.sysrq" = 1;
|
||||
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixos-24.05/nixos/modules/profiles/hardened.nix
|
||||
blacklistedKernelModules = [
|
||||
# Obscure network protocols
|
||||
"ax25"
|
||||
"netrom"
|
||||
"rose"
|
||||
|
||||
# Old or rare or insufficiently audited filesystems
|
||||
"adfs"
|
||||
"affs"
|
||||
"bfs"
|
||||
"befs"
|
||||
"cramfs"
|
||||
"efs"
|
||||
# "erofs" // used by systemd
|
||||
"exofs"
|
||||
"freevxfs"
|
||||
"f2fs"
|
||||
"hfs"
|
||||
"hpfs"
|
||||
"jfs"
|
||||
"minix"
|
||||
"nilfs2"
|
||||
"ntfs"
|
||||
"omfs"
|
||||
"qnx4"
|
||||
"qnx6"
|
||||
"sysv"
|
||||
"ufs"
|
||||
];
|
||||
};
|
||||
|
||||
hardware.bluetooth = {
|
||||
powerOnBoot = true;
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.docker.enableOnBoot = lib.mkDefault false;
|
||||
virtualisation.docker.autoPrune = {
|
||||
enable = lib.mkDefault true;
|
||||
flags = [ "--system" "--all" ];
|
||||
dates = "daily";
|
||||
};
|
||||
}
|
||||
|
||||
+19
-6
@@ -6,30 +6,43 @@
|
||||
./nix-builders/tsuki.nix
|
||||
];
|
||||
|
||||
sops.secrets = {
|
||||
"nix/access-tokens" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
sops = {
|
||||
secrets = {
|
||||
"nix/access-tokens/github" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
"nix/access-tokens/pvv-git" = { sopsFile = ./../../secrets/common.yaml; };
|
||||
};
|
||||
templates."nix-access-tokens.conf".content = let
|
||||
inherit (config.sops) placeholder;
|
||||
in ''
|
||||
access-tokens = github.com=${placeholder."nix/access-tokens/github"} git.pvv.ntnu.no=${placeholder."nix/access-tokens/pvv-git"}
|
||||
'';
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = unstable-pkgs.nixVersions.stable;
|
||||
package = unstable-pkgs.nixVersions.latest;
|
||||
distributedBuilds = config.networking.hostName != "tsuki";
|
||||
|
||||
daemonCPUSchedPolicy = "batch";
|
||||
|
||||
settings = {
|
||||
allow-dirty = true;
|
||||
allowed-uris = [ "http://" "https://" ];
|
||||
auto-optimise-store = true;
|
||||
binary-caches = [ "https://cache.nixos.org/" ];
|
||||
builders-use-substitutes = true;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
log-lines = 50;
|
||||
trusted-users = [ "h7x4" "nix-builder" ];
|
||||
trusted-users = [ "h7x4" ];
|
||||
allowed-users = [ "@users" ];
|
||||
use-xdg-base-directories = true;
|
||||
};
|
||||
|
||||
extraOptions = ''
|
||||
!include ${config.sops.secrets."nix/access-tokens".path}
|
||||
!include ${config.sops.templates."nix-access-tokens.conf".path}
|
||||
'';
|
||||
|
||||
optimise.automatic = true;
|
||||
gc.automatic = true;
|
||||
|
||||
registry = {
|
||||
home.to = {
|
||||
type = "path";
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
services.blueman.enable = config.hardware.bluetooth.enable;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
{
|
||||
services.dbus = {
|
||||
enable = true;
|
||||
implementation = "broker";
|
||||
packages = with pkgs; [
|
||||
gcr
|
||||
dconf
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.locate = {
|
||||
enable = true;
|
||||
package = pkgs.plocate;
|
||||
localuser = null;
|
||||
pruneNames = [
|
||||
".bzr"
|
||||
".cache"
|
||||
".git"
|
||||
".hg"
|
||||
".svn"
|
||||
|
||||
".direnv"
|
||||
"target"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{ config, ... }: {
|
||||
services.nixseparatedebuginfod = {
|
||||
enable = true;
|
||||
nixPackage = config.nix.package;
|
||||
};
|
||||
}
|
||||
@@ -1,12 +1,32 @@
|
||||
{ ... }:
|
||||
{ lib, ... }:
|
||||
{
|
||||
services.openssh = {
|
||||
enable = lib.mkDefault true;
|
||||
startWhenNeeded = true;
|
||||
settings = {
|
||||
StreamLocalBindUnlink = true;
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
PermitRootLogin = "no";
|
||||
PermitEmptyPasswords = false;
|
||||
ChallengeResponseAuthentication = false;
|
||||
GSSAPIAuthentication = false;
|
||||
HostbasedAuthentication = false;
|
||||
IgnoreRhosts = true;
|
||||
KerberosAuthentication = false;
|
||||
RhostsRSAAuthentication = false;
|
||||
Protocol = "2";
|
||||
Macs = [
|
||||
"hmac-sha2-512-etm@openssh.com"
|
||||
"hmac-sha2-256-etm@openssh.com"
|
||||
"umac-128-etm@openssh.com"
|
||||
"hmac-sha2-512"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# systemd.services."sshd@".serviceConfig = {
|
||||
# Nice = -15;
|
||||
# IOSchedulingClass = "realtime";
|
||||
# };
|
||||
}
|
||||
|
||||
@@ -5,5 +5,24 @@
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
|
||||
wireplumber = {
|
||||
enable = true;
|
||||
|
||||
extraConfig."10-bluez" = {
|
||||
"monitor.bluez.properties" = {
|
||||
"bluez5.enable-sbc-xq" = true;
|
||||
"bluez5.enable-msbc" = true;
|
||||
"bluez5.enable-hw-volume" = true;
|
||||
"bluez5.codecs" = [
|
||||
"ldac"
|
||||
"aac"
|
||||
"sbc_xq"
|
||||
"aptx"
|
||||
"sbc"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.udisks2.enable = true;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.userdbd.enable = true;
|
||||
}
|
||||
@@ -8,7 +8,10 @@
|
||||
wayland.enable = config.machineVars.wayland;
|
||||
package = pkgs.kdePackages.sddm;
|
||||
theme = "sddm-astronaut-theme";
|
||||
# extraPackages = [ pkgs.sddm-astronaut ];
|
||||
extraPackages = [
|
||||
pkgs.kdePackages.qt5compat
|
||||
# pkgs.sddm-astronaut
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -41,4 +44,7 @@
|
||||
extraPackages = hPkgs: with hPkgs; [ dbus ];
|
||||
};
|
||||
};
|
||||
|
||||
services.graphical-desktop.enable = !config.machineVars.headless;
|
||||
services.speechd.enable = false;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
boot.binfmt.emulatedSystems = [
|
||||
"aarch64-linux"
|
||||
"armv7l-linux"
|
||||
@@ -34,6 +36,8 @@
|
||||
development = true;
|
||||
creative = true;
|
||||
|
||||
wayland = true;
|
||||
|
||||
dataDrives = let
|
||||
main = "/data";
|
||||
in {
|
||||
@@ -60,9 +64,18 @@
|
||||
hybrid-sleep.enable = false;
|
||||
};
|
||||
|
||||
systemd.network = {
|
||||
enable = true;
|
||||
networks."40-enp0s31f6" = {
|
||||
name = "enp0s31f6";
|
||||
DHCP = true;
|
||||
domains = [ "nordicsemi.no" ];
|
||||
};
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "dosei";
|
||||
networkmanager.enable = true;
|
||||
useNetworkd = true;
|
||||
# TODO: reenable
|
||||
firewall.enable = false;
|
||||
# hostId = "";
|
||||
|
||||
@@ -9,32 +9,36 @@
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" "cryptd" ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
boot.supportedFilesystems = [ "bcachefs" ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/e7f7bd86-0634-48f2-ab7c-f19b72ee47ab";
|
||||
fsType = "ext4";
|
||||
{ device = "UUID=ef98dc67-17bf-4005-8209-b5d3c352d6c6";
|
||||
fsType = "bcachefs";
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."crypted".device = "/dev/disk/by-uuid/1b6e3d9b-4408-45ac-9b98-dce4b505c311";
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/ABFF-19E8";
|
||||
{ device = "/dev/disk/by-uuid/C930-D394";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/28225b33-ef40-4ff3-8d1b-7163d8cc3faa"; }
|
||||
[ { device = "/dev/disk/by-uuid/4fcc8f63-f5e0-42e3-a9d3-a96e4a26d5e8"; }
|
||||
];
|
||||
|
||||
# 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.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||
# networking.useDHCP = lib.mkDefault true;
|
||||
networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.enableAllFirmware = true;
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
{ config, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
home.stateVersion = "24.05";
|
||||
|
||||
home.packages = with pkgs; [
|
||||
groovy
|
||||
];
|
||||
|
||||
programs.ssh.matchBlocks = {
|
||||
"tsuki-ws" = {
|
||||
user = "h7x4";
|
||||
@@ -11,11 +15,8 @@
|
||||
|
||||
"hildring pvv-login".proxyJump = "tsuki-ws";
|
||||
"drolsum pvv-login2 pvv".proxyJump = "tsuki-ws";
|
||||
"microbel pvv-users pvv-mail".proxyJump = "tsuki-ws";
|
||||
};
|
||||
|
||||
sops.secrets."git/nordicsemi-maintenance-repos-config" = { };
|
||||
|
||||
programs.git.includes = [
|
||||
{ path = config.sops.secrets."git/nordicsemi-maintenance-repos-config".path; }
|
||||
];
|
||||
}
|
||||
programs.waybar.settings.mainBar.output = [ "DP-1" ];
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
# TODO: Reproducible certificates
|
||||
services.journald.remote = {
|
||||
enable = true;
|
||||
settings.Remote = {
|
||||
# ServerKeyFile = "/run/credentials/systemd-journald-remote.service/key.pem";
|
||||
# ServerCertificateFile = "/run/credentials/systemd-journald-remote.service/.pem";
|
||||
ServerKeyFile = "/etc/journald-remote-certs/key.pem";
|
||||
ServerCertificateFile = "/etc/journald-remote-certs/cert.pem";
|
||||
TrustedCertificateFile = "-";
|
||||
};
|
||||
};
|
||||
|
||||
# systemd.services.systemd-journal-remote.serviceConfig.LoadCredential = [
|
||||
# "key.pem:/etc/journald-remote-certs/key.pem"
|
||||
# "cert.pem:/etc/journald-remote-certs/cert.pem"
|
||||
# ];
|
||||
}
|
||||
@@ -1,96 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
|
||||
./services/avahi.nix
|
||||
./services/docker.nix
|
||||
./services/journald-remote.nix
|
||||
];
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
boot.binfmt.emulatedSystems = [
|
||||
"aarch64-linux"
|
||||
"armv7l-linux"
|
||||
];
|
||||
|
||||
i18n.defaultLocale = "en_US.UTF-8";
|
||||
|
||||
services.udev.packages = with pkgs; [
|
||||
segger-jlink
|
||||
];
|
||||
|
||||
system.stateVersion = "24.05";
|
||||
|
||||
machineVars = {
|
||||
headless = true;
|
||||
gaming = false;
|
||||
development = true;
|
||||
creative = false;
|
||||
|
||||
dataDrives = let
|
||||
main = "/data";
|
||||
in {
|
||||
drives = { inherit main; };
|
||||
default = main;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.targets = {
|
||||
sleep.enable = false;
|
||||
suspend.enable = false;
|
||||
hibernate.enable = false;
|
||||
hybrid-sleep.enable = false;
|
||||
};
|
||||
|
||||
# security.pam.services.login.unixAuth = true;
|
||||
|
||||
# systemd.network = {
|
||||
# enable = true;
|
||||
# # broken
|
||||
# wait-online.enable = true;
|
||||
# };
|
||||
|
||||
networking = {
|
||||
hostName = "europa";
|
||||
networkmanager.enable = true;
|
||||
# TODO: reenable
|
||||
firewall.enable = false;
|
||||
# hostId = "007f0201";
|
||||
};
|
||||
|
||||
services = {
|
||||
openssh = {
|
||||
enable = true;
|
||||
settings.X11Forwarding = true;
|
||||
settings.PasswordAuthentication = lib.mkForce true;
|
||||
};
|
||||
# xserver = {
|
||||
# # displayManager.gdm.enable = true;
|
||||
# # desktopManager.gnome.enable = true;
|
||||
# # videoDrivers = [ "nvidia" ];
|
||||
# };
|
||||
# tailscale.enable = true;
|
||||
};
|
||||
|
||||
hardware = {
|
||||
bluetooth.enable = true;
|
||||
# cpu.amd.updateMicrocode = true;
|
||||
enableRedistributableFirmware = true;
|
||||
keyboard.zsa.enable = true;
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
};
|
||||
|
||||
# nvidia = {
|
||||
# modesetting.enable = true;
|
||||
# nvidiaSettings = true;
|
||||
# };
|
||||
};
|
||||
|
||||
programs.usbtop.enable = true;
|
||||
}
|
||||
@@ -1,40 +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" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/2de4150d-e418-4f22-a516-3f35352eb66a";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/12CE-A600";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/8c8bc640-83f4-4eee-909b-457989cebfe4"; }
|
||||
];
|
||||
|
||||
# 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.eno1.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
home.stateVersion = "24.05";
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
services.avahi = {
|
||||
enable = true;
|
||||
publish.enable = true;
|
||||
publish.addresses = true;
|
||||
publish.domain = true;
|
||||
publish.hinfo = true;
|
||||
publish.userServices = true;
|
||||
publish.workstation = true;
|
||||
extraServiceFiles.ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
|
||||
};
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
virtualisation.docker.enable = true;
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
services.journald.upload = {
|
||||
enable = true;
|
||||
settings.Upload = {
|
||||
URL = "https://10.250.14.105:19532";
|
||||
# ServerKeyFile = toString ./key.pem;
|
||||
# ServerCertificateFile = toString ./cert.pem;
|
||||
ServerKeyFile = "-";
|
||||
ServerCertificateFile = "-";
|
||||
TrustedCertificateFile = "-";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{ ... }:
|
||||
{
|
||||
systemd.mounts = let
|
||||
mkBindmount = name: src: dst: {
|
||||
description = "Bindmount for ${name}";
|
||||
what = src;
|
||||
where = dst;
|
||||
type = "none";
|
||||
options = "bind";
|
||||
before = [ "local-fs.target" ];
|
||||
wantedBy = [ "local-fs.target" ];
|
||||
};
|
||||
in [
|
||||
(mkBindmount ".local" "/data/local" "/home/h7x4/.local")
|
||||
(mkBindmount "Downloads" "/data/Downloads" "/home/h7x4/Downloads")
|
||||
(mkBindmount "Dropbox" "/data/Dropbox" "/home/h7x4/Dropbox")
|
||||
(mkBindmount "MEGA" "/data/MEGA" "/home/h7x4/MEGA")
|
||||
(mkBindmount "NTNU" "/data/pCloud/NTNU" "/home/h7x4/NTNU")
|
||||
(mkBindmount "ctf" "/data/ctf" "/home/h7x4/ctf")
|
||||
(mkBindmount "documents" "/data/pCloud/documents" "/home/h7x4/documents")
|
||||
(mkBindmount "downloads" "/data/Downloads" "/home/h7x4/downloads")
|
||||
(mkBindmount "git" "/data/git" "/home/h7x4/git")
|
||||
(mkBindmount "music" "/data/pCloud/music" "/home/h7x4/music")
|
||||
(mkBindmount "nixpkgs" "/data/nixpkgs" "/home/h7x4/nixpkgs")
|
||||
(mkBindmount "pictures" "/data/pCloud/pictures" "/home/h7x4/pictures")
|
||||
(mkBindmount "pvv" "/data/pvv" "/home/h7x4/pvv")
|
||||
(mkBindmount "Zotero" "/data/Zotero" "/home/h7x4/Zotero")
|
||||
];
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
{ config, lib, pkgs, inputs, specialArgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./programs/steam.nix
|
||||
|
||||
./services/avahi.nix
|
||||
./services/btrfs.nix
|
||||
./services/docker.nix
|
||||
@@ -11,12 +13,13 @@
|
||||
./services/tailscale.nix
|
||||
./services/keybase.nix
|
||||
|
||||
./bindmounts.nix
|
||||
./nspawn-containers/arch.nix
|
||||
|
||||
./testconfig.nix
|
||||
];
|
||||
|
||||
system.stateVersion = "22.05";
|
||||
system.stateVersion = "25.05";
|
||||
|
||||
boot.binfmt.emulatedSystems = [
|
||||
"x86_64-windows"
|
||||
@@ -32,6 +35,8 @@
|
||||
"nixos-test"
|
||||
];
|
||||
|
||||
environment.enableDebugInfo = true;
|
||||
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ALL = "en_US.UTF-8";
|
||||
};
|
||||
@@ -69,9 +74,26 @@
|
||||
|
||||
# security.pam.services.login.unixAuth = true;
|
||||
|
||||
systemd.network = {
|
||||
enable = true;
|
||||
networks."40-enp6s0" = {
|
||||
gateway = [ "192.168.50.1" ];
|
||||
address = [ "192.168.50.200/24" ];
|
||||
dns = [
|
||||
"1.1.1.1"
|
||||
"8.8.8.8"
|
||||
];
|
||||
networkConfig.IPv6AcceptRA = "no";
|
||||
DHCP = "yes";
|
||||
};
|
||||
wait-online.ignoredInterfaces = [
|
||||
"tailscale0"
|
||||
];
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "kasei";
|
||||
networkmanager.enable = true;
|
||||
useNetworkd = true;
|
||||
interfaces.enp6s0.useDHCP = true;
|
||||
firewall.enable = false;
|
||||
hostId = "f0660cef";
|
||||
@@ -79,28 +101,12 @@
|
||||
|
||||
services = {
|
||||
openssh.enable = true;
|
||||
xserver.videoDrivers = [ "amdgpu" ];
|
||||
xserver.videoDrivers = [ "nvidia" ];
|
||||
tailscale.enable = true;
|
||||
avahi = {
|
||||
enable = true;
|
||||
publish.enable = true;
|
||||
publish.addresses = true;
|
||||
publish.domain = true;
|
||||
publish.hinfo = true;
|
||||
publish.userServices = true;
|
||||
publish.workstation = true;
|
||||
extraServiceFiles.ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service";
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ];
|
||||
initrd.kernelModules = [ "amdgpu" ];
|
||||
|
||||
# kernelPackages = pkgs.linuxKernel.packages.linux_zen.zfs;
|
||||
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
|
||||
kernelModules = [ "kvm-amd" ];
|
||||
supportedFilesystems = [ "zfs" ];
|
||||
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = false;
|
||||
@@ -144,10 +150,12 @@
|
||||
enableRedistributableFirmware = true;
|
||||
keyboard.zsa.enable = true;
|
||||
sane.enable = true;
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
|
||||
nvidia = {
|
||||
modesetting.enable = true;
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||
gamescopeSession.enable = true;
|
||||
};
|
||||
|
||||
programs.gamescope = {
|
||||
enable = true;
|
||||
capSysNice = true;
|
||||
};
|
||||
|
||||
programs.appimage.enable = true;
|
||||
programs.appimage.binfmt = true;
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
{ ... }:
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
enableTCPIP = true;
|
||||
package = pkgs.postgresql_17;
|
||||
authentication = ''
|
||||
# tailscale xps
|
||||
host all all 100.94.170.21/32 md5
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ config, lib, modulesPath, ... }:
|
||||
{ config, pkgs, lib, modulesPath, ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
@@ -57,13 +57,6 @@
|
||||
firewall.enable=true;
|
||||
};
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
systemd.services."sshd@".serviceConfig = {
|
||||
Nice = -15;
|
||||
IOSchedulingClass = "realtime";
|
||||
};
|
||||
|
||||
users = {
|
||||
users = {
|
||||
media = {
|
||||
@@ -92,7 +85,9 @@
|
||||
services.zfs.autoScrub.enable = true;
|
||||
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackages_6_13;
|
||||
zfs.requestEncryptionCredentials = false;
|
||||
zfs.package = pkgs.zfs_2_3;
|
||||
loader = {
|
||||
grub = {
|
||||
enable = true;
|
||||
|
||||
@@ -17,6 +17,7 @@ in {
|
||||
};
|
||||
|
||||
services.kanidm = {
|
||||
package = pkgs.kanidm_1_5;
|
||||
enableServer = true;
|
||||
# enablePAM = true;
|
||||
serverSettings = let
|
||||
@@ -37,7 +38,7 @@ in {
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = [ pkgs.kanidm ];
|
||||
systemPackages = [ cfg.package ];
|
||||
etc."kanidm/config".text = ''
|
||||
uri="https://auth.nani.wtf"
|
||||
'';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user