Compare commits
374 commits
main
...
d918bf279d
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | d918bf279d | ||
Bruno BELANYI | 6f3bee895c | ||
Bruno BELANYI | 069987f47e | ||
Bruno BELANYI | 971b6e9b65 | ||
Bruno BELANYI | 8c103a2261 | ||
Bruno BELANYI | 76f33fbd57 | ||
Bruno BELANYI | 7d787a2770 | ||
Bruno BELANYI | 323e99bbb0 | ||
Bruno BELANYI | 8569a8eb55 | ||
Bruno BELANYI | 6d393fdef2 | ||
Bruno BELANYI | a85922b3b3 | ||
Bruno BELANYI | d1cd5bfa32 | ||
Bruno BELANYI | d64a867afc | ||
Bruno BELANYI | cc21d84808 | ||
Bruno BELANYI | 84cdc30037 | ||
Bruno BELANYI | 07cf0fa4da | ||
Bruno BELANYI | 24de1890fc | ||
Bruno BELANYI | 4055ef17f0 | ||
Bruno BELANYI | 7ce69233c1 | ||
Bruno BELANYI | 9f86615e77 | ||
Bruno BELANYI | e805496588 | ||
Bruno BELANYI | 3201445c08 | ||
Bruno BELANYI | 30eaefc1d1 | ||
Bruno BELANYI | 5f41bb1647 | ||
Bruno BELANYI | fec4956063 | ||
Bruno BELANYI | a62c0ad126 | ||
Bruno BELANYI | 2cc13dddb5 | ||
Bruno BELANYI | de92358bc0 | ||
Bruno BELANYI | 167db81c6c | ||
Bruno BELANYI | 738d1760c3 | ||
Bruno BELANYI | e962d4c574 | ||
Bruno BELANYI | 1c0d671fff | ||
Bruno BELANYI | 3bf3980e45 | ||
Bruno BELANYI | f6faa11ff7 | ||
Bruno BELANYI | 67090494e2 | ||
Bruno BELANYI | 0d44b3b9f2 | ||
Bruno BELANYI | 37c20529c1 | ||
Bruno BELANYI | 2449a96652 | ||
Bruno BELANYI | 8a9337710f | ||
Bruno BELANYI | 7b75ea43ad | ||
Bruno BELANYI | fb6e2afe89 | ||
Bruno BELANYI | 51067582e0 | ||
Bruno BELANYI | 78ade4c605 | ||
Bruno BELANYI | 5c2921e00d | ||
Bruno BELANYI | 62a18cd3f6 | ||
Bruno BELANYI | c6cc64e156 | ||
Bruno BELANYI | 875a3d8587 | ||
Bruno BELANYI | 409e0ef357 | ||
Bruno BELANYI | b6af754199 | ||
Bruno BELANYI | ca5e5a53cd | ||
Bruno BELANYI | ba10af0644 | ||
Bruno BELANYI | 0f2c20e51d | ||
Bruno BELANYI | ca218730ff | ||
Bruno BELANYI | ac5fd7f472 | ||
Bruno BELANYI | db37cea907 | ||
Bruno BELANYI | 1cf93825b2 | ||
Bruno BELANYI | 8a2aad9b54 | ||
Bruno BELANYI | 018394b61d | ||
Bruno BELANYI | 1e3c633c72 | ||
Bruno BELANYI | df302465c9 | ||
Bruno BELANYI | 673ead7863 | ||
Bruno BELANYI | 3d10461a6e | ||
Bruno BELANYI | 75312c747b | ||
Bruno BELANYI | 68be7743ad | ||
Bruno BELANYI | 9d362655e2 | ||
Bruno BELANYI | 604b99a7ac | ||
Bruno BELANYI | 8467fda721 | ||
Bruno BELANYI | bad9b8a06b | ||
Bruno BELANYI | 2d26b36e31 | ||
Bruno BELANYI | c93a9e5a98 | ||
Bruno BELANYI | 3fa14ebe71 | ||
Bruno BELANYI | bd1a2000fe | ||
Bruno BELANYI | 4a0c10b897 | ||
Bruno BELANYI | 9f3811ea3b | ||
Bruno BELANYI | 5c95ba1113 | ||
Bruno BELANYI | 37bb7fd625 | ||
Bruno BELANYI | 45321072fc | ||
Bruno BELANYI | ed456c999d | ||
Bruno BELANYI | ad848ef89d | ||
Bruno BELANYI | 680d0c9f37 | ||
Bruno BELANYI | 9a06108603 | ||
Bruno BELANYI | c8633abf6d | ||
Bruno BELANYI | aceb4ef901 | ||
Bruno BELANYI | 5937d43993 | ||
Bruno BELANYI | add6326fdf | ||
Bruno BELANYI | b0e4475586 | ||
Bruno BELANYI | 5c1dd6500a | ||
Bruno BELANYI | 60e977611c | ||
Bruno BELANYI | 99462199bd | ||
Bruno BELANYI | 4fe18ff4cd | ||
Bruno BELANYI | 02ffbcf970 | ||
Bruno BELANYI | 878c92b67e | ||
Bruno BELANYI | 8596ce8638 | ||
Bruno BELANYI | 808058d576 | ||
Bruno BELANYI | 8ffad5d41b | ||
Bruno BELANYI | 52706ab4c4 | ||
Bruno BELANYI | 5ae7b593e4 | ||
Bruno BELANYI | 87613a9163 | ||
Bruno BELANYI | 47d19e5b3f | ||
Bruno BELANYI | a78091c57c | ||
Bruno BELANYI | 9aba0d3ce0 | ||
Bruno BELANYI | 78064bb2a1 | ||
Bruno BELANYI | 70af0ba99a | ||
Bruno BELANYI | dc2a3610a6 | ||
Bruno BELANYI | 894b571745 | ||
Bruno BELANYI | 2049e7a2c5 | ||
Bruno BELANYI | 7032ddef37 | ||
Bruno BELANYI | 81e12969eb | ||
Bruno BELANYI | b97eff2479 | ||
Bruno BELANYI | 4f742b69f2 | ||
Bruno BELANYI | 11fbbd62eb | ||
Bruno BELANYI | d21087ddcd | ||
Bruno BELANYI | 3919a87d9e | ||
Bruno BELANYI | 3fd487bbd2 | ||
Bruno BELANYI | 5916ae631d | ||
Bruno BELANYI | 1a436fd962 | ||
Bruno BELANYI | a48303e66d | ||
Bruno BELANYI | 30fc01b5ae | ||
Bruno BELANYI | 13684ecdc4 | ||
Bruno BELANYI | fe720b2de3 | ||
Bruno BELANYI | ec6b31f4a6 | ||
Bruno BELANYI | 1335bbfe9d | ||
Bruno BELANYI | 2cc1925346 | ||
Bruno BELANYI | eb0c5d5895 | ||
Bruno BELANYI | 8c298c26f9 | ||
Bruno BELANYI | 55a04cfac3 | ||
Bruno BELANYI | 1783c2838b | ||
Bruno BELANYI | e215f7aa1d | ||
Bruno BELANYI | afb683f1cf | ||
Bruno BELANYI | c320387746 | ||
Bruno BELANYI | bbb1231ad3 | ||
Bruno BELANYI | 9f00d8a38e | ||
Bruno BELANYI | 820b52314f | ||
Bruno BELANYI | a3293277d9 | ||
Bruno BELANYI | 2ecd417a68 | ||
Bruno BELANYI | 4e8045716c | ||
Bruno BELANYI | e060476f32 | ||
Bruno BELANYI | 2458ddf59d | ||
Bruno BELANYI | 8927b3182f | ||
Bruno BELANYI | f2dfeeb35b | ||
Bruno BELANYI | 971b610cd5 | ||
Bruno BELANYI | 21f48b5f71 | ||
Bruno BELANYI | a3edf2548b | ||
Bruno BELANYI | ea7b064546 | ||
Bruno BELANYI | ff8e64d601 | ||
Bruno BELANYI | 791109c3c1 | ||
Bruno BELANYI | 6eb3942270 | ||
Bruno BELANYI | 2232062fd9 | ||
Bruno BELANYI | d6e9f9786d | ||
Bruno BELANYI | 5abe4e929e | ||
Bruno BELANYI | 57717d70ef | ||
Bruno BELANYI | 7a382368e8 | ||
Bruno BELANYI | 0f17123d09 | ||
Bruno BELANYI | c6d21493ef | ||
Bruno BELANYI | 5cebb9b54b | ||
Bruno BELANYI | 92c2748747 | ||
Bruno BELANYI | 4cae294cf5 | ||
Bruno BELANYI | 23c6093c36 | ||
Bruno BELANYI | 3fdcfb5b5f | ||
Bruno BELANYI | c9418cc4d3 | ||
Bruno BELANYI | cd02cbff45 | ||
Bruno BELANYI | daa69a54fa | ||
Bruno BELANYI | 212dd299e2 | ||
Bruno BELANYI | cff3811cad | ||
Bruno BELANYI | 8f266245ee | ||
Bruno BELANYI | b8be3d80a8 | ||
Bruno BELANYI | b04c1b09ea | ||
Bruno BELANYI | 3a471433ed | ||
Bruno BELANYI | f8325cc9c7 | ||
Bruno BELANYI | cd1173d2f6 | ||
Bruno BELANYI | e319eaf09f | ||
Bruno BELANYI | e6ba569b36 | ||
Bruno BELANYI | ee21de5b94 | ||
Bruno BELANYI | 6614b47546 | ||
Bruno BELANYI | 06c53620f8 | ||
Bruno BELANYI | d43045c6d6 | ||
Bruno BELANYI | 6113ad154d | ||
Bruno BELANYI | e8982b8bc9 | ||
Bruno BELANYI | 7684489c9a | ||
Bruno BELANYI | 1994ef2b1b | ||
Bruno BELANYI | a434016252 | ||
Bruno BELANYI | 1794eefd30 | ||
Bruno BELANYI | 29437d3e3f | ||
Bruno BELANYI | a827a34501 | ||
Bruno BELANYI | 610b0f2f4b | ||
Bruno BELANYI | 59cb038045 | ||
Bruno BELANYI | 15db81eb3b | ||
Bruno BELANYI | 24efa3edca | ||
Bruno BELANYI | 2fe4f1faad | ||
Bruno BELANYI | 4f1f687eea | ||
Bruno BELANYI | b90be0acdf | ||
Bruno BELANYI | ea4c699b81 | ||
Bruno BELANYI | 8efe75295d | ||
Bruno BELANYI | 2d9b11406a | ||
Bruno BELANYI | 003c08cb09 | ||
Bruno BELANYI | 6728b50d3a | ||
Bruno BELANYI | 2eaf3bf2c7 | ||
Bruno BELANYI | 0077ce1f94 | ||
Bruno BELANYI | 14d9fc89f1 | ||
Bruno BELANYI | f660bf94e9 | ||
Bruno BELANYI | 3b9f01e780 | ||
Bruno BELANYI | 60f1e693d1 | ||
Bruno BELANYI | ce4b0b8c90 | ||
Bruno BELANYI | d2704b17fe | ||
Bruno BELANYI | 31f8ec6e98 | ||
Bruno BELANYI | af67d04992 | ||
Bruno BELANYI | f9bcf79430 | ||
Bruno BELANYI | b0cc830467 | ||
Bruno BELANYI | 9b054d10c7 | ||
Bruno BELANYI | e81aaa8ebc | ||
Bruno BELANYI | 737b5e797b | ||
Bruno BELANYI | 6728b5b949 | ||
Bruno BELANYI | 2999ba7c0b | ||
Bruno BELANYI | 1ac9f0cc8c | ||
Bruno BELANYI | 6074958292 | ||
Bruno BELANYI | da21e7a6f2 | ||
Bruno BELANYI | 395f15f181 | ||
Bruno BELANYI | 059831b532 | ||
Bruno BELANYI | 76d165343e | ||
Bruno BELANYI | f66da6fee6 | ||
Bruno BELANYI | ca1c7962ea | ||
Bruno BELANYI | 796df5475e | ||
Bruno BELANYI | 414606b58e | ||
Bruno BELANYI | 931b67fdb2 | ||
Bruno BELANYI | 8b4966fcbe | ||
Bruno BELANYI | a508db48c9 | ||
Bruno BELANYI | 406eeea9f6 | ||
Bruno BELANYI | 9d3d86365c | ||
Bruno BELANYI | 78d77890de | ||
Bruno BELANYI | a33fbc6659 | ||
Bruno BELANYI | b134aedff0 | ||
Bruno BELANYI | d31e293cef | ||
Bruno BELANYI | 182ec2a4db | ||
Bruno BELANYI | 81647c5a02 | ||
Bruno BELANYI | 8a8f7387f4 | ||
Bruno BELANYI | f2b20c65a8 | ||
Bruno BELANYI | cc37713839 | ||
Bruno BELANYI | e80485018c | ||
Bruno BELANYI | 15abb291ef | ||
Bruno BELANYI | fb56631ef3 | ||
Bruno BELANYI | 9113290161 | ||
Bruno BELANYI | 943ea20b16 | ||
Bruno BELANYI | 129fcdd42c | ||
Bruno BELANYI | d086af7e00 | ||
Bruno BELANYI | e4d8a4d4b2 | ||
Bruno BELANYI | 1a5dd0b91c | ||
Bruno BELANYI | 02c2a23ee5 | ||
Bruno BELANYI | f6ace9d438 | ||
Bruno BELANYI | 2a0b5b7802 | ||
Bruno BELANYI | 2c596395b0 | ||
Bruno BELANYI | 986701d1c8 | ||
Bruno BELANYI | ee33ab11c6 | ||
Bruno BELANYI | 7d0a772cce | ||
Bruno BELANYI | 97ee498405 | ||
Bruno BELANYI | e5fdfd6c44 | ||
Bruno BELANYI | 76148d75b8 | ||
Bruno BELANYI | 9e6bc604f3 | ||
Bruno BELANYI | b4d3b06fbf | ||
Bruno BELANYI | 8de23feee7 | ||
Bruno BELANYI | 0fc3bf3096 | ||
Bruno BELANYI | 7d48b0edab | ||
Bruno BELANYI | d23ad8f5e1 | ||
Bruno BELANYI | f3764ce20e | ||
Bruno BELANYI | f9d849c5da | ||
Bruno BELANYI | 59e833a55b | ||
Bruno BELANYI | 03130ed9ee | ||
Bruno BELANYI | ac4cf0c1a2 | ||
Bruno BELANYI | fab93a5f2f | ||
Bruno BELANYI | f04368a71e | ||
Bruno BELANYI | 30ce91557d | ||
Bruno BELANYI | d46f66842f | ||
Bruno BELANYI | 737484dcfe | ||
Bruno BELANYI | 125935ac0f | ||
Bruno BELANYI | e786eaddde | ||
Bruno BELANYI | e211ac7d73 | ||
Bruno BELANYI | 3f50abcbe0 | ||
Bruno BELANYI | 1c2193d698 | ||
Bruno BELANYI | 12b3397a20 | ||
Bruno BELANYI | ca620a4eb6 | ||
Bruno BELANYI | 885b45d39c | ||
Bruno BELANYI | 0c943d8430 | ||
Bruno BELANYI | 79dfb3a979 | ||
Bruno BELANYI | 00a5d1b076 | ||
Bruno BELANYI | 5e193b3a42 | ||
Bruno BELANYI | bf9de874ce | ||
Bruno BELANYI | 5aaa497653 | ||
Bruno BELANYI | 3887a86650 | ||
Bruno BELANYI | f57fd32088 | ||
Bruno BELANYI | 1c147613e4 | ||
Bruno BELANYI | 15190d4b50 | ||
Bruno BELANYI | 5f7d2c74bc | ||
Bruno BELANYI | 53dd04a0b7 | ||
Bruno BELANYI | 86ab6bf17a | ||
Bruno BELANYI | 6008ac470c | ||
Bruno BELANYI | 717c628ff1 | ||
Bruno BELANYI | 749ef9f072 | ||
Bruno BELANYI | a0c63f00f9 | ||
Bruno BELANYI | d9734dd505 | ||
Bruno BELANYI | 4225bdd103 | ||
Bruno BELANYI | 3a07cffa14 | ||
Bruno BELANYI | 06f9f423e9 | ||
Bruno BELANYI | ad1d907c25 | ||
Bruno BELANYI | ef0f4bdca5 | ||
Bruno BELANYI | b4d002033a | ||
Bruno BELANYI | 8837c7c33c | ||
Bruno BELANYI | f4cc68a650 | ||
Bruno BELANYI | 79525013b0 | ||
Bruno BELANYI | 2b8d01f056 | ||
Bruno BELANYI | b115d94cd6 | ||
Bruno BELANYI | 1022601602 | ||
Bruno BELANYI | 376e60d71e | ||
Bruno BELANYI | a03db294fe | ||
Bruno BELANYI | f2b9040175 | ||
Bruno BELANYI | b1e8664e32 | ||
Bruno BELANYI | b61aca7def | ||
Bruno BELANYI | d388a379d4 | ||
Bruno BELANYI | 3402b92784 | ||
Bruno BELANYI | b55466b791 | ||
Bruno BELANYI | 036d59ec11 | ||
Bruno BELANYI | f89e1ba3e9 | ||
Bruno BELANYI | 8788deac5e | ||
Bruno BELANYI | 676cd03c9c | ||
Bruno BELANYI | e329e7a59a | ||
Bruno BELANYI | 98a8e068ea | ||
Bruno BELANYI | f5fcd2a7a6 | ||
Bruno BELANYI | 1b9b598662 | ||
Bruno BELANYI | 05e0cd4e1f | ||
Bruno BELANYI | 9973e0d32f | ||
Bruno BELANYI | 8231e8feaa | ||
Bruno BELANYI | 8dc89846b2 | ||
Bruno BELANYI | 5a32160954 | ||
Bruno BELANYI | 6612d0226a | ||
Bruno BELANYI | 75e3d9bf70 | ||
Bruno BELANYI | 9dbfb65c27 | ||
Bruno BELANYI | f8d6447ac4 | ||
Bruno BELANYI | 185781a4e2 | ||
Bruno BELANYI | cdc29efafc | ||
Bruno BELANYI | 9f6c614c9f | ||
Bruno BELANYI | 54a20058fb | ||
Bruno BELANYI | 6bad81a644 | ||
Bruno BELANYI | 971ee359ce | ||
Bruno BELANYI | c175964630 | ||
Bruno BELANYI | 046391e26e | ||
Bruno BELANYI | b32fec2c63 | ||
Bruno BELANYI | 3ec448bf03 | ||
Bruno BELANYI | c3c44bceb6 | ||
Bruno BELANYI | e1240c188e | ||
Bruno BELANYI | d5b3b95827 | ||
Bruno BELANYI | c17b5f4004 | ||
Bruno BELANYI | e06edc8f47 | ||
Bruno BELANYI | 4d04dd9b9b | ||
Bruno BELANYI | e6b810b5a1 | ||
Bruno BELANYI | 595720dcd4 | ||
Bruno BELANYI | e6fb00ce9a | ||
Bruno BELANYI | d01b7963cd | ||
Bruno BELANYI | 646768c3b7 | ||
Bruno BELANYI | b254e0f7ac | ||
Bruno BELANYI | fee045d82c | ||
Bruno BELANYI | 76b17e924a | ||
Bruno BELANYI | 9fe78a5a70 | ||
Bruno BELANYI | 90ccf42779 | ||
Bruno BELANYI | cdbe16e703 | ||
Bruno BELANYI | 1da8177ea2 | ||
Bruno BELANYI | fe9f468e06 | ||
Bruno BELANYI | 45cb955433 | ||
Bruno BELANYI | b6fb77fc34 | ||
Bruno BELANYI | f57cfda767 | ||
Bruno BELANYI | 5427f15a17 | ||
Bruno BELANYI | 6acf9f4a19 | ||
Bruno BELANYI | cd7c8e2172 | ||
Bruno BELANYI | e0b0f44a9a | ||
Bruno BELANYI | bd53470e46 | ||
Bruno BELANYI | f634f1b2ed | ||
dc052386d1 |
43
.drone.yml
43
.drone.yml
|
@ -1,24 +1,27 @@
|
||||||
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
name: check config
|
type: exec
|
||||||
|
name: NixOS config check
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: format check
|
- name: nix flake check
|
||||||
image: nixos/nix
|
commands:
|
||||||
commands:
|
- nix flake check
|
||||||
- nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt . --check'
|
|
||||||
|
|
||||||
- name: notify
|
- name: notifiy
|
||||||
image: plugins/matrix
|
commands:
|
||||||
settings:
|
- nix run .#matrix-notifier
|
||||||
homeserver:
|
environment:
|
||||||
from_secret: matrix_homeserver
|
ADDRESS:
|
||||||
roomid:
|
from_secret: matrix_homeserver
|
||||||
from_secret: matrix_roomid
|
ROOM:
|
||||||
username:
|
from_secret: matrix_roomid
|
||||||
from_secret: matrix_username
|
USER:
|
||||||
password:
|
from_secret: matrix_username
|
||||||
from_secret: matrix_password
|
PASS:
|
||||||
trigger:
|
from_secret: matrix_password
|
||||||
status:
|
when:
|
||||||
- failure
|
status:
|
||||||
- success
|
- failure
|
||||||
|
- success
|
||||||
|
...
|
||||||
|
|
1
.envrc
1
.envrc
|
@ -6,3 +6,4 @@ use_flake() {
|
||||||
|
|
||||||
ulimit -s unlimited # Bypass current bug in `nix` flakes evaluation
|
ulimit -s unlimited # Bypass current bug in `nix` flakes evaluation
|
||||||
use flake
|
use flake
|
||||||
|
eval "$shellHooks"
|
||||||
|
|
4
.git-crypt/.gitattributes
vendored
4
.git-crypt/.gitattributes
vendored
|
@ -1,4 +0,0 @@
|
||||||
# Do not edit this file. To specify the files to encrypt, create your own
|
|
||||||
# .gitattributes file in the directory where your files are.
|
|
||||||
* !filter !diff
|
|
||||||
*.gpg binary
|
|
Binary file not shown.
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/.pre-commit-config.yaml
|
|
@ -1,21 +0,0 @@
|
||||||
repos:
|
|
||||||
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
|
|
||||||
rev: 'v2.3.0'
|
|
||||||
hooks:
|
|
||||||
- id: 'trailing-whitespace'
|
|
||||||
- id: 'end-of-file-fixer'
|
|
||||||
- id: 'check-yaml'
|
|
||||||
- id: 'check-added-large-files'
|
|
||||||
- repo: 'https://github.com/jumanjihouse/pre-commit-hooks'
|
|
||||||
rev: '2.1.4'
|
|
||||||
hooks:
|
|
||||||
- id: 'forbid-binary'
|
|
||||||
- repo: 'local'
|
|
||||||
hooks:
|
|
||||||
- id: 'nixpkgs-fmt'
|
|
||||||
name: 'nixpkgs-fmt'
|
|
||||||
description: 'Format nix code with nixpkgs-fmt'
|
|
||||||
entry: 'nixpkgs-fmt'
|
|
||||||
language: 'system'
|
|
||||||
files: '\.nix$'
|
|
||||||
always_run: true
|
|
|
@ -21,3 +21,4 @@ Secondly, take care of a few manual steps:
|
||||||
* Configure Sonarr, Radarr, Bazarr
|
* Configure Sonarr, Radarr, Bazarr
|
||||||
* Configure Transmission's webui port
|
* Configure Transmission's webui port
|
||||||
* Configure Quassel user
|
* Configure Quassel user
|
||||||
|
* Configure Flood account
|
||||||
|
|
|
@ -58,6 +58,8 @@ get_ssh() {
|
||||||
|
|
||||||
get_doc "SysAdmin/SSH" "shared-key-public" "$HOME/.ssh/shared_rsa.pub" 644
|
get_doc "SysAdmin/SSH" "shared-key-public" "$HOME/.ssh/shared_rsa.pub" 644
|
||||||
get_doc "SysAdmin/SSH" "shared-key-private" "$HOME/.ssh/shared_rsa" 600
|
get_doc "SysAdmin/SSH" "shared-key-private" "$HOME/.ssh/shared_rsa" 600
|
||||||
|
get_doc "SysAdmin/SSH" "agenix-public" "$HOME/.ssh/id_ed25519.pub" 644
|
||||||
|
get_doc "SysAdmin/SSH" "agenix-private" "$HOME/.ssh/id_ed25519" 600
|
||||||
}
|
}
|
||||||
|
|
||||||
get_pgp() {
|
get_pgp() {
|
||||||
|
@ -78,7 +80,7 @@ get_pgp() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_creds() {
|
get_creds() {
|
||||||
BW_SESSION="$(bw login --raw)"
|
BW_SESSION="$(bw login --raw || bw unlock --raw)"
|
||||||
export BW_SESSION
|
export BW_SESSION
|
||||||
|
|
||||||
get_ssh
|
get_ssh
|
||||||
|
|
73
flake.lock
73
flake.lock
|
@ -1,12 +1,33 @@
|
||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
|
"agenix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1631896269,
|
||||||
|
"narHash": "sha256-DAyCxJ8JacayOzGgGSfzrn7ghtsfL/EsCyk1NEUaAR8=",
|
||||||
|
"owner": "ryantm",
|
||||||
|
"repo": "agenix",
|
||||||
|
"rev": "daf1d773989ac5d949aeef03fce0fe27e583dbca",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "ryantm",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "agenix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"futils": {
|
"futils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1619345332,
|
"lastModified": 1631561581,
|
||||||
"narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=",
|
"narHash": "sha256-3VQMV5zvxaVLvqqUrNz3iJelLw30mIVSfZmAaauM3dA=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28",
|
"rev": "7e5bf3925f6fbdfaf50a2a7ca0be2879c4261d19",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -23,11 +44,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1619558193,
|
"lastModified": 1633296444,
|
||||||
"narHash": "sha256-DljP5/9EX0eXEPhzCUFqFEHkkcFuXJBx1PTgcv0OgyM=",
|
"narHash": "sha256-DnC7yVyoYFSsvFze16AWDa5iSHgtT1MbDGgp8rSC3H4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "18ad12d52b8cebbb57013865eec2be5125de050a",
|
"rev": "099cbcf13e8219f07b493980a66fe64df0e32d09",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -39,11 +60,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1619464443,
|
"lastModified": 1633263894,
|
||||||
"narHash": "sha256-R7WAb8EnkIJxxaF6GTHUPytjonhB4Zm0iatyWoW169A=",
|
"narHash": "sha256-InuWViZr3SL8PqRROkWhmSd3N8gGkiP7YaA7BRdjmhk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "8e4fe32876ca15e3d5eb3ecd3ca0b224417f5f17",
|
"rev": "01f2f2842aaa7f3af957fef93439d639e6941e6c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -55,11 +76,11 @@
|
||||||
},
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1619628114,
|
"lastModified": 1633342505,
|
||||||
"narHash": "sha256-s3pQyvMfXVmbQOX224yOWQf6zi8406sShFF4u17LVQ0=",
|
"narHash": "sha256-UgXnO+jX6V33mtbFgQKPLndNQid1DqOnMcsPlxqeWdk=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "0615e756dc14986c4968fa478c0bd080d621cb2b",
|
"rev": "061e44abde1dc11b10ff93fe6a388272850f473c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -69,12 +90,38 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pre-commit-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": [
|
||||||
|
"futils"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1631170176,
|
||||||
|
"narHash": "sha256-RLN/kur2Kpxt0cJp0Fms8ixuGpT8IHX0OpeQ8u8f0X4=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"rev": "3ed0e618cebc1ff291c27b749cf7568959cac028",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"agenix": "agenix",
|
||||||
"futils": "futils",
|
"futils": "futils",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nur": "nur"
|
"nur": "nur",
|
||||||
|
"pre-commit-hooks": "pre-commit-hooks"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
111
flake.nix
111
flake.nix
|
@ -1,6 +1,16 @@
|
||||||
{
|
{
|
||||||
description = "NixOS configuration with flakes";
|
description = "NixOS configuration with flakes";
|
||||||
inputs = {
|
inputs = {
|
||||||
|
agenix = {
|
||||||
|
type = "github";
|
||||||
|
owner = "ryantm";
|
||||||
|
repo = "agenix";
|
||||||
|
ref = "master";
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
futils = {
|
futils = {
|
||||||
type = "github";
|
type = "github";
|
||||||
owner = "numtide";
|
owner = "numtide";
|
||||||
|
@ -31,9 +41,29 @@
|
||||||
repo = "NUR";
|
repo = "NUR";
|
||||||
ref = "master";
|
ref = "master";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pre-commit-hooks = {
|
||||||
|
type = "github";
|
||||||
|
owner = "cachix";
|
||||||
|
repo = "pre-commit-hooks.nix";
|
||||||
|
ref = "master";
|
||||||
|
inputs = {
|
||||||
|
flake-utils.follows = "futils";
|
||||||
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, futils, home-manager, nixpkgs, nur } @ inputs:
|
outputs =
|
||||||
|
inputs @
|
||||||
|
{ self
|
||||||
|
, agenix
|
||||||
|
, futils
|
||||||
|
, home-manager
|
||||||
|
, nixpkgs
|
||||||
|
, nur
|
||||||
|
, pre-commit-hooks
|
||||||
|
}:
|
||||||
let
|
let
|
||||||
inherit (futils.lib) eachDefaultSystem;
|
inherit (futils.lib) eachDefaultSystem;
|
||||||
|
|
||||||
|
@ -51,58 +81,81 @@
|
||||||
nur.overlay
|
nur.overlay
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
home-manager.nixosModules.home-manager
|
# Include generic settings
|
||||||
{
|
./modules
|
||||||
home-manager.users.ambroisie = import ./home;
|
# Include bundles of settings
|
||||||
# Nix Flakes compatibility
|
./profiles
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
buildHost = name: system: lib.nixosSystem {
|
buildHost = name: system: lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = defaultModules ++ [
|
modules = defaultModules ++ [
|
||||||
(./. + "/${name}.nix")
|
(./. + "/machines/${name}")
|
||||||
];
|
];
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
# Use my extended lib in NixOS configuration
|
# Use my extended lib in NixOS configuration
|
||||||
inherit lib;
|
inherit lib;
|
||||||
|
# Inject inputs to use them in global registry
|
||||||
|
inherit inputs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
eachDefaultSystem
|
eachDefaultSystem
|
||||||
(system:
|
(system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
apps = {
|
apps = {
|
||||||
diff-flake = futils.lib.mkApp { drv = packages.diff-flake; };
|
diff-flake = futils.lib.mkApp { drv = packages.diff-flake; };
|
||||||
|
};
|
||||||
|
|
||||||
|
checks = {
|
||||||
|
pre-commit = pre-commit-hooks.lib.${system}.run {
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
|
hooks = {
|
||||||
|
nixpkgs-fmt = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
defaultApp = apps.diff-flake;
|
defaultApp = apps.diff-flake;
|
||||||
|
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
name = "NixOS-config";
|
name = "NixOS-config";
|
||||||
buildInputs = with pkgs; [
|
|
||||||
git-crypt
|
|
||||||
gitAndTools.pre-commit
|
|
||||||
gnupg
|
|
||||||
nixpkgs-fmt
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
packages = import ./pkgs { inherit pkgs; };
|
nativeBuildInputs = with pkgs; [
|
||||||
}) // {
|
gitAndTools.pre-commit
|
||||||
|
gnupg
|
||||||
|
nixpkgs-fmt
|
||||||
|
];
|
||||||
|
|
||||||
|
inherit (self.checks.${system}.pre-commit) shellHook;
|
||||||
|
};
|
||||||
|
|
||||||
|
packages =
|
||||||
|
let
|
||||||
|
inherit (futils.lib) filterPackages flattenTree;
|
||||||
|
packages = import ./pkgs { inherit pkgs; };
|
||||||
|
flattenedPackages = flattenTree packages;
|
||||||
|
finalPackages = filterPackages system flattenedPackages;
|
||||||
|
in
|
||||||
|
finalPackages;
|
||||||
|
}) // {
|
||||||
overlay = self.overlays.pkgs;
|
overlay = self.overlays.pkgs;
|
||||||
|
|
||||||
overlays = {
|
overlays = import ./overlays // {
|
||||||
lib = final: prev: { inherit lib; };
|
lib = final: prev: { inherit lib; };
|
||||||
pkgs = final: prev: { ambroisie = import ./pkgs { pkgs = prev; }; };
|
pkgs = final: prev: {
|
||||||
|
ambroisie = prev.recurseIntoAttrs (import ./pkgs { pkgs = prev; });
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations = lib.mapAttrs buildHost {
|
nixosConfigurations = lib.mapAttrs buildHost {
|
||||||
|
aramis = "x86_64-linux";
|
||||||
porthos = "x86_64-linux";
|
porthos = "x86_64-linux";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
19
home/bluetooth/default.nix
Normal file
19
home/bluetooth/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.bluetooth;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.bluetooth = with lib; {
|
||||||
|
enable = mkEnableOption "bluetooth configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.blueman-applet = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.mpris-proxy = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
29
home/comma/default.nix
Normal file
29
home/comma/default.nix
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.comma;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.comma = with lib; {
|
||||||
|
enable = my.mkDisableOption "comma configuration";
|
||||||
|
|
||||||
|
pkgsFlake = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "pkgs";
|
||||||
|
example = "nixpkgs";
|
||||||
|
description = ''
|
||||||
|
Which flake from the registry should be used with
|
||||||
|
<command>nix shell</command>.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
ambroisie.comma
|
||||||
|
];
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
COMMA_PKGS_FLAKE = cfg.pkgsFlake;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,20 +1,37 @@
|
||||||
{ ... }:
|
{ ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./bat.nix
|
./bat
|
||||||
./direnv.nix
|
./bluetooth
|
||||||
./documentation.nix
|
./comma
|
||||||
|
./direnv
|
||||||
|
./documentation
|
||||||
|
./feh
|
||||||
|
./firefox
|
||||||
|
./flameshot
|
||||||
|
./gammastep
|
||||||
|
./gdb
|
||||||
./git
|
./git
|
||||||
./gpg.nix
|
./gpg
|
||||||
./htop.nix
|
./gtk
|
||||||
./jq.nix
|
./htop
|
||||||
./packages.nix
|
./jq
|
||||||
./pager.nix
|
./mail
|
||||||
./secrets # Home-manager specific secrets
|
./mpv
|
||||||
./ssh.nix
|
./nix-index
|
||||||
./tmux.nix
|
./nm-applet
|
||||||
|
./packages
|
||||||
|
./pager
|
||||||
|
./power-alert
|
||||||
|
./ssh
|
||||||
|
./terminal
|
||||||
|
./tmux
|
||||||
|
./udiskie
|
||||||
./vim
|
./vim
|
||||||
./xdg.nix
|
./wm
|
||||||
|
./x
|
||||||
|
./xdg
|
||||||
|
./zathura
|
||||||
./zsh
|
./zsh
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,11 @@ in
|
||||||
|
|
||||||
config.programs.direnv = lib.mkIf cfg.enable {
|
config.programs.direnv = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
# A better `use_nix`
|
nix-direnv = {
|
||||||
enableNixDirenvIntegration = true;
|
# A better `use_nix`
|
||||||
|
enable = true;
|
||||||
|
# And `use_flake`
|
||||||
|
enableFlakes = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
13
home/feh/default.nix
Normal file
13
home/feh/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.feh;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.feh = with lib; {
|
||||||
|
enable = mkEnableOption "feh configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config.programs.feh = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
84
home/firefox/default.nix
Normal file
84
home/firefox/default.nix
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.firefox;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./tridactyl
|
||||||
|
];
|
||||||
|
|
||||||
|
options.my.home.firefox = with lib; {
|
||||||
|
enable = mkEnableOption "firefox configuration";
|
||||||
|
|
||||||
|
tridactyl = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "tridactyl configuration";
|
||||||
|
example = false;
|
||||||
|
default = config.my.home.firefox.enable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
ff2mpv = {
|
||||||
|
enable = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
description = "ff2mpv configuration";
|
||||||
|
example = false;
|
||||||
|
default = config.my.home.mpv.enable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config.programs.firefox = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
package = pkgs.firefox.override {
|
||||||
|
cfg = {
|
||||||
|
enableTridactylNative = cfg.tridactyl.enable;
|
||||||
|
};
|
||||||
|
|
||||||
|
extraNativeMessagingHosts = with pkgs; ([ ]
|
||||||
|
# Watch videos using mpv
|
||||||
|
++ lib.optional cfg.ff2mpv.enable ambroisie.ff2mpv-go
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
profiles = {
|
||||||
|
default = {
|
||||||
|
id = 0;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
"browser.bookmarks.showMobileBookmarks" = true; # Mobile bookmarks
|
||||||
|
"browser.download.useDownloadDir" = false; # Ask for download location
|
||||||
|
"browser.in-content.dark-mode" = true; # Dark mode
|
||||||
|
"browser.newtabpage.activity-stream.feeds.section.topstories" = false; # Disable top stories
|
||||||
|
"browser.newtabpage.activity-stream.feeds.sections" = false;
|
||||||
|
"browser.newtabpage.activity-stream.feeds.system.topstories" = false; # Disable top stories
|
||||||
|
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false; # Disable pocket
|
||||||
|
"extensions.pocket.enabled" = false; # Disable pocket
|
||||||
|
"media.eme.enabled" = true; # Enable DRM
|
||||||
|
"media.gmp-widevinecdm.visible" = true; # Enable DRM
|
||||||
|
"media.gmp-widevinecdm.enabled" = true; # Enable DRM
|
||||||
|
"signon.autofillForms" = false; # Disable built-in form-filling
|
||||||
|
"signon.rememberSignons" = false; # Disable built-in password manager
|
||||||
|
"ui.systemUsesDarkTheme" = true; # Dark mode
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
extensions = with pkgs.nur.repos.rycee.firefox-addons; ([
|
||||||
|
bitwarden
|
||||||
|
form-history-control
|
||||||
|
https-everywhere
|
||||||
|
i-dont-care-about-cookies
|
||||||
|
reddit-comment-collapser
|
||||||
|
reddit-enhancement-suite
|
||||||
|
refined-github
|
||||||
|
sponsorblock
|
||||||
|
ublock-origin
|
||||||
|
]
|
||||||
|
++ lib.optional (cfg.tridactyl.enable) tridactyl
|
||||||
|
++ lib.optional (cfg.ff2mpv.enable) ff2mpv
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
9
home/firefox/tridactyl/default.nix
Normal file
9
home/firefox/tridactyl/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.firefox.tridactyl;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
xdg.configFile."tridactyl/tridactylrc".source = ./tridactylrc;
|
||||||
|
};
|
||||||
|
}
|
75
home/firefox/tridactyl/tridactylrc
Normal file
75
home/firefox/tridactyl/tridactylrc
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
" Shamelessly taken from bovine3dom's example configuration file from the docs
|
||||||
|
|
||||||
|
" Basics {{{
|
||||||
|
" Use dark color scheme
|
||||||
|
colorscheme dark
|
||||||
|
|
||||||
|
" Make tridactyl open Vim in my prefered terminal
|
||||||
|
" FIXME: make it follow my prefered terminal
|
||||||
|
set editorcmd termite --class tridactyl_editor -e 'vim %f'
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" Binds {{{
|
||||||
|
" Reddit et al. {{{
|
||||||
|
" Toggle comments on Reddit, Hacker News, Lobste.rs
|
||||||
|
bind ;c hint -c [class*="expand"],[class="togg"],[class="comment_folder"]
|
||||||
|
|
||||||
|
" Make `gu` take me back to subreddit from comments
|
||||||
|
bindurl reddit.com gu urlparent 3
|
||||||
|
|
||||||
|
" Only hint search results on Google
|
||||||
|
bindurl www.google.com f hint -Jc #search div:not(.action-menu) > a
|
||||||
|
bindurl www.google.com F hint -Jbc #search div:not(.action-menu) > a
|
||||||
|
|
||||||
|
" Only hint search results on DuckDuckGo
|
||||||
|
bindurl ^https://duckduckgo.com f hint -Jc [class=result__a]
|
||||||
|
bindurl ^https://duckduckgo.com F hint -Jbc [class=result__a]
|
||||||
|
|
||||||
|
" Only hint item pages on Hacker News
|
||||||
|
bindurl news.ycombinator.com ;f hint -Jc .age > a
|
||||||
|
bindurl news.ycombinator.com ;F hint -Jtc .age > a
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" Better bindings {{{
|
||||||
|
" Handy multiwindow binds
|
||||||
|
bind gd tabdetach
|
||||||
|
bind gD composite tabduplicate; tabdetach
|
||||||
|
|
||||||
|
" Duplicate a tab without detaching window
|
||||||
|
bind <Space>d tabduplicate
|
||||||
|
|
||||||
|
" Make yy use canonical links on the few websites that support them
|
||||||
|
bind yy clipboard yankcanon
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" Search {{{
|
||||||
|
" Case insensitive only if fully lowercase
|
||||||
|
set findcase smart
|
||||||
|
|
||||||
|
" Search forward/backward
|
||||||
|
bind / fillcmdline find
|
||||||
|
bind ? fillcmdline find -?
|
||||||
|
|
||||||
|
" Go to next/previous match
|
||||||
|
bind n findnext 1
|
||||||
|
bind N findnext -1
|
||||||
|
|
||||||
|
" Because :nohls never works
|
||||||
|
bind <Space><Space> nohlsearch
|
||||||
|
|
||||||
|
" Use browser's native find when using Ctrl-F
|
||||||
|
unbind <C-f>
|
||||||
|
" }}}
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" Redirections {{{
|
||||||
|
" Always redirect Reddit to the old site
|
||||||
|
autocmd DocStart ^http(s?)://www.reddit.com js tri.excmds.urlmodify("-t", "www", "old")
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" Disabled websites {{{
|
||||||
|
blacklistadd netflix.com
|
||||||
|
blacklistadd jellyfin.belanyi.fr
|
||||||
|
" }}}
|
||||||
|
|
||||||
|
" vim: set filetype=vim foldmethod=marker:
|
13
home/flameshot/default.nix
Normal file
13
home/flameshot/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.flameshot;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.flameshot = with lib; {
|
||||||
|
enable = mkEnableOption "flameshot configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config.services.flameshot = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
44
home/gammastep/default.nix
Normal file
44
home/gammastep/default.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.gammastep;
|
||||||
|
|
||||||
|
mkTempOption = with lib; description: default: mkOption {
|
||||||
|
inherit description default;
|
||||||
|
type = types.int;
|
||||||
|
example = 1000;
|
||||||
|
};
|
||||||
|
|
||||||
|
mkTimeOption = with lib; description: default: mkOption {
|
||||||
|
inherit description default;
|
||||||
|
type = types.str;
|
||||||
|
example = "12:00-14:00";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.gammastep = with lib; {
|
||||||
|
enable = mkEnableOption "gammastep configuration";
|
||||||
|
|
||||||
|
temperature = {
|
||||||
|
day = mkTempOption "Colour temperature to use during the day" 6500;
|
||||||
|
night = mkTempOption "Colour temperature to use during the night" 2000;
|
||||||
|
};
|
||||||
|
|
||||||
|
times = {
|
||||||
|
dawn = mkTimeOption "Dawn time" "6:00-7:30";
|
||||||
|
dusk = mkTimeOption "Dusk time" "18:30-20:00";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config.services.gammastep = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
tray = true;
|
||||||
|
|
||||||
|
dawnTime = cfg.times.dawn;
|
||||||
|
duskTime = cfg.times.dusk;
|
||||||
|
|
||||||
|
temperature = {
|
||||||
|
inherit (cfg.temperature) day night;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
42
home/gdb/default.nix
Normal file
42
home/gdb/default.nix
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.gdb;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.gdb = with lib; {
|
||||||
|
enable = my.mkDisableOption "gdb configuration";
|
||||||
|
|
||||||
|
rr = {
|
||||||
|
enable = my.mkDisableOption "rr configuration";
|
||||||
|
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.rr;
|
||||||
|
defaultText = literalExample "pkgs.rr";
|
||||||
|
description = ''
|
||||||
|
Package providing rr
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
gdb
|
||||||
|
];
|
||||||
|
|
||||||
|
# FIXME: waiting for commit 64aaad6349d2b2c45063a5383f877ce9a3a0c354
|
||||||
|
xdg.configFile."gdb/gdbinit".source = ./gdbinit;
|
||||||
|
|
||||||
|
# FIXME: remove once `gdb` is updated from version 10.2
|
||||||
|
home.file.".gdbinit".source = ./gdbinit;
|
||||||
|
})
|
||||||
|
|
||||||
|
(lib.mkIf cfg.rr.enable {
|
||||||
|
home.packages = [
|
||||||
|
cfg.rr.package
|
||||||
|
];
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
24
home/gdb/gdbinit
Normal file
24
home/gdb/gdbinit
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# Keep a history of all commands in each directory
|
||||||
|
set history save on
|
||||||
|
|
||||||
|
# Enable those pretty-printers
|
||||||
|
enable pretty-printer
|
||||||
|
|
||||||
|
# Pretty formatting of structures
|
||||||
|
set print pretty on
|
||||||
|
# Show derived type based on VTable
|
||||||
|
set print object on
|
||||||
|
# Show static members
|
||||||
|
set print static-members on
|
||||||
|
# Show VTable
|
||||||
|
set print vtbl on
|
||||||
|
# Demangle types
|
||||||
|
set print demangle on
|
||||||
|
|
||||||
|
# Read python scrips in the load path
|
||||||
|
set auto-load python-scripts
|
||||||
|
|
||||||
|
# Allow autoloading project-local .gdbinit files
|
||||||
|
set auto-load safe-path ~/git/
|
||||||
|
# Allow autoloading from the Nix store
|
||||||
|
set auto-load safe-path /nix/store
|
|
@ -18,11 +18,12 @@ in
|
||||||
package = pkgs.gitAndTools.gitFull;
|
package = pkgs.gitAndTools.gitFull;
|
||||||
|
|
||||||
aliases = {
|
aliases = {
|
||||||
lol = "log --graph --decorate --pretty=oneline --abbrev-commit";
|
lol = "log --graph --decorate --pretty=oneline --abbrev-commit --topo-order";
|
||||||
lola = "lol --all";
|
lola = "lol --all";
|
||||||
assume = "update-index --assume-unchanged";
|
assume = "update-index --assume-unchanged";
|
||||||
unassume = "update-index --no-assume-unchanged";
|
unassume = "update-index --no-assume-unchanged";
|
||||||
assumed = "!git ls-files -v | grep ^h | cut -c 3-";
|
assumed = "!git ls-files -v | grep ^h | cut -c 3-";
|
||||||
|
pick = "log -p -G";
|
||||||
push-new = "!git push -u origin "
|
push-new = "!git push -u origin "
|
||||||
+ ''"$(git branch | grep '^* ' | cut -f2- -d' ')"'';
|
+ ''"$(git branch | grep '^* ' | cut -f2- -d' ')"'';
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,8 +3,15 @@ let
|
||||||
cfg = config.my.home.gpg;
|
cfg = config.my.home.gpg;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.home.gpg = with lib.my; {
|
options.my.home.gpg = with lib; {
|
||||||
enable = mkDisableOption "gpg configuration";
|
enable = my.mkDisableOption "gpg configuration";
|
||||||
|
|
||||||
|
pinentry = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "tty";
|
||||||
|
example = "gtk2";
|
||||||
|
description = "Which pinentry interface to use";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
@ -15,7 +22,7 @@ in
|
||||||
services.gpg-agent = {
|
services.gpg-agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableSshSupport = true; # One agent to rule them all
|
enableSshSupport = true; # One agent to rule them all
|
||||||
pinentryFlavor = "tty";
|
pinentryFlavor = cfg.pinentry;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
allow-loopback-pinentry
|
allow-loopback-pinentry
|
||||||
'';
|
'';
|
33
home/gtk/default.nix
Normal file
33
home/gtk/default.nix
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.gtk;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.gtk = with lib; {
|
||||||
|
enable = mkEnableOption "GTK configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config.gtk = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
font = {
|
||||||
|
package = pkgs.dejavu_fonts;
|
||||||
|
name = "DejaVu Sans";
|
||||||
|
};
|
||||||
|
|
||||||
|
gtk2 = {
|
||||||
|
# That sweet, sweet clean home that I am always aiming for...
|
||||||
|
configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||||
|
};
|
||||||
|
|
||||||
|
iconTheme = {
|
||||||
|
package = pkgs.gnome3.gnome_themes_standard;
|
||||||
|
name = "Adwaita";
|
||||||
|
};
|
||||||
|
|
||||||
|
theme = {
|
||||||
|
package = pkgs.gnome3.gnome_themes_standard;
|
||||||
|
name = "Adwaita";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
105
home/mail/accounts/default.nix
Normal file
105
home/mail/accounts/default.nix
Normal file
|
@ -0,0 +1,105 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.mail;
|
||||||
|
|
||||||
|
mkAddress = address: domain: "${address}@${domain}";
|
||||||
|
|
||||||
|
mkConfig = { domain, address, passName, aliases ? [ ], primary ? false }: {
|
||||||
|
realName = lib.mkDefault "Bruno BELANYI";
|
||||||
|
userName = lib.mkDefault (mkAddress address domain);
|
||||||
|
passwordCommand =
|
||||||
|
lib.mkDefault [ "${pkgs.ambroisie.bw-pass}/bin/bw-pass" "Mail" passName ];
|
||||||
|
|
||||||
|
address = mkAddress address domain;
|
||||||
|
aliases = builtins.map (lib.flip mkAddress domain) aliases;
|
||||||
|
|
||||||
|
inherit primary;
|
||||||
|
|
||||||
|
himalaya = {
|
||||||
|
enable = cfg.himalaya.enable;
|
||||||
|
};
|
||||||
|
|
||||||
|
msmtp = {
|
||||||
|
enable = cfg.msmtp.enable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
migaduConfig = {
|
||||||
|
imap = {
|
||||||
|
host = "imap.migadu.com";
|
||||||
|
port = 993;
|
||||||
|
tls = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
smtp = {
|
||||||
|
host = "smtp.migadu.com";
|
||||||
|
port = 465;
|
||||||
|
tls = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
gmailConfig = {
|
||||||
|
flavor = "gmail.com";
|
||||||
|
folders = {
|
||||||
|
drafts = "[Gmail]/Drafts";
|
||||||
|
sent = "[Gmail]/Sent Mail";
|
||||||
|
trash = "[Gmail]/Trash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
office365Config = {
|
||||||
|
imap = {
|
||||||
|
host = "outlook.office365.com";
|
||||||
|
port = 993;
|
||||||
|
tls = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
smtp = {
|
||||||
|
host = "outlook.office365.com";
|
||||||
|
port = 587;
|
||||||
|
tls = {
|
||||||
|
enable = true;
|
||||||
|
useStartTls = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config.accounts.email.accounts = {
|
||||||
|
personal = lib.mkMerge [
|
||||||
|
# Common configuraton
|
||||||
|
(mkConfig {
|
||||||
|
domain = "belanyi.fr";
|
||||||
|
address = "bruno";
|
||||||
|
passName = "Migadu";
|
||||||
|
aliases = [ "admin" "postmaster" ];
|
||||||
|
primary = true; # This is my primary email
|
||||||
|
})
|
||||||
|
migaduConfig
|
||||||
|
];
|
||||||
|
|
||||||
|
gmail = lib.mkMerge [
|
||||||
|
# Common configuraton
|
||||||
|
(mkConfig {
|
||||||
|
domain = "gmail.com";
|
||||||
|
address = "brunobelanyi";
|
||||||
|
passName = "GMail";
|
||||||
|
})
|
||||||
|
gmailConfig
|
||||||
|
];
|
||||||
|
|
||||||
|
epita = lib.mkMerge [
|
||||||
|
# Common configuration
|
||||||
|
(mkConfig {
|
||||||
|
domain = "epita.fr";
|
||||||
|
address = "bruno.belanyi";
|
||||||
|
passName = "EPITA";
|
||||||
|
})
|
||||||
|
office365Config
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
31
home/mail/default.nix
Normal file
31
home/mail/default.nix
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.mail;
|
||||||
|
|
||||||
|
mkRelatedOption = desc: lib.mkEnableOption desc // { default = cfg.enable; };
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./accounts
|
||||||
|
./himalaya
|
||||||
|
./msmtp
|
||||||
|
];
|
||||||
|
|
||||||
|
options.my.home.mail = with lib; {
|
||||||
|
enable = my.mkDisableOption "email configuration";
|
||||||
|
|
||||||
|
himalaya = {
|
||||||
|
enable = mkRelatedOption "himalaya configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
msmtp = {
|
||||||
|
enable = mkRelatedOption "msmtp configuration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
accounts.email = {
|
||||||
|
maildirBasePath = "mail";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
23
home/mail/himalaya/default.nix
Normal file
23
home/mail/himalaya/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.mail.himalaya;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config.programs.himalaya = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
notify-cmd =
|
||||||
|
let
|
||||||
|
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||||
|
in
|
||||||
|
pkgs.writeScript "mail-notifier" ''
|
||||||
|
SENDER="$1"
|
||||||
|
SUBJECT="$2"
|
||||||
|
${notify-send} \
|
||||||
|
-c himalaya \
|
||||||
|
-- "$(printf 'Received email from %s\n\n%s' "$SENDER" "$SUBJECT")"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
9
home/mail/msmtp/default.nix
Normal file
9
home/mail/msmtp/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.mail.msmtp;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config.programs.msmtp = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
19
home/mpv/default.nix
Normal file
19
home/mpv/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.mpv;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.mpv = with lib; {
|
||||||
|
enable = mkEnableOption "mpv configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.mpv = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
scripts = [
|
||||||
|
pkgs.mpvScripts.mpris # Allow controlling using media keys
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
13
home/nix-index/default.nix
Normal file
13
home/nix-index/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.nix-index;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.nix-index = with lib.my; {
|
||||||
|
enable = mkDisableOption "nix-index configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config.programs.nix-index = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
13
home/nm-applet/default.nix
Normal file
13
home/nm-applet/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.nm-applet;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.nm-applet = with lib; {
|
||||||
|
enable = mkEnableOption "network-manager-applet configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config.services.network-manager-applet = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,20 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.my.home.packages;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.my.home.packages = with lib.my; {
|
|
||||||
enable = mkDisableOption "user packages";
|
|
||||||
};
|
|
||||||
|
|
||||||
config.home.packages = with pkgs; lib.mkIf cfg.enable [
|
|
||||||
# Git related
|
|
||||||
gitAndTools.git-absorb
|
|
||||||
gitAndTools.git-revise
|
|
||||||
gitAndTools.tig
|
|
||||||
# Dev work
|
|
||||||
rr
|
|
||||||
# Terminal prettiness
|
|
||||||
termite.terminfo
|
|
||||||
];
|
|
||||||
}
|
|
28
home/packages/default.nix
Normal file
28
home/packages/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.packages;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.packages = with lib; {
|
||||||
|
enable = my.mkDisableOption "user packages";
|
||||||
|
|
||||||
|
additionalPackages = mkOption {
|
||||||
|
type = with types; listOf package;
|
||||||
|
default = [ ];
|
||||||
|
example = literalExample ''
|
||||||
|
with pkgs; [
|
||||||
|
quasselClient
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config.home.packages = with pkgs; lib.mkIf cfg.enable ([
|
||||||
|
file
|
||||||
|
gitAndTools.git-absorb
|
||||||
|
gitAndTools.git-revise
|
||||||
|
gitAndTools.tig
|
||||||
|
rr
|
||||||
|
termite.terminfo
|
||||||
|
] ++ cfg.additionalPackages);
|
||||||
|
}
|
|
@ -1,18 +0,0 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.my.home.pager;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.my.home.pager = with lib.my; {
|
|
||||||
enable = mkDisableOption "pager configuration";
|
|
||||||
};
|
|
||||||
|
|
||||||
config.programs.lesspipe.enable = cfg.enable;
|
|
||||||
|
|
||||||
config.home.sessionVariables = lib.mkIf cfg.enable {
|
|
||||||
# My default pager
|
|
||||||
PAGER = "less";
|
|
||||||
# Clear the screen on start and exit
|
|
||||||
LESS = "-R -+X -c";
|
|
||||||
};
|
|
||||||
}
|
|
36
home/pager/default.nix
Normal file
36
home/pager/default.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.pager;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.pager = with lib.my; {
|
||||||
|
enable = mkDisableOption "pager configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.sessionVariables = {
|
||||||
|
# My default pager
|
||||||
|
PAGER = "less";
|
||||||
|
# Clear the screen on start and exit
|
||||||
|
LESS = "-R -+X -c";
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.zsh.localVariables = {
|
||||||
|
# Colored man pages
|
||||||
|
LESS_TERMCAP_mb = "$(tput bold; tput setaf 2)";
|
||||||
|
LESS_TERMCAP_md = "$(tput bold; tput setaf 6)";
|
||||||
|
LESS_TERMCAP_me = "$(tput sgr0)";
|
||||||
|
LESS_TERMCAP_so = "$(tput bold; tput setaf 3; tput setab 4)";
|
||||||
|
LESS_TERMCAP_se = "$(tput rmso; tput sgr0)";
|
||||||
|
LESS_TERMCAP_us = "$(tput bold; tput setaf 2)";
|
||||||
|
LESS_TERMCAP_ue = "$(tput rmul; tput sgr0)";
|
||||||
|
LESS_TERMCAP_mr = "$(tput rev)";
|
||||||
|
LESS_TERMCAP_mh = "$(tput dim)";
|
||||||
|
LESS_TERMCAP_ZN = "$(tput ssubm)";
|
||||||
|
LESS_TERMCAP_ZV = "$(tput rsubm)";
|
||||||
|
LESS_TERMCAP_ZO = "$(tput ssupm)";
|
||||||
|
LESS_TERMCAP_ZW = "$(tput rsupm)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
15
home/power-alert/default.nix
Normal file
15
home/power-alert/default.nix
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.power-alert;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.power-alert = with lib; {
|
||||||
|
enable = mkEnableOption "power-alert configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.poweralertd = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
3
home/secrets/.gitattributes
vendored
3
home/secrets/.gitattributes
vendored
|
@ -1,3 +0,0 @@
|
||||||
* filter=git-crypt diff=git-crypt
|
|
||||||
.gitattributes !filter !diff
|
|
||||||
/default.nix !filter !diff
|
|
Binary file not shown.
|
@ -1,19 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
|
||||||
canaryHash = builtins.hashFile "sha256" ./canary;
|
|
||||||
expectedHash =
|
|
||||||
"9df8c065663197b5a1095122d48e140d3677d860343256abd5ab6e4fb4c696ab";
|
|
||||||
in
|
|
||||||
if canaryHash != expectedHash then
|
|
||||||
abort "Secrets are not readable. Have you run `git-crypt unlock`?"
|
|
||||||
else {
|
|
||||||
options.my.secrets = mkOption {
|
|
||||||
type = types.attrs;
|
|
||||||
};
|
|
||||||
|
|
||||||
config.my.secrets = {
|
|
||||||
# Home-manager secrets go here
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -7,7 +7,7 @@ in
|
||||||
enable = mkDisableOption "ssh configuration";
|
enable = mkDisableOption "ssh configuration";
|
||||||
};
|
};
|
||||||
|
|
||||||
config.programs.ssh = {
|
config.programs.ssh = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
matchBlocks = {
|
matchBlocks = {
|
61
home/terminal/default.nix
Normal file
61
home/terminal/default.nix
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
mkColorOption = with lib; description: default: mkOption {
|
||||||
|
inherit description default;
|
||||||
|
example = "#abcdef";
|
||||||
|
type = types.strMatching "#[0-9a-f]{6}";
|
||||||
|
};
|
||||||
|
|
||||||
|
cfg = config.my.home.terminal;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./termite
|
||||||
|
];
|
||||||
|
|
||||||
|
options.my.home = with lib; {
|
||||||
|
terminal = {
|
||||||
|
program = mkOption {
|
||||||
|
type = with types; nullOr (enum [ "termite" ]);
|
||||||
|
default = null;
|
||||||
|
example = "termite";
|
||||||
|
description = "Which terminal to use for home session";
|
||||||
|
};
|
||||||
|
|
||||||
|
colors = {
|
||||||
|
background = mkColorOption "Background color" "#161616";
|
||||||
|
foreground = mkColorOption "Foreground color" "#ffffff";
|
||||||
|
foregroundBold = mkColorOption "Foreground bold color" "#ffffff";
|
||||||
|
cursor = mkColorOption "Cursor color" "#ffffff";
|
||||||
|
|
||||||
|
black = mkColorOption "Black" "#222222";
|
||||||
|
blackBold = mkColorOption "Black bold" "#666666";
|
||||||
|
|
||||||
|
red = mkColorOption "Red" "#e84f4f";
|
||||||
|
redBold = mkColorOption "Red bold" "#d23d3d";
|
||||||
|
|
||||||
|
green = mkColorOption "Green" "#b7ce42";
|
||||||
|
greenBold = mkColorOption "Green bold" "#bde077";
|
||||||
|
|
||||||
|
yellow = mkColorOption "Yellow" "#fea63c";
|
||||||
|
yellowBold = mkColorOption "Yellow bold" "#ffe863";
|
||||||
|
|
||||||
|
blue = mkColorOption "Blue" "#66aabb";
|
||||||
|
blueBold = mkColorOption "Blue bold" "#aaccbb";
|
||||||
|
|
||||||
|
magenta = mkColorOption "Magenta" "#b7416e";
|
||||||
|
magentaBold = mkColorOption "Magenta bold" "#e16a98";
|
||||||
|
|
||||||
|
cyan = mkColorOption "Cyan" "#6d878d";
|
||||||
|
cyanBold = mkColorOption "Cyan bold" "#42717b";
|
||||||
|
|
||||||
|
white = mkColorOption "White" "#dddddd";
|
||||||
|
whiteBold = mkColorOption "White bold" "#cccccc";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config.home.sessionVariables = lib.mkIf (cfg.program != null) {
|
||||||
|
TERMINAL = cfg.program;
|
||||||
|
};
|
||||||
|
}
|
53
home/terminal/termite/default.nix
Normal file
53
home/terminal/termite/default.nix
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.terminal;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf (cfg.program == "termite") {
|
||||||
|
programs.termite = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Niceties
|
||||||
|
browser = "${pkgs.xdg-utils}/bin/xdg-open";
|
||||||
|
clickableUrl = true;
|
||||||
|
dynamicTitle = true;
|
||||||
|
fullscreen = false;
|
||||||
|
mouseAutohide = true;
|
||||||
|
urgentOnBell = true;
|
||||||
|
|
||||||
|
# Look and feel
|
||||||
|
allowBold = true;
|
||||||
|
audibleBell = false;
|
||||||
|
cursorBlink = "system";
|
||||||
|
font = "Monospace 9";
|
||||||
|
scrollbar = "off";
|
||||||
|
|
||||||
|
|
||||||
|
# Colors
|
||||||
|
backgroundColor = cfg.colors.background;
|
||||||
|
cursorColor = cfg.colors.cursor;
|
||||||
|
foregroundColor = cfg.colors.foreground;
|
||||||
|
foregroundBoldColor = cfg.colors.foregroundBold;
|
||||||
|
colorsExtra = with cfg.colors; ''
|
||||||
|
# Normal colors
|
||||||
|
color0 = ${black}
|
||||||
|
color1 = ${red}
|
||||||
|
color2 = ${green}
|
||||||
|
color3 = ${yellow}
|
||||||
|
color4 = ${blue}
|
||||||
|
color5 = ${magenta}
|
||||||
|
color6 = ${cyan}
|
||||||
|
color7 = ${white}
|
||||||
|
# Bold colors
|
||||||
|
color8 = ${blackBold}
|
||||||
|
color9 = ${redBold}
|
||||||
|
color10 = ${greenBold}
|
||||||
|
color11 = ${yellowBold}
|
||||||
|
color12 = ${blueBold}
|
||||||
|
color13 = ${magentaBold}
|
||||||
|
color14 = ${cyanBold}
|
||||||
|
color15 = ${whiteBold}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -5,6 +5,10 @@ in
|
||||||
{
|
{
|
||||||
options.my.home.tmux = with lib.my; {
|
options.my.home.tmux = with lib.my; {
|
||||||
enable = mkDisableOption "tmux terminal multiplexer";
|
enable = mkDisableOption "tmux terminal multiplexer";
|
||||||
|
|
||||||
|
service = {
|
||||||
|
enable = mkDisableOption "tmux server service";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.programs.tmux = lib.mkIf cfg.enable {
|
config.programs.tmux = lib.mkIf cfg.enable {
|
||||||
|
@ -13,7 +17,7 @@ in
|
||||||
keyMode = "vi"; # Home-row keys and other niceties
|
keyMode = "vi"; # Home-row keys and other niceties
|
||||||
clock24 = true; # I'm one of those heathens
|
clock24 = true; # I'm one of those heathens
|
||||||
escapeTime = 0; # Let vim do its thing instead
|
escapeTime = 0; # Let vim do its thing instead
|
||||||
historyLimit = 5000; # Bigger buffer
|
historyLimit = 50000; # Bigger buffer
|
||||||
terminal = "tmux-256color"; # I want accurate termcap info
|
terminal = "tmux-256color"; # I want accurate termcap info
|
||||||
|
|
||||||
plugins = with pkgs.tmuxPlugins; [
|
plugins = with pkgs.tmuxPlugins; [
|
||||||
|
@ -44,4 +48,30 @@ in
|
||||||
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
|
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
config.systemd.user.services.tmux = lib.mkIf cfg.service.enable {
|
||||||
|
Unit = {
|
||||||
|
Description = "tmux server";
|
||||||
|
};
|
||||||
|
|
||||||
|
Install = {
|
||||||
|
WantedBy = [ "default.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Service =
|
||||||
|
let
|
||||||
|
# Wrap `tmux` in a login shell and set the socket path
|
||||||
|
tmuxCmd = "${config.programs.tmux.package}/bin/tmux";
|
||||||
|
socketExport = lib.optionalString
|
||||||
|
config.programs.tmux.secureSocket
|
||||||
|
''export TMUX_TMPDIR=''${XDG_RUNTIME_DIR:-"/run/user/\$(id -u)"};'';
|
||||||
|
mkTmuxCommand =
|
||||||
|
c: "${pkgs.runtimeShell} -l -c '${socketExport} ${tmuxCmd} ${c}'";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
Type = "forking";
|
||||||
|
ExecStart = mkTmuxCommand "new -d -s ambroisie";
|
||||||
|
ExecStop = mkTmuxCommand "kill-server";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
13
home/udiskie/default.nix
Normal file
13
home/udiskie/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.udiskie;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.udiskie = with lib; {
|
||||||
|
enable = mkEnableOption "udiskie configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config.services.udiskie = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -31,10 +31,7 @@ in
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
# Theming
|
# Theming
|
||||||
lightline-vim # Fancy status bar
|
lightline-vim # Fancy status bar
|
||||||
{
|
vim-gruvbox8 # Nice dark theme
|
||||||
plugin = onedark-vim; # Nice dark theme
|
|
||||||
optional = true; # Needs to be `packadd`-ed manually...
|
|
||||||
}
|
|
||||||
|
|
||||||
# tpope essentials
|
# tpope essentials
|
||||||
vim-commentary # Easy comments
|
vim-commentary # Easy comments
|
||||||
|
|
|
@ -68,10 +68,12 @@ set timeoutlen=500
|
||||||
" Set dark mode by default
|
" Set dark mode by default
|
||||||
set background=dark
|
set background=dark
|
||||||
|
|
||||||
" Load it manually because of autoload functions...
|
" Include plug-in integration
|
||||||
packadd! onedark-vim
|
let g:gruvbox_plugin_hi_groups=1
|
||||||
" Use onedark
|
" Include filetype integration
|
||||||
colorscheme onedark
|
let g:gruvbox_filetype_hi_groups=1
|
||||||
|
" Use my preferred colorscheme
|
||||||
|
colorscheme gruvbox8
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Search parameters {{{
|
" Search parameters {{{
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
let g:lightline={}
|
let g:lightline={}
|
||||||
|
|
||||||
" Use the wombat colorscheme
|
" Use the wombat colorscheme
|
||||||
let g:lightline.colorscheme='onedark'
|
let g:lightline.colorscheme='wombat'
|
||||||
|
|
||||||
" Status-line for active buffer
|
" Status-line for active buffer
|
||||||
let g:lightline.active={
|
let g:lightline.active={
|
||||||
|
|
87
home/wm/default.nix
Normal file
87
home/wm/default.nix
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
mkRelatedOption = description: relatedWMs:
|
||||||
|
let
|
||||||
|
isActivatedWm = wm: config.my.home.wm.windowManager == wm;
|
||||||
|
in
|
||||||
|
(lib.mkEnableOption description) // {
|
||||||
|
default = builtins.any isActivatedWm relatedWMs;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./dunst
|
||||||
|
./i3
|
||||||
|
./i3bar
|
||||||
|
./rofi
|
||||||
|
./screen-lock
|
||||||
|
];
|
||||||
|
|
||||||
|
options.my.home.wm = with lib; {
|
||||||
|
windowManager = mkOption {
|
||||||
|
type = with types; nullOr (enum [ "i3" ]);
|
||||||
|
default = null;
|
||||||
|
example = "i3";
|
||||||
|
description = "Which window manager to use for home session";
|
||||||
|
};
|
||||||
|
|
||||||
|
dunst = {
|
||||||
|
enable = mkRelatedOption "dunst configuration" [ "i3" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
i3bar = {
|
||||||
|
enable = mkRelatedOption "i3bar configuration" [ "i3" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
rofi = {
|
||||||
|
enable = mkRelatedOption "rofi menu" [ "i3" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
screen-lock = {
|
||||||
|
enable = mkRelatedOption "automatic X screen locker" [ "i3" ];
|
||||||
|
|
||||||
|
command = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "${pkgs.i3lock}/bin/i3lock -n -c 000000";
|
||||||
|
example = "\${pkgs.i3lock}/bin/i3lock -n -i lock.png";
|
||||||
|
description = "Locker command to run";
|
||||||
|
};
|
||||||
|
|
||||||
|
cornerLock = {
|
||||||
|
enable = my.mkDisableOption ''
|
||||||
|
Move mouse to upper-left corner to lock instantly, lower-right corner to
|
||||||
|
disable auto-lock.
|
||||||
|
'';
|
||||||
|
|
||||||
|
delay = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 5;
|
||||||
|
example = 15;
|
||||||
|
description = "How many seconds before locking this way";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
notify = {
|
||||||
|
enable = my.mkDisableOption "Notify when about to lock the screen";
|
||||||
|
|
||||||
|
delay = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 5;
|
||||||
|
example = 15;
|
||||||
|
description = ''
|
||||||
|
How many seconds in advance should there be a notification.
|
||||||
|
This value must be at lesser than or equal to `cornerLock.delay`
|
||||||
|
when both options are enabled.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
timeout = mkOption {
|
||||||
|
type = types.ints.between 1 60;
|
||||||
|
default = 5;
|
||||||
|
example = 1;
|
||||||
|
description = "Inactive time interval to lock the screen automatically";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
68
home/wm/dunst/default.nix
Normal file
68
home/wm/dunst/default.nix
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.wm.dunst;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.dunst = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
global = {
|
||||||
|
alignment = "center"; # Put message in the middle of the box
|
||||||
|
browser = "xdg-open"; # use default browser to open links
|
||||||
|
dmenu =
|
||||||
|
lib.mkIf
|
||||||
|
config.my.home.wm.rofi.enable
|
||||||
|
"rofi -p dunst -dmenu"; # use rofi for menu
|
||||||
|
follow = "keyboard"; # follow keyboard focus
|
||||||
|
font = "Monospace 8"; # Simple looking font
|
||||||
|
frame_width = 3; # small frame
|
||||||
|
geometry = "300x50-15+49";
|
||||||
|
markup = "full"; # subset of HTML
|
||||||
|
max_icon_size = 32; # avoid icons that are too big
|
||||||
|
padding = 6; # distance between text and bubble border
|
||||||
|
progress_bar = true; # show a progress bar in notification bubbles
|
||||||
|
separator_color = "frame"; # use frame color to separate bubbles
|
||||||
|
sort = true; # sort messages by urgency
|
||||||
|
word_wrap = true; # Break long lines to make them readable
|
||||||
|
};
|
||||||
|
|
||||||
|
urgency_low = {
|
||||||
|
background = "#191311";
|
||||||
|
foreground = "#3b7c87";
|
||||||
|
frame_color = "#3b7c87";
|
||||||
|
highlight = "#4998a6";
|
||||||
|
timeout = 10;
|
||||||
|
};
|
||||||
|
|
||||||
|
urgency_normal = {
|
||||||
|
background = "#191311";
|
||||||
|
foreground = "#5b8234";
|
||||||
|
frame_color = "#5b8234";
|
||||||
|
highlight = "#73a542";
|
||||||
|
timeout = 10;
|
||||||
|
};
|
||||||
|
|
||||||
|
urgency_critical = {
|
||||||
|
background = "#191311";
|
||||||
|
foreground = "#b7472a";
|
||||||
|
frame_color = "#b7472a";
|
||||||
|
highlight = "#d25637";
|
||||||
|
timeout = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
fullscreen_delay_everything = {
|
||||||
|
# delay notifications by default
|
||||||
|
fullscreen = "delay";
|
||||||
|
};
|
||||||
|
|
||||||
|
fullscreen_show_critical = {
|
||||||
|
# show critical notification
|
||||||
|
fullscreen = "show";
|
||||||
|
msg_urgency = "critical";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
373
home/wm/i3/default.nix
Normal file
373
home/wm/i3/default.nix
Normal file
|
@ -0,0 +1,373 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
isEnabled = config.my.home.wm.windowManager == "i3";
|
||||||
|
|
||||||
|
terminal =
|
||||||
|
if config.my.home.terminal.program != null
|
||||||
|
then config.my.home.terminal.program
|
||||||
|
else "i3-sensible-terminal";
|
||||||
|
|
||||||
|
alt = "Mod1"; # `Alt` key
|
||||||
|
modifier = "Mod4"; # `Super` key
|
||||||
|
movementKeys = [ "Left" "Down" "Up" "Right" ];
|
||||||
|
vimMovementKeys = [ "h" "j" "k" "l" ];
|
||||||
|
shutdownMode =
|
||||||
|
"(l)ock, (e)xit, switch_(u)ser, (h)ibernate, (r)eboot, (Shift+s)hutdown";
|
||||||
|
|
||||||
|
# Takes an attrset of bindings for movement keys, transforms it to Vim keys
|
||||||
|
toVimKeyBindings =
|
||||||
|
let
|
||||||
|
toVimKeys = builtins.replaceStrings movementKeys vimMovementKeys;
|
||||||
|
in
|
||||||
|
lib.my.renameAttrs toVimKeys;
|
||||||
|
|
||||||
|
# Takes an attrset of bindings for movement keys, add equivalent Vim keys
|
||||||
|
addVimKeyBindings = bindings: bindings // (toVimKeyBindings bindings);
|
||||||
|
# Generate an attrset of movement bindings, using the mapper function
|
||||||
|
genMovementBindings = f: addVimKeyBindings (lib.my.genAttrs' movementKeys f);
|
||||||
|
|
||||||
|
# Screen backlight management
|
||||||
|
changeBacklight =
|
||||||
|
let
|
||||||
|
brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl";
|
||||||
|
in
|
||||||
|
pkgs.writeScript "change-backlight" ''
|
||||||
|
#!/bin/sh
|
||||||
|
if [ "$1" = "up" ]; then
|
||||||
|
upDown="+$2%"
|
||||||
|
else
|
||||||
|
upDown="$2%-"
|
||||||
|
fi
|
||||||
|
|
||||||
|
newBrightness="$(${brightnessctl} -m set "$upDown" | cut -d, -f4)"
|
||||||
|
${pkgs.libnotify}/bin/notify-send -u low \
|
||||||
|
-h string:x-canonical-private-synchronous:change-backlight \
|
||||||
|
-h "int:value:''${newBrightness/\%/}" \
|
||||||
|
-- "Set brightness to $newBrightness"
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Lock management
|
||||||
|
toggleXautolock =
|
||||||
|
let
|
||||||
|
systemctlUser = "${pkgs.systemd}/bin/systemctl --user";
|
||||||
|
notify-send = "${pkgs.libnotify}/bin/notify-send";
|
||||||
|
notify = "${notify-send} -u low"
|
||||||
|
+ " -h string:x-canonical-private-synchronous:xautolock-toggle";
|
||||||
|
in
|
||||||
|
pkgs.writeScript "toggle-xautolock" ''
|
||||||
|
#!/bin/sh
|
||||||
|
if ${systemctlUser} is-active xautolock-session.service; then
|
||||||
|
${systemctlUser} stop --user xautolock-session.service
|
||||||
|
xset s off
|
||||||
|
${notify} "Disabled Xautolock"
|
||||||
|
else
|
||||||
|
${systemctlUser} start xautolock-session.service
|
||||||
|
xset s on
|
||||||
|
${notify} "Enabled Xautolock"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf isEnabled {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
ambroisie.i3-get-window-criteria # little helper for i3 configuration
|
||||||
|
arandr # Used by a mapping
|
||||||
|
pamixer # Used by a mapping
|
||||||
|
playerctl # Used by a mapping
|
||||||
|
];
|
||||||
|
|
||||||
|
xsession.windowManager.i3 = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
config = {
|
||||||
|
inherit modifier;
|
||||||
|
|
||||||
|
bars =
|
||||||
|
let
|
||||||
|
barConfigPath =
|
||||||
|
config.xdg.configFile."i3status-rust/config-top.toml".target;
|
||||||
|
in
|
||||||
|
[
|
||||||
|
{
|
||||||
|
statusCommand = "i3status-rs ${barConfigPath}";
|
||||||
|
trayOutput = "primary";
|
||||||
|
position = "top";
|
||||||
|
|
||||||
|
colors = {
|
||||||
|
background = "#021215";
|
||||||
|
statusline = "#93a1a1";
|
||||||
|
separator = "#2aa198";
|
||||||
|
|
||||||
|
focusedWorkspace = {
|
||||||
|
border = "#2aa198";
|
||||||
|
background = "#073642";
|
||||||
|
text = "#eee895";
|
||||||
|
};
|
||||||
|
|
||||||
|
activeWorkspace = {
|
||||||
|
border = "#073642";
|
||||||
|
background = "#002b36";
|
||||||
|
text = "#839496";
|
||||||
|
};
|
||||||
|
|
||||||
|
inactiveWorkspace = {
|
||||||
|
border = "#002b36";
|
||||||
|
background = "#021215";
|
||||||
|
text = "#586e75";
|
||||||
|
};
|
||||||
|
|
||||||
|
urgentWorkspace = {
|
||||||
|
border = "#cb4b16";
|
||||||
|
background = "#dc322f";
|
||||||
|
text = "#fdf6e3";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
fonts = {
|
||||||
|
names = [ "DejaVu Sans Mono" "FontAwesome5Free" ];
|
||||||
|
size = 8.0;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
floating = {
|
||||||
|
inherit modifier;
|
||||||
|
|
||||||
|
criteria = [
|
||||||
|
{ class = "^tridactyl_editor$"; }
|
||||||
|
{ class = "^Blueman-.*$"; }
|
||||||
|
{ title = "^htop$"; }
|
||||||
|
{ class = "^Thunderbird$"; instance = "Mailnews"; window_role = "filterlist"; }
|
||||||
|
{ class = "^Pavucontrol.*$"; }
|
||||||
|
{ class = "^Arandr$"; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
focus = {
|
||||||
|
followMouse = true; # It is annoying sometimes, but useful enough to use
|
||||||
|
mouseWarping = true; # Let's moving around when switching screens
|
||||||
|
};
|
||||||
|
|
||||||
|
fonts = {
|
||||||
|
names = [ "DejaVu Sans Mono" ];
|
||||||
|
size = 8.0;
|
||||||
|
};
|
||||||
|
|
||||||
|
# I don't care for i3's default values, I specify them all explicitly
|
||||||
|
keybindings = lib.my.recursiveMerge [
|
||||||
|
{
|
||||||
|
# The basics
|
||||||
|
"${modifier}+Return" = "exec ${terminal} ${
|
||||||
|
lib.optionalString config.my.home.tmux.enable "-e tmux new-session"
|
||||||
|
}";
|
||||||
|
"${modifier}+Shift+Return" = "exec env TMUX=nil ${terminal}";
|
||||||
|
"${modifier}+Shift+q" = "kill";
|
||||||
|
"${modifier}+f" = "fullscreen toggle";
|
||||||
|
"${modifier}+Shift+c" = "reload";
|
||||||
|
"${modifier}+Shift+r" = "restart";
|
||||||
|
"${modifier}+Shift+e" =
|
||||||
|
"exec i3-nagbar -t warning -m 'Do you want to exit i3?' -b 'Yes' 'i3-msg exit'";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Splits
|
||||||
|
"${modifier}+g" = "split h"; # Horizontally
|
||||||
|
"${modifier}+v" = "split v"; # Vertically
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Layouts
|
||||||
|
"${modifier}+s" = "layout stacking";
|
||||||
|
"${modifier}+w" = "layout tabbed";
|
||||||
|
"${modifier}+e" = "layout toggle split";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Toggle tiling/floating
|
||||||
|
"${modifier}+Control+space" = "floating toggle";
|
||||||
|
# Change focus between tiling/floating
|
||||||
|
"${modifier}+space" = "focus mode_toggle";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Focus parent container
|
||||||
|
"${modifier}+q" = "focus parent";
|
||||||
|
# Focus child container
|
||||||
|
"${modifier}+a" = "focus child";
|
||||||
|
}
|
||||||
|
(lib.optionalAttrs config.my.home.wm.rofi.enable {
|
||||||
|
# Rofi tools
|
||||||
|
"${modifier}+d" = "exec rofi -show drun -disable-history";
|
||||||
|
"${modifier}+Shift+d" = "exec rofi -show run -disable-history";
|
||||||
|
"${modifier}+p" = "exec --no-startup-id flameshot gui";
|
||||||
|
"${modifier}+Shift+p" = "exec rofi -show emoji";
|
||||||
|
})
|
||||||
|
(
|
||||||
|
# Changing container focus
|
||||||
|
genMovementBindings (
|
||||||
|
key: lib.nameValuePair
|
||||||
|
"${modifier}+${key}"
|
||||||
|
"focus ${lib.toLower key}"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(
|
||||||
|
# Changing screen focus
|
||||||
|
genMovementBindings (
|
||||||
|
key: lib.nameValuePair
|
||||||
|
"${modifier}+${alt}+${key}"
|
||||||
|
"focus output ${lib.toLower key}"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(
|
||||||
|
# Moving workspace to another screen
|
||||||
|
genMovementBindings (
|
||||||
|
key: lib.nameValuePair
|
||||||
|
"${modifier}+${alt}+Control+${key}"
|
||||||
|
"move workspace to output ${lib.toLower key}"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(
|
||||||
|
# Moving container to another screen
|
||||||
|
genMovementBindings (
|
||||||
|
key: lib.nameValuePair
|
||||||
|
"${modifier}+${alt}+Shift+${key}"
|
||||||
|
"move container to output ${lib.toLower key}"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(addVimKeyBindings {
|
||||||
|
# Scroll through workspaces on given screen
|
||||||
|
"${modifier}+Control+Left" = "workspace prev_on_output";
|
||||||
|
"${modifier}+Control+Right" = "workspace next_on_output";
|
||||||
|
# Use scratchpad
|
||||||
|
"${modifier}+Control+Up" = "move to scratchpad";
|
||||||
|
"${modifier}+Control+Down" = "scratchpad show";
|
||||||
|
})
|
||||||
|
(
|
||||||
|
# Moving floating window
|
||||||
|
genMovementBindings (
|
||||||
|
key: lib.nameValuePair
|
||||||
|
"${modifier}+Shift+${key}"
|
||||||
|
"move ${lib.toLower key} 10 px"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
# Media keys
|
||||||
|
"XF86AudioRaiseVolume" = "exec pamixer --allow-boost -i 5";
|
||||||
|
"XF86AudioLowerVolume" = "exec pamixer --allow-boost -d 5";
|
||||||
|
"Control+XF86AudioRaiseVolume" = "exec pamixer --allow-boost -i 1";
|
||||||
|
"Control+XF86AudioLowerVolume" = "exec pamixer --allow-boost -d 1";
|
||||||
|
"XF86AudioMute" = "exec pamixer --toggle-mute";
|
||||||
|
"XF86AudioMicMute" = "exec pamixer --default-source --toggle-mute";
|
||||||
|
|
||||||
|
"XF86AudioPlay" = "exec playerctl play-pause";
|
||||||
|
"XF86AudioNext" = "exec playerctl next";
|
||||||
|
"XF86AudioPrev" = "exec playerctl previous";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Screen management
|
||||||
|
"XF86Display" = "exec arandr";
|
||||||
|
"XF86MonBrightnessUp" = "exec ${changeBacklight} up 10";
|
||||||
|
"XF86MonBrightnessDown" = "exec ${changeBacklight} down 10";
|
||||||
|
"Control+XF86MonBrightnessUp" = "exec ${changeBacklight} up 1";
|
||||||
|
"Control+XF86MonBrightnessDown" = "exec ${changeBacklight} down 1";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
# Sub-modes
|
||||||
|
"${modifier}+r" = "mode resize";
|
||||||
|
"${modifier}+Shift+space" = "mode floating";
|
||||||
|
}
|
||||||
|
(lib.optionalAttrs config.my.home.wm.screen-lock.enable {
|
||||||
|
"${modifier}+x" = "exec ${toggleXautolock}";
|
||||||
|
})
|
||||||
|
(
|
||||||
|
let
|
||||||
|
execDunstctl = "exec ${pkgs.dunst}/bin/dunstctl";
|
||||||
|
in
|
||||||
|
lib.optionalAttrs config.my.home.wm.dunst.enable {
|
||||||
|
"${modifier}+minus" = "${execDunstctl} close";
|
||||||
|
"${modifier}+Shift+minus" = "${execDunstctl} close-all";
|
||||||
|
"${modifier}+equal" = "${execDunstctl} history-pop";
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
|
||||||
|
keycodebindings =
|
||||||
|
let
|
||||||
|
toKeycode = n: if n == 0 then 19 else n + 9;
|
||||||
|
createWorkspaceBindings = mapping: command:
|
||||||
|
let
|
||||||
|
createWorkspaceBinding = num:
|
||||||
|
lib.nameValuePair
|
||||||
|
"${mapping}+${toString (toKeycode num)}"
|
||||||
|
"${command} ${toString num}";
|
||||||
|
oneToNine = builtins.genList (x: x + 1) 9;
|
||||||
|
in
|
||||||
|
lib.my.genAttrs' oneToNine createWorkspaceBinding;
|
||||||
|
in
|
||||||
|
lib.my.recursiveMerge [
|
||||||
|
(createWorkspaceBindings modifier "workspace number")
|
||||||
|
(createWorkspaceBindings "${modifier}+Shift" "move container to workspace number")
|
||||||
|
{
|
||||||
|
"${modifier}+${toString (toKeycode 0)}" = ''mode "${shutdownMode}"'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
modes =
|
||||||
|
let
|
||||||
|
makeModeBindings = attrs: (addVimKeyBindings attrs) // {
|
||||||
|
"Escape" = "mode default";
|
||||||
|
"Return" = "mode default";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
resize = makeModeBindings {
|
||||||
|
# Normal movements
|
||||||
|
"Left" = "resize shrink width 10 px or 10 ppt";
|
||||||
|
"Down" = "resize grow height 10 px or 10 ppt";
|
||||||
|
"Up" = "resize shrink height 10 px or 10 ppt";
|
||||||
|
"Right" = "resize grow width 10 px or 10 ppt";
|
||||||
|
# Small movements
|
||||||
|
"Control+Left" = "resize shrink width 1 px or 1 ppt";
|
||||||
|
"Control+Down" = "resize grow height 1 px or 1 ppt";
|
||||||
|
"Control+Up" = "resize shrink height 1 px or 1 ppt";
|
||||||
|
"Control+Right" = "resize grow width 1 px or 1 ppt";
|
||||||
|
# Big movements
|
||||||
|
"Shift+Left" = "resize shrink width 100 px or 100 ppt";
|
||||||
|
"Shift+Down" = "resize grow height 100 px or 100 ppt";
|
||||||
|
"Shift+Up" = "resize shrink height 100 px or 100 ppt";
|
||||||
|
"Shift+Right" = "resize grow width 100 px or 100 ppt";
|
||||||
|
};
|
||||||
|
|
||||||
|
floating = makeModeBindings {
|
||||||
|
# Normal movements
|
||||||
|
"Left" = "move left 10 px";
|
||||||
|
"Down" = "move down 10 px";
|
||||||
|
"Up" = "move up 10 px";
|
||||||
|
"Right" = "move right 10 px";
|
||||||
|
# Small movements
|
||||||
|
"Control+Left" = "move left 1 px";
|
||||||
|
"Control+Down" = "move down 1 px";
|
||||||
|
"Control+Up" = "move up 1 px";
|
||||||
|
"Control+Right" = "move right 1 px";
|
||||||
|
# Big movements
|
||||||
|
"Shift+Left" = "move left 100 px";
|
||||||
|
"Shift+Down" = "move down 100 px";
|
||||||
|
"Shift+Up" = "move up 100 px";
|
||||||
|
"Shift+Right" = "move right 100 px";
|
||||||
|
};
|
||||||
|
|
||||||
|
${shutdownMode} = makeModeBindings {
|
||||||
|
"l" = "exec --no-startup-id loginctl lock-session, mode default";
|
||||||
|
"s" = "exec --no-startup-id systemctl suspend, mode default";
|
||||||
|
"u" = "exec --no-startup-id dm-tool switch-to-greeter, mode default";
|
||||||
|
"e" = "exec --no-startup-id i3-msg exit, mode default";
|
||||||
|
"h" = "exec --no-startup-id systemctl hibernate, mode default";
|
||||||
|
"r" = "exec --no-startup-id systemctl reboot, mode default";
|
||||||
|
"Shift+s" = "exec --no-startup-id systemctl poweroff, mode default";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
startup = [
|
||||||
|
# FIXME
|
||||||
|
# { commdand; always; notification; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
62
home/wm/i3bar/default.nix
Normal file
62
home/wm/i3bar/default.nix
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.wm.i3bar;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
alsaUtils # Used by `sound` block
|
||||||
|
lm_sensors # Used by `temperature` block
|
||||||
|
font-awesome # Icon font
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.i3status-rust = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
bars = {
|
||||||
|
top = {
|
||||||
|
icons = "awesome5";
|
||||||
|
|
||||||
|
blocks = builtins.filter (attr: attr != { }) [
|
||||||
|
{
|
||||||
|
block = "music";
|
||||||
|
buttons = [ "prev" "play" "next" ];
|
||||||
|
max_width = 50;
|
||||||
|
hide_when_empty = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "cpu";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "disk_space";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "net";
|
||||||
|
format = "{ssid} {ip} {signal_strength}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "backlight";
|
||||||
|
invert_icons = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "battery";
|
||||||
|
format = "{percentage} ({time})";
|
||||||
|
full_format = "{percentage}";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "temperature";
|
||||||
|
collapsed = false;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "sound";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
block = "time";
|
||||||
|
format = "%F %T";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
21
home/wm/rofi/default.nix
Normal file
21
home/wm/rofi/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.wm.rofi;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
programs.rofi = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
terminal = config.my.home.terminal.program; # null by default
|
||||||
|
|
||||||
|
package = pkgs.rofi.override {
|
||||||
|
plugins = with pkgs; [
|
||||||
|
rofi-emoji
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
theme = "gruvbox-dark-hard";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
54
home/wm/screen-lock/default.nix
Normal file
54
home/wm/screen-lock/default.nix
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.wm.screen-lock;
|
||||||
|
|
||||||
|
notficationCmd =
|
||||||
|
let
|
||||||
|
duration = toString (cfg.notify.delay * 1000);
|
||||||
|
notifyCmd = "${pkgs.libnotify}/bin/notify-send -u critical -t ${duration}";
|
||||||
|
in
|
||||||
|
# Needs to be surrounded by quotes for systemd to launch it correctly
|
||||||
|
''"${notifyCmd} -- 'Locking in ${toString cfg.notify.delay} seconds'"'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion =
|
||||||
|
let
|
||||||
|
inherit (cfg) cornerLock notify;
|
||||||
|
bothEnabled = cornerLock.enable && notify.enable;
|
||||||
|
cornerLockHigherThanNotify = cornerLock.delay >= notify.delay;
|
||||||
|
in
|
||||||
|
bothEnabled -> cornerLockHigherThanNotify;
|
||||||
|
message = ''
|
||||||
|
`config.my.home.wm.notify.delay` cannot have a value higher than
|
||||||
|
`config.my.home.wm.cornerLock.delay`.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
services.screen-locker = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
inactiveInterval = cfg.timeout;
|
||||||
|
|
||||||
|
lockCmd = cfg.command;
|
||||||
|
|
||||||
|
xautolockExtraOptions = lib.optionals cfg.cornerLock.enable [
|
||||||
|
# Mouse corners: instant lock on upper-left, never lock on lower-right
|
||||||
|
"-cornerdelay"
|
||||||
|
"${toString cfg.cornerLock.delay}"
|
||||||
|
"-cornerredelay"
|
||||||
|
"${toString cfg.cornerLock.delay}"
|
||||||
|
"-corners"
|
||||||
|
"+00-"
|
||||||
|
] ++ lib.optionals cfg.notify.enable [
|
||||||
|
"-notify"
|
||||||
|
"${toString cfg.notify.delay}"
|
||||||
|
"-notifier"
|
||||||
|
notficationCmd
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
12
home/x/cursor/default.nix
Normal file
12
home/x/cursor/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.x;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
xsession.pointerCursor = {
|
||||||
|
package = pkgs.ambroisie.vimix-cursors;
|
||||||
|
name = "Vimix-cursors";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
22
home/x/default.nix
Normal file
22
home/x/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.x;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./cursor
|
||||||
|
./keyboard
|
||||||
|
];
|
||||||
|
|
||||||
|
options.my.home.x = with lib; {
|
||||||
|
enable = mkEnableOption "X server configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
xsession.enable = true;
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
xsel
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
12
home/x/keyboard/default.nix
Normal file
12
home/x/keyboard/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.x;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home.keyboard = {
|
||||||
|
layout = "fr";
|
||||||
|
variant = "us";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -31,6 +31,7 @@ in
|
||||||
# A tidy home is a tidy mind
|
# A tidy home is a tidy mind
|
||||||
dataFile = {
|
dataFile = {
|
||||||
"bash/.keep".text = "";
|
"bash/.keep".text = "";
|
||||||
|
"gdb/.keep".text = "";
|
||||||
"tig/.keep".text = "";
|
"tig/.keep".text = "";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -39,6 +40,7 @@ in
|
||||||
config.home.sessionVariables = with config.xdg; lib.mkIf cfg.enable {
|
config.home.sessionVariables = with config.xdg; lib.mkIf cfg.enable {
|
||||||
CARGO_HOME = "${dataHome}/cargo";
|
CARGO_HOME = "${dataHome}/cargo";
|
||||||
DOCKER_CONFIG = "${configHome}/docker";
|
DOCKER_CONFIG = "${configHome}/docker";
|
||||||
|
GDBHISTFILE = "${dataHome}/gdb/gdb_history";
|
||||||
HISTFILE = "${dataHome}/bash/history";
|
HISTFILE = "${dataHome}/bash/history";
|
||||||
INPUTRC = "${configHome}/readline/inputrc";
|
INPUTRC = "${configHome}/readline/inputrc";
|
||||||
LESSHISTFILE = "${dataHome}/less/history";
|
LESSHISTFILE = "${dataHome}/less/history";
|
20
home/zathura/default.nix
Normal file
20
home/zathura/default.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.zathura;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.zathura = with lib; {
|
||||||
|
enable = mkEnableOption "zathura configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config.programs.zathura = lib.mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
options = {
|
||||||
|
# Show '~' instead of full path to '$HOME' in window title
|
||||||
|
"window-title-home-tilde" = true;
|
||||||
|
# Show '~' instead of full path to '$HOME' in status bar
|
||||||
|
"statusbar-home-tilde" = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -13,10 +13,12 @@ in
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
|
|
||||||
history = {
|
history = {
|
||||||
size = 50000;
|
size = 500000;
|
||||||
|
save = 500000;
|
||||||
|
extended = false;
|
||||||
ignoreSpace = true;
|
ignoreSpace = true;
|
||||||
ignoreDups = true;
|
ignoreDups = true;
|
||||||
share = true;
|
share = false;
|
||||||
path = "${config.xdg.dataHome}/zsh/zsh_history";
|
path = "${config.xdg.dataHome}/zsh/zsh_history";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -44,6 +46,16 @@ in
|
||||||
# Modal editing is life, but CLI benefits from emacs gymnastics
|
# Modal editing is life, but CLI benefits from emacs gymnastics
|
||||||
defaultKeymap = "emacs";
|
defaultKeymap = "emacs";
|
||||||
|
|
||||||
|
# Make those happen early to avoid doing double the work
|
||||||
|
initExtraFirst =
|
||||||
|
lib.optionalString config.my.home.tmux.enable ''
|
||||||
|
# Launch tmux unless already inside one
|
||||||
|
if [ -z "$TMUX" ]; then
|
||||||
|
exec tmux new-session
|
||||||
|
fi
|
||||||
|
''
|
||||||
|
;
|
||||||
|
|
||||||
initExtra = lib.concatMapStrings builtins.readFile [
|
initExtra = lib.concatMapStrings builtins.readFile [
|
||||||
./completion-styles.zsh
|
./completion-styles.zsh
|
||||||
./extra-mappings.zsh
|
./extra-mappings.zsh
|
||||||
|
@ -65,6 +77,12 @@ in
|
||||||
# Sometime `gpg-agent` errors out...
|
# Sometime `gpg-agent` errors out...
|
||||||
reset-agent = "gpg-connect-agent updatestartuptty /bye";
|
reset-agent = "gpg-connect-agent updatestartuptty /bye";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Enable VTE integration when using one of the affected shells
|
||||||
|
enableVteIntegration =
|
||||||
|
builtins.any (name: config.my.home.terminal.program == name) [
|
||||||
|
"termite"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Fuzzy-wuzzy
|
# Fuzzy-wuzzy
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Fix delete key not working
|
# Fix delete key not working
|
||||||
bindkey "\e[3~" delete-char
|
bindkey "\e[3~" delete-char
|
||||||
|
|
||||||
# Fix Ctrl+u killing from the cursor instead of the whole line
|
# Fix Ctrl+u killing from the cursor instead of the whole line
|
||||||
|
|
|
@ -8,5 +8,9 @@ setopt autopushd pushdminus pushdsilent
|
||||||
setopt rcquotes
|
setopt rcquotes
|
||||||
# Single word commands can resume an existing job
|
# Single word commands can resume an existing job
|
||||||
setopt autoresume
|
setopt autoresume
|
||||||
|
# Append commands to history as they are exectuted
|
||||||
|
setopt inc_append_history_time
|
||||||
|
# Remove useless whitespace from commands
|
||||||
|
setopt hist_reduce_blanks
|
||||||
# Those options aren't wanted
|
# Those options aren't wanted
|
||||||
unsetopt beep extendedglob notify
|
unsetopt beep extendedglob notify
|
||||||
|
|
|
@ -1,7 +1,50 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib) filterAttrs mapAttrs';
|
inherit (lib)
|
||||||
|
filterAttrs
|
||||||
|
foldl
|
||||||
|
listToAttrs
|
||||||
|
mapAttrs'
|
||||||
|
nameValuePair
|
||||||
|
recursiveUpdate
|
||||||
|
;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
# Filter a generated set of attrs using a predicate function.
|
||||||
|
#
|
||||||
|
# mapFilterAttrs ::
|
||||||
|
# (name -> value -> bool)
|
||||||
|
# (name -> value -> { name = any; value = any; })
|
||||||
|
# attrs
|
||||||
mapFilterAttrs = pred: f: attrs: filterAttrs pred (mapAttrs' f attrs);
|
mapFilterAttrs = pred: f: attrs: filterAttrs pred (mapAttrs' f attrs);
|
||||||
|
|
||||||
|
# Generate an attribute set by mapping a function over a list of values.
|
||||||
|
#
|
||||||
|
# genAttrs' ::
|
||||||
|
# [ values ]
|
||||||
|
# (value -> { name = any; value = any; })
|
||||||
|
# attrs
|
||||||
|
genAttrs' = values: f: listToAttrs (map f values);
|
||||||
|
|
||||||
|
# Merge a list of attrs recursively, later values override previous ones.
|
||||||
|
#
|
||||||
|
# recursiveMerge ::
|
||||||
|
# [ attrs ]
|
||||||
|
# attrs
|
||||||
|
recursiveMerge = foldl recursiveUpdate { };
|
||||||
|
|
||||||
|
# Rename each of the attributes in an attribute set using the mapping function
|
||||||
|
#
|
||||||
|
# renameAttrs ::
|
||||||
|
# (name -> new name)
|
||||||
|
# attrs
|
||||||
|
renameAttrs = f: mapAttrs' (name: value: nameValuePair (f name) value);
|
||||||
|
|
||||||
|
# Rename each of the attributes in an attribute set using a function which
|
||||||
|
# takes the attribute's name and value as inputs.
|
||||||
|
#
|
||||||
|
# renameAttrs' ::
|
||||||
|
# (name -> value -> new name)
|
||||||
|
# attrs
|
||||||
|
renameAttrs' = f: mapAttrs' (name: value: nameValuePair (f name value) value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,7 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
mylib = makeExtensible (self:
|
mylib = makeExtensible (self:
|
||||||
with self; mapModules ./.
|
mapModules ./. (file: import file { inherit self lib pkgs inputs; })
|
||||||
(file: import file { inherit self lib pkgs inputs; })
|
|
||||||
);
|
);
|
||||||
in
|
in
|
||||||
mylib.extend (self: super:
|
mylib.extend (self: super:
|
||||||
|
|
27
lib/lists.nix
Normal file
27
lib/lists.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (lib) filter foldl';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# Count the number of appararitions of each value in a list.
|
||||||
|
#
|
||||||
|
# countValues ::
|
||||||
|
# [ any ] -> ({ any = int; })
|
||||||
|
countValues =
|
||||||
|
let
|
||||||
|
addToCount = acc: x:
|
||||||
|
let
|
||||||
|
v = toString x;
|
||||||
|
in
|
||||||
|
acc // { ${v} = (acc.${v} or 0) + 1; };
|
||||||
|
in
|
||||||
|
foldl' addToCount { };
|
||||||
|
|
||||||
|
# Filter a list using a predicate function after applying a map.
|
||||||
|
#
|
||||||
|
# mapFilter ::
|
||||||
|
# (value -> bool)
|
||||||
|
# (any -> value)
|
||||||
|
# [ any ]
|
||||||
|
mapFilter = pred: f: attrs: filter pred (map f attrs);
|
||||||
|
}
|
|
@ -3,21 +3,48 @@ let
|
||||||
inherit (builtins) readDir pathExists;
|
inherit (builtins) readDir pathExists;
|
||||||
inherit (lib) hasPrefix hasSuffix nameValuePair removeSuffix;
|
inherit (lib) hasPrefix hasSuffix nameValuePair removeSuffix;
|
||||||
inherit (self.attrs) mapFilterAttrs;
|
inherit (self.attrs) mapFilterAttrs;
|
||||||
|
|
||||||
|
implOptionalRecursion = recurse:
|
||||||
|
let
|
||||||
|
recurseStep =
|
||||||
|
if recurse
|
||||||
|
then (n: path: fn: nameValuePair n (impl path fn))
|
||||||
|
else (_: _: _: nameValuePair "" null);
|
||||||
|
impl = dir: fn:
|
||||||
|
mapFilterAttrs
|
||||||
|
(n: _: n != "" && !(hasPrefix "_" n))
|
||||||
|
(n: v:
|
||||||
|
let
|
||||||
|
path = "${toString dir}/${n}";
|
||||||
|
in
|
||||||
|
if v == "directory"
|
||||||
|
then
|
||||||
|
if pathExists "${path}/default.nix"
|
||||||
|
then nameValuePair n (fn path)
|
||||||
|
else recurseStep n path fn
|
||||||
|
else if v == "regular" && n != "default.nix" && hasSuffix ".nix" n
|
||||||
|
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
||||||
|
else nameValuePair "" null)
|
||||||
|
(readDir dir);
|
||||||
|
in
|
||||||
|
impl;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
mapModules = dir: fn:
|
# Find all nix modules in a directory, discard any prefixed with "_",
|
||||||
mapFilterAttrs
|
# map a function to each resulting path, and generate an attribute set
|
||||||
(n: v:
|
# to associate module name to resulting value.
|
||||||
v != null &&
|
#
|
||||||
!(hasPrefix "_" n))
|
# mapModules ::
|
||||||
(n: v:
|
# path
|
||||||
let path = "${toString dir}/${n}"; in
|
# (path -> any)
|
||||||
if v == "directory" && pathExists "${path}/default.nix"
|
# attrs
|
||||||
then nameValuePair n (fn path)
|
mapModules = implOptionalRecursion false;
|
||||||
else if v == "regular" &&
|
|
||||||
n != "default.nix" &&
|
# Recursive version of mapModules.
|
||||||
hasSuffix ".nix" n
|
#
|
||||||
then nameValuePair (removeSuffix ".nix" n) (fn path)
|
# mapModulesRec ::
|
||||||
else nameValuePair "" null)
|
# path
|
||||||
(readDir dir);
|
# (path -> any)
|
||||||
|
# attrs
|
||||||
|
mapModulesRec = implOptionalRecursion true;
|
||||||
}
|
}
|
||||||
|
|
32
machines/aramis/boot.nix
Normal file
32
machines/aramis/boot.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
initrd = {
|
||||||
|
availableKernelModules = [
|
||||||
|
"nvme"
|
||||||
|
"sd_mod"
|
||||||
|
"sdhci_pci"
|
||||||
|
"usb_storage"
|
||||||
|
"usbhid"
|
||||||
|
"xhci_pci"
|
||||||
|
];
|
||||||
|
kernelModules = [
|
||||||
|
"dm-snapshot"
|
||||||
|
];
|
||||||
|
luks.devices.crypt = {
|
||||||
|
device = "/dev/nvme0n1p1";
|
||||||
|
preLVM = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
kernelModules = [
|
||||||
|
"kvm-intel"
|
||||||
|
];
|
||||||
|
extraModulePackages = [ ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,18 +1,27 @@
|
||||||
# Porthos self-hosted server
|
# Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ ... }:
|
{ ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# Include generic settings
|
./boot.nix
|
||||||
./modules
|
./hardware.nix
|
||||||
# Include porthos-specific modules
|
./home.nix
|
||||||
./machines/porthos
|
./networking.nix
|
||||||
# Include my secrets
|
./profiles.nix
|
||||||
./secrets
|
./programs.nix
|
||||||
# Include my services
|
./services.nix
|
||||||
./services
|
./sound.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "Europe/Paris";
|
||||||
|
|
||||||
|
# Enable CUPS to print documents.
|
||||||
|
services.printing.enable = true;
|
||||||
|
|
||||||
# This value determines the NixOS release from which the default
|
# This value determines the NixOS release from which the default
|
||||||
# settings for stateful data, like file locations and database versions
|
# settings for stateful data, like file locations and database versions
|
||||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
34
machines/aramis/hardware.nix
Normal file
34
machines/aramis/hardware.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
{ lib, modulesPath, ... }:
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/disk/by-label/nixos";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
"/boot" = {
|
||||||
|
device = "/dev/disk/by-label/boot";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [
|
||||||
|
{ device = "/dev/disk/by-label/swap"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
|
|
||||||
|
hardware = {
|
||||||
|
cpu.intel.updateMicrocode = true;
|
||||||
|
|
||||||
|
trackpoint = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
emulateWheel = true; # Holding middle buttons allows scrolling
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
28
machines/aramis/home.nix
Normal file
28
machines/aramis/home.nix
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
my.home = {
|
||||||
|
# Image viewver
|
||||||
|
feh.enable = true;
|
||||||
|
# Firefo profile and extensions
|
||||||
|
firefox.enable = true;
|
||||||
|
# Blue light filter
|
||||||
|
gammastep.enable = true;
|
||||||
|
# Use a small popup to enter passwords
|
||||||
|
gpg.pinentry = "gtk2";
|
||||||
|
# Machine specific packages
|
||||||
|
packages.additionalPackages = with pkgs; [
|
||||||
|
jellyfin-media-player # Wraps the webui and mpv together
|
||||||
|
pavucontrol # Audio mixer GUI
|
||||||
|
quasselClient # IRC client
|
||||||
|
transgui # Transmission remote
|
||||||
|
];
|
||||||
|
# Minimal video player
|
||||||
|
mpv.enable = true;
|
||||||
|
# Network-Manager applet
|
||||||
|
nm-applet.enable = true;
|
||||||
|
# Termite terminal
|
||||||
|
terminal.program = "termite";
|
||||||
|
# Zathura document viewer
|
||||||
|
zathura.enable = true;
|
||||||
|
};
|
||||||
|
}
|
53
machines/aramis/install.sh
Executable file
53
machines/aramis/install.sh
Executable file
|
@ -0,0 +1,53 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
if [ "$(id -u)" -ne 0 ]; then
|
||||||
|
echo "This script must be run as root" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
SWAP_SIZE=16GiB
|
||||||
|
|
||||||
|
parted /dev/nvme0n1 --script -- \
|
||||||
|
mklabel gpt \
|
||||||
|
mkpart primary 512MiB 100% \
|
||||||
|
mkpart ESP fat32 1MiB 512MiB \
|
||||||
|
set 2 esp on
|
||||||
|
|
||||||
|
cryptsetup luksFormat /dev/nvme0n1p1
|
||||||
|
cryptsetup open /dev/nvme0n1p1 crypt
|
||||||
|
|
||||||
|
pvcreate /dev/mapper/crypt
|
||||||
|
vgcreate lvm /dev/mapper/crypt
|
||||||
|
lvcreate -L "$SWAP_SIZE" -n swap lvm
|
||||||
|
lvcreate -l 100%FREE -n root lvm
|
||||||
|
|
||||||
|
mkfs.ext4 -L nixos /dev/lvm/root
|
||||||
|
mkswap -L swap /dev/lvm/swap
|
||||||
|
mkfs.vfat -n boot /dev/nvme0n1p2
|
||||||
|
|
||||||
|
mount /dev/disk/by-label/nixos /mnt
|
||||||
|
mkdir /mnt/boot
|
||||||
|
mount /dev/nvme0n1p2 /mnt/boot
|
||||||
|
swapon /dev/lvm/swap
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
# Run the following commands as setup user
|
||||||
|
nixos-generate-config --root /mnt
|
||||||
|
|
||||||
|
# Change uuids to labels
|
||||||
|
vim /mnt/etc/nixos/hardware-configuration.nix
|
||||||
|
|
||||||
|
# Install system
|
||||||
|
mkdir -p /mnt/home/ambroisie/git/nix/config
|
||||||
|
cd /mnt/home/ambroisie/git/nix/config
|
||||||
|
|
||||||
|
git clone <this-repo> .
|
||||||
|
# Assuming you set up GPG key correctly
|
||||||
|
git crypt unlock
|
||||||
|
|
||||||
|
# Setup LUKS with 'boot.initrd.luks.devices.crypt', device is /dev/nvme0n1p1, preLVM = true
|
||||||
|
|
||||||
|
# Use 'nixos-install --flake .#aramis --root /mnt --impure' because of home-manager issue
|
||||||
|
EOF
|
25
machines/aramis/networking.nix
Normal file
25
machines/aramis/networking.nix
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
networking = {
|
||||||
|
hostName = "aramis";
|
||||||
|
domain = "nodomain.local"; # FIXME: gotta fix domain handling
|
||||||
|
|
||||||
|
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
||||||
|
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
||||||
|
# replicates the default behaviour.
|
||||||
|
useDHCP = false;
|
||||||
|
|
||||||
|
interfaces = {
|
||||||
|
enp0s31f6.useDHCP = true;
|
||||||
|
wlp0s20f3.useDHCP = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
my.hardware.networking = {
|
||||||
|
# Which interface is used to connect to the internet
|
||||||
|
externalInterface = "enp0s3";
|
||||||
|
|
||||||
|
# Enable WiFi integration
|
||||||
|
wireless.enable = true;
|
||||||
|
};
|
||||||
|
}
|
17
machines/aramis/profiles.nix
Normal file
17
machines/aramis/profiles.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
my.profiles = {
|
||||||
|
# Bluetooth configuration and GUI
|
||||||
|
bluetooth.enable = true;
|
||||||
|
# Mouse and keyboard configuration
|
||||||
|
devices.enable = true;
|
||||||
|
# GTK theme configuration
|
||||||
|
gtk.enable = true;
|
||||||
|
# Laptop specific configuration
|
||||||
|
laptop.enable = true;
|
||||||
|
# i3 configuration
|
||||||
|
wm.windowManager = "i3";
|
||||||
|
# X configuration
|
||||||
|
x.enable = true;
|
||||||
|
};
|
||||||
|
}
|
7
machines/aramis/programs.nix
Normal file
7
machines/aramis/programs.nix
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
my.programs = {
|
||||||
|
# Steam configuration
|
||||||
|
steam.enable = true;
|
||||||
|
};
|
||||||
|
}
|
8
machines/aramis/services.nix
Normal file
8
machines/aramis/services.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
config.my.services = {
|
||||||
|
wireguard = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
8
machines/aramis/sound.nix
Normal file
8
machines/aramis/sound.nix
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
my.hardware.sound = {
|
||||||
|
pipewire = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -9,4 +9,15 @@
|
||||||
./services.nix
|
./services.nix
|
||||||
./users.nix
|
./users.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Set your time zone.
|
||||||
|
time.timeZone = "Europe/Paris";
|
||||||
|
|
||||||
|
# This value determines the NixOS release from which the default
|
||||||
|
# settings for stateful data, like file locations and database versions
|
||||||
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||||
|
# this value at the release version of the first install of this system.
|
||||||
|
# Before changing this value read the documentation for this option
|
||||||
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||||
|
system.stateVersion = "20.09"; # Did you read the comment?
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,5 +31,5 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
# Which interface is used to connect to the internet
|
# Which interface is used to connect to the internet
|
||||||
my.networking.externalInterface = "eth0";
|
my.hardware.networking.externalInterface = "eth0";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Deployed services
|
# Deployed services
|
||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
let
|
let
|
||||||
my = config.my;
|
secrets = config.age.secrets;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# List services that you want to enable:
|
# List services that you want to enable:
|
||||||
|
@ -19,11 +19,8 @@ in
|
||||||
OnActiveSec = "6h";
|
OnActiveSec = "6h";
|
||||||
OnUnitActiveSec = "6h";
|
OnUnitActiveSec = "6h";
|
||||||
};
|
};
|
||||||
# Insecure, I don't care.
|
passwordFile = secrets."backup/password".path;
|
||||||
passwordFile =
|
credentialsFile = secrets."backup/credentials".path;
|
||||||
builtins.toFile "password.txt" my.secrets.backup.password;
|
|
||||||
credentialsFile =
|
|
||||||
builtins.toFile "creds.env" my.secrets.backup.credentials;
|
|
||||||
};
|
};
|
||||||
# My blog and related hosts
|
# My blog and related hosts
|
||||||
blog.enable = true;
|
blog.enable = true;
|
||||||
|
@ -34,11 +31,12 @@ in
|
||||||
drone = {
|
drone = {
|
||||||
enable = true;
|
enable = true;
|
||||||
runners = [ "docker" "exec" ];
|
runners = [ "docker" "exec" ];
|
||||||
# Insecure, I don't care.
|
secretFile = secrets."drone/gitea".path;
|
||||||
secretFile =
|
sharedSecretFile = secrets."drone/secret".path;
|
||||||
builtins.toFile "gitea.env" my.secrets.drone.gitea;
|
};
|
||||||
sharedSecretFile =
|
# Flood UI for transmission
|
||||||
builtins.toFile "rpc.env" my.secrets.drone.secret;
|
flood = {
|
||||||
|
enable = true;
|
||||||
};
|
};
|
||||||
# Gitea forge
|
# Gitea forge
|
||||||
gitea.enable = true;
|
gitea.enable = true;
|
||||||
|
@ -52,36 +50,66 @@ in
|
||||||
# Gitea mirrorig service
|
# Gitea mirrorig service
|
||||||
lohr = {
|
lohr = {
|
||||||
enable = true;
|
enable = true;
|
||||||
sharedSecretFile =
|
sharedSecretFile = secrets."lohr/secret".path;
|
||||||
let
|
|
||||||
content = "LOHR_SECRET=${my.secrets.lohr.secret}";
|
|
||||||
in
|
|
||||||
builtins.toFile "lohr-secret.env" content;
|
|
||||||
};
|
};
|
||||||
# Matrix backend and Element chat front-end
|
# Matrix backend and Element chat front-end
|
||||||
matrix = {
|
matrix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
secret = my.secrets.matrix.secret;
|
mailConfigFile = secrets."matrix/mail".path;
|
||||||
|
# Only necessary when doing the initial registration
|
||||||
|
# secret = "change-me";
|
||||||
};
|
};
|
||||||
miniflux = {
|
miniflux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
password = my.secrets.miniflux.password;
|
credentialsFiles = secrets."miniflux/credentials".path;
|
||||||
|
};
|
||||||
|
# Various monitoring dashboards
|
||||||
|
monitoring = {
|
||||||
|
enable = true;
|
||||||
|
grafana = {
|
||||||
|
passwordFile = secrets."monitoring/password".path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# FLOSS music streaming server
|
||||||
|
navidrome = {
|
||||||
|
enable = true;
|
||||||
|
musicFolder = "/data/media/music";
|
||||||
};
|
};
|
||||||
# Nextcloud self-hosted cloud
|
# Nextcloud self-hosted cloud
|
||||||
nextcloud = {
|
nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
password = my.secrets.nextcloud.password;
|
passwordFile = secrets."nextcloud/password".path;
|
||||||
|
};
|
||||||
|
nginx = {
|
||||||
|
enable = true;
|
||||||
|
acme = {
|
||||||
|
credentialsFile = secrets."acme/dns-key".path;
|
||||||
|
};
|
||||||
|
sso = {
|
||||||
|
authKeyFile = secrets."sso/auth-key".path;
|
||||||
|
users = {
|
||||||
|
ambroisie = {
|
||||||
|
passwordHashFile = secrets."sso/ambroisie/password-hash".path;
|
||||||
|
totpSecretFile = secrets."sso/ambroisie/totp-secret".path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
groups = {
|
||||||
|
root = [ "ambroisie" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
paperless = {
|
||||||
|
enable = true;
|
||||||
|
documentPath = "/data/media/paperless";
|
||||||
|
passwordFile = secrets."paperless/password".path;
|
||||||
|
secretKeyFile = secrets."paperless/secret-key".path;
|
||||||
};
|
};
|
||||||
# The whole *arr software suite
|
# The whole *arr software suite
|
||||||
pirate.enable = true;
|
pirate.enable = true;
|
||||||
# Podcast automatic downloader
|
# Podcast automatic downloader
|
||||||
podgrab = {
|
podgrab = {
|
||||||
enable = true;
|
enable = true;
|
||||||
passwordFile =
|
passwordFile = secrets."podgrab/password".path;
|
||||||
let
|
|
||||||
contents = "PASSWORD=${my.secrets.podgrab.password}";
|
|
||||||
in
|
|
||||||
builtins.toFile "podgrab.env" contents;
|
|
||||||
port = 9598;
|
port = 9598;
|
||||||
};
|
};
|
||||||
# Regular backups
|
# Regular backups
|
||||||
|
@ -97,8 +125,7 @@ in
|
||||||
# Torrent client and webui
|
# Torrent client and webui
|
||||||
transmission = {
|
transmission = {
|
||||||
enable = true;
|
enable = true;
|
||||||
username = "Ambroisie";
|
credentialsFile = secrets."transmission/credentials".path;
|
||||||
password = my.secrets.transmission.password;
|
|
||||||
};
|
};
|
||||||
# Simple, in-kernel VPN
|
# Simple, in-kernel VPN
|
||||||
wireguard = {
|
wireguard = {
|
||||||
|
@ -106,9 +133,4 @@ in
|
||||||
startAtBoot = true; # Server must be started to ensure clients can connect
|
startAtBoot = true; # Server must be started to ensure clients can connect
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.gnupg.agent = {
|
|
||||||
enable = true;
|
|
||||||
enableSSHSupport = true;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
1
machines/porthos/ssh/drone.pub
Normal file
1
machines/porthos/ssh/drone.pub
Normal file
|
@ -0,0 +1 @@
|
||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDWVUvOT1/triPcj7wiLAmiVkPZ71crySbReetHaGxMYYdKNFurJQsP6BqsdCAwrGbduLUDJovLtjOM7SxghjkGqh2RZucj/zqpja8YoFqYTcLutlqa1NwUqQTq21azKBDSdvkBPWWyZhOKssnag+0bZRN3vVajoDrwAU6zJLhHh9eNESTEytAnZnllXsHB1dKF1p7FWVwYTGAc1PdHHSQNMkjg9aCM+VBzTHhp8nF+GOtGzt0A0XnoZGdhn6KqhKyH7KxwPMmeD3RNeCEmQY/TXjthOx/mBkgTEa8LWOBxdy/Rs6edUenvPcQ5tK5nX0GSxxqtbORlhT+tGiqq1UHeIUhXirBUaS7pnDo+Edc0m8ruLcwHwyQ5yVn2ts3daKxb87+PyjYiRxxeQXvbF84ef7ZOkLTEn0tnftFHLqszBfOjoV1DmMNSWPDULD3krObzNbr1I0xHE7bDRXw2t8L1cwHOLHTL9KwsTCw1d25JSxINp2wAZxlGVZLXoXVMKTjfx1xSGbUuRzA1Q6+1IH9WDvSSixDzvc2Dqnj91/xardivApK+T+OxTBurwWsxzEezIAbTCpoKW9ulzu06xWGWhxATkzUmVh/qhFUHAVlmhEvn0KqlYbWteEcUxgKS1uSAoA6+pZh5NMG1u1hLEktBQbDnS0VdyKYBUHZidLuR4w== ambroisie@porthos
|
|
@ -10,6 +10,6 @@ in
|
||||||
group = "nginx";
|
group = "nginx";
|
||||||
createHome = false; # Messes with permissions
|
createHome = false; # Messes with permissions
|
||||||
home = "/var/www/";
|
home = "/var/www/";
|
||||||
openssh.authorizedKeys.keys = [ my.secrets.drone.ssh.publicKey ];
|
openssh.authorizedKeys.keyFiles = [ ./ssh/drone.pub ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,28 @@
|
||||||
# Common modules
|
# Common modules
|
||||||
{ ... }:
|
{ lib, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./documentation.nix
|
./hardware
|
||||||
./ergodox.nix
|
./home
|
||||||
./language.nix
|
./programs
|
||||||
./media.nix
|
./secrets
|
||||||
./networking.nix
|
./services
|
||||||
./nix.nix
|
./system
|
||||||
./packages.nix
|
|
||||||
./users.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
options.my = with lib; {
|
||||||
|
user = {
|
||||||
|
name = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "ambroisie";
|
||||||
|
example = "alice";
|
||||||
|
description = "my username";
|
||||||
|
};
|
||||||
|
|
||||||
|
home = {
|
||||||
|
enable = my.mkDisableOption "home-manager configuration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.my.module.documentation;
|
|
||||||
|
|
||||||
# I usually want everything enabled at once, but keep it customizable
|
|
||||||
defaultToGlobal = description: lib.mkEnableOption description // {
|
|
||||||
default = cfg.enable;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.my.module.documentation = with lib.my; {
|
|
||||||
enable = mkDisableOption "Documentation integration";
|
|
||||||
|
|
||||||
dev.enable = defaultToGlobal "Documentation aimed at developers";
|
|
||||||
|
|
||||||
info.enable = defaultToGlobal "Documentation aimed at developers";
|
|
||||||
|
|
||||||
man.enable = defaultToGlobal "Documentation aimed at developers";
|
|
||||||
|
|
||||||
nixos.enable = defaultToGlobal "NixOS documentation";
|
|
||||||
};
|
|
||||||
|
|
||||||
config.documentation = {
|
|
||||||
enable = cfg.enable;
|
|
||||||
|
|
||||||
dev.enable = cfg.dev.enable;
|
|
||||||
|
|
||||||
info.enable = cfg.info.enable;
|
|
||||||
|
|
||||||
man = {
|
|
||||||
enable = cfg.man.enable;
|
|
||||||
generateCaches = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixos.enable = cfg.nixos.enable;
|
|
||||||
};
|
|
||||||
}
|
|
75
modules/hardware/bluetooth/default.nix
Normal file
75
modules/hardware/bluetooth/default.nix
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.hardware.bluetooth;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.hardware.bluetooth = with lib; {
|
||||||
|
enable = mkEnableOption "bluetooth configuration";
|
||||||
|
|
||||||
|
enableHeadsetIntegration = my.mkDisableOption "A2DP sink configuration";
|
||||||
|
|
||||||
|
loadExtraCodecs = my.mkDisableOption "extra audio codecs";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
|
# Enable bluetooth devices and GUI to connect to them
|
||||||
|
{
|
||||||
|
hardware.bluetooth.enable = true;
|
||||||
|
services.blueman.enable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Support for additional bluetooth codecs
|
||||||
|
(lib.mkIf cfg.loadExtraCodecs {
|
||||||
|
hardware.pulseaudio = {
|
||||||
|
extraModules = [ pkgs.pulseaudio-modules-bt ];
|
||||||
|
package = pkgs.pulseaudioFull;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.pipewire = {
|
||||||
|
media-session.config.bluez-monitor.rules = [
|
||||||
|
{
|
||||||
|
# Matches all cards
|
||||||
|
matches = [{ "device.name" = "~bluez_card.*"; }];
|
||||||
|
actions = {
|
||||||
|
"update-props" = {
|
||||||
|
"bluez5.reconnect-profiles" = [
|
||||||
|
"hfp_hf"
|
||||||
|
"hsp_hs"
|
||||||
|
"a2dp_sink"
|
||||||
|
];
|
||||||
|
# mSBC provides better audio + microphone
|
||||||
|
"bluez5.msbc-support" = true;
|
||||||
|
# SBC XQ provides better audio
|
||||||
|
"bluez5.sbc-xq-support" = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
matches = [
|
||||||
|
# Matches all sources
|
||||||
|
{
|
||||||
|
"node.name" = "~bluez_input.*";
|
||||||
|
}
|
||||||
|
# Matches all outputs
|
||||||
|
{
|
||||||
|
"node.name" = "~bluez_output.*";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
actions = {
|
||||||
|
"node.pause-on-idle" = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
|
# Support for A2DP audio profile
|
||||||
|
(lib.mkIf cfg.enableHeadsetIntegration {
|
||||||
|
hardware.bluetooth.settings = {
|
||||||
|
General = {
|
||||||
|
Enable = "Source,Sink,Media,Socket";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
13
modules/hardware/default.nix
Normal file
13
modules/hardware/default.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# Hardware-related modules
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./bluetooth
|
||||||
|
./ergodox
|
||||||
|
./mx-ergo
|
||||||
|
./networking
|
||||||
|
./sound
|
||||||
|
./upower
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,16 +1,14 @@
|
||||||
# ZSA keyboard udev rules
|
# ZSA keyboard udev rules
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.my.modules.ergodox;
|
cfg = config.my.hardware.ergodox;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.modules.ergodox = with lib; {
|
options.my.hardware.ergodox = with lib; {
|
||||||
enable = mkEnableOption "ZSA udev rules and user group configuration";
|
enable = mkEnableOption "ZSA udev rules and user group configuration";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
hardware.keyboard.zsa.enable = true;
|
hardware.keyboard.zsa.enable = true;
|
||||||
|
|
||||||
users.extraGroups = [ "plugdev" ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
26
modules/hardware/mx-ergo/default.nix
Normal file
26
modules/hardware/mx-ergo/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# Hold down the `next page` button to scroll using the ball
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.hardware.mx-ergo;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.hardware.mx-ergo = with lib; {
|
||||||
|
enable = mkEnableOption "MX Ergo configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.xserver = {
|
||||||
|
# This section must be *after* the one configured by `libinput`
|
||||||
|
# for the `ScrollMethod` configuration to not be overriden
|
||||||
|
inputClassSections = lib.mkAfter [
|
||||||
|
''
|
||||||
|
Identifier "MX Ergo scroll button configuration"
|
||||||
|
MatchProduct "MX Ergo"
|
||||||
|
MatchIsPointer "on"
|
||||||
|
Option "ScrollMethod" "button"
|
||||||
|
Option "ScrollButton" "9"
|
||||||
|
''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
27
modules/hardware/networking/default.nix
Normal file
27
modules/hardware/networking/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.hardware.networking;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.hardware.networking = with lib; {
|
||||||
|
externalInterface = mkOption {
|
||||||
|
type = types.nullOr types.str;
|
||||||
|
default = null;
|
||||||
|
example = "eth0";
|
||||||
|
description = ''
|
||||||
|
Name of the network interface that egresses to the internet. Used for
|
||||||
|
e.g. NATing internal networks.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
wireless = {
|
||||||
|
enable = mkEnableOption "wireless configuration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf cfg.wireless.enable {
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
}
|
67
modules/hardware/sound/default.nix
Normal file
67
modules/hardware/sound/default.nix
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.hardware.sound;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.hardware.sound = with lib; {
|
||||||
|
pipewire = {
|
||||||
|
enable = mkEnableOption "pipewire configuration";
|
||||||
|
};
|
||||||
|
|
||||||
|
pulse = {
|
||||||
|
enable = mkEnableOption "pulseaudio configuration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = (lib.mkMerge [
|
||||||
|
# Sanity check
|
||||||
|
{
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
assertion = builtins.all (lib.id) [
|
||||||
|
(cfg.pipewire.enable -> !cfg.pulse.enable)
|
||||||
|
(cfg.pulse.enable -> !cfg.pipewire.enable)
|
||||||
|
];
|
||||||
|
message = ''
|
||||||
|
`config.my.hardware.sound.pipewire.enable` and
|
||||||
|
`config.my.hardware.sound.pulse.enable` are incompatible.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
(lib.mkIf cfg.pipewire.enable {
|
||||||
|
# RealtimeKit is recommended
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
|
||||||
|
services.pipewire = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
alsa = {
|
||||||
|
enable = true;
|
||||||
|
support32Bit = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
pulse = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
jack = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
media-session = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
|
# Pulseaudio setup
|
||||||
|
(lib.mkIf cfg.pulse.enable {
|
||||||
|
# ALSA
|
||||||
|
sound.enable = true;
|
||||||
|
|
||||||
|
hardware.pulseaudio.enable = true;
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
}
|
44
modules/hardware/upower/default.nix
Normal file
44
modules/hardware/upower/default.nix
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.hardware.upower;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.hardware.upower = with lib; {
|
||||||
|
enable = mkEnableOption "upower configuration";
|
||||||
|
|
||||||
|
levels = {
|
||||||
|
low = mkOption {
|
||||||
|
type = types.ints.unsigned;
|
||||||
|
default = 25;
|
||||||
|
example = 10;
|
||||||
|
description = "Low percentage";
|
||||||
|
};
|
||||||
|
|
||||||
|
critical = mkOption {
|
||||||
|
type = types.ints.unsigned;
|
||||||
|
default = 15;
|
||||||
|
example = 5;
|
||||||
|
description = "Critical percentage";
|
||||||
|
};
|
||||||
|
|
||||||
|
action = mkOption {
|
||||||
|
type = types.ints.unsigned;
|
||||||
|
default = 5;
|
||||||
|
example = 3;
|
||||||
|
description = "Percentage at which point an action must be taken";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.upower = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
percentageLow = cfg.levels.low;
|
||||||
|
|
||||||
|
percentageCritical = cfg.levels.critical;
|
||||||
|
|
||||||
|
percentageAction = cfg.levels.action;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
24
modules/home/default.nix
Normal file
24
modules/home/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ config, inputs, lib, ... }:
|
||||||
|
let
|
||||||
|
actualPath = [ "home-manager" "users" config.my.user.name "my" "home" ];
|
||||||
|
aliasPath = [ "my" "home" ];
|
||||||
|
|
||||||
|
cfg = config.my.user.home;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
inputs.home-manager.nixosModule # enable home-manager options
|
||||||
|
(lib.mkAliasOptionModule aliasPath actualPath) # simplify setting home options
|
||||||
|
];
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
home-manager = {
|
||||||
|
# Not a fan of out-of-directory imports, but this is a good exception
|
||||||
|
users.${config.my.user.name} = import ../../home;
|
||||||
|
|
||||||
|
# Nix Flakes compatibility
|
||||||
|
useGlobalPkgs = true;
|
||||||
|
useUserPackages = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,7 +0,0 @@
|
||||||
# Language settings
|
|
||||||
{ ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# Select internationalisation properties.
|
|
||||||
i18n.defaultLocale = "en_US.UTF-8";
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
# Abstracting away the need for a common 'media' group
|
|
||||||
|
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
mediaServices = with config.my.services; [
|
|
||||||
calibre-web
|
|
||||||
jellyfin
|
|
||||||
pirate
|
|
||||||
sabnzbd
|
|
||||||
transmission
|
|
||||||
];
|
|
||||||
needed = builtins.any (service: service.enable) mediaServices;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
config.users.groups.media = lib.mkIf needed { };
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
options.my.networking.externalInterface = with lib; mkOption {
|
|
||||||
type = types.nullOr types.str;
|
|
||||||
default = null;
|
|
||||||
example = "eth0";
|
|
||||||
description = ''
|
|
||||||
Name of the network interface that egresses to the internet. Used for
|
|
||||||
e.g. NATing internal networks.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
# Nix related settings
|
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
nix = {
|
|
||||||
package = pkgs.nixFlakes;
|
|
||||||
extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,19 +0,0 @@
|
||||||
# Common packages
|
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# List packages installed in system profile. To search, run:
|
|
||||||
# $ nix search wget
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
git
|
|
||||||
git-crypt
|
|
||||||
mosh
|
|
||||||
vim
|
|
||||||
wget
|
|
||||||
];
|
|
||||||
|
|
||||||
programs.vim.defaultEditor = true; # Modal editing is life
|
|
||||||
programs.zsh.enable = true; # Use integrations
|
|
||||||
|
|
||||||
nixpkgs.config.allowUnfree = true; # Because I don't care *that* much.
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue