Compare commits
377 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e3a17925f2 | |||
| c170e251ac | |||
| ec1747707b | |||
| 56f2abc737 | |||
| cb6f46aea8 | |||
| dfab5ddacc | |||
| 0e2faec44f | |||
| 88671c40e7 | |||
| 9f59301a0e | |||
| d13a353921 | |||
| 989989ecc6 | |||
| 0a66a3b0a3 | |||
| be036118ca | |||
| 601fcafd31 | |||
| 087d38487c | |||
| b0e481a1f1 | |||
| 1ca7607814 | |||
| 59ea29a7ab | |||
| 486a3b343c | |||
| 3b7772712e | |||
| 37b34beca4 | |||
| ef60e7bf91 | |||
| 05bfd2df13 | |||
| 9d00eb39f9 | |||
| 30a9619f2c | |||
| da2ab6f86b | |||
| 7c61a58808 | |||
| 67c62534e8 | |||
| 26dc7bb149 | |||
| a1120fd930 | |||
| 13c72a8256 | |||
| 0322de2622 | |||
| d9be6f9213 | |||
| b977203d15 | |||
| db4e3b5fdd | |||
| a1f4764526 | |||
| 0996ec71e9 | |||
| 2e8d068070 | |||
| ee606e5518 | |||
| 440eb287ed | |||
| ee9828151c | |||
| 0b6bafb39c | |||
| df570294b4 | |||
| 5e0c7e90ff | |||
| ada780afc8 | |||
| d624ab4323 | |||
| f2dfb10c1b | |||
| f10666ff7c | |||
| a378fa3d60 | |||
| dfefa53e6b | |||
| 09a6af9d36 | |||
| 1172968a93 | |||
| 6d2ba3f0c1 | |||
| 262988949c | |||
| f5a745f37e | |||
| 02b6079198 | |||
| c645d31dd3 | |||
| 32a6789f44 | |||
| f173808e10 | |||
| 7ba80d4458 | |||
| e63a1a92e8 | |||
| 90cb0f987b | |||
| bfd05251f2 | |||
| 13b70df944 | |||
| a0c6965438 | |||
| e36daaa48c | |||
| ca239579d5 | |||
| d34d2adb42 | |||
| cc80f0e885 | |||
| 737603403a | |||
| 05a94aae60 | |||
| b02b7c0af8 | |||
| 24cd473387 | |||
| f6630bc6e0 | |||
| 417e6658dc | |||
| f626371732 | |||
| d318e35a93 | |||
| 7ddac56e17 | |||
| b060b69114 | |||
| 12f3032d8d | |||
| bbd300422b | |||
| b2d19ee218 | |||
| f5c1148c94 | |||
| f682523804 | |||
| b635efba09 | |||
| bd474f798e | |||
| 1575e50fea | |||
| ae851875a9 | |||
| 24630c5e5d | |||
| ae35522d11 | |||
| 6634eb7cb0 | |||
| d0568b9f19 | |||
| 803992635f | |||
| 9dbf2293ce | |||
| bc9b29f62b | |||
| 7347bcb842 | |||
| cc9dfa7940 | |||
| 0db7703857 | |||
| c8e84fbc36 | |||
| d3553ae104 | |||
| 9c5a1b12ef | |||
| d282a3b0b6 | |||
| 62487cc5ca | |||
| f81c62dc0a | |||
| f02f673012 | |||
| 0be942efe2 | |||
| 9f91849707 | |||
| 1cdf80adff | |||
| 8be00a52c8 | |||
| eb5c35d670 | |||
| d00d8cd43b | |||
| b4ea5aa354 | |||
| 8a9af081fc | |||
| ef86bc96f6 | |||
| 289888aa50 | |||
| 5b1b79a760 | |||
| c60388668c | |||
| 9c3e4bea8d | |||
| 2f6d1aa482 | |||
| c5267e7932 | |||
| 08baea2e22 | |||
| 356ed4bfdc | |||
| 3799aa0c90 | |||
| 28779f60ea | |||
| d0a9bdd002 | |||
| 0ee541c9e4 | |||
| e1baf45441 | |||
| e6c1b945f3 | |||
| 0efb7dfba1 | |||
| 4760e508be | |||
| 682346a66a | |||
| 0fac56f612 | |||
| 270d43251f | |||
| c3cf8138f8 | |||
| 7ccccfc84c | |||
| e39b79c508 | |||
| 664506b6cb | |||
| a946ff7cce | |||
| 99819c1df5 | |||
| c515ea9807 | |||
| 7ce3e9a391 | |||
| f61271a323 | |||
| 4a988dbce7 | |||
| 79a866a287 | |||
| bd53ef65ec | |||
| 804bf99e74 | |||
| 6e7fa3e223 | |||
| 508a45d801 | |||
| 7c9cb5156f | |||
| 08d8c4cbc5 | |||
| 7dc0adee72 | |||
| d61b27bcb5 | |||
| 0030a41a8f | |||
| 66fa46afb6 | |||
| 26da19ba38 | |||
| 81a4104973 | |||
| 6b55dfca46 | |||
| b3676ccbe6 | |||
| 71af10ff3b | |||
| a99adf065d | |||
| 2485f24fcc | |||
| 777d915cd2 | |||
| 5df740ca6e | |||
| dd27f9eaeb | |||
| d370d96f47 | |||
| 1e98f591f5 | |||
| 5e2bec4ac5 | |||
| 0c30883e22 | |||
| c9a42f1a13 | |||
| a9c123d9d4 | |||
| e4c9e863cf | |||
| 2970073d5e | |||
| 8bef422482 | |||
| 6247cecf0b | |||
| 721e74845a | |||
| 349ff8b5a1 | |||
| 4cf9b16faf | |||
| 8fc95549bf | |||
| f2dbaba802 | |||
| 538c81ca47 | |||
| 32161dd090 | |||
| a310ab4d4a | |||
| bc290e371b | |||
| b407453836 | |||
| 6ff9c397c8 | |||
| 033d50c738 | |||
| 7dc223a77e | |||
| c472654934 | |||
| 189a3a4689 | |||
| 1f0040a9dd | |||
| 5d8615cdb0 | |||
| 2f96ab5464 | |||
| c8bd133e49 | |||
| 5778d72dd4 | |||
| 01285af535 | |||
| e1cd93d6d1 | |||
| 714c45f5f9 | |||
| 87df015862 | |||
| c09091fa25 | |||
| 8b4a0a7055 | |||
| 78319f4ef6 | |||
| f66e73c5a6 | |||
| cf9d5acd95 | |||
| 98fed47741 | |||
| ed57391eb0 | |||
| fc4a44c023 | |||
| c158f17c63 | |||
| e61bd9ae14 | |||
| 4f6b899643 | |||
| 5d2cf3e5dd | |||
| befddfe476 | |||
| 204cb03922 | |||
| eebbb9f5e6 | |||
| ad76bb3451 | |||
| 0564357a9c | |||
| b44672d16c | |||
| 1164bebee4 | |||
| 29129215a5 | |||
| bc08dc1949 | |||
| 6e825eef7f | |||
| 6ae4d4ba80 | |||
| c34911ba26 | |||
| 82819ff091 | |||
| 12ef055135 | |||
| 5beb15c165 | |||
| cf6584ea71 | |||
| 3bbe86cb55 | |||
| 18c6e79d0c | |||
| 6fbefd0a67 | |||
| d502490bf6 | |||
| 3f6b5b321a | |||
| 2d06846467 | |||
| baac168826 | |||
| 78e5053ae5 | |||
| 25ac706450 | |||
| edff2bdc6c | |||
| 337f67109e | |||
| 450389400a | |||
| f52d604d42 | |||
| d12e3b979a | |||
| 7b482f8cfa | |||
| de1bc12b1b | |||
| a6fb453c9e | |||
| 32429619ab | |||
| cc6e5ea071 | |||
| ba29d32d80 | |||
| 0f08976902 | |||
| b3ac7784ca | |||
| b271e43df4 | |||
| 3dff682ceb | |||
| 8d05c3a204 | |||
| 887825d254 | |||
| 8061e07a00 | |||
| fa1cf24af5 | |||
| 1ab318b6db | |||
| 59493d03fa | |||
| c06504032c | |||
| cf80c7549e | |||
| e6b7e24a36 | |||
| 1b5a415d7a | |||
| 95d9cd0a27 | |||
| cca05de49b | |||
| fa9f23751c | |||
| cf33721ec1 | |||
| 52c72bd45d | |||
| c6e736d64b | |||
| c90d1c0208 | |||
| 5ed0ece058 | |||
| 8684376b98 | |||
| 03cee6582f | |||
| 86291af053 | |||
| 54bb672d9e | |||
| f34bf79884 | |||
| db9ebd5ffd | |||
| 64e384c18a | |||
| 1e325739b1 | |||
| 2bf5d295d4 | |||
| 040d8a210c | |||
| df63bce926 | |||
| b5707d8457 | |||
| cd4ed3679c | |||
| 55b6aadf00 | |||
| 849ecfd6b7 | |||
| ca60e962f0 | |||
| 7bf52e7a75 | |||
| 872caa0407 | |||
| 580a08841f | |||
| ff6442e588 | |||
| 271846703f | |||
| 298affd460 | |||
| d718c8084a | |||
| 39d35091d6 | |||
| cf9b184c9f | |||
| 4abe5d7b8d | |||
| 54ebad9151 | |||
| 3234d0db2e | |||
| c9b5a1d39b | |||
| fc8d43982b | |||
| c4a47b9e53 | |||
| 34182f3e45 | |||
| 87de22fec4 | |||
| 787010ac34 | |||
| 874a1ab939 | |||
| 95df12c59e | |||
| 25c0938a64 | |||
| 5731b52d3c | |||
| c7d88c1f57 | |||
| 678016e391 | |||
| e14d6f8405 | |||
| 588cbabbc2 | |||
| 7cc49c29f1 | |||
| 21b3d4ad37 | |||
| b6629a38a1 | |||
| a88afaaab3 | |||
| 2acda6e977 | |||
| d1dd9bfdd6 | |||
| 027d819860 | |||
| 7e02cc8566 | |||
| bacc1bf9cd | |||
| 6e7815ce22 | |||
| 0193f84847 | |||
| bb2c967981 | |||
| 8d24a094bf | |||
| cb0dc30c7e | |||
| 190d409992 | |||
| acd7f8308c | |||
| 4af3fa88dd | |||
| e90d2eca1e | |||
| 462f671a76 | |||
| 5d2371dda4 | |||
| 379032a40b | |||
| 65b5146dcb | |||
| 4c53b59e89 | |||
| 9bd5cac675 | |||
| 2e65d0aa03 | |||
| afc74dcf68 | |||
| e7e3d0040a | |||
| 14c174890e | |||
| dd472488b6 | |||
| ec4d00509e | |||
| aa0c789b6e | |||
| 016115faa5 | |||
| f6ade7c612 | |||
| 0bfd154437 | |||
| 9a752121ba | |||
| 3ea707245b | |||
| e31ae3f553 | |||
| c38db38207 | |||
| 6b364e19de | |||
| dae0504f5c | |||
| d53ed4ef7e | |||
| 530f8498a1 | |||
| ef3c903582 | |||
| 8314b91324 | |||
| ccd4752d04 | |||
| 1bfeeacf2f | |||
| bfac95b71e | |||
| b91508af5f | |||
| e51486a796 | |||
| 897af2712f | |||
| ed5b4d121c | |||
| 45a7973553 | |||
| a5f0922ba7 | |||
| 792a7e7bfc | |||
| 8f512eb0bd | |||
| 4936c0c46e | |||
| fe54e220e4 | |||
| 0c5b01b5f0 | |||
| 0024dff048 | |||
| 7c42d4d950 | |||
| dc0fc97cb9 | |||
| 86114a4db1 | |||
| 24ef3ed105 | |||
| be437c3417 | |||
| e2e75407c9 | |||
| b99f77e0de | |||
| 909409ff29 |
@@ -0,0 +1,2 @@
|
|||||||
|
patreon: ryan4yin
|
||||||
|
custom: ['https://buymeacoffee.com/ryan4yin', 'https://afdian.net/a/ryan4yin']
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
name: Mirror this repo to Gitee
|
||||||
|
on:
|
||||||
|
workflow_dispatch: {}
|
||||||
|
push: {}
|
||||||
|
jobs:
|
||||||
|
mirror:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Mirror repo to Gitee
|
||||||
|
id: mirror-to-gitee
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
INPUT_SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY_GITEE_MIRROR }}
|
||||||
|
INPUT_TARGET_REPO_URL: git@gitee.com:ryan_yin/nix-config.git
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
echo "$INPUT_SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
|
||||||
|
chmod 600 ~/.ssh/id_rsa
|
||||||
|
|
||||||
|
export GIT_SSH_COMMAND="ssh -v -i ~/.ssh/id_rsa -o StrictHostKeyChecking=no"
|
||||||
|
git remote add mirror "$INPUT_TARGET_REPO_URL"
|
||||||
|
git push --tags --force --prune mirror "refs/remotes/origin/*:refs/heads/*"
|
||||||
|
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
result
|
result
|
||||||
result/
|
result/
|
||||||
|
.DS_Store
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2023 Ryan Yin
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -1,12 +1,35 @@
|
|||||||
deploy:
|
#
|
||||||
sudo nixos-rebuild switch --flake .
|
# NOTE: Makefile's target name should not be the same as one of the file or directory in the current directory,
|
||||||
|
# otherwise the target will not be executed!
|
||||||
|
#
|
||||||
|
|
||||||
debug:
|
|
||||||
sudo nixos-rebuild switch --flake . --show-trace --verbose
|
|
||||||
|
|
||||||
update:
|
############################################################################
|
||||||
|
#
|
||||||
|
# Nix commands related to the local machine
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
i3:
|
||||||
|
nixos-rebuild switch --flake .#ai_i3 --use-remote-sudo
|
||||||
|
|
||||||
|
hypr:
|
||||||
|
nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo
|
||||||
|
|
||||||
|
i3-debug:
|
||||||
|
nixos-rebuild switch --flake .#ai_i3 --use-remote-sudo --show-trace --verbose
|
||||||
|
|
||||||
|
hypr-debug:
|
||||||
|
nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo --show-trace --verbose
|
||||||
|
|
||||||
|
up:
|
||||||
nix flake update
|
nix flake update
|
||||||
|
|
||||||
|
# Update specific input
|
||||||
|
# usage: make upp i=wallpapers
|
||||||
|
upp:
|
||||||
|
nix flake lock --update-input $(i)
|
||||||
|
|
||||||
history:
|
history:
|
||||||
nix profile history --profile /nix/var/nix/profiles/system
|
nix profile history --profile /nix/var/nix/profiles/system
|
||||||
|
|
||||||
@@ -14,23 +37,110 @@ gc:
|
|||||||
# remove all generations older than 7 days
|
# remove all generations older than 7 days
|
||||||
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
|
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
|
||||||
|
|
||||||
# garbage collect all unused nix store entries older than 14 days
|
# garbage collect all unused nix store entries
|
||||||
sudo nix store gc --debug
|
sudo nix store gc --debug
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# Darwin related commands, harmonica is my macbook pro's hostname
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
darwin-set-proxy:
|
darwin-set-proxy:
|
||||||
sudo python3 scripts/darwin_set_proxy.py
|
echo "skip setting proxy, use global proxy instead"
|
||||||
|
# sudo python3 scripts/darwin_set_proxy.py
|
||||||
|
|
||||||
darwin: darwin-set-proxy
|
ha: darwin-set-proxy
|
||||||
nix build .#darwinConfigurations.harmonica.system \
|
nix build .#darwinConfigurations.harmonica.system
|
||||||
--extra-experimental-features 'nix-command flakes'
|
|
||||||
./result/sw/bin/darwin-rebuild switch --flake .
|
./result/sw/bin/darwin-rebuild switch --flake .
|
||||||
|
sleep 3
|
||||||
|
sudo chmod 644 /etc/agenix/alias-for-work.*
|
||||||
|
|
||||||
darwin-debug: darwin-set-proxy
|
ha-debug: darwin-set-proxy
|
||||||
nix build .#darwinConfigurations.harmonica.system \
|
nix build .#darwinConfigurations.harmonica.system --show-trace --verbose
|
||||||
--show-trace --verbose \
|
./result/sw/bin/darwin-rebuild switch --flake .#harmonica --show-trace --verbose
|
||||||
--extra-experimental-features 'nix-command flakes'
|
sleep 3
|
||||||
./result/sw/bin/darwin-rebuild switch --flake . --show-trace --verbose
|
sudo chmod 644 /etc/agenix/alias-for-work.*
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# Idols, Commands related to my remote distributed building cluster
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
add-idols-ssh-key:
|
||||||
|
ssh-add ~/.ssh/ai-idols
|
||||||
|
|
||||||
|
idols: add-idols-ssh-key
|
||||||
|
colmena apply --on '@dist-build'
|
||||||
|
|
||||||
|
aqua:
|
||||||
|
colmena apply --on '@aqua'
|
||||||
|
|
||||||
|
ruby:
|
||||||
|
colmena apply --on '@ruby'
|
||||||
|
|
||||||
|
kana:
|
||||||
|
colmena apply --on '@kana'
|
||||||
|
|
||||||
|
idols-debug: add-idols-ssh-key
|
||||||
|
colmena apply --on '@dist-build' --verbose --show-trace
|
||||||
|
|
||||||
|
# only used once to setup the virtual machines
|
||||||
|
idols-image:
|
||||||
|
# take image for idols, and upload the image to proxmox nodes.
|
||||||
|
nom build .#aquamarine
|
||||||
|
scp result root@gtr5:/var/lib/vz/dump/vzdump-qemu-aquamarine.vma.zst
|
||||||
|
|
||||||
|
nom build .#ruby
|
||||||
|
scp result root@s500plus:/var/lib/vz/dump/vzdump-qemu-ruby.vma.zst
|
||||||
|
|
||||||
|
nom build .#kana
|
||||||
|
scp result root@um560:/var/lib/vz/dump/vzdump-qemu-kana.vma.zst
|
||||||
|
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# RISC-V related commands
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
roll: add-idols-ssh-key
|
||||||
|
colmena apply --on '@riscv'
|
||||||
|
|
||||||
|
roll-debug: add-idols-ssh-key
|
||||||
|
colmena apply --on '@dist-build' --verbose --show-trace
|
||||||
|
|
||||||
|
nozomi:
|
||||||
|
colmena apply --on '@nozomi'
|
||||||
|
|
||||||
|
yukina:
|
||||||
|
colmena apply --on '@yukina'
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# Aarch64 related commands
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
aarch:
|
||||||
|
colmena apply --on '@aarch'
|
||||||
|
|
||||||
|
suzu:
|
||||||
|
colmena apply --on '@suzu'
|
||||||
|
|
||||||
|
suzu-debug:
|
||||||
|
colmena apply --on '@suzu' --verbose --show-trace
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
#
|
||||||
|
# Misc, other useful commands
|
||||||
|
#
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
# format the nix files in this repo
|
||||||
|
nix fmt
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
|||||||
@@ -1,90 +1,200 @@
|
|||||||
# Nix Configuration
|
<h2 align="center">:snowflake: Ryan4Yin's Nix Config :snowflake:</h2>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="https://raw.githubusercontent.com/catppuccin/catppuccin/main/assets/palette/macchiato.png" width="400" />
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/ryan4yin/nix-config/stargazers">
|
||||||
|
<img alt="Stargazers" src="https://img.shields.io/github/stars/ryan4yin/nix-config?style=for-the-badge&logo=starship&color=C9CBFF&logoColor=D9E0EE&labelColor=302D41"></a>
|
||||||
|
<a href="https://nixos.org/">
|
||||||
|
<img src="https://img.shields.io/badge/NixOS-23.05-informational.svg?style=for-the-badge&logo=nixos&color=F2CDCD&logoColor=D9E0EE&labelColor=302D41"></a>
|
||||||
|
<a href="https://github.com/ryan4yin/nixos-and-flakes-book">
|
||||||
|
<img src="https://img.shields.io/static/v1?label=Nix Flakes&message=learning&style=for-the-badge&logo=nixos&color=DDB6F2&logoColor=D9E0EE&labelColor=302D41"></a>
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
This repository is home to the nix code that builds my systems.
|
This repository is home to the nix code that builds my systems.
|
||||||
|
|
||||||
## Screenshots
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## TODO
|
|
||||||
|
|
||||||
- enable disk encryption to enhance data security
|
|
||||||
- make fcitx5-rime work in vscode/chrome/telegram on wayland
|
|
||||||
- auto unlock with `ssh-agent` after login
|
|
||||||
- [People using ssh-agent, how do you unlock it on login? - reddit](https://www.reddit.com/r/NixOS/comments/lsbo9a/people_using_sshagent_how_do_you_unlock_it_on/)
|
|
||||||
- update scripts for i3wm, especially rofi & screenshot
|
|
||||||
- fix `xdg-open`: after set `firefox.desktop` as defaultApplication, NixOS returned error `no apps installed that can open "https://baidu.com"`
|
|
||||||
- `Xcursor.size` do not take effect in i3
|
|
||||||
|
|
||||||
## Why Nix?
|
## Why Nix?
|
||||||
|
|
||||||
Nix allows for easy to manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works forever. If someone else shares their configuration, anyone can make use of it.
|
Nix allows for easy-to-manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works forever. If someone else shares their configuration, anyone can make use of it.
|
||||||
|
|
||||||
**Want to know Nix in details? Looking for a beginner-friendly tutorial? Check out [NixOS & Nix Flakes - A Guide for Beginners](https://thiscute.world/en/posts/nixos-and-flake-basics/)!**
|
**Want to know Nix in detail? Looking for a beginner-friendly tutorial or best practices? Check out [NixOS & Nix Flakes Book - 🛠️ ❤️ An unofficial & opinionated :book: for beginners](https://github.com/ryan4yin/nixos-and-flakes-book)!**
|
||||||
|
|
||||||
|
> If you're using macOS, you can also check out [ryan4yin/nix-darwin-kickstarter](https://github.com/ryan4yin/nix-darwin-kickstarter) for a quick start.
|
||||||
|
|
||||||
|
## Components
|
||||||
|
|
||||||
|
| | NixOS(Wayland) | NixOS(Xorg) |
|
||||||
|
| --------------------------- | :---------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| **Window Manager** | [Hyprland][Hyprland] | [i3][i3] |
|
||||||
|
| **Terminal Emulator** | [Kitty][Kitty] | [Kitty][Kitty] |
|
||||||
|
| **Bar** | [Waybar][Waybar] | [i3block][i3block] |
|
||||||
|
| **Application Launcher** | [anyrun][anyrun] | [rofi][rofi] |
|
||||||
|
| **Notification Daemon** | [Mako][Mako] | [Dunst][Dunst] |
|
||||||
|
| **Display Manager** | [GDM][GDM] | [GDM][GDM] |
|
||||||
|
| **Color Scheme** | [Catppuccin][Catppuccin] | [Catppuccin][Catppuccin] |
|
||||||
|
| **network management tool** | [NetworkManager][NetworkManager] | [NetworkManager][NetworkManager] |
|
||||||
|
| **Input method framework** | [Fcitx5][Fcitx5] | [Fcitx5][Fcitx5] |
|
||||||
|
| **System resource monitor** | [Btop][Btop] | [Btop][Btop] |
|
||||||
|
| **File Manager** | [ranger][ranger] + [thunar][thunar] | [ranger][ranger] + [thunar][thunar] |
|
||||||
|
| **Shell** | [Nushell][Nushell] + [Starship][Starship] | [Nushell][Nushell] + [Starship][Starship] |
|
||||||
|
| **Music Player** | [mpd][mpd], [ncmpcpp][ncmpcpp], [mpc][mpc], [Netease-cloud-music-gtk][netease-cloud-music-gtk] | [Netease-cloud-music-gtk][netease-cloud-music-gtk] |
|
||||||
|
| **Media Player** | [mpv][mpv] | [mpv][mpv] |
|
||||||
|
| **Text Editor** | [Neovim][Neovim] | [Neovim][Neovim] |
|
||||||
|
| **Fonts** | [Nerd fonts][Nerd fonts] | [Nerd fonts][Nerd fonts] |
|
||||||
|
| **Image Viewer** | [imv][imv] | [imv][imv] |
|
||||||
|
| **Screenshot Software** | [grim][grim] | [flameshot](https://github.com/flameshot-org/flameshot) |
|
||||||
|
| **Screen Recording** | [OBS][OBS] | [OBS][OBS] |
|
||||||
|
| **Filesystem & Encryption** | tmpfs on `/`, [Btrfs][Btrfs] subvolumes on a [LUKS][LUKS] crypted partition for persistent, unlock via passphrase | tmpfs on `/`, [Btrfs][Btrfs] subvolumes on a [LUKS][LUKS] crypted partition for persistent, unlock via passphrase |
|
||||||
|
| **Secure Boot** | [lanzaboote][lanzaboote] | [lanzaboote][lanzaboote] |
|
||||||
|
|
||||||
|
Wallpapers: https://github.com/ryan4yin/wallpapers
|
||||||
|
|
||||||
|
## Hyprland + AstroNvim
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## I3 + AstroNvim
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## Neovim
|
||||||
|
|
||||||
|
See [./home/base/desktop/neovim](./home/base/desktop/neovim) for details.
|
||||||
|
|
||||||
|
## Hosts
|
||||||
|
|
||||||
|
See [./hosts](./hosts) for details.
|
||||||
|
|
||||||
|
## Secrets Management
|
||||||
|
|
||||||
|
See [./secrets](./secrets) for details.
|
||||||
|
|
||||||
## How to Deploy this Flake?
|
## How to Deploy this Flake?
|
||||||
|
|
||||||
> Note: you should NOT deploy this flake directly on your machine, it contains my hardware information and personal information which is not suitable for you. You may use this repo as a reference to build your own configuration.
|
> :red_circle: **IMPORTANT**: **You should NOT deploy this flake directly on your machine:exclamation: It will not succeed.** this flake contains my hardware configuration(such as [hardware-configuration.nix](hosts/idols/ai/hardware-configuration.nix), [cifs-mount.nix](https://github.com/ryan4yin/nix-config/blob/v0.1.1/hosts/idols/ai/cifs-mount.nix), [Nvidia Support](https://github.com/ryan4yin/nix-config/blob/v0.1.1/hosts/idols/ai/default.nix#L77-L91), etc.) which is not suitable for your hardware, and my private secrets repository [ryan4yin/nix-secrets](https://github.com/ryan4yin/nix-config/tree/main/secrets) that only I have access to. You may use this repo as a reference to build your own configuration.
|
||||||
|
|
||||||
After installed NixOS with `nix-command` & `flake` enabled, flow the steps below to deploy this flake.
|
For MacOS:
|
||||||
|
|
||||||
For NixOS, use the following commands:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# deploy my test configuration
|
|
||||||
sudo nixos-rebuild switch --flake .#nixos-test
|
|
||||||
|
|
||||||
|
|
||||||
# deploy my PC's configuration
|
|
||||||
sudo nixos-rebuild switch --flake .#msi-rtx4090
|
|
||||||
|
|
||||||
# or just deploy with hostname
|
|
||||||
sudo nixos-rebuild switch
|
|
||||||
|
|
||||||
# we can also deploy using make, which is defined in Makefile
|
|
||||||
make deploy
|
|
||||||
```
|
|
||||||
|
|
||||||
For MacOS, use the following commands:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# deploy the darwin configuration(harmonicia)
|
# deploy the darwin configuration(harmonicia)
|
||||||
make darwin
|
make ha
|
||||||
|
|
||||||
# deploy with details
|
# deploy with details
|
||||||
make darwin-debug
|
make ha-debug
|
||||||
```
|
```
|
||||||
|
|
||||||
## Install Apps from Flatpak
|
For NixOS:
|
||||||
|
|
||||||
We can install apps from flathub, which has a lot of apps that are not supported well in nixpkgs.
|
> Need to restart the machine when switching between `wayland` and `xorg`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Add the Flathub repository
|
# deploy one of the configuration based on the hostname
|
||||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
sudo nixos-rebuild switch --flake .#ai_i3
|
||||||
|
# sudo nixos-rebuild switch --flake .#ai_hyprland
|
||||||
|
|
||||||
# install apps from flathub
|
# we can also deploy using `make`, which is defined in Makefile
|
||||||
flatpak install netease-cloud-music-gtk
|
make i3 # deploy my pc with i3 window manager
|
||||||
|
# make hypr # deploy my pc with hyprland compositor
|
||||||
|
|
||||||
# install 3d printer slicer - cura
|
# or we can deploy with details
|
||||||
flatpak install flathub com.ultimaker.cura
|
make i3-debug
|
||||||
|
# make hypr-debug
|
||||||
# or you can search apps from flathub
|
|
||||||
flatpak search <keyword>
|
|
||||||
# search on website is also supported: https://flathub.org/
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Other Interesting Dotfiles
|
To deploy this flake from NixOS's official ISO image(purest installation method), please refer to [ryan4yin/nix-config/nixos-install](https://github.com/ryan4yin/nix-config/tree/nixos-install)
|
||||||
|
|
||||||
Other configurations that inspired me:
|
## How to create & managage VM from this flake?
|
||||||
|
|
||||||
- [notwidow/hyprland](https://github.com/notwidow/hyprland): hyprland configuration
|
use `aquamarine` as an example, we can create a virtual machine with the following command:
|
||||||
- [denisse-dev/dotfiles](https://github.com/denisse-dev/dotfiles)
|
|
||||||
- [notusknot/dotfiles-nix](https://github.com/notusknot/dotfiles-nix)
|
```shell
|
||||||
- [xddxdd/nixos-config](https://github.com/xddxdd/nixos-config)
|
# 1. generate a proxmox vma image file
|
||||||
- [bobbbay/dotfiles](https://github.com/bobbbay/dotfiles)
|
nom build .#aquamarine # `nom`(nix-output-monitor) can be replaced by the standard command `nix`
|
||||||
- [gytis-ivaskevicius/nixfiles](https://github.com/gytis-ivaskevicius/nixfiles)
|
|
||||||
- [fufexan/dotfiles](https://github.com/fufexan/dotfiles)
|
# 2. upload the genereated image to proxmox server's backup directory `/var/lib/vz/dump`
|
||||||
- [davidtwco/veritas](https://github.com/davidtwco/veritas)
|
# please replace the vma file name with the one you generated in step 1.
|
||||||
- [NixOS-CN/NixOS-CN-telegram](https://github.com/NixOS-CN/NixOS-CN-telegram)
|
scp result/vzdump-qemu-aquamarine-nixos-23.11.20230603.dd49825.vma.zst root@192.168.5.174:/var/lib/vz/dump
|
||||||
- [Tips&Tricks for NixOS Desktop](https://discourse.nixos.org/t/tips-tricks-for-nixos-desktop/28488/2)
|
|
||||||
|
# 3. the image we uploaded will be listed in proxmox web ui's this page: [storage 'local'] -> [backups], we can restore a vm from it via the web ui now.
|
||||||
|
```
|
||||||
|
|
||||||
|
Once the virtual machine `aquamarine` is created, we can deploy updates to it with the following commands:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
# 1. add the ssh key to ssh-agent
|
||||||
|
ssh-add ~/.ssh/ai-idols
|
||||||
|
|
||||||
|
# 2. deploy the configuration to all the remote host with tag `@dist-build`
|
||||||
|
# using the ssh key we added in step 1
|
||||||
|
colmena apply --on '@dist-build' --show-trace
|
||||||
|
```
|
||||||
|
|
||||||
|
If you're not familiar with remote deployment, please read this tutorial first: [Remote Deployment - NixOS & Flakes Book](https://nixos-and-flakes.thiscute.world/best-practices/remote-deployment)
|
||||||
|
|
||||||
|
## References
|
||||||
|
|
||||||
|
Other dotfiles that inspired me:
|
||||||
|
|
||||||
|
- Nix Flakes
|
||||||
|
- [NixOS-CN/NixOS-CN-telegram](https://github.com/NixOS-CN/NixOS-CN-telegram)
|
||||||
|
- [notusknot/dotfiles-nix](https://github.com/notusknot/dotfiles-nix)
|
||||||
|
- [xddxdd/nixos-config](https://github.com/xddxdd/nixos-config)
|
||||||
|
- [bobbbay/dotfiles](https://github.com/bobbbay/dotfiles)
|
||||||
|
- [gytis-ivaskevicius/nixfiles](https://github.com/gytis-ivaskevicius/nixfiles)
|
||||||
|
- [davidtwco/veritas](https://github.com/davidtwco/veritas)
|
||||||
|
- [gvolpe/nix-config](https://github.com/gvolpe/nix-config)
|
||||||
|
- [Ruixi-rebirth/flakes](https://github.com/Ruixi-rebirth/flakes)
|
||||||
|
- [fufexan/dotfiles](https://github.com/fufexan/dotfiles): gtk theme, xdg, git, media, anyrun, etc.
|
||||||
|
- Hyprland(wayland)
|
||||||
|
- [notwidow/hyprland](https://github.com/notwidow/hyprland): This is where I start my hyprland journey.
|
||||||
|
- [HeinzDev/Hyprland-dotfiles](https://github.com/HeinzDev/Hyprland-dotfiles): Refer to the waybar configuration here.
|
||||||
|
- [linuxmobile/kaku](https://github.com/linuxmobile/kaku)
|
||||||
|
- I3 Window Manager
|
||||||
|
- [endeavouros-i3wm-setup](https://github.com/endeavouros-team/endeavouros-i3wm-setup): I started using i3 here, and my i3 configuration is also based on it, but made a lot of changes.
|
||||||
|
- [denisse-dev/dotfiles](https://github.com/denisse-dev/dotfiles)
|
||||||
|
- Neovim/AstroNvim
|
||||||
|
- [maxbrunet/dotfiles](https://github.com/maxbrunet/dotfiles): astronvim with nix flakes.
|
||||||
|
- Misc
|
||||||
|
- [1amSimp1e/dots](https://github.com/1amSimp1e/dots)
|
||||||
|
|
||||||
|
[Hyprland]: https://github.com/hyprwm/Hyprland
|
||||||
|
[i3]: https://github.com/i3/i3
|
||||||
|
[Kitty]: https://github.com/kovidgoyal/kitty
|
||||||
|
[Nushell]: https://github.com/nushell/nushell
|
||||||
|
[Starship]: https://github.com/starship/starship
|
||||||
|
[Waybar]: https://github.com/Alexays/Waybar
|
||||||
|
[i3block]: https://github.com/vivien/i3blocks
|
||||||
|
[rofi]: https://github.com/davatorium/rofi
|
||||||
|
[anyrun]: https://github.com/Kirottu/anyrun
|
||||||
|
[Dunst]: https://github.com/dunst-project/dunst
|
||||||
|
[Fcitx5]: https://github.com/fcitx/fcitx5
|
||||||
|
[Btop]: https://github.com/aristocratos/btop
|
||||||
|
[mpv]: https://github.com/mpv-player/mpv
|
||||||
|
[Neovim]: https://github.com/neovim/neovim
|
||||||
|
[AstroNvim]: https://github.com/AstroNvim/AstroNvim
|
||||||
|
[flameshot]: https://github.com/flameshot-org/flameshot
|
||||||
|
[grim]: https://github.com/emersion/grim
|
||||||
|
[imv]: https://sr.ht/~exec64/imv/
|
||||||
|
[OBS]: https://obsproject.com
|
||||||
|
[Mako]: https://github.com/emersion/mako
|
||||||
|
[Nerd fonts]: https://github.com/ryanoasis/nerd-fonts
|
||||||
|
[catppuccin]: https://github.com/catppuccin/catppuccin
|
||||||
|
[mpd]: https://github.com/MusicPlayerDaemon/MPD
|
||||||
|
[ncmpcpp]: https://github.com/ncmpcpp/ncmpcpp
|
||||||
|
[mpc]: https://github.com/MusicPlayerDaemon/mpc
|
||||||
|
[Netease-cloud-music-gtk]: https://github.com/gmg137/netease-cloud-music-gtk
|
||||||
|
[NetworkManager]: https://wiki.gnome.org/Projects/NetworkManager
|
||||||
|
[wl-clipboard]: https://github.com/bugaevc/wl-clipboard
|
||||||
|
[GDM]: https://wiki.archlinux.org/title/GDM
|
||||||
|
[thunar]: https://gitlab.xfce.org/xfce/thunar
|
||||||
|
[ranger]: https://github.com/ranger/ranger
|
||||||
|
[Catppuccin]: https://github.com/catppuccin/catppuccin
|
||||||
|
[Btrfs]: https://btrfs.readthedocs.io
|
||||||
|
[LUKS]: https://wiki.archlinux.org/title/Dm-crypt/Encrypting_an_entire_system
|
||||||
|
[lanzaboote]: https://github.com/nix-community/lanzaboote
|
||||||
|
|||||||
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 249 KiB |
|
After Width: | Height: | Size: 450 KiB |
|
After Width: | Height: | Size: 320 KiB |
|
After Width: | Height: | Size: 359 KiB |
|
After Width: | Height: | Size: 382 KiB |
|
After Width: | Height: | Size: 60 KiB |
|
After Width: | Height: | Size: 243 KiB |
|
After Width: | Height: | Size: 232 KiB |
|
After Width: | Height: | Size: 841 KiB |
|
After Width: | Height: | Size: 362 KiB |
|
After Width: | Height: | Size: 350 KiB |
|
Before Width: | Height: | Size: 336 KiB |
@@ -1,68 +1,320 @@
|
|||||||
{
|
{
|
||||||
description = "NixOS configuration of Ryan Yin";
|
description = "NixOS & macOS configuration of Ryan Yin";
|
||||||
|
|
||||||
# the nixConfig here only affects the flake itself, not the system configuration!
|
##################################################################################################################
|
||||||
nixConfig = {
|
#
|
||||||
experimental-features = [ "nix-command" "flakes" ];
|
# Want to know Nix in details? Looking for a beginner-friendly tutorial?
|
||||||
|
# Check out https://github.com/ryan4yin/nixos-and-flakes-book !
|
||||||
|
#
|
||||||
|
##################################################################################################################
|
||||||
|
|
||||||
substituters = [
|
# The `outputs` function will return all the build results of the flake.
|
||||||
# replace official cache with a mirror located in China
|
# A flake can have many use cases and different types of outputs,
|
||||||
"https://mirrors.bfsu.edu.cn/nix-channels/store"
|
# parameters in `outputs` are defined in `inputs` and can be referenced by their names.
|
||||||
"https://mirrors.ustc.edu.cn/nix-channels/store"
|
# However, `self` is an exception, this special parameter points to the `outputs` itself (self-reference)
|
||||||
"https://cache.nixos.org"
|
# The `@` syntax here is used to alias the attribute set of the inputs's parameter, making it convenient to use inside the function.
|
||||||
];
|
outputs = inputs @ {
|
||||||
|
self,
|
||||||
|
nixpkgs,
|
||||||
|
nixpkgs-unstable,
|
||||||
|
nix-darwin,
|
||||||
|
home-manager,
|
||||||
|
nixos-generators,
|
||||||
|
nixos-licheepi4a,
|
||||||
|
nixos-rk3588,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
username = "ryan";
|
||||||
|
userfullname = "Ryan Yin";
|
||||||
|
useremail = "xiaoyin_c@qq.com";
|
||||||
|
|
||||||
# nix community's cache server
|
x64_system = "x86_64-linux";
|
||||||
extra-substituters = [
|
x64_darwin = "x86_64-darwin";
|
||||||
"https://nix-community.cachix.org"
|
riscv64_system = "riscv64-linux";
|
||||||
"https://nixpkgs-wayland.cachix.org"
|
aarch64_system = "aarch64-linux";
|
||||||
"https://xddxdd.cachix.org"
|
allSystems = [x64_system x64_darwin riscv64_system aarch64_system];
|
||||||
];
|
|
||||||
extra-trusted-public-keys = [
|
nixosSystem = import ./lib/nixosSystem.nix;
|
||||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
macosSystem = import ./lib/macosSystem.nix;
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
colmenaSystem = import ./lib/colmenaSystem.nix;
|
||||||
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
|
||||||
"xddxdd.cachix.org-1:ay1HJyNDYmlSwj5NXQG065C8LfoqqKaTNCyzeixGjf8="
|
# 星野 アイ, Hoshino Ai
|
||||||
];
|
idol_ai_modules_i3 = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/idols/ai
|
||||||
|
./modules/nixos/i3.nix
|
||||||
|
];
|
||||||
|
home-module = import ./home/linux/desktop-i3.nix;
|
||||||
|
};
|
||||||
|
idol_ai_modules_hyprland = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/idols/ai
|
||||||
|
./modules/nixos/hyprland.nix
|
||||||
|
];
|
||||||
|
home-module = import ./home/linux/desktop-hyprland.nix;
|
||||||
|
};
|
||||||
|
|
||||||
|
# 星野 愛久愛海, Hoshino Akuamarin
|
||||||
|
idol_aquamarine_modules = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/idols/aquamarine
|
||||||
|
];
|
||||||
|
home-module = import ./home/linux/server.nix;
|
||||||
|
};
|
||||||
|
idol_aquamarine_tags = ["dist-build" "aqua"];
|
||||||
|
|
||||||
|
# 星野 瑠美衣, Hoshino Rubii
|
||||||
|
idol_ruby_modules = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/idols/ruby
|
||||||
|
];
|
||||||
|
home-module = import ./home/linux/server.nix;
|
||||||
|
};
|
||||||
|
idol_ruby_tags = ["dist-build" "ruby"];
|
||||||
|
|
||||||
|
# 有馬 かな, Arima Kana
|
||||||
|
idol_kana_modules = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/idols/kana
|
||||||
|
];
|
||||||
|
home-module = import ./home/linux/server.nix;
|
||||||
|
};
|
||||||
|
idol_kana_tags = ["dist-build" "kana"];
|
||||||
|
|
||||||
|
# 森友 望未, Moritomo Nozomi
|
||||||
|
rolling_nozomi_modules = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/rolling_girls/nozomi
|
||||||
|
];
|
||||||
|
# home-module = import ./home/linux/server-riscv64.nix;
|
||||||
|
};
|
||||||
|
rolling_nozomi_tags = ["riscv" "nozomi"];
|
||||||
|
|
||||||
|
# 小坂 結季奈, Kosaka Yukina
|
||||||
|
rolling_yukina_modules = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/rolling_girls/yukina
|
||||||
|
];
|
||||||
|
# home-module = import ./home/linux/server-riscv64.nix;
|
||||||
|
};
|
||||||
|
rolling_yukina_tags = ["riscv" "yukina"];
|
||||||
|
|
||||||
|
# 大木 鈴, Ōki Suzu
|
||||||
|
_12kingdoms_suzu_modules = {
|
||||||
|
nixos-modules = [
|
||||||
|
./hosts/12kingdoms/suzu
|
||||||
|
];
|
||||||
|
# home-module = import ./home/linux/server.nix;
|
||||||
|
};
|
||||||
|
_12kingdoms_suzu_tags = ["aarch" "suzu"];
|
||||||
|
|
||||||
|
x64_specialArgs =
|
||||||
|
{
|
||||||
|
inherit username userfullname useremail;
|
||||||
|
# use unstable branch for some packages to get the latest updates
|
||||||
|
pkgs-unstable = import nixpkgs-unstable {
|
||||||
|
system = x64_system; # refer the `system` parameter form outer scope recursively
|
||||||
|
# To use chrome, we need to allow the installation of non-free software
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// inputs;
|
||||||
|
in {
|
||||||
|
nixosConfigurations = let
|
||||||
|
base_args = {
|
||||||
|
inherit home-manager nixos-generators;
|
||||||
|
nixpkgs = nixpkgs; # or nixpkgs-unstable
|
||||||
|
system = x64_system;
|
||||||
|
specialArgs = x64_specialArgs;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
# ai with i3 window manager
|
||||||
|
ai_i3 = nixosSystem (idol_ai_modules_i3 // base_args);
|
||||||
|
# ai with hyprland compositor
|
||||||
|
ai_hyprland = nixosSystem (idol_ai_modules_hyprland // base_args);
|
||||||
|
|
||||||
|
# three virtual machines without desktop environment.
|
||||||
|
aquamarine = nixosSystem (idol_aquamarine_modules // base_args);
|
||||||
|
ruby = nixosSystem (idol_ruby_modules // base_args);
|
||||||
|
kana = nixosSystem (idol_kana_modules // base_args);
|
||||||
|
};
|
||||||
|
|
||||||
|
# colmena - remote deployment via SSH
|
||||||
|
colmena = let
|
||||||
|
# x86_64 related
|
||||||
|
x64_base_args = {
|
||||||
|
inherit home-manager;
|
||||||
|
nixpkgs = nixpkgs; # or nixpkgs-unstable
|
||||||
|
specialArgs = x64_specialArgs;
|
||||||
|
};
|
||||||
|
|
||||||
|
# riscv64 related
|
||||||
|
# using the same nixpkgs as nixos-licheepi4a to utilize the cross-compilation cache.
|
||||||
|
lpi4a_pkgs = import nixos-licheepi4a.inputs.nixpkgs {system = x64_system;};
|
||||||
|
lpi4a_specialArgs =
|
||||||
|
{
|
||||||
|
inherit username userfullname useremail;
|
||||||
|
pkgsKernel = nixos-licheepi4a.packages.${x64_system}.pkgsKernelCross;
|
||||||
|
}
|
||||||
|
// inputs;
|
||||||
|
lpi4a_base_args = {
|
||||||
|
inherit home-manager;
|
||||||
|
nixpkgs = nixos-licheepi4a.inputs.nixpkgs; # or nixpkgs-unstable
|
||||||
|
specialArgs = lpi4a_specialArgs;
|
||||||
|
targetUser = "root";
|
||||||
|
};
|
||||||
|
|
||||||
|
# aarch64 related
|
||||||
|
# using the same nixpkgs as nixos-rk3588 to utilize the cross-compilation cache.
|
||||||
|
rk3588_pkgs = import nixos-rk3588.inputs.nixpkgs {system = x64_system;};
|
||||||
|
rk3588_specialArgs =
|
||||||
|
{
|
||||||
|
inherit username userfullname useremail;
|
||||||
|
}
|
||||||
|
// nixos-rk3588.inputs;
|
||||||
|
rk3588_base_args = {
|
||||||
|
inherit home-manager;
|
||||||
|
nixpkgs = nixos-rk3588.inputs.nixpkgs; # or nixpkgs-unstable
|
||||||
|
specialArgs = rk3588_specialArgs;
|
||||||
|
targetUser = "root";
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
meta = {
|
||||||
|
nixpkgs = import nixpkgs {system = x64_system;};
|
||||||
|
specialArgs = x64_specialArgs;
|
||||||
|
|
||||||
|
nodeSpecialArgs = {
|
||||||
|
# riscv64 SBCs
|
||||||
|
nozomi = lpi4a_specialArgs;
|
||||||
|
yukina = lpi4a_specialArgs;
|
||||||
|
|
||||||
|
# aarch64 SBCs
|
||||||
|
suzu = rk3588_specialArgs;
|
||||||
|
};
|
||||||
|
nodeNixpkgs = {
|
||||||
|
nozomi = lpi4a_pkgs;
|
||||||
|
yukina = lpi4a_pkgs;
|
||||||
|
|
||||||
|
# aarch64 SBCs
|
||||||
|
suzu = rk3588_pkgs;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# proxmox virtual machines(x86_64)
|
||||||
|
aquamarine = colmenaSystem (idol_aquamarine_modules // x64_base_args // {host_tags = idol_aquamarine_tags;});
|
||||||
|
ruby = colmenaSystem (idol_ruby_modules // x64_base_args // {host_tags = idol_ruby_tags;});
|
||||||
|
kana = colmenaSystem (idol_kana_modules // x64_base_args // {host_tags = idol_kana_tags;});
|
||||||
|
|
||||||
|
# riscv64 SBCs
|
||||||
|
nozomi = colmenaSystem (rolling_nozomi_modules // lpi4a_base_args // {host_tags = rolling_nozomi_tags;});
|
||||||
|
yukina = colmenaSystem (rolling_yukina_modules // lpi4a_base_args // {host_tags = rolling_yukina_tags;});
|
||||||
|
|
||||||
|
# aarch64 SBCs
|
||||||
|
suzu = colmenaSystem (_12kingdoms_suzu_modules // rk3588_base_args // {host_tags = _12kingdoms_suzu_tags;});
|
||||||
|
};
|
||||||
|
|
||||||
|
# take system images for idols
|
||||||
|
# https://github.com/nix-community/nixos-generators
|
||||||
|
packages."${x64_system}" =
|
||||||
|
# genAttrs returns an attribute set with the given keys and values(host => image).
|
||||||
|
nixpkgs.lib.genAttrs [
|
||||||
|
"ai_i3"
|
||||||
|
"ai_hyprland"
|
||||||
|
] (
|
||||||
|
# generate iso image for hosts with desktop environment
|
||||||
|
host:
|
||||||
|
self.nixosConfigurations.${host}.config.formats.iso
|
||||||
|
)
|
||||||
|
// nixpkgs.lib.genAttrs [
|
||||||
|
"aquamarine"
|
||||||
|
"ruby"
|
||||||
|
"kana"
|
||||||
|
] (
|
||||||
|
# generate proxmox image for virtual machines without desktop environment
|
||||||
|
host:
|
||||||
|
self.nixosConfigurations.${host}.config.formats.proxmox
|
||||||
|
);
|
||||||
|
|
||||||
|
# macOS's configuration, for work.
|
||||||
|
darwinConfigurations = let
|
||||||
|
system = x64_darwin;
|
||||||
|
specialArgs =
|
||||||
|
{
|
||||||
|
inherit username userfullname useremail;
|
||||||
|
# use unstable branch for some packages to get the latest updates
|
||||||
|
pkgs-unstable = import nixpkgs-unstable {
|
||||||
|
inherit system; # refer the `system` parameter form outer scope recursively
|
||||||
|
# To use chrome, we need to allow the installation of non-free software
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// inputs;
|
||||||
|
base_args = {
|
||||||
|
inherit nix-darwin home-manager system specialArgs nixpkgs;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
harmonica = macosSystem (base_args
|
||||||
|
// {
|
||||||
|
darwin-modules = [
|
||||||
|
./hosts/harmonica
|
||||||
|
];
|
||||||
|
home-module = import ./home/darwin;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
# format the nix code in this flake
|
||||||
|
# alejandra is a nix formatter with a beautiful output
|
||||||
|
formatter = nixpkgs.lib.genAttrs allSystems (
|
||||||
|
system:
|
||||||
|
nixpkgs.legacyPackages.${system}.alejandra
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
# This is the standard format for flake.nix. `inputs` are the dependencies of the flake,
|
# This is the standard format for flake.nix. `inputs` are the dependencies of the flake,
|
||||||
# and `outputs` function will return all the build results of the flake.
|
|
||||||
# Each item in `inputs` will be passed as a parameter to the `outputs` function after being pulled and built.
|
# Each item in `inputs` will be passed as a parameter to the `outputs` function after being pulled and built.
|
||||||
inputs = {
|
inputs = {
|
||||||
# There are many ways to reference flake inputs. The most widely used is github:owner/name/reference,
|
# There are many ways to reference flake inputs. The most widely used is github:owner/name/reference,
|
||||||
# which represents the GitHub repository URL + branch/commit-id/tag.
|
# which represents the GitHub repository URL + branch/commit-id/tag.
|
||||||
|
|
||||||
# Official NixOS package source, using nixos-unstable branch here
|
# Official NixOS package source, using nixos's stable branch by default
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
|
||||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.05";
|
# nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
# for macos
|
# for macos
|
||||||
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.05-darwin";
|
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.11-darwin";
|
||||||
darwin = {
|
nix-darwin = {
|
||||||
url = "github:lnl7/nix-darwin";
|
url = "github:lnl7/nix-darwin";
|
||||||
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
||||||
};
|
};
|
||||||
|
|
||||||
# nix users repository
|
|
||||||
# used to install some packages not in nixpkgs
|
|
||||||
# e.g. wechat-uos/qqmusic/dingtalk
|
|
||||||
nur.url = "github:nix-community/NUR";
|
|
||||||
|
|
||||||
# home-manager, used for managing user configuration
|
# home-manager, used for managing user configuration
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-23.05";
|
url = "github:nix-community/home-manager/release-23.11";
|
||||||
|
# url = "github:nix-community/home-manager/master";
|
||||||
|
|
||||||
# The `follows` keyword in inputs is used for inheritance.
|
# The `follows` keyword in inputs is used for inheritance.
|
||||||
# Here, `inputs.nixpkgs` of home-manager is kept consistent with the `inputs.nixpkgs` of the current flake,
|
# Here, `inputs.nixpkgs` of home-manager is kept consistent with the `inputs.nixpkgs` of the current flake,
|
||||||
# to avoid problems caused by different versions of nixpkgs dependencies.
|
# to avoid problems caused by different versions of nixpkgs dependencies.
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
lanzaboote = {
|
||||||
|
url = "github:nix-community/lanzaboote/v0.3.0";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
impermanence.url = "github:nix-community/impermanence";
|
||||||
|
|
||||||
# modern window compositor
|
# modern window compositor
|
||||||
hyprland.url = "github:hyprwm/Hyprland/v0.25.0";
|
hyprland.url = "github:hyprwm/Hyprland/v0.32.3";
|
||||||
# community wayland nixpkgs
|
# community wayland nixpkgs
|
||||||
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
nixpkgs-wayland.url = "github:nix-community/nixpkgs-wayland";
|
||||||
|
# anyrun - a wayland launcher
|
||||||
|
anyrun = {
|
||||||
|
url = "github:Kirottu/anyrun";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
# generate iso/qcow2/docker/... image from nixos configuration
|
# generate iso/qcow2/docker/... image from nixos configuration
|
||||||
nixos-generators = {
|
nixos-generators = {
|
||||||
@@ -70,143 +322,108 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
# use devenv to manage my development environment
|
# secrets management, lock with git commit at 2023/7/15
|
||||||
devenv.url = "github:cachix/devenv/v0.6.2";
|
agenix.url = "github:ryantm/agenix/0d8c5325fc81daf00532e3e26c6752f7bcde1143";
|
||||||
|
|
||||||
# secrets management, lock with git commit at 2023/5/15
|
######################## Some non-flake repositories #########################################
|
||||||
agenix.url = "github:ryantm/agenix/db5637d10f797bb251b94ef9040b237f4702cde3";
|
|
||||||
|
|
||||||
# nix language server, used by vscode & neovim
|
# AstroNvim is an aesthetic and feature-rich neovim config.
|
||||||
nil.url = "github:oxalica/nil/2023-05-09";
|
astronvim = {
|
||||||
|
url = "github:AstroNvim/AstroNvim/v3.39.0";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# useful nushell scripts, such as auto_completion
|
||||||
|
nushell-scripts = {
|
||||||
|
url = "github:nushell/nu_scripts/main";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
######################## My own repositories #########################################
|
||||||
|
|
||||||
|
# my private secrets, it's a private repository, you need to replace it with your own.
|
||||||
|
# use ssh protocol to authenticate via ssh-agent/ssh-key, and shallow clone to save time
|
||||||
|
mysecrets = {
|
||||||
|
url = "git+ssh://git@github.com/ryan4yin/nix-secrets.git?shallow=1";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
# my wallpapers
|
||||||
|
wallpapers = {
|
||||||
|
url = "github:ryan4yin/wallpapers";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nur-ryan4yin = {
|
||||||
|
url = "github:ryan4yin/nur-packages";
|
||||||
|
# inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
# riscv64 SBCs
|
||||||
|
nixos-licheepi4a.url = "github:ryan4yin/nixos-licheepi4a";
|
||||||
|
# nixos-jh7110.url = "github:ryan4yin/nixos-jh7110";
|
||||||
|
|
||||||
|
# aarch64 SBCs
|
||||||
|
nixos-rk3588.url = "github:ryan4yin/nixos-rk3588";
|
||||||
|
|
||||||
|
######################## Color Schemes #########################################
|
||||||
|
|
||||||
|
# color scheme - catppuccin
|
||||||
|
catppuccin-btop = {
|
||||||
|
url = "github:catppuccin/btop";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
catppuccin-fcitx5 = {
|
||||||
|
url = "github:catppuccin/fcitx5";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
catppuccin-bat = {
|
||||||
|
url = "github:catppuccin/bat";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
catppuccin-alacritty = {
|
||||||
|
url = "github:catppuccin/alacritty";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
catppuccin-helix = {
|
||||||
|
url = "github:catppuccin/helix";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
catppuccin-starship = {
|
||||||
|
url = "github:catppuccin/starship";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
catppuccin-hyprland = {
|
||||||
|
url = "github:catppuccin/hyprland";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
catppuccin-cava = {
|
||||||
|
url = "github:catppuccin/cava";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
|
cattppuccin-k9s = {
|
||||||
|
url = "github:catppuccin/k9s";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# `outputs` are all the build result of the flake.
|
# the nixConfig here only affects the flake itself, not the system configuration!
|
||||||
# A flake can have many use cases and different types of outputs.
|
nixConfig = {
|
||||||
# parameters in `outputs` are defined in `inputs` and can be referenced by their names.
|
# substituers will be appended to the default substituters when fetching packages
|
||||||
# However, `self` is an exception, This special parameter points to the `outputs` itself (self-reference)
|
extra-substituters = [
|
||||||
# The `@` syntax here is used to alias the attribute set of the inputs's parameter, making it convenient to use inside the function.
|
# my own cache server
|
||||||
outputs = inputs@{
|
"https://ryan4yin.cachix.org"
|
||||||
self,
|
"https://anyrun.cachix.org"
|
||||||
nixpkgs,
|
"https://hyprland.cachix.org"
|
||||||
darwin,
|
"https://nix-community.cachix.org"
|
||||||
home-manager,
|
"https://nixpkgs-wayland.cachix.org"
|
||||||
...
|
];
|
||||||
}: {
|
extra-trusted-public-keys = [
|
||||||
nixosConfigurations = {
|
"ryan4yin.cachix.org-1:Gbk27ZU5AYpGS9i3ssoLlwdvMIh0NxG0w8it/cv9kbU="
|
||||||
# By default, NixOS will try to refer the nixosConfiguration with its hostname.
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
# so the system named `msi-rtx4090` will use this configuration.
|
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
||||||
# However, the configuration name can also be specified using `sudo nixos-rebuild switch --flake /path/to/flakes/directory#<name>`.
|
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
||||||
# The `nixpkgs.lib.nixosSystem` function is used to build this configuration, the following attribute set is its parameter.
|
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||||
# Run `sudo nixos-rebuild switch --flake .#msi-rtx4090` in the flake's directory to deploy this configuration on any NixOS system
|
];
|
||||||
msi-rtx4090 = nixpkgs.lib.nixosSystem rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
|
|
||||||
# The Nix module system can modularize configurations, improving the maintainability of configurations.
|
|
||||||
#
|
|
||||||
# Each parameter in the `modules` is a Nix Module, and there is a partial introduction to it in the nixpkgs manual:
|
|
||||||
# <https://nixos.org/manual/nixpkgs/unstable/#module-system-introduction>
|
|
||||||
# It is said to be partial because the documentation is not complete, only some simple introductions
|
|
||||||
# (such is the current state of Nix documentation...)
|
|
||||||
# A Nix Module can be an attribute set, or a function that returns an attribute set.
|
|
||||||
# If a Module is a function, according to the Nix Wiki description, this function can have up to four parameters:
|
|
||||||
#
|
|
||||||
# config: The configuration of the entire system
|
|
||||||
# options: All option declarations refined with all definition and declaration references.
|
|
||||||
# pkgs: The attribute set extracted from the Nix package collection and enhanced with the nixpkgs.config option.
|
|
||||||
# modulesPath: The location of the module directory of Nix.
|
|
||||||
#
|
|
||||||
# Only these four parameters can be passed by default.
|
|
||||||
# If you need to pass other parameters, you must use `specialArgs` by uncomment the following line
|
|
||||||
specialArgs = {
|
|
||||||
pkgs-stable = import inputs.nixpkgs-stable {
|
|
||||||
system = system; # refer the `system` parameter form outer scope recursively
|
|
||||||
# To use chrome, we need to allow the installation of non-free software
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
} // inputs;
|
|
||||||
modules = [
|
|
||||||
./hosts/msi-rtx4090
|
|
||||||
|
|
||||||
# make home-manager as a module of nixos
|
|
||||||
# so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch`
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
# pass all inputs into home manager's all sub modules
|
|
||||||
home-manager.extraSpecialArgs = specialArgs;
|
|
||||||
home-manager.users.ryan = import ./home/linux/x11.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nixos-test = nixpkgs.lib.nixosSystem rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = {
|
|
||||||
pkgs-stable = import inputs.nixpkgs-stable {
|
|
||||||
system = system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
} // inputs;
|
|
||||||
modules = [
|
|
||||||
./hosts/nixos-test
|
|
||||||
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
home-manager.extraSpecialArgs = specialArgs;
|
|
||||||
home-manager.users.ryan = import ./home/linux/wayland.nix;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# configurations for MacOS
|
|
||||||
darwinConfigurations."harmonica" = darwin.lib.darwinSystem {
|
|
||||||
system = "x86_64-darwin";
|
|
||||||
|
|
||||||
specialArgs = inputs;
|
|
||||||
modules = [
|
|
||||||
./hosts/harmonica
|
|
||||||
|
|
||||||
home-manager.darwinModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
|
|
||||||
home-manager.extraSpecialArgs = inputs;
|
|
||||||
home-manager.users.admin = import ./home/darwin;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# generate qcow2 & iso image from nixos configuration
|
|
||||||
# https://github.com/nix-community/nixos-generators
|
|
||||||
# packages.x86_64-linux = {
|
|
||||||
# qcow2 = nixos-generators.nixosGenerate {
|
|
||||||
# system = "x86_64-linux";
|
|
||||||
# modules = [
|
|
||||||
# # you can include your own nixos configuration here, i.e.
|
|
||||||
# # ./configuration.nix
|
|
||||||
# ];
|
|
||||||
# format = "qcow";
|
|
||||||
|
|
||||||
# # you can also define your own custom formats
|
|
||||||
# # customFormats = { "myFormat" = <myFormatModule>; ... };
|
|
||||||
# # format = "myFormat";
|
|
||||||
# };
|
|
||||||
|
|
||||||
# iso = nixos-generators.nixosGenerate {
|
|
||||||
# system = "x86_64-linux";
|
|
||||||
# modules = [
|
|
||||||
# # you can include your own nixos configuration here, i.e.
|
|
||||||
# # ./configuration.nix
|
|
||||||
# ];
|
|
||||||
# format = "iso";
|
|
||||||
# };
|
|
||||||
# };
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
{ lib, stdenvNoCC, fetchgit }:
|
|
||||||
|
|
||||||
stdenvNoCC.mkDerivation rec {
|
|
||||||
pname = "archcraft-font";
|
|
||||||
version = "2023-05-07";
|
|
||||||
|
|
||||||
src = fetchgit {
|
|
||||||
url = "https://github.com/archcraft-os/archcraft-packages.git";
|
|
||||||
rev = "88030ee6d2df80db958541b53bd3673e081720cf"; # git commit id
|
|
||||||
sparseCheckout = [ "archcraft-fonts/files/icon-fonts/archcraft.ttf" ]; # only fetch the feather.ttf file
|
|
||||||
|
|
||||||
# the sha256 is used to verify the integrity of the downloaded source, and alse cache the build result.
|
|
||||||
# so if you copy other package src's sha256, you will get a cached build result of that package, and all configs in this file will be ignored.
|
|
||||||
# specify sha256 to empty and build it, then an error will indicate the correct sha256
|
|
||||||
sha256 = "sha256-DrGN8lN4Yr1RTyCUZhJjzKgCuC0vTnSWjOKovNg3T/U=";
|
|
||||||
};
|
|
||||||
|
|
||||||
installPhase = ''
|
|
||||||
runHook preInstall
|
|
||||||
|
|
||||||
install -Dm644 archcraft-fonts/files/icon-fonts/archcraft.ttf -t $out/share/fonts/truetype/
|
|
||||||
|
|
||||||
runHook postInstall
|
|
||||||
'';
|
|
||||||
|
|
||||||
meta = with lib; {
|
|
||||||
homepage = "https://github.com/archcraft-os/archcraft-packages";
|
|
||||||
description = "Archcraft icon font";
|
|
||||||
version = version;
|
|
||||||
longDescription = ''Archcraft icon font'';
|
|
||||||
license = licenses.mit;
|
|
||||||
maintainers = [ maintainers.ryan4yin ];
|
|
||||||
platforms = platforms.all;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
{ lib, stdenvNoCC, fetchgit }:
|
{
|
||||||
|
lib,
|
||||||
|
stdenvNoCC,
|
||||||
|
fetchgit,
|
||||||
|
}:
|
||||||
stdenvNoCC.mkDerivation rec {
|
stdenvNoCC.mkDerivation rec {
|
||||||
pname = "icomoon-feather-font";
|
pname = "icomoon-feather-font";
|
||||||
version = "2023-05-06";
|
version = "2023-05-06";
|
||||||
@@ -7,8 +10,8 @@ stdenvNoCC.mkDerivation rec {
|
|||||||
# 参考 https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-icomoon-feather
|
# 参考 https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-icomoon-feather
|
||||||
src = fetchgit {
|
src = fetchgit {
|
||||||
url = "https://github.com/adi1090x/polybar-themes.git";
|
url = "https://github.com/adi1090x/polybar-themes.git";
|
||||||
rev = "47b66337a92a1afd2240ed7094ffcb039cc686cf"; # git commit id
|
rev = "47b66337a92a1afd2240ed7094ffcb039cc686cf"; # git commit id
|
||||||
sparseCheckout = [ "fonts/feather.ttf" ]; # only fetch the feather.ttf file
|
sparseCheckout = ["fonts/feather.ttf"]; # only fetch the feather.ttf file
|
||||||
|
|
||||||
# the sha256 is used to verify the integrity of the downloaded source, and alse cache the build result.
|
# the sha256 is used to verify the integrity of the downloaded source, and alse cache the build result.
|
||||||
# so if you copy other package src's sha256, you will get a cached build result of that package, and all configs in this file will be ignored.
|
# so if you copy other package src's sha256, you will get a cached build result of that package, and all configs in this file will be ignored.
|
||||||
@@ -33,7 +36,7 @@ stdenvNoCC.mkDerivation rec {
|
|||||||
Each icon is designed on a 24x24 grid with an emphasis on simplicity, consistency, and flexibility.
|
Each icon is designed on a 24x24 grid with an emphasis on simplicity, consistency, and flexibility.
|
||||||
'';
|
'';
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
maintainers = [ maintainers.ryan4yin ];
|
maintainers = [maintainers.ryan4yin];
|
||||||
platforms = platforms.all;
|
platforms = platforms.all;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Home Manager's Submodules
|
||||||
|
|
||||||
|
1. `base`: The base module that is suitable for both Linux and macOS.
|
||||||
|
2. `linux`: Linux-specific configuration.
|
||||||
|
3. `darwin`: macOS-specific configuration.
|
||||||
|
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
# Home Manager's Base Submodules
|
||||||
|
|
||||||
|
2. `server`: Configuration which is suitable for both servers and desktops.
|
||||||
|
1. `desktop`: Configuration for desktop environments, such as Hyprland, I3, etc.
|
||||||
|
1. it import `server` as its submodule.
|
||||||
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# general tools
|
||||||
|
pulumi
|
||||||
|
pulumictl
|
||||||
|
# istioctl
|
||||||
|
|
||||||
|
# aws
|
||||||
|
awscli2
|
||||||
|
aws-iam-authenticator
|
||||||
|
eksctl
|
||||||
|
istioctl
|
||||||
|
|
||||||
|
# aliyun
|
||||||
|
aliyun-cli
|
||||||
|
] ++ (if pkgs.stdenv.isLinux then [
|
||||||
|
# cloud tools that nix do not have cache for.
|
||||||
|
terraform
|
||||||
|
terraformer # generate terraform configs from existing cloud resources
|
||||||
|
] else []);
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
skopeo
|
||||||
|
docker-compose
|
||||||
|
dive # explore docker layers
|
||||||
|
];
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{ ... }: {
|
||||||
|
imports = [
|
||||||
|
./container.nix
|
||||||
|
./kubernetes.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
|
cattppuccin-k9s,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
kubectl
|
||||||
|
kubernetes-helm
|
||||||
|
];
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
k9s = {
|
||||||
|
enable = true;
|
||||||
|
skin =
|
||||||
|
let
|
||||||
|
skin_file = "${cattppuccin-k9s}/dist/mocha.yml"; # theme - cattppuccin mocha
|
||||||
|
skin_attr = builtins.fromJSON (builtins.readFile
|
||||||
|
# replace 'base: &base "#1e1e2e"' with 'base: &base "default"'
|
||||||
|
# to make fg/bg color transparent. "default" means transparent in k9s skin.
|
||||||
|
(pkgs.runCommandNoCC "get-skin-json" {} ''
|
||||||
|
cat ${skin_file} \
|
||||||
|
| sed -E 's@(base: &base ).+@\1 "default"@g' \
|
||||||
|
| ${pkgs.yj}/bin/yj > $out
|
||||||
|
'')
|
||||||
|
);
|
||||||
|
in
|
||||||
|
skin_attr;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
../server
|
||||||
|
|
||||||
|
./cloud
|
||||||
|
./container
|
||||||
|
./neovim
|
||||||
|
./terminal
|
||||||
|
|
||||||
|
./development.nix
|
||||||
|
./helix.nix
|
||||||
|
./media.nix
|
||||||
|
./shell.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
pkgs-unstable,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
#############################################################
|
||||||
|
#
|
||||||
|
# Basic settings for development environment
|
||||||
|
#
|
||||||
|
# Please avoid to install language specific packages here(globally),
|
||||||
|
# instead, install them:
|
||||||
|
# 1. per IDE, such as `programs.neovim.extraPackages`
|
||||||
|
# 2. per-project, using https://github.com/the-nix-way/dev-templates
|
||||||
|
#
|
||||||
|
#############################################################
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
(python3.withPackages (
|
||||||
|
ps:
|
||||||
|
with ps; [
|
||||||
|
ipython
|
||||||
|
pandas
|
||||||
|
requests
|
||||||
|
pyquery
|
||||||
|
pyyaml
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
|
cargo # rust package manager
|
||||||
|
go
|
||||||
|
jdk17
|
||||||
|
guile # scheme language
|
||||||
|
|
||||||
|
# db related
|
||||||
|
dbeaver
|
||||||
|
mycli
|
||||||
|
pgcli
|
||||||
|
mongosh
|
||||||
|
sqlite
|
||||||
|
|
||||||
|
# embedded development
|
||||||
|
minicom
|
||||||
|
|
||||||
|
# misc
|
||||||
|
pkgs-unstable.devbox
|
||||||
|
glow # markdown previewer
|
||||||
|
fzf
|
||||||
|
gdu # disk usage analyzer, required by AstroNvim
|
||||||
|
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
|
||||||
|
bfg-repo-cleaner # remove large files from git history
|
||||||
|
k6 # load testing tool
|
||||||
|
protobuf # protocol buffer compiler
|
||||||
|
] ++ (if pkgs.stdenv.isLinux then [
|
||||||
|
# Automatically trims your branches whose tracking remote refs are merged or gone
|
||||||
|
# It's really useful when you work on a project for a long time.
|
||||||
|
git-trim
|
||||||
|
|
||||||
|
# need to run `conda-install` before using it
|
||||||
|
# need to run `conda-shell` before using command `conda`
|
||||||
|
# conda is not available for MacOS
|
||||||
|
conda
|
||||||
|
|
||||||
|
mitmproxy # http/https proxy tool
|
||||||
|
insomnia # REST client
|
||||||
|
wireshark # network analyzer
|
||||||
|
] else []);
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
direnv = {
|
||||||
|
enable = true;
|
||||||
|
nix-direnv.enable = true;
|
||||||
|
|
||||||
|
enableZshIntegration = true;
|
||||||
|
enableBashIntegration = true;
|
||||||
|
enableNushellIntegration = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
{ pkgs, catppuccin-helix, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# https://github.com/catppuccin/helix
|
||||||
|
xdg.configFile."helix/themes".source = "${catppuccin-helix}/themes/default";
|
||||||
|
|
||||||
|
programs.helix = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.helix;
|
||||||
|
settings = {
|
||||||
|
theme = "catppuccin_mocha";
|
||||||
|
editor = {
|
||||||
|
line-number = "relative";
|
||||||
|
cursorline = true;
|
||||||
|
color-modes = true;
|
||||||
|
lsp.display-messages = true;
|
||||||
|
cursor-shape = {
|
||||||
|
insert = "bar";
|
||||||
|
normal = "block";
|
||||||
|
select = "underline";
|
||||||
|
};
|
||||||
|
indent-guides.render = true;
|
||||||
|
};
|
||||||
|
keys.normal = {
|
||||||
|
space.space = "file_picker";
|
||||||
|
space.w = ":w";
|
||||||
|
space.q = ":q";
|
||||||
|
esc = [ "collapse_selection" "keep_primary_selection" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
ffmpeg-full
|
ffmpeg-full
|
||||||
|
|
||||||
# images
|
# images
|
||||||
viu # terminal image viewer
|
viu # Terminal image viewer with native support for iTerm and Kitty
|
||||||
imagemagick
|
imagemagick
|
||||||
graphviz
|
graphviz
|
||||||
];
|
];
|
||||||
@@ -0,0 +1,228 @@
|
|||||||
|
# AstroNvim Configuration and Shortcuts
|
||||||
|
|
||||||
|
My Neovim config based on [AstroNvim](https://github.com/AstroNvim/AstroNvim).
|
||||||
|
For more details, visit the [AstroNvim website](https://astronvim.com/).
|
||||||
|
|
||||||
|
This document outlines neovim's configuration structure and various shortcuts/commands for efficient usage.
|
||||||
|
|
||||||
|
## Configuration Structure
|
||||||
|
|
||||||
|
| Description | Standard Location | My Location |
|
||||||
|
| ------------------------------------------------- | ------------------------------------------- | ------------------------------------------------------------------------- |
|
||||||
|
| Neovim's config | `~/.config/nvim` | AstroNvim's github repository, referenced as a flake input in this flake. |
|
||||||
|
| AstroNvim's user configuration | `$XDG_CONFIG_HOME/astronvim/lua/user` | [./astronvim_user/](./astronvim_user/) |
|
||||||
|
| Plugins installation directory (lazy.nvim) | `~/.local/share/nvim/` | The same as standard location, generated and managed by lazy.nvim. |
|
||||||
|
| LSP servers, DAP servers, linters, and formatters | `~/.local/share/nvim/mason/`(by mason.nvim) | [./default.nix](./default.nix), installed by nix. |
|
||||||
|
|
||||||
|
## Update/Clean Plugins
|
||||||
|
|
||||||
|
Note that lazy.nvim will not automatically update plugins, so you need to update them manually.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
:Lazy update
|
||||||
|
```
|
||||||
|
|
||||||
|
Remove all unused plugins:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
:Lazy clean
|
||||||
|
```
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
## Visual Modes
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ------------------------ | ---------------------------------------- |
|
||||||
|
| Toggle visual mode | `v` |
|
||||||
|
| Toggle visual block mode | `<Ctrl> + v` (select a block vertically) |
|
||||||
|
|
||||||
|
## Incremental Selection
|
||||||
|
|
||||||
|
Provided by nvim-treesitter.
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ----------------- | -------------- |
|
||||||
|
| init selection | `<Ctrl-space>` |
|
||||||
|
| node incremental | `<Ctrl-space>` |
|
||||||
|
| scope incremental | `<Alt-Space>` |
|
||||||
|
| node decremental | `Backspace` |
|
||||||
|
|
||||||
|
## Search and Jump
|
||||||
|
|
||||||
|
Provided by [flash.nvim](https://github.com/folke/flash.nvim), it's a intelligent search and jump plugin.
|
||||||
|
|
||||||
|
1. It enhaces the default search and jump behavior of neovim.(search with prefix `/`)
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ----------------- | ------------------------------------------------------------------------------------------------------------- |
|
||||||
|
| Search | `/`(normal search), `s`(disable all code highlight, only highlight matches) |
|
||||||
|
| Treesitter Search | `yR`,`dR`, `cR`, `vR`, `ctrl+v+R`(arround your matches, all the surrounding Treesitter nodes will be labeled) |
|
||||||
|
| Remote Flash | `yr`, `dr`, `cr`, (arround your matches, all the surrounding Treesitter nodes will be labeled) |
|
||||||
|
|
||||||
|
## Text Manipulation
|
||||||
|
|
||||||
|
- Add at the end of multiple lines: `:normal A<text>`
|
||||||
|
|
||||||
|
- Execublock: `:A<text>`
|
||||||
|
|
||||||
|
- visual block mode(ctrl + v)
|
||||||
|
- Append text at the end of each line in the selected block
|
||||||
|
- If position exceeds line end, neovim adds spaces automatically
|
||||||
|
|
||||||
|
- Delete the last char of multivle lines: `:normal $x`
|
||||||
|
|
||||||
|
- Execute `$x` on each line
|
||||||
|
- visual mode(v)
|
||||||
|
- `$` moves cursor to the end of line
|
||||||
|
- `x` deletes the character under the cursor
|
||||||
|
|
||||||
|
- Delete the last word of multiple lines: `:normal $bD`
|
||||||
|
- Execute `$bD` on each line
|
||||||
|
- visual mode(v)
|
||||||
|
- `$` moves cursor to the end of line
|
||||||
|
- `b` moves cursor to the beginning of the last word
|
||||||
|
- `D` deletes from cursor to the end of line
|
||||||
|
|
||||||
|
## Commands & Shortcuts
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ----------------------------- | -------------- |
|
||||||
|
| Learn Neovim's Basics | `:Tutor` |
|
||||||
|
| Open file explorer | `<Space> + e` |
|
||||||
|
| Focus Neotree to current file | `<Space> + o` |
|
||||||
|
| Floating Terminal | `<Space> + tf` |
|
||||||
|
| Horizontal Split Terminal | `<Space> + th` |
|
||||||
|
| Vertical Split Terminal | `<Space> + tv` |
|
||||||
|
| Open IPython REPL | `<Space> + tp` |
|
||||||
|
| Toggle line wrap | `<Space> + uw` |
|
||||||
|
| Show line diagnostics | `gl` |
|
||||||
|
| Show function/variable info | `K` |
|
||||||
|
| Go to definition | `gd` |
|
||||||
|
| References of a symbol | `gr` |
|
||||||
|
|
||||||
|
## Window Navigation
|
||||||
|
|
||||||
|
- Switch between windows: `<Ctrl> + h/j/k/l`
|
||||||
|
- Resize windows: `<Ctrl> + Up/Down/Left/Right`
|
||||||
|
- Note: On macOS, conflicts with system shortcuts
|
||||||
|
- Disable in System Preferences -> Keyboard -> Shortcuts -> Mission Control
|
||||||
|
|
||||||
|
## Splitting and Buffers
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| --------------------- | ------------- |
|
||||||
|
| Horizontal Split | `\` |
|
||||||
|
| Vertical Split | `\|` |
|
||||||
|
| Next Buffer (Tab) | `]b` |
|
||||||
|
| Previous Buffer (Tab) | `[b` |
|
||||||
|
| Close Buffer | `<Space> + c` |
|
||||||
|
|
||||||
|
## Editing and Formatting
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ----------------------------------------------------- | -------------- |
|
||||||
|
| Toggle buffer auto formatting | `<Space> + uf` |
|
||||||
|
| Format Document | `<Space> + lf` |
|
||||||
|
| Code Actions | `<Space> + la` |
|
||||||
|
| Rename | `<Space> + lr` |
|
||||||
|
| Opening LSP symbols | `<Space> + lS` |
|
||||||
|
| Comment Line(support multiple lines) | `<Space> + /` |
|
||||||
|
| Open filepath/URL at cursor(neovim's builtin command) | `gx` |
|
||||||
|
| Find files by name (fzf) | `<Space> + ff` |
|
||||||
|
| Grep string in files (ripgrep) | `<Space> + fw` |
|
||||||
|
|
||||||
|
## Sessions
|
||||||
|
|
||||||
|
| Action | Shortcut |
|
||||||
|
| ------------------------------ | -------------- |
|
||||||
|
| Save Session | `<Space> + Ss` |
|
||||||
|
| Last Session | `<Space> + Sl` |
|
||||||
|
| Delete Session | `<Space> + Sd` |
|
||||||
|
| Search Session | `<Space> + Sf` |
|
||||||
|
| Load Current Directory Session | `<Space> + S.` |
|
||||||
|
|
||||||
|
## Debugging
|
||||||
|
|
||||||
|
Press `<Space> + D` to view available bindings and options.
|
||||||
|
|
||||||
|
## Find and Replace
|
||||||
|
|
||||||
|
| Action | Command |
|
||||||
|
| ------------------------ | ----------------------------------- |
|
||||||
|
| Replace in selected area | `:s/old/new/g` |
|
||||||
|
| Replace in current line | Same as above |
|
||||||
|
| Replace in whole file | `:% s/old/new/g` |
|
||||||
|
| Replace with regex | `:% s@\vhttp://(\w+)@https://\1@gc` |
|
||||||
|
|
||||||
|
1. `\v` means means that in the regex pattern after it can be used without backslash escaping(similar to python's raw string).
|
||||||
|
2. `\1` means the first matched group in the pattern.
|
||||||
|
|
||||||
|
## Replace in the specific lines
|
||||||
|
|
||||||
|
| Action | Command |
|
||||||
|
| ----------------------------------------- | -------------------------------------- |
|
||||||
|
| From the 10th line to the end of the file | `:10,$ s/old/new/g` or `:10,$ s@^@#@g` |
|
||||||
|
| From the 10th line to the 20th line | `:10,20 s/old/new/g` |
|
||||||
|
|
||||||
|
The postfix(flags) in the above commands:
|
||||||
|
|
||||||
|
1. `g` means replace all the matched strings in the current line/file.
|
||||||
|
2. `c` means ask for confirmation before replacing.
|
||||||
|
3. `i` means ignore case.
|
||||||
|
|
||||||
|
## Search and Replace Globally
|
||||||
|
|
||||||
|
| Description | Shortcut |
|
||||||
|
| ------------------------------------------------------------ | ---------------------------------------------------------------- |
|
||||||
|
| Open spectre.nvim search and replace panel | `<Space> + ss` |
|
||||||
|
| Search and replace in command line(need install `sad` first) | `find -name "*.nix" \| sad '<pattern>' '<replacement>' \| delta` |
|
||||||
|
|
||||||
|
## Surrounding Characters
|
||||||
|
|
||||||
|
Provided by mini.surround plugin.
|
||||||
|
|
||||||
|
- Prefix `gz`
|
||||||
|
|
||||||
|
| Action | Shortcut | Description |
|
||||||
|
| ------------------------------ | -------- | ----------------------------------------------- |
|
||||||
|
| Add surrounding characters | `gzaiw'` | Add `'` around the word under cursor |
|
||||||
|
| Delete surrounding characters | `gzd'` | Delete `'` around the word under cursor |
|
||||||
|
| Replace surrounding characters | `gzr'"` | Replace `'` by `"` around the word under cursor |
|
||||||
|
| Highlight surrounding | `gzh'` | Highlight `'` around the word under cursor |
|
||||||
|
|
||||||
|
## Text Manipulation
|
||||||
|
|
||||||
|
| Action | |
|
||||||
|
| -------------------------------------- | ------------- |
|
||||||
|
| Join Selection of Lines With Space | `:join` |
|
||||||
|
| Join without spaces | `:join!` |
|
||||||
|
| Join with LSP intelligence(treesj) | `<Space> + j` |
|
||||||
|
| Split Line into Multiple Lines(treesj) | `<Space> + s` |
|
||||||
|
|
||||||
|
## Convert Text Case
|
||||||
|
|
||||||
|
| Action | |
|
||||||
|
| -------------------- | --- |
|
||||||
|
| Toggle text's case | `~` |
|
||||||
|
| Convert to uppercase | `U` |
|
||||||
|
| Convert to lowercase | `u` |
|
||||||
|
|
||||||
|
## Miscellaneous
|
||||||
|
|
||||||
|
| Action | |
|
||||||
|
| ---------------------------- | -------------------------------------------- |
|
||||||
|
| Save selected text to a file | `:w filename` (Will show `:'<,'>w filename`) |
|
||||||
|
| Show all Yank History | `:<Space> + yh` |
|
||||||
|
| Show undo history | `:<Space> + uh` |
|
||||||
|
|
||||||
|
## Additional Resources
|
||||||
|
|
||||||
|
For more detailed information and advanced usage, refer to:
|
||||||
|
|
||||||
|
1. [AstroNvim walkthrough](https://astronvim.com/Basic%20Usage/walkthrough)
|
||||||
|
2. [./astronvim_user/mapping.lua](./astronvim_user/mappings.lua)
|
||||||
|
3. All the plugins' documentations
|
||||||
@@ -0,0 +1,459 @@
|
|||||||
|
return {
|
||||||
|
colorscheme = "catppuccin",
|
||||||
|
|
||||||
|
options = {
|
||||||
|
opt = {
|
||||||
|
relativenumber = true, -- Show relative numberline
|
||||||
|
signcolumn = "auto", -- Show sign column when used only
|
||||||
|
spell = false, -- Spell checking
|
||||||
|
swapfile = false, -- Swapfile
|
||||||
|
smartindent = false, -- fix https://github.com/ryan4yin/nix-config/issues/4
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
plugins = {
|
||||||
|
"AstroNvim/astrocommunity",
|
||||||
|
-- colorscheme - catppuccin
|
||||||
|
{ import = "astrocommunity.colorscheme.catppuccin" },
|
||||||
|
-- Highly experimental plugin that completely replaces
|
||||||
|
-- the UI for messages, cmdline and the popupmenu.
|
||||||
|
{ import = "astrocommunity.utility.noice-nvim" },
|
||||||
|
-- Fully featured & enhanced replacement for copilot.vim
|
||||||
|
-- <Tab> work with both auto completion in cmp and copilot
|
||||||
|
{ import = "astrocommunity.media.vim-wakatime" },
|
||||||
|
{ import = "astrocommunity.motion.leap-nvim" },
|
||||||
|
{ import = "astrocommunity.motion.flit-nvim" },
|
||||||
|
{ import = "astrocommunity.scrolling.nvim-scrollbar" },
|
||||||
|
{ import = "astrocommunity.editing-support.todo-comments-nvim" },
|
||||||
|
-- Language Support
|
||||||
|
---- Frontend & NodeJS
|
||||||
|
{ import = "astrocommunity.pack.typescript-all-in-one" },
|
||||||
|
{ import = "astrocommunity.pack.tailwindcss" },
|
||||||
|
{ import = "astrocommunity.pack.html-css" },
|
||||||
|
{ import = "astrocommunity.pack.prisma" },
|
||||||
|
{ import = "astrocommunity.pack.vue" },
|
||||||
|
---- Configuration Language
|
||||||
|
{ import = "astrocommunity.pack.markdown" },
|
||||||
|
{ import = "astrocommunity.pack.json" },
|
||||||
|
{ import = "astrocommunity.pack.yaml" },
|
||||||
|
{ import = "astrocommunity.pack.toml" },
|
||||||
|
---- Backend
|
||||||
|
{ import = "astrocommunity.pack.lua" },
|
||||||
|
{ import = "astrocommunity.pack.go" },
|
||||||
|
{ import = "astrocommunity.pack.rust" },
|
||||||
|
{ import = "astrocommunity.pack.python" },
|
||||||
|
{ import = "astrocommunity.pack.java" },
|
||||||
|
-- { import = "astrocommunity.pack.nix" }, -- manually add config for nix, comment this one.
|
||||||
|
{ import = "astrocommunity.pack.proto" },
|
||||||
|
---- Operation & Cloud Native
|
||||||
|
{ import = "astrocommunity.pack.terraform" },
|
||||||
|
{ import = "astrocommunity.pack.bash" },
|
||||||
|
{ import = "astrocommunity.pack.cmake" },
|
||||||
|
{ import = "astrocommunity.pack.cpp" },
|
||||||
|
{ import = "astrocommunity.pack.docker" },
|
||||||
|
-- Motion
|
||||||
|
{ import = "astrocommunity.motion.mini-surround" },
|
||||||
|
-- https://github.com/echasnovski/mini.ai
|
||||||
|
{ import = "astrocommunity.motion.mini-ai" },
|
||||||
|
{ import = "astrocommunity.motion.flash-nvim" },
|
||||||
|
{ "folke/flash.nvim", vscode = false },
|
||||||
|
-- Lua implementation of CamelCaseMotion, with extra consideration of punctuation.
|
||||||
|
{ import = "astrocommunity.motion.nvim-spider" },
|
||||||
|
-- AI Assistant
|
||||||
|
{ import = "astrocommunity.completion.copilot-lua-cmp" },
|
||||||
|
-- Custom copilot-lua to enable filtypes: markdown
|
||||||
|
{
|
||||||
|
"zbirenbaum/copilot.lua",
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.filetypes = {
|
||||||
|
yaml = true,
|
||||||
|
markdown = true,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"0x00-ketsu/autosave.nvim",
|
||||||
|
-- lazy-loading on events
|
||||||
|
event = { "InsertLeave", "TextChanged" },
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.prompt_style = "notify" -- or stdout
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- markdown preview
|
||||||
|
{
|
||||||
|
"0x00-ketsu/markdown-preview.nvim",
|
||||||
|
ft = { "md", "markdown", "mkd", "mkdn", "mdwn", "mdown", "mdtxt", "mdtext", "rmd", "wiki" },
|
||||||
|
config = function()
|
||||||
|
require("markdown-preview").setup({
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the setup section below
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- clipboard manager
|
||||||
|
{
|
||||||
|
"gbprod/yanky.nvim",
|
||||||
|
opts = function()
|
||||||
|
local mapping = require("yanky.telescope.mapping")
|
||||||
|
local mappings = mapping.get_defaults()
|
||||||
|
mappings.i["<c-p>"] = nil
|
||||||
|
return {
|
||||||
|
highlight = { timer = 200 },
|
||||||
|
picker = {
|
||||||
|
telescope = {
|
||||||
|
use_default_mappings = false,
|
||||||
|
mappings = mappings,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
keys = {
|
||||||
|
{
|
||||||
|
"y",
|
||||||
|
"<Plug>(YankyYank)",
|
||||||
|
mode = { "n", "x" },
|
||||||
|
desc = "Yank text",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"p",
|
||||||
|
"<Plug>(YankyPutAfter)",
|
||||||
|
mode = { "n", "x" },
|
||||||
|
desc = "Put yanked text after cursor",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"P",
|
||||||
|
"<Plug>(YankyPutBefore)",
|
||||||
|
mode = { "n", "x" },
|
||||||
|
desc = "Put yanked text before cursor",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gp",
|
||||||
|
"<Plug>(YankyGPutAfter)",
|
||||||
|
mode = { "n", "x" },
|
||||||
|
desc = "Put yanked text after selection",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"gP",
|
||||||
|
"<Plug>(YankyGPutBefore)",
|
||||||
|
mode = { "n", "x" },
|
||||||
|
desc = "Put yanked text before selection",
|
||||||
|
},
|
||||||
|
{ "[y", "<Plug>(YankyCycleForward)", desc = "Cycle forward through yank history" },
|
||||||
|
{ "]y", "<Plug>(YankyCycleBackward)", desc = "Cycle backward through yank history" },
|
||||||
|
{ "]p", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
|
||||||
|
{ "[p", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
|
||||||
|
{ "]P", "<Plug>(YankyPutIndentAfterLinewise)", desc = "Put indented after cursor (linewise)" },
|
||||||
|
{ "[P", "<Plug>(YankyPutIndentBeforeLinewise)", desc = "Put indented before cursor (linewise)" },
|
||||||
|
{ ">p", "<Plug>(YankyPutIndentAfterShiftRight)", desc = "Put and indent right" },
|
||||||
|
{ "<p", "<Plug>(YankyPutIndentAfterShiftLeft)", desc = "Put and indent left" },
|
||||||
|
{ ">P", "<Plug>(YankyPutIndentBeforeShiftRight)", desc = "Put before and indent right" },
|
||||||
|
{ "<P", "<Plug>(YankyPutIndentBeforeShiftLeft)", desc = "Put before and indent left" },
|
||||||
|
{ "=p", "<Plug>(YankyPutAfterFilter)", desc = "Put after applying a filter" },
|
||||||
|
{ "=P", "<Plug>(YankyPutBeforeFilter)", desc = "Put before applying a filter" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Enhanced matchparen.vim plugin for Neovim to highlight the outer pair.
|
||||||
|
{
|
||||||
|
"utilyre/sentiment.nvim",
|
||||||
|
version = "*",
|
||||||
|
event = "VeryLazy", -- keep for lazy loading
|
||||||
|
opts = {
|
||||||
|
-- config
|
||||||
|
},
|
||||||
|
init = function()
|
||||||
|
-- `matchparen.vim` needs to be disabled manually in case of lazy loading
|
||||||
|
vim.g.loaded_matchparen = 1
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- joining blocks of code into oneline, or splitting one line into multiple lines.
|
||||||
|
{
|
||||||
|
"Wansmer/treesj",
|
||||||
|
keys = { "<space>m", "<space>j", "<space>s" },
|
||||||
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||||
|
config = function()
|
||||||
|
require("treesj").setup({ --[[ your config ]]
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- File explorer(Custom configs)
|
||||||
|
{
|
||||||
|
"nvim-neo-tree/neo-tree.nvim",
|
||||||
|
opts = {
|
||||||
|
filesystem = {
|
||||||
|
filtered_items = {
|
||||||
|
visible = true, -- visible by default
|
||||||
|
hide_dotfiles = false,
|
||||||
|
hide_gitignored = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- The plugin offers the alibity to refactor code.
|
||||||
|
{
|
||||||
|
"ThePrimeagen/refactoring.nvim",
|
||||||
|
dependencies = {
|
||||||
|
{ "nvim-lua/plenary.nvim" },
|
||||||
|
{ "nvim-treesitter/nvim-treesitter" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- The plugin offers the abilibty to search and replace.
|
||||||
|
{
|
||||||
|
"nvim-pack/nvim-spectre",
|
||||||
|
dependencies = {
|
||||||
|
{ "nvim-lua/plenary.nvim" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- full signature help, docs and completion for the nvim lua API.
|
||||||
|
{ "folke/neodev.nvim", opts = {} },
|
||||||
|
|
||||||
|
{ "RRethy/vim-illuminate", config = function() end },
|
||||||
|
|
||||||
|
-- Language Parser for syntax highlighting / indentation / folding / Incremental selection
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local utils = require("astronvim.utils")
|
||||||
|
opts.incremental_selection = {
|
||||||
|
enable = true,
|
||||||
|
keymaps = {
|
||||||
|
init_selection = "<C-space>", -- Ctrl + Space
|
||||||
|
node_incremental = "<C-space>",
|
||||||
|
scope_incremental = "<A-space>", -- Alt + Space
|
||||||
|
node_decremental = "<bs>", -- Backspace
|
||||||
|
},
|
||||||
|
}
|
||||||
|
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, {
|
||||||
|
-- neovim
|
||||||
|
"vim",
|
||||||
|
"lua",
|
||||||
|
-- operation & cloud native
|
||||||
|
"dockerfile",
|
||||||
|
"hcl",
|
||||||
|
"jsonnet",
|
||||||
|
"regex",
|
||||||
|
"terraform",
|
||||||
|
"nix",
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- implementation/definition preview
|
||||||
|
{
|
||||||
|
"rmagatti/goto-preview",
|
||||||
|
config = function()
|
||||||
|
require("goto-preview").setup({})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Undo tree
|
||||||
|
{ "debugloop/telescope-undo.nvim" },
|
||||||
|
|
||||||
|
-- Install lsp, formmatter and others via home manager instead of Mason.nvim
|
||||||
|
-- LSP installations
|
||||||
|
{
|
||||||
|
"williamboman/mason-lspconfig.nvim",
|
||||||
|
-- overwrite ensure_installed to install lsp via home manager(except emmet_ls)
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.ensure_installed = {
|
||||||
|
"emmet_ls", -- not exist in nixpkgs, so install it via mason
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
-- Formatters/Linter installation
|
||||||
|
{
|
||||||
|
"jay-babu/mason-null-ls.nvim",
|
||||||
|
-- ensure_installed nothing
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.ensure_installed = nil
|
||||||
|
opts.automatic_installation = false
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
opts = function(_, opts)
|
||||||
|
local null_ls = require("null-ls")
|
||||||
|
local code_actions = null_ls.builtins.code_actions
|
||||||
|
local diagnostics = null_ls.builtins.diagnostics
|
||||||
|
local formatting = null_ls.builtins.formatting
|
||||||
|
local hover = null_ls.builtins.hover
|
||||||
|
local completion = null_ls.builtins.completion
|
||||||
|
-- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md
|
||||||
|
if type(opts.sources) == "table" then
|
||||||
|
vim.list_extend(opts.sources, {
|
||||||
|
-- Common Code Actions
|
||||||
|
code_actions.gitsigns,
|
||||||
|
-- common refactoring actions based off the Refactoring book by Martin Fowler
|
||||||
|
code_actions.refactoring,
|
||||||
|
code_actions.gomodifytags, -- Go - modify struct field tags
|
||||||
|
code_actions.impl, -- Go - generate interface method stubs
|
||||||
|
code_actions.shellcheck,
|
||||||
|
code_actions.proselint, -- English prose linter
|
||||||
|
code_actions.statix, -- Lints and suggestions for Nix.
|
||||||
|
|
||||||
|
-- Diagnostic
|
||||||
|
diagnostics.actionlint, -- GitHub Actions workflow syntax checking
|
||||||
|
diagnostics.buf, -- check text in current buffer
|
||||||
|
diagnostics.checkmake, -- check Makefiles
|
||||||
|
diagnostics.deadnix, -- Scan Nix files for dead code.
|
||||||
|
|
||||||
|
-- Formatting
|
||||||
|
formatting.prettier, -- js/ts/vue/css/html/json/... formatter
|
||||||
|
diagnostics.hadolint, -- Dockerfile linter
|
||||||
|
formatting.black, -- Python formatter
|
||||||
|
formatting.ruff, -- extremely fast Python linter
|
||||||
|
formatting.goimports, -- Go formatter
|
||||||
|
formatting.shfmt, -- Shell formatter
|
||||||
|
formatting.rustfmt, -- Rust formatter
|
||||||
|
formatting.taplo, -- TOML formatteautoindentr
|
||||||
|
formatting.terraform_fmt, -- Terraform formatter
|
||||||
|
formatting.stylua, -- Lua formatter
|
||||||
|
formatting.alejandra, -- Nix formatter
|
||||||
|
formatting.sqlfluff.with({ -- SQL formatter
|
||||||
|
extra_args = { "--dialect", "postgres" }, -- change to your dialect
|
||||||
|
}),
|
||||||
|
formatting.nginx_beautifier, -- Nginx formatter
|
||||||
|
null_ls.builtins.formatting.verible_verilog_format, -- Verilog formatter
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
-- Debugger installation
|
||||||
|
{
|
||||||
|
"jay-babu/mason-nvim-dap.nvim",
|
||||||
|
-- overrides `require("mason-nvim-dap").setup(...)`
|
||||||
|
opts = function(_, opts)
|
||||||
|
opts.ensure_installed = nil
|
||||||
|
opts.automatic_installation = false
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
branch = "0.1.x",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
|
init = function()
|
||||||
|
-- 1. Disable highlighting for certain filetypes
|
||||||
|
-- 2. Ignore files larger than a certain filesize
|
||||||
|
local previewers = require("telescope.previewers")
|
||||||
|
|
||||||
|
local _bad = { ".*%.csv", ".*%.min.js" } -- Put all filetypes that slow you down in this array
|
||||||
|
local filesize_threshold = 300 * 1024 -- 300KB
|
||||||
|
local bad_files = function(filepath)
|
||||||
|
for _, v in ipairs(_bad) do
|
||||||
|
if filepath:match(v) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
local new_maker = function(filepath, bufnr, opts)
|
||||||
|
opts = opts or {}
|
||||||
|
if opts.use_ft_detect == nil then
|
||||||
|
opts.use_ft_detect = true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 1. Check if the file is in the bad_files array, and if so, don't highlight it
|
||||||
|
opts.use_ft_detect = opts.use_ft_detect == false and false or bad_files(filepath)
|
||||||
|
|
||||||
|
-- 2. Check the file size, and ignore it if it's too big(preview nothing).
|
||||||
|
filepath = vim.fn.expand(filepath)
|
||||||
|
vim.loop.fs_stat(filepath, function(_, stat)
|
||||||
|
if not stat then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if stat.size > filesize_threshold then
|
||||||
|
return
|
||||||
|
else
|
||||||
|
previewers.buffer_previewer_maker(filepath, bufnr, opts)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
require("telescope").setup({
|
||||||
|
defaults = {
|
||||||
|
buffer_previewer_maker = new_maker,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- Configure require("lazy").setup() options
|
||||||
|
lazy = {
|
||||||
|
defaults = { lazy = true },
|
||||||
|
performance = {
|
||||||
|
rtp = {
|
||||||
|
-- customize default disabled vim plugins
|
||||||
|
disabled_plugins = {},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
|
||||||
|
lsp = {
|
||||||
|
config = {
|
||||||
|
-- the offset_enconding of clangd will confilicts whit null-ls
|
||||||
|
-- so we need to manually set it to utf-8
|
||||||
|
clangd = {
|
||||||
|
capabilities = {
|
||||||
|
offsetEncoding = "utf-8",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
-- enable servers that installed by home-manager instead of mason
|
||||||
|
servers = {
|
||||||
|
---- Frontend & NodeJS
|
||||||
|
"tsserver", -- typescript/javascript language server
|
||||||
|
"tailwindcss", -- tailwindcss language server
|
||||||
|
"html", -- html language server
|
||||||
|
"cssls", -- css language server
|
||||||
|
"prismals", -- prisma language server
|
||||||
|
"volar", -- vue language server
|
||||||
|
---- Configuration Language
|
||||||
|
"marksman", -- markdown ls
|
||||||
|
"jsonls", -- json language server
|
||||||
|
"yamlls", -- yaml language server
|
||||||
|
"taplo", -- toml language server
|
||||||
|
---- Backend
|
||||||
|
"lua_ls", -- lua
|
||||||
|
"gopls", -- go
|
||||||
|
"rust_analyzer", -- rust
|
||||||
|
"pyright", -- python
|
||||||
|
"ruff_lsp", -- extremely fast Python linter and code transformation
|
||||||
|
"jdtls", -- java
|
||||||
|
"nil_ls", -- nix language server
|
||||||
|
"bufls", -- protocol buffer language server
|
||||||
|
"zls", -- zig language server
|
||||||
|
---- HDL
|
||||||
|
"verible", -- verilog language server
|
||||||
|
---- Operation & Cloud Nativautoindente
|
||||||
|
"bashls", -- bash
|
||||||
|
"cmake", -- cmake language server
|
||||||
|
"clangd", -- c/c++
|
||||||
|
"dockerls", -- dockerfile
|
||||||
|
"jsonnet_ls", -- jsonnet language server
|
||||||
|
"terraformls", -- terraform hcl
|
||||||
|
},
|
||||||
|
formatting = {
|
||||||
|
disabled = {},
|
||||||
|
format_on_save = {
|
||||||
|
enabled = true,
|
||||||
|
allow_filetypes = {
|
||||||
|
"go",
|
||||||
|
"jsonnet",
|
||||||
|
"rust",
|
||||||
|
"terraform",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
-- Mapping data with "desc" stored directly by vim.keymap.set().
|
||||||
|
--
|
||||||
|
-- Please use this mappings table to set keyboard mapping since this is the
|
||||||
|
-- lower level configuration and more robust one. (which-key will
|
||||||
|
-- automatically pick-up stored data by this setting.)
|
||||||
|
local utils = require "astronvim.utils"
|
||||||
|
|
||||||
|
require("telescope").load_extension("refactoring")
|
||||||
|
require("telescope").load_extension("yank_history")
|
||||||
|
require("telescope").load_extension("undo")
|
||||||
|
|
||||||
|
return {
|
||||||
|
-- normal mode
|
||||||
|
n = {
|
||||||
|
-- second key is the lefthand side of the map
|
||||||
|
-- mappings seen under group name "Buffer"
|
||||||
|
["<leader>bn"] = { "<cmd>tabnew<cr>", desc = "New tab" },
|
||||||
|
-- quick save
|
||||||
|
["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
||||||
|
|
||||||
|
-- Terminal
|
||||||
|
-- NOTE: https://neovim.io/doc/user/builtin.html#jobstart()
|
||||||
|
-- 1. If {cmd} is a List it runs directly (no 'shell')
|
||||||
|
-- 2. If {cmd} is a String it runs in the 'shell'
|
||||||
|
["<leader>tp"] = { function() utils.toggle_term_cmd({ cmd = "ipython" }) end, desc = "ToggleTerm python" },
|
||||||
|
|
||||||
|
-- search and replace globally
|
||||||
|
['<leader>ss'] = {'<cmd>lua require("spectre").toggle()<CR>', desc = "Toggle Spectre" },
|
||||||
|
['<leader>sw'] = {'<cmd>lua require("spectre").open_visual({select_word=true})<CR>', desc = "Search current word" },
|
||||||
|
['<leader>sp'] ={'<cmd>lua require("spectre").open_file_search({select_word=true})<CR>', desc = "Search on current file" },
|
||||||
|
|
||||||
|
-- refactoring
|
||||||
|
["<leader>ri"] = { function() require('refactoring').refactor('Inline Variable') end, desc = "Inverse of extract variable" },
|
||||||
|
["<leader>rb"] = { function() require('refactoring').refactor('Extract Block') end, desc = "Extract Block" },
|
||||||
|
["<leader>rbf"] = { function() require('refactoring').refactor('Extract Block To File') end, desc = "Extract Block To File" },
|
||||||
|
["<leader>rr"] = { function() require('telescope').extensions.refactoring.refactors() end, desc = "Prompt for a refactor to apply" },
|
||||||
|
["<leader>rp"] = { function() require('refactoring').debug.printf({below = false}) end, desc = "Insert print statement to mark the calling of a function" },
|
||||||
|
["<leader>rv"] = { function() require('refactoring').debug.print_var() end, desc = "Insert print statement to print a variable" },
|
||||||
|
["<leader>rc"] = { function() require('refactoring').debug.cleanup({}) end, desc = "Cleanup of all generated print statements" },
|
||||||
|
|
||||||
|
-- yank_history
|
||||||
|
["<leader>yh"] = { function() require("telescope").extensions.yank_history.yank_history() end, desc = "Preview Yank History" },
|
||||||
|
|
||||||
|
-- undo history
|
||||||
|
["<leader>uh"] = {"<cmd>Telescope undo<cr>", desc="Telescope undo" },
|
||||||
|
|
||||||
|
-- implementation/definition preview
|
||||||
|
["gpd"] = { "<cmd>lua require('goto-preview').goto_preview_definition()<CR>", desc="goto_preview_definition" },
|
||||||
|
["gpt"] = { "<cmd>lua require('goto-preview').goto_preview_type_definition()<CR>", desc="goto_preview_type_definition" },
|
||||||
|
["gpi"] = { "<cmd>lua require('goto-preview').goto_preview_implementation()<CR>", desc="goto_preview_implementation" },
|
||||||
|
["gP" ] = { "<cmd>lua require('goto-preview').close_all_win()<CR>", desc="close_all_win" },
|
||||||
|
["gpr"] = { "<cmd>lua require('goto-preview').goto_preview_references()<CR>", desc="goto_preview_references" },
|
||||||
|
},
|
||||||
|
-- Visual mode
|
||||||
|
v = {
|
||||||
|
-- search and replace globally
|
||||||
|
['<leader>sw'] = {'<esc><cmd>lua require("spectre").open_visual()<CR>', desc = "Search current word" },
|
||||||
|
},
|
||||||
|
-- visual mode(what's the difference between v and x???)
|
||||||
|
x = {
|
||||||
|
-- refactoring
|
||||||
|
["<leader>ri"] = { function() require('refactoring').refactor('Inline Variable') end, desc = "Inverse of extract variable" },
|
||||||
|
["<leader>re"] = { function() require('refactoring').refactor('Extract Function') end, desc = "Extracts the selected code to a separate function" },
|
||||||
|
["<leader>rf"] = { function() require('refactoring').refactor('Extract Function To File') end, desc = "Extract Function To File" },
|
||||||
|
["<leader>rv"] = { function() require('refactoring').refactor('Extract Variable') end, desc = "Extracts occurrences of a selected expression to its own variable" },
|
||||||
|
["<leader>rr"] = { function() require('telescope').extensions.refactoring.refactors() end, desc = "Prompt for a refactor to apply" },
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
astronvim,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
###############################################################################
|
||||||
|
#
|
||||||
|
# AstroNvim's configuration and all its dependencies(lsp, formatter, etc.)
|
||||||
|
#
|
||||||
|
#e#############################################################################
|
||||||
|
{
|
||||||
|
xdg.configFile = {
|
||||||
|
# astronvim's config
|
||||||
|
"nvim".source = astronvim;
|
||||||
|
|
||||||
|
# my custom astronvim config, astronvim will load it after base config
|
||||||
|
# https://github.com/AstroNvim/AstroNvim/blob/v3.32.0/lua/astronvim/bootstrap.lua#L15-L16
|
||||||
|
"astronvim/lua/user".source = ./astronvim_user;
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs.config = {
|
||||||
|
programs.npm.npmrc = ''
|
||||||
|
prefix = ''${HOME}/.npm-global
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
neovim = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
defaultEditor = true;
|
||||||
|
viAlias = true;
|
||||||
|
vimAlias = true;
|
||||||
|
|
||||||
|
# currently we use lazy.nvim as neovim's package manager, so comment this one.
|
||||||
|
# plugins = with pkgs.vimPlugins; [
|
||||||
|
# # search all the plugins using https://search.nixos.org/packages
|
||||||
|
# ];
|
||||||
|
|
||||||
|
# Extra packages only available to nvim(won't pollute the global home environment)
|
||||||
|
extraPackages = with pkgs;
|
||||||
|
[
|
||||||
|
#-- c/c++
|
||||||
|
cmake
|
||||||
|
cmake-language-server
|
||||||
|
gnumake
|
||||||
|
checkmake
|
||||||
|
gcc # c/c++ compiler, required by nvim-treesitter!
|
||||||
|
llvmPackages.clang-unwrapped # c/c++ tools with clang-tools such as clangd
|
||||||
|
gdb
|
||||||
|
lldb
|
||||||
|
|
||||||
|
#-- python
|
||||||
|
nodePackages.pyright # python language server
|
||||||
|
python3Packages.black # python formatter
|
||||||
|
python3Packages.ruff-lsp
|
||||||
|
(python3.withPackages (
|
||||||
|
ps:
|
||||||
|
with ps; [
|
||||||
|
pynvim # Python client and plugin host for Nvim
|
||||||
|
|
||||||
|
ipython
|
||||||
|
pandas
|
||||||
|
requests
|
||||||
|
pyquery
|
||||||
|
pyyaml
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
|
#-- rust
|
||||||
|
rust-analyzer
|
||||||
|
cargo # rust package manager
|
||||||
|
rustfmt
|
||||||
|
|
||||||
|
#-- zig
|
||||||
|
zls
|
||||||
|
|
||||||
|
#-- nix
|
||||||
|
nil
|
||||||
|
rnix-lsp
|
||||||
|
# nixd
|
||||||
|
statix # Lints and suggestions for the nix programming language
|
||||||
|
deadnix # Find and remove unused code in .nix source files
|
||||||
|
alejandra # Nix Code Formatter
|
||||||
|
|
||||||
|
#-- golang
|
||||||
|
go
|
||||||
|
gomodifytags
|
||||||
|
iferr # generate error handling code for go
|
||||||
|
impl # generate function implementation for go
|
||||||
|
gotools # contains tools like: godoc, goimports, etc.
|
||||||
|
gopls # go language server
|
||||||
|
delve # go debugger
|
||||||
|
|
||||||
|
# -- java
|
||||||
|
jdk17
|
||||||
|
gradle
|
||||||
|
maven
|
||||||
|
spring-boot-cli
|
||||||
|
|
||||||
|
#-- lua
|
||||||
|
stylua
|
||||||
|
lua-language-server
|
||||||
|
|
||||||
|
#-- bash
|
||||||
|
nodePackages.bash-language-server
|
||||||
|
shellcheck
|
||||||
|
shfmt
|
||||||
|
|
||||||
|
#-- javascript/typescript --#
|
||||||
|
nodePackages.nodejs
|
||||||
|
nodePackages.typescript
|
||||||
|
nodePackages.typescript-language-server
|
||||||
|
# HTML/CSS/JSON/ESLint language servers extracted from vscode
|
||||||
|
nodePackages.vscode-langservers-extracted
|
||||||
|
nodePackages."@tailwindcss/language-server"
|
||||||
|
|
||||||
|
#-- CloudNative
|
||||||
|
nodePackages.dockerfile-language-server-nodejs
|
||||||
|
# terraform # install via brew on macOS
|
||||||
|
terraform-ls
|
||||||
|
jsonnet
|
||||||
|
jsonnet-language-server
|
||||||
|
hadolint # Dockerfile linter
|
||||||
|
|
||||||
|
#-- Others
|
||||||
|
taplo # TOML language server / formatter / validator
|
||||||
|
nodePackages.yaml-language-server
|
||||||
|
sqlfluff # SQL linter
|
||||||
|
actionlint # GitHub Actions linter
|
||||||
|
buf # protoc plugin for linting and formatting
|
||||||
|
proselint # English prose linter
|
||||||
|
guile # scheme language
|
||||||
|
|
||||||
|
#-- Misc
|
||||||
|
tree-sitter # common language parser/highlighter
|
||||||
|
nodePackages.prettier # common code formatter
|
||||||
|
marksman # language server for markdown
|
||||||
|
glow # markdown previewer
|
||||||
|
fzf
|
||||||
|
|
||||||
|
#-- Optional Requirements:
|
||||||
|
gdu # disk usage analyzer, required by AstroNvim
|
||||||
|
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
|
||||||
|
]
|
||||||
|
++ (
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then []
|
||||||
|
else [
|
||||||
|
#-- verilog / systemverilog
|
||||||
|
verible
|
||||||
|
]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{ nushell-scripts, ...}: {
|
||||||
|
programs.bash = {
|
||||||
|
# load the alias file for work
|
||||||
|
bashrcExtra = ''
|
||||||
|
alias_for_work=/etc/agenix/alias-for-work.bash
|
||||||
|
if [ -f $alias_for_work ]; then
|
||||||
|
. $alias_for_work
|
||||||
|
else
|
||||||
|
echo "No alias file found for work"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.nushell = {
|
||||||
|
# load the alias file for work
|
||||||
|
# the file must exist, otherwise nushell will complain about it!
|
||||||
|
#
|
||||||
|
# currently, nushell does not support conditional sourcing of files
|
||||||
|
# https://github.com/nushell/nushell/issues/8214
|
||||||
|
extraConfig = ''
|
||||||
|
source /etc/agenix/alias-for-work.nushell
|
||||||
|
use ${nushell-scripts}/custom-completions/git/git-completions.nu *
|
||||||
|
use ${nushell-scripts}/custom-completions/glow/glow-completions.nu *
|
||||||
|
use ${nushell-scripts}/custom-completions/make/make-completions.nu *
|
||||||
|
use ${nushell-scripts}/custom-completions/nix/nix-completions.nu *
|
||||||
|
use ${nushell-scripts}/custom-completions/man/man-completions.nu *
|
||||||
|
use ${nushell-scripts}/custom-completions/cargo/cargo-completions.nu *
|
||||||
|
use ${nushell-scripts}/custom-completions/zellij/zellij-completions.nu *
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
# Termianl Emulators
|
||||||
|
|
||||||
|
1. kitty: My main terminal emulator.
|
||||||
|
2. wezterm: My secondary terminal emulator.
|
||||||
|
3. alacritty: Standby terminal.
|
||||||
|
|
||||||
|
|
||||||
|
## 'xterm-kitty': unknown terminal type when `ssh` into a remote host or `sudo xxx`
|
||||||
|
|
||||||
|
> https://sw.kovidgoyal.net/kitty/faq/#i-get-errors-about-the-terminal-being-unknown-or-opening-the-terminal-failing-or-functional-keys-like-arrow-keys-don-t-work
|
||||||
|
|
||||||
|
> https://wezfurlong.org/wezterm/config/lua/config/term.html
|
||||||
|
|
||||||
|
kitty set `TERM` to `xterm-kitty` by default, and TUI apps like `viu`, `yazi`, `curses` will try to search in the host's [terminfo(terminal capability data base)](https://linux.die.net/man/5/terminfo) for value of `TERM` to determine the capabilities of the terminal.
|
||||||
|
|
||||||
|
But when you `ssh` into a remote host, the remote host is very likely to not have `xterm-kitty` in its terminfo, so you will get this error:
|
||||||
|
|
||||||
|
```
|
||||||
|
'xterm-kitty': unknown terminal type
|
||||||
|
```
|
||||||
|
|
||||||
|
Or when you `sudo xxx`, `sudo` won't preserve the `TERM` variable, it will be reset to root's default `TERM` value, which is `xterm` or `xterm-256color` in most linux distributions, so you will get this error:
|
||||||
|
|
||||||
|
```
|
||||||
|
'xterm-256color': unknown terminal type
|
||||||
|
```
|
||||||
|
|
||||||
|
or
|
||||||
|
|
||||||
|
```
|
||||||
|
Error opening terminal: xterm-kitty.
|
||||||
|
```
|
||||||
|
|
||||||
|
NixOS preserve the `TERMINFO` and `TERMINFO_DIRS` environment variables, for `root` and the `wheel` group: [nixpkgs/nixos/modules/config/terminfo.nix](https://github.com/NixOS/nixpkgs/blob/nixos-23.11/nixos/modules/config/terminfo.nix#L18)
|
||||||
|
|
||||||
|
For nix-darwin, take a look at <https://github.com/LnL7/nix-darwin/wiki/Terminfo-issues>
|
||||||
|
|
||||||
|
### Solutions
|
||||||
|
|
||||||
|
Simplest solution, it will automatically copy over the terminfo files and also magically enable shell integration on the remote machine:
|
||||||
|
|
||||||
|
```
|
||||||
|
kitten ssh user@host
|
||||||
|
```
|
||||||
|
|
||||||
|
Or if you do not care about kitty's features(such as true color & graphics protocol), you can simply set `TERM` to `xterm-256color`, which is built-in in most linux distributions:
|
||||||
|
|
||||||
|
```
|
||||||
|
export TERM=xterm-256color
|
||||||
|
```
|
||||||
|
|
||||||
|
If you need kitty's features, but do not like the magic of `kitten`, you can manually install kitty's terminfo on the remote host:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# install on ubuntu / debian
|
||||||
|
sudo apt-get install kitty-terminfo
|
||||||
|
|
||||||
|
# or copy from local machine
|
||||||
|
infocmp -a xterm-kitty | ssh myserver tic -x -o \~/.terminfo /dev/stdin
|
||||||
|
```
|
||||||
|
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
{pkgs, catppuccin-alacritty, ...}:
|
||||||
|
###########################################################
|
||||||
|
#
|
||||||
|
# Alacritty Configuration
|
||||||
|
#
|
||||||
|
# Useful Hot Keys for macOS:
|
||||||
|
# 1. Multi-Window: `command + N`
|
||||||
|
# 2. Increase Font Size: `command + =` | `command + +`
|
||||||
|
# 3. Decrease Font Size: `command + -` | `command + _`
|
||||||
|
# 4. Search Text: `command + F`
|
||||||
|
# 5. And Other common shortcuts such as Copy, Paste, Cursor Move, etc.
|
||||||
|
#
|
||||||
|
# Useful Hot Keys for Linux:
|
||||||
|
# 1. Increase Font Size: `ctrl + shift + =` | `ctrl + shift + +`
|
||||||
|
# 2. Decrease Font Size: `ctrl + shift + -` | `ctrl + shift + _`
|
||||||
|
# 3. Search Text: `ctrl + shift + N`
|
||||||
|
# 4. And Other common shortcuts such as Copy, Paste, Cursor Move, etc.
|
||||||
|
#
|
||||||
|
# Note: Alacritty do not have support for Tabs, and any graphic protocol.
|
||||||
|
#
|
||||||
|
###########################################################
|
||||||
|
{
|
||||||
|
xdg.configFile."alacritty/theme_catppuccin.yml".source = "${catppuccin-alacritty}/catppuccin-mocha.yml";
|
||||||
|
programs.alacritty = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."alacritty/alacritty.yml".text =
|
||||||
|
''
|
||||||
|
import:
|
||||||
|
# all alacritty themes can be found at
|
||||||
|
# https://github.com/alacritty/alacritty-theme
|
||||||
|
- ~/.config/alacritty/theme_catppuccin.yml
|
||||||
|
|
||||||
|
window:
|
||||||
|
# Background opacity
|
||||||
|
#
|
||||||
|
# Window opacity as a floating point number from `0.0` to `1.0`.
|
||||||
|
# The value `0.0` is completely transparent and `1.0` is opaque.
|
||||||
|
opacity: 0.93
|
||||||
|
|
||||||
|
# Startup Mode (changes require restart)
|
||||||
|
#
|
||||||
|
# Values for `startup_mode`:
|
||||||
|
# - Windowed
|
||||||
|
# - Maximized
|
||||||
|
# - Fullscreen
|
||||||
|
#
|
||||||
|
# Values for `startup_mode` (macOS only):
|
||||||
|
# - SimpleFullscreen
|
||||||
|
startup_mode: Maximized
|
||||||
|
|
||||||
|
# Allow terminal applications to change Alacritty's window title.
|
||||||
|
dynamic_title: true
|
||||||
|
|
||||||
|
# Make `Option` key behave as `Alt` (macOS only):
|
||||||
|
# - OnlyLeft
|
||||||
|
# - OnlyRight
|
||||||
|
# - Both
|
||||||
|
# - None (default)
|
||||||
|
option_as_alt: Both
|
||||||
|
|
||||||
|
scrolling:
|
||||||
|
# Maximum number of lines in the scrollback buffer.
|
||||||
|
# Specifying '0' will disable scrolling.
|
||||||
|
history: 10000
|
||||||
|
|
||||||
|
# Scrolling distance multiplier.
|
||||||
|
#multiplier: 3
|
||||||
|
|
||||||
|
# Font configuration
|
||||||
|
font:
|
||||||
|
# Normal (roman) font face
|
||||||
|
bold:
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
italic:
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
normal:
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
bold_italic:
|
||||||
|
# Font family
|
||||||
|
#
|
||||||
|
# If the bold italic family is not specified, it will fall back to the
|
||||||
|
# value specified for the normal font.
|
||||||
|
family: JetBrainsMono Nerd Font
|
||||||
|
shell:
|
||||||
|
# To resolve issues:
|
||||||
|
# 1. https://github.com/ryan4yin/nix-config/issues/26
|
||||||
|
# 2. https://github.com/ryan4yin/nix-config/issues/8
|
||||||
|
# Spawn a nushell in login mode via `bash`
|
||||||
|
program: ${pkgs.bash}/bin/bash
|
||||||
|
args:
|
||||||
|
- --login
|
||||||
|
- -c
|
||||||
|
- 'nu --login --interactive'
|
||||||
|
''
|
||||||
|
+ (
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then ''
|
||||||
|
# Point size
|
||||||
|
size: 14
|
||||||
|
''
|
||||||
|
else ''
|
||||||
|
# holder identation
|
||||||
|
# Point size
|
||||||
|
size: 13
|
||||||
|
''
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{...}: {
|
||||||
|
imports = [
|
||||||
|
./alacritty.nix
|
||||||
|
./kitty.nix
|
||||||
|
./wezterm.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
###########################################################
|
||||||
|
#
|
||||||
|
# Kitty Configuration
|
||||||
|
#
|
||||||
|
# Useful Hot Keys for macOS:
|
||||||
|
# 1. New Tab: `command + t`
|
||||||
|
# 2. Close Tab: `command + w`
|
||||||
|
# 3. Switch Tab: `shift + command + [` | `shift + command + ]`
|
||||||
|
# 4. Increase Font Size: `command + =` | `command + +`
|
||||||
|
# 5. Decrease Font Size: `command + -` | `command + _`
|
||||||
|
# 6. And Other common shortcuts such as Copy, Paste, Cursor Move, etc.
|
||||||
|
# 7. Search in the current window(show_scrollback): `ctrl + shift + h`
|
||||||
|
# This will open a pager, it's defined by `scrollback_pager`, default is `less`
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Useful Hot Keys for Linux:
|
||||||
|
# 1. New Tab: `ctrl + shift + t`
|
||||||
|
# 2. Close Tab: `ctrl + shift + q`
|
||||||
|
# 3. Switch Tab: `ctrl + shift + right` | `ctrl + shift + left`
|
||||||
|
# 4. Increase Font Size: `ctrl + shift + =` | `ctrl + shift + +`
|
||||||
|
# 5. Decrease Font Size: `ctrl + shift + -` | `ctrl + shift + _`
|
||||||
|
# 6. And Other common shortcuts such as Copy, Paste, Cursor Move, etc.
|
||||||
|
#
|
||||||
|
###########################################################
|
||||||
|
{
|
||||||
|
programs.kitty = {
|
||||||
|
enable = true;
|
||||||
|
# kitty has catppuccin theme built-in,
|
||||||
|
# all the built-in themes are packaged into an extra package named `kitty-themes`
|
||||||
|
# and it's installed by home-manager if `theme` is specified.
|
||||||
|
theme = "Catppuccin-Mocha";
|
||||||
|
font = {
|
||||||
|
name = "JetBrainsMono Nerd Font";
|
||||||
|
# use different font size on macOS
|
||||||
|
size =
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then 14
|
||||||
|
else 13;
|
||||||
|
};
|
||||||
|
|
||||||
|
keybindings = {
|
||||||
|
"ctrl+shift+m" = "toggle_maximized";
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
background_opacity = "0.93";
|
||||||
|
macos_option_as_alt = true; # Option key acts as Alt on macOS
|
||||||
|
scrollback_lines = 10000;
|
||||||
|
enable_audio_bell = false;
|
||||||
|
tab_bar_edge = "top"; # tab bar on top
|
||||||
|
# To resolve issues:
|
||||||
|
# 1. https://github.com/ryan4yin/nix-config/issues/26
|
||||||
|
# 2. https://github.com/ryan4yin/nix-config/issues/8
|
||||||
|
# Spawn a nushell in login mode via `bash`
|
||||||
|
shell = "${pkgs.bash}/bin/bash --login -c 'nu --login --interactive'";
|
||||||
|
};
|
||||||
|
|
||||||
|
# macOS specific settings
|
||||||
|
darwinLaunchOptions = ["--start-as=maximized"];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
{pkgs, ...}:
|
||||||
|
###########################################################
|
||||||
|
#
|
||||||
|
# Wezterm Configuration
|
||||||
|
#
|
||||||
|
# Default Keybindings: https://wezfurlong.org/wezterm/config/default-keys.html
|
||||||
|
#
|
||||||
|
###########################################################
|
||||||
|
{
|
||||||
|
# wezterm has catppuccin theme built-in,
|
||||||
|
# it's not necessary to install it separately.
|
||||||
|
|
||||||
|
# we can add wezterm as a flake input once this PR is merged:
|
||||||
|
# https://github.com/wez/wezterm/pull/3547
|
||||||
|
|
||||||
|
programs.wezterm =
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# TODO: Fix: https://github.com/wez/wezterm/issues/4483
|
||||||
|
# package = pkgs.wezterm.override { };
|
||||||
|
|
||||||
|
extraConfig = let
|
||||||
|
fontsize =
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then "14.0"
|
||||||
|
else "13.0";
|
||||||
|
in
|
||||||
|
''
|
||||||
|
-- Pull in the wezterm API
|
||||||
|
local wezterm = require 'wezterm'
|
||||||
|
|
||||||
|
-- This table will hold the configuration.
|
||||||
|
local config = {}
|
||||||
|
|
||||||
|
-- In newer versions of wezterm, use the config_builder which will
|
||||||
|
-- help provide clearer error messages
|
||||||
|
if wezterm.config_builder then
|
||||||
|
config = wezterm.config_builder()
|
||||||
|
end
|
||||||
|
|
||||||
|
wezterm.on('toggle-opacity', function(window, pane)
|
||||||
|
local overrides = window:get_config_overrides() or {}
|
||||||
|
if not overrides.window_background_opacity then
|
||||||
|
overrides.window_background_opacity = 0.93
|
||||||
|
else
|
||||||
|
overrides.window_background_opacity = nil
|
||||||
|
end
|
||||||
|
window:set_config_overrides(overrides)
|
||||||
|
end)
|
||||||
|
|
||||||
|
wezterm.on('toggle-maximize', function(window, pane)
|
||||||
|
window:maximize()
|
||||||
|
end)
|
||||||
|
|
||||||
|
-- This is where you actually apply your config choices
|
||||||
|
config.color_scheme = "Catppuccin Mocha"
|
||||||
|
config.font = wezterm.font_with_fallback {
|
||||||
|
"JetBrainsMono Nerd Font",
|
||||||
|
"FiraCode Nerd Font",
|
||||||
|
|
||||||
|
-- To avoid 'Chinese characters displayed as variant (Japanese) glyphs'
|
||||||
|
"Source Han Sans SC",
|
||||||
|
"Source Han Sans TC"
|
||||||
|
}
|
||||||
|
|
||||||
|
config.hide_tab_bar_if_only_one_tab = true
|
||||||
|
config.scrollback_lines = 10000
|
||||||
|
config.enable_scroll_bar = true
|
||||||
|
|
||||||
|
config.keys = {
|
||||||
|
-- toggle opacity(CTRL + SHIFT + B)
|
||||||
|
{
|
||||||
|
key = 'B',
|
||||||
|
mods = 'CTRL',
|
||||||
|
action = wezterm.action.EmitEvent 'toggle-opacity',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key = 'M',
|
||||||
|
mods = 'CTRL',
|
||||||
|
action = wezterm.action.EmitEvent 'toggle-maximize',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
config.font_size = ${fontsize}
|
||||||
|
|
||||||
|
-- To resolve issues:
|
||||||
|
-- 1. https://github.com/ryan4yin/nix-config/issues/26
|
||||||
|
-- 2. https://github.com/ryan4yin/nix-config/issues/8
|
||||||
|
-- Spawn a nushell in login mode via `bash`
|
||||||
|
config.default_prog = { '${pkgs.bash}/bin/bash', '--login', '-c', 'nu --login --interactive' }
|
||||||
|
|
||||||
|
return config
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
// (
|
||||||
|
if pkgs.stdenv.isDarwin
|
||||||
|
then {
|
||||||
|
# install wezterm via homebrew on macOS to avoid compilation, dummy package here.
|
||||||
|
package = pkgs.hello;
|
||||||
|
enableBashIntegration = false;
|
||||||
|
enableZshIntegration = false;
|
||||||
|
}
|
||||||
|
else {}
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{...}: {
|
||||||
|
programs.bash = {
|
||||||
|
enable = true;
|
||||||
|
enableCompletion = true;
|
||||||
|
bashrcExtra = ''
|
||||||
|
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
|
||||||
|
'';
|
||||||
|
|
||||||
|
shellAliases = {
|
||||||
|
k = "kubectl";
|
||||||
|
|
||||||
|
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||||
|
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{ catppuccin-bat, ...}: {
|
||||||
|
# a cat(1) clone with syntax highlighting and Git integration.
|
||||||
|
programs.bat = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
pager = "less -FR";
|
||||||
|
theme = "catppuccin-mocha";
|
||||||
|
};
|
||||||
|
themes = {
|
||||||
|
# https://raw.githubusercontent.com/catppuccin/bat/main/Catppuccin-mocha.tmTheme
|
||||||
|
catppuccin-mocha = {
|
||||||
|
src = catppuccin-bat;
|
||||||
|
file = "Catppuccin-mocha.tmTheme";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{ catppuccin-btop, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# https://github.com/catppuccin/btop/blob/main/themes/catppuccin_mocha.theme
|
||||||
|
home.file.".config/btop/themes".source = "${catppuccin-btop}/themes";
|
||||||
|
|
||||||
|
# replacement of htop/nmon
|
||||||
|
programs.btop = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
color_theme = "catppuccin_mocha";
|
||||||
|
theme_background = false; # make btop transparent
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
neofetch
|
||||||
|
ranger # terminal file manager(batteries included, with image preview support)
|
||||||
|
|
||||||
|
# archives
|
||||||
|
zip
|
||||||
|
xz
|
||||||
|
unzip
|
||||||
|
p7zip
|
||||||
|
|
||||||
|
# networking tools
|
||||||
|
mtr # A network diagnostic tool
|
||||||
|
iperf3
|
||||||
|
dnsutils # `dig` + `nslookup`
|
||||||
|
ldns # replacement of `dig`, it provide the command `drill`
|
||||||
|
aria2 # A lightweight multi-protocol & multi-source command-line download utility
|
||||||
|
socat # replacement of openbsd-netcat
|
||||||
|
nmap # A utility for network discovery and security auditing
|
||||||
|
ipcalc # it is a calculator for the IPv4/v6 addresses
|
||||||
|
|
||||||
|
|
||||||
|
# Text Processing
|
||||||
|
# Docs: https://github.com/learnbyexample/Command-line-text-processing
|
||||||
|
gnugrep # GNU grep, provides `grep`/`egrep`/`fgrep`
|
||||||
|
gnused # GNU sed, very powerful(mainly for replacing text in files)
|
||||||
|
gawk # GNU awk, a pattern scanning and processing language
|
||||||
|
ripgrep # recursively searches directories for a regex pattern
|
||||||
|
sad # CLI search and replace, with diff preview, really useful!!!
|
||||||
|
delta # A viewer for git and diff output
|
||||||
|
# A fast and polyglot tool for code searching, linting, rewriting at large scale
|
||||||
|
# supported languages: only some mainstream languages currently(do not support nix/nginx/yaml/toml/...)
|
||||||
|
ast-grep
|
||||||
|
jq # A lightweight and flexible command-line JSON processor
|
||||||
|
yq-go # yaml processer https://github.com/mikefarah/yq
|
||||||
|
|
||||||
|
# misc
|
||||||
|
tldr
|
||||||
|
cowsay
|
||||||
|
file
|
||||||
|
which
|
||||||
|
tree
|
||||||
|
gnutar
|
||||||
|
zstd
|
||||||
|
caddy
|
||||||
|
gnupg
|
||||||
|
|
||||||
|
# nix related
|
||||||
|
#
|
||||||
|
# it provides the command `nom` works just like `nix
|
||||||
|
# with more details log output
|
||||||
|
nix-output-monitor
|
||||||
|
nodePackages.node2nix
|
||||||
|
|
||||||
|
# productivity
|
||||||
|
hugo # static site generator
|
||||||
|
glow # markdown previewer in terminal
|
||||||
|
];
|
||||||
|
|
||||||
|
programs = {
|
||||||
|
# modern vim
|
||||||
|
neovim = {
|
||||||
|
enable = true;
|
||||||
|
defaultEditor = true;
|
||||||
|
vimAlias = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# A modern replacement for ‘ls’
|
||||||
|
# useful in bash/zsh prompt, not in nushell.
|
||||||
|
eza = {
|
||||||
|
enable = true;
|
||||||
|
enableAliases = true;
|
||||||
|
git = true;
|
||||||
|
icons = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# A command-line fuzzy finder
|
||||||
|
fzf = {
|
||||||
|
enable = true;
|
||||||
|
# https://github.com/catppuccin/fzf
|
||||||
|
# catppuccin-mocha
|
||||||
|
colors = {
|
||||||
|
"bg+" = "#313244";
|
||||||
|
"bg" = "#1e1e2e";
|
||||||
|
"spinner" = "#f5e0dc";
|
||||||
|
"hl" = "#f38ba8";
|
||||||
|
"fg" = "#cdd6f4";
|
||||||
|
"header" = "#f38ba8";
|
||||||
|
"info" = "#cba6f7";
|
||||||
|
"pointer" = "#f5e0dc";
|
||||||
|
"marker" = "#f5e0dc";
|
||||||
|
"fg+" = "#cdd6f4";
|
||||||
|
"prompt" = "#cba6f7";
|
||||||
|
"hl+" = "#f38ba8";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# skim provides a single executable: sk.
|
||||||
|
# Basically anywhere you would want to use grep, try sk instead.
|
||||||
|
skim = {
|
||||||
|
enable = true;
|
||||||
|
enableBashIntegration = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
{config, pkgs, ...}:
|
{...}: {
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
./nushell
|
./nushell
|
||||||
|
./tmux
|
||||||
|
./zellij
|
||||||
|
|
||||||
|
./bash.nix
|
||||||
|
./bat.nix
|
||||||
|
./btop.nix
|
||||||
./core.nix
|
./core.nix
|
||||||
./development.nix
|
|
||||||
./git.nix
|
./git.nix
|
||||||
./media.nix
|
|
||||||
./starship.nix
|
./starship.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
|
||||||
|
userfullname,
|
||||||
|
useremail,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
# `programs.git` will generate the config file: ~/.config/git/config
|
||||||
|
# to make git use this config file, `~/.gitconfig` should not exist!
|
||||||
|
#
|
||||||
|
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
|
||||||
|
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
||||||
|
rm -f ~/.gitconfig
|
||||||
|
'';
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
lfs.enable = true;
|
||||||
|
|
||||||
|
userName = userfullname;
|
||||||
|
userEmail = useremail;
|
||||||
|
|
||||||
|
includes = [
|
||||||
|
{
|
||||||
|
# use diffrent email & name for work
|
||||||
|
path = "~/work/.gitconfig";
|
||||||
|
condition = "gitdir:~/work/";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
extraConfig = {
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
push.autoSetupRemote = true;
|
||||||
|
pull.rebase = true;
|
||||||
|
|
||||||
|
# replace https with ssh
|
||||||
|
url = {
|
||||||
|
"ssh://git@github.com/ryan4yin" = {
|
||||||
|
insteadOf = "https://github.com/ryan4yin";
|
||||||
|
};
|
||||||
|
# "ssh://git@gitlab.com/" = {
|
||||||
|
# insteadOf = "https://gitlab.com/";
|
||||||
|
# };
|
||||||
|
# "ssh://git@bitbucket.com/" = {
|
||||||
|
# insteadOf = "https://bitbucket.com/";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# signing = {
|
||||||
|
# key = "xxx";
|
||||||
|
# signByDefault = true;
|
||||||
|
# };
|
||||||
|
|
||||||
|
# A syntax-highlighting pager in Rust(2019 ~ Now)
|
||||||
|
delta = {
|
||||||
|
enable = true;
|
||||||
|
options = {
|
||||||
|
diff-so-fancy = true;
|
||||||
|
line-numbers = true;
|
||||||
|
true-color = "always";
|
||||||
|
# features => named groups of settings, used to keep related settings organized
|
||||||
|
# features = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
aliases = {
|
||||||
|
# common aliases
|
||||||
|
br = "branch";
|
||||||
|
co = "checkout";
|
||||||
|
st = "status";
|
||||||
|
ls = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate";
|
||||||
|
ll = "log --pretty=format:\"%C(yellow)%h%Cred%d\\\\ %Creset%s%Cblue\\\\ [%cn]\" --decorate --numstat";
|
||||||
|
cm = "commit -m"; # commit via `git cm <message>`
|
||||||
|
ca = "commit -am"; # commit all changes via `git ca <message>`
|
||||||
|
dc = "diff --cached";
|
||||||
|
|
||||||
|
amend = "commit --amend -m"; # amend commit message via `git amend <message>`
|
||||||
|
unstage = "reset HEAD --"; # unstage file via `git unstage <file>`
|
||||||
|
merged = "branch --merged"; # list merged(into HEAD) branches via `git merged`
|
||||||
|
unmerged = "branch --no-merged"; # list unmerged(into HEAD) branches via `git unmerged`
|
||||||
|
nonexist = "remote prune origin --dry-run"; # list non-exist(remote) branches via `git nonexist`
|
||||||
|
|
||||||
|
# delete merged branches except master & dev & staging
|
||||||
|
# `!` indicates it's a shell script, not a git subcommand
|
||||||
|
delmerged = ''! git branch --merged | egrep -v "(^\*|main|master|dev|staging)" | xargs git branch -d'';
|
||||||
|
# delete non-exist(remote) branches
|
||||||
|
delnonexist = "remote prune origin";
|
||||||
|
|
||||||
|
# aliases for submodule
|
||||||
|
update = "submodule update --init --recursive";
|
||||||
|
foreach = "submodule foreach";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
# Nushell Config File
|
||||||
|
#
|
||||||
|
# version = 0.81.1
|
||||||
|
|
||||||
|
# let's define some colors
|
||||||
|
|
||||||
|
# https://github.com/catppuccin/i3/blob/main/themes/catppuccin-mocha
|
||||||
|
let rosewater = "#f5e0dc"
|
||||||
|
let flamingo = "#f2cdcd"
|
||||||
|
let pink = "#f5c2e7"
|
||||||
|
let mauve = "#cba6f7"
|
||||||
|
let red = "#f38ba8"
|
||||||
|
let maroon = "#eba0ac"
|
||||||
|
let peach = "#fab387"
|
||||||
|
let green = "#a6e3a1"
|
||||||
|
let teal = "#94e2d5"
|
||||||
|
let sky = "#89dceb"
|
||||||
|
let sapphire = "#74c7ec"
|
||||||
|
let blue = "#89b4fa"
|
||||||
|
let lavender = "#b4befe"
|
||||||
|
let text = "#cdd6f4"
|
||||||
|
let subtext1 = "#bac2de"
|
||||||
|
let subtext0 = "#a6adc8"
|
||||||
|
let overlay2 = "#9399b2"
|
||||||
|
let overlay1 = "#7f849c"
|
||||||
|
let overlay0 = "#6c7086"
|
||||||
|
let surface2 = "#585b70"
|
||||||
|
let surface1 = "#45475a"
|
||||||
|
let surface0 = "#313244"
|
||||||
|
let base = "#1e1e2e"
|
||||||
|
let mantle = "#181825"
|
||||||
|
let crust = "#11111b"
|
||||||
|
|
||||||
|
# we're creating a theme here that uses the colors we defined above.
|
||||||
|
|
||||||
|
let catppuccin_theme = {
|
||||||
|
separator: $overlay2
|
||||||
|
leading_trailing_space_bg: $surface2
|
||||||
|
header: $red
|
||||||
|
date: $pink
|
||||||
|
filesize: $green
|
||||||
|
row_index: $text
|
||||||
|
bool: $peach
|
||||||
|
int: $red
|
||||||
|
duration: $sky
|
||||||
|
range: $sapphire
|
||||||
|
float: $lavender
|
||||||
|
string: $text
|
||||||
|
nothing: $overlay1
|
||||||
|
binary: $subtext1
|
||||||
|
cellpath: $subtext0
|
||||||
|
hints: dark_gray
|
||||||
|
|
||||||
|
shape_garbage: { fg: $overlay2 bg: $red attr: b}
|
||||||
|
shape_bool: $maroon
|
||||||
|
shape_int: { fg: $pink attr: b}
|
||||||
|
shape_float: { fg: $pink attr: b}
|
||||||
|
shape_range: { fg: $overlay0 attr: b}
|
||||||
|
shape_internalcall: { fg: $maroon attr: b}
|
||||||
|
shape_external: $mauve
|
||||||
|
shape_externalarg: { fg: $red attr: b}
|
||||||
|
shape_literal: $flamingo
|
||||||
|
shape_operator: $rosewater
|
||||||
|
shape_signature: { fg: $red attr: b}
|
||||||
|
shape_string: $red
|
||||||
|
shape_filepath: $peach
|
||||||
|
shape_globpattern: { fg: $teal attr: b}
|
||||||
|
shape_variable: $pink
|
||||||
|
shape_flag: { fg: $mauve attr: b}
|
||||||
|
shape_custom: {attr: b}
|
||||||
|
}
|
||||||
|
|
||||||
|
# The default config record. This is where much of your global configuration is setup.
|
||||||
|
$env.config = {
|
||||||
|
color_config: $catppuccin_theme # <-- this is the theme
|
||||||
|
use_ansi_coloring: true
|
||||||
|
|
||||||
|
# true or false to enable or disable the welcome banner at startup
|
||||||
|
show_banner: false
|
||||||
|
|
||||||
|
table: {
|
||||||
|
mode: rounded # basic, compact, compact_double, light, thin, with_love, rounded, reinforced, heavy, none, other
|
||||||
|
index_mode: always # "always" show indexes, "never" show indexes, "auto" = show indexes when a table has "index" column
|
||||||
|
show_empty: true # show 'empty list' and 'empty record' placeholders for command output
|
||||||
|
trim: {
|
||||||
|
methodology: wrapping # wrapping or truncating
|
||||||
|
wrapping_try_keep_words: true # A strategy used by the 'wrapping' methodology
|
||||||
|
truncating_suffix: "..." # A suffix used by the 'truncating' methodology
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
completions: {
|
||||||
|
case_sensitive: false # set to true to enable case-sensitive completions
|
||||||
|
quick: true # set this to false to prevent auto-selecting completions when only one remains
|
||||||
|
partial: true # set this to false to prevent partial filling of the prompt
|
||||||
|
algorithm: "prefix" # prefix or fuzzy
|
||||||
|
external: {
|
||||||
|
enable: true # set to false to prevent nushell looking into $env.PATH to find more suggestions, `false` recommended for WSL users as this look up may be very slow
|
||||||
|
max_results: 100 # setting it lower can improve completion performance at the cost of omitting some options
|
||||||
|
completer: null # check 'carapace_completer' above as an example
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filesize: {
|
||||||
|
metric: true # true => KB, MB, GB (ISO standard), false => KiB, MiB, GiB (Windows standard)
|
||||||
|
format: "auto" # b, kb, kib, mb, mib, gb, gib, tb, tib, pb, pib, eb, eib, zb, zib, auto
|
||||||
|
}
|
||||||
|
cursor_shape: {
|
||||||
|
emacs: line # block, underscore, line, blink_block, blink_underscore, blink_line (line is the default)
|
||||||
|
vi_insert: block # block, underscore, line , blink_block, blink_underscore, blink_line (block is the default)
|
||||||
|
vi_normal: underscore # block, underscore, line, blink_block, blink_underscore, blink_line (underscore is the default)
|
||||||
|
}
|
||||||
|
use_grid_icons: true
|
||||||
|
footer_mode: "25" # always, never, number_of_rows, auto
|
||||||
|
float_precision: 2 # the precision for displaying floats in tables
|
||||||
|
# buffer_editor: "emacs" # command that will be used to edit the current line buffer with ctrl+o, if unset fallback to $env.EDITOR and $env.VISUAL
|
||||||
|
bracketed_paste: true # enable bracketed paste, currently useless on windows
|
||||||
|
edit_mode: emacs # emacs, vi
|
||||||
|
shell_integration: true # enables terminal markers and a workaround to arrow keys stop working issue
|
||||||
|
render_right_prompt_on_last_line: false # true or false to enable or disable right prompt to be rendered on last line of the prompt.
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
{ config, ...}: {
|
||||||
|
programs.nushell = {
|
||||||
|
enable = true;
|
||||||
|
configFile.source = ./config.nu;
|
||||||
|
|
||||||
|
# home-manager will merge the cotent in `environmentVariables` with the `envFile.source`
|
||||||
|
# but basically, I set all environment variables via the shell-independent way, so I don't need to use those two options
|
||||||
|
#
|
||||||
|
# envFile.source = ./env.nu;
|
||||||
|
# environmentVariables = { FOO="bar"; };
|
||||||
|
|
||||||
|
shellAliases = {
|
||||||
|
k = "kubectl";
|
||||||
|
|
||||||
|
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||||
|
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{ catppuccin-starship, ...}: {
|
||||||
|
programs.starship = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
enableBashIntegration = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
enableNushellIntegration = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
character = {
|
||||||
|
success_symbol = "[›](bold green)";
|
||||||
|
error_symbol = "[›](bold red)";
|
||||||
|
};
|
||||||
|
aws = {
|
||||||
|
symbol = "🅰 ";
|
||||||
|
};
|
||||||
|
gcloud = {
|
||||||
|
# do not show the account/project's info
|
||||||
|
# to avoid the leak of sensitive information when sharing the terminal
|
||||||
|
format = "on [$symbol$active(\($region\))]($style) ";
|
||||||
|
symbol = "🅶 ️";
|
||||||
|
};
|
||||||
|
|
||||||
|
palette = "catppuccin_mocha";
|
||||||
|
} // builtins.fromTOML (builtins.readFile "${catppuccin-starship}/palettes/mocha.toml");
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
programs.tmux = {
|
||||||
|
enable = true;
|
||||||
|
shell = "${pkgs.nushell}/bin/nu";
|
||||||
|
|
||||||
|
# Resize the window to the size of the smallest session for which it is the current window.
|
||||||
|
#
|
||||||
|
aggressiveResize = true;
|
||||||
|
|
||||||
|
# https://github.com/tmux-plugins/tmux-sensible
|
||||||
|
# tmux-sensible overwrites default tmux shortcuts, makes them more sane.
|
||||||
|
sensibleOnTop = true;
|
||||||
|
|
||||||
|
# https://github.com/sxyazi/yazi/wiki/Image-preview-within-tmux
|
||||||
|
extraConfig = ''
|
||||||
|
set -g allow-passthrough on
|
||||||
|
|
||||||
|
set -ga update-environment TERM
|
||||||
|
set -ga update-environment TERM_PROGRAM
|
||||||
|
'';
|
||||||
|
# keyMode = "vi"; # default is emacs
|
||||||
|
|
||||||
|
baseIndex = 1; # start index from 1
|
||||||
|
escapeTime = 0; # do not wait for escape key
|
||||||
|
|
||||||
|
plugins = with pkgs.tmuxPlugins; [
|
||||||
|
{
|
||||||
|
# theme
|
||||||
|
# https://github.com/catppuccin/tmux
|
||||||
|
plugin = catppuccin;
|
||||||
|
extraConfig = ''
|
||||||
|
set -g @catppuccin_flavour 'mocha' # or frappe, macchiato, mocha
|
||||||
|
set -g @catppuccin_window_status_enable "yes"
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://github.com/tmux-plugins/tmux-yank
|
||||||
|
# Enables copying to system clipboard.
|
||||||
|
yank
|
||||||
|
|
||||||
|
{
|
||||||
|
# https://github.com/tmux-plugins/tmux-resurrect
|
||||||
|
# Manually persists tmux environment across system restarts.
|
||||||
|
# prefix + Ctrl-s - save
|
||||||
|
# prefix + Ctrl-r - restore
|
||||||
|
#
|
||||||
|
plugin = resurrect;
|
||||||
|
# Restore Neovim sessions
|
||||||
|
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
|
||||||
|
}
|
||||||
|
|
||||||
|
# set -g @plugin 'tmux-plugins/tmux-cpu'
|
||||||
|
{
|
||||||
|
plugin = cpu;
|
||||||
|
extraConfig = ''
|
||||||
|
set -g status-right '#{cpu_bg_color} CPU: #{cpu_icon} #{cpu_percentage} | %a %h-%d %H:%M '
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,355 @@
|
|||||||
|
// If you'd like to override the default keybindings completely, be sure to change "keybinds" to "keybinds clear-defaults=true"
|
||||||
|
keybinds {
|
||||||
|
normal {
|
||||||
|
// uncomment this and adjust key if using copy_on_select=false
|
||||||
|
// bind "Alt c" { Copy; }
|
||||||
|
}
|
||||||
|
locked {
|
||||||
|
bind "Ctrl g" { SwitchToMode "Normal"; }
|
||||||
|
}
|
||||||
|
resize {
|
||||||
|
bind "Ctrl n" { SwitchToMode "Normal"; }
|
||||||
|
bind "h" "Left" { Resize "Increase Left"; }
|
||||||
|
bind "j" "Down" { Resize "Increase Down"; }
|
||||||
|
bind "k" "Up" { Resize "Increase Up"; }
|
||||||
|
bind "l" "Right" { Resize "Increase Right"; }
|
||||||
|
bind "H" { Resize "Decrease Left"; }
|
||||||
|
bind "J" { Resize "Decrease Down"; }
|
||||||
|
bind "K" { Resize "Decrease Up"; }
|
||||||
|
bind "L" { Resize "Decrease Right"; }
|
||||||
|
bind "=" "+" { Resize "Increase"; }
|
||||||
|
bind "-" { Resize "Decrease"; }
|
||||||
|
}
|
||||||
|
pane {
|
||||||
|
bind "Ctrl p" { SwitchToMode "Normal"; }
|
||||||
|
bind "h" "Left" { MoveFocus "Left"; }
|
||||||
|
bind "l" "Right" { MoveFocus "Right"; }
|
||||||
|
bind "j" "Down" { MoveFocus "Down"; }
|
||||||
|
bind "k" "Up" { MoveFocus "Up"; }
|
||||||
|
bind "p" { SwitchFocus; }
|
||||||
|
bind "n" { NewPane; SwitchToMode "Normal"; }
|
||||||
|
bind "d" { NewPane "Down"; SwitchToMode "Normal"; }
|
||||||
|
bind "r" { NewPane "Right"; SwitchToMode "Normal"; }
|
||||||
|
bind "x" { CloseFocus; SwitchToMode "Normal"; }
|
||||||
|
bind "f" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
|
||||||
|
bind "z" { TogglePaneFrames; SwitchToMode "Normal"; }
|
||||||
|
bind "w" { ToggleFloatingPanes; SwitchToMode "Normal"; }
|
||||||
|
bind "e" { TogglePaneEmbedOrFloating; SwitchToMode "Normal"; }
|
||||||
|
bind "c" { SwitchToMode "RenamePane"; PaneNameInput 0;}
|
||||||
|
}
|
||||||
|
move {
|
||||||
|
bind "Ctrl h" { SwitchToMode "Normal"; }
|
||||||
|
bind "n" "Tab" { MovePane; }
|
||||||
|
bind "p" { MovePaneBackwards; }
|
||||||
|
bind "h" "Left" { MovePane "Left"; }
|
||||||
|
bind "j" "Down" { MovePane "Down"; }
|
||||||
|
bind "k" "Up" { MovePane "Up"; }
|
||||||
|
bind "l" "Right" { MovePane "Right"; }
|
||||||
|
}
|
||||||
|
tab {
|
||||||
|
bind "Ctrl t" { SwitchToMode "Normal"; }
|
||||||
|
bind "r" { SwitchToMode "RenameTab"; TabNameInput 0; }
|
||||||
|
bind "h" "Left" "Up" "k" { GoToPreviousTab; }
|
||||||
|
bind "l" "Right" "Down" "j" { GoToNextTab; }
|
||||||
|
bind "n" { NewTab; SwitchToMode "Normal"; }
|
||||||
|
bind "x" { CloseTab; SwitchToMode "Normal"; }
|
||||||
|
bind "s" { ToggleActiveSyncTab; SwitchToMode "Normal"; }
|
||||||
|
bind "1" { GoToTab 1; SwitchToMode "Normal"; }
|
||||||
|
bind "2" { GoToTab 2; SwitchToMode "Normal"; }
|
||||||
|
bind "3" { GoToTab 3; SwitchToMode "Normal"; }
|
||||||
|
bind "4" { GoToTab 4; SwitchToMode "Normal"; }
|
||||||
|
bind "5" { GoToTab 5; SwitchToMode "Normal"; }
|
||||||
|
bind "6" { GoToTab 6; SwitchToMode "Normal"; }
|
||||||
|
bind "7" { GoToTab 7; SwitchToMode "Normal"; }
|
||||||
|
bind "8" { GoToTab 8; SwitchToMode "Normal"; }
|
||||||
|
bind "9" { GoToTab 9; SwitchToMode "Normal"; }
|
||||||
|
bind "Tab" { ToggleTab; }
|
||||||
|
}
|
||||||
|
scroll {
|
||||||
|
bind "Ctrl s" { SwitchToMode "Normal"; }
|
||||||
|
bind "e" { EditScrollback; SwitchToMode "Normal"; }
|
||||||
|
bind "s" { SwitchToMode "EnterSearch"; SearchInput 0; }
|
||||||
|
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
|
||||||
|
bind "j" "Down" { ScrollDown; }
|
||||||
|
bind "k" "Up" { ScrollUp; }
|
||||||
|
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
|
||||||
|
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
|
||||||
|
bind "d" { HalfPageScrollDown; }
|
||||||
|
bind "u" { HalfPageScrollUp; }
|
||||||
|
// uncomment this and adjust key if using copy_on_select=false
|
||||||
|
// bind "Alt c" { Copy; }
|
||||||
|
}
|
||||||
|
search {
|
||||||
|
bind "Ctrl s" { SwitchToMode "Normal"; }
|
||||||
|
bind "Ctrl c" { ScrollToBottom; SwitchToMode "Normal"; }
|
||||||
|
bind "j" "Down" { ScrollDown; }
|
||||||
|
bind "k" "Up" { ScrollUp; }
|
||||||
|
bind "Ctrl f" "PageDown" "Right" "l" { PageScrollDown; }
|
||||||
|
bind "Ctrl b" "PageUp" "Left" "h" { PageScrollUp; }
|
||||||
|
bind "d" { HalfPageScrollDown; }
|
||||||
|
bind "u" { HalfPageScrollUp; }
|
||||||
|
bind "n" { Search "down"; }
|
||||||
|
bind "p" { Search "up"; }
|
||||||
|
bind "c" { SearchToggleOption "CaseSensitivity"; }
|
||||||
|
bind "w" { SearchToggleOption "Wrap"; }
|
||||||
|
bind "o" { SearchToggleOption "WholeWord"; }
|
||||||
|
}
|
||||||
|
entersearch {
|
||||||
|
bind "Ctrl c" "Esc" { SwitchToMode "Scroll"; }
|
||||||
|
bind "Enter" { SwitchToMode "Search"; }
|
||||||
|
}
|
||||||
|
renametab {
|
||||||
|
bind "Ctrl c" { SwitchToMode "Normal"; }
|
||||||
|
bind "Esc" { UndoRenameTab; SwitchToMode "Tab"; }
|
||||||
|
}
|
||||||
|
renamepane {
|
||||||
|
bind "Ctrl c" { SwitchToMode "Normal"; }
|
||||||
|
bind "Esc" { UndoRenamePane; SwitchToMode "Pane"; }
|
||||||
|
}
|
||||||
|
session {
|
||||||
|
bind "Ctrl o" { SwitchToMode "Normal"; }
|
||||||
|
bind "Ctrl s" { SwitchToMode "Scroll"; }
|
||||||
|
bind "d" { Detach; }
|
||||||
|
}
|
||||||
|
tmux {
|
||||||
|
bind "[" { SwitchToMode "Scroll"; }
|
||||||
|
bind "Ctrl b" { Write 2; SwitchToMode "Normal"; }
|
||||||
|
bind "\"" { NewPane "Down"; SwitchToMode "Normal"; }
|
||||||
|
bind "%" { NewPane "Right"; SwitchToMode "Normal"; }
|
||||||
|
bind "z" { ToggleFocusFullscreen; SwitchToMode "Normal"; }
|
||||||
|
bind "c" { NewTab; SwitchToMode "Normal"; }
|
||||||
|
bind "," { SwitchToMode "RenameTab"; }
|
||||||
|
bind "p" { GoToPreviousTab; SwitchToMode "Normal"; }
|
||||||
|
bind "n" { GoToNextTab; SwitchToMode "Normal"; }
|
||||||
|
bind "Left" { MoveFocus "Left"; SwitchToMode "Normal"; }
|
||||||
|
bind "Right" { MoveFocus "Right"; SwitchToMode "Normal"; }
|
||||||
|
bind "Down" { MoveFocus "Down"; SwitchToMode "Normal"; }
|
||||||
|
bind "Up" { MoveFocus "Up"; SwitchToMode "Normal"; }
|
||||||
|
bind "h" { MoveFocus "Left"; SwitchToMode "Normal"; }
|
||||||
|
bind "l" { MoveFocus "Right"; SwitchToMode "Normal"; }
|
||||||
|
bind "j" { MoveFocus "Down"; SwitchToMode "Normal"; }
|
||||||
|
bind "k" { MoveFocus "Up"; SwitchToMode "Normal"; }
|
||||||
|
bind "o" { FocusNextPane; }
|
||||||
|
bind "d" { Detach; }
|
||||||
|
bind "Space" { NextSwapLayout; }
|
||||||
|
bind "x" { CloseFocus; SwitchToMode "Normal"; }
|
||||||
|
}
|
||||||
|
shared_except "locked" {
|
||||||
|
bind "Ctrl g" { SwitchToMode "Locked"; }
|
||||||
|
bind "Ctrl q" { Quit; }
|
||||||
|
bind "Alt n" { NewPane; }
|
||||||
|
bind "Alt h" "Alt Left" { MoveFocusOrTab "Left"; }
|
||||||
|
bind "Alt l" "Alt Right" { MoveFocusOrTab "Right"; }
|
||||||
|
bind "Alt j" "Alt Down" { MoveFocus "Down"; }
|
||||||
|
bind "Alt k" "Alt Up" { MoveFocus "Up"; }
|
||||||
|
bind "Alt =" "Alt +" { Resize "Increase"; }
|
||||||
|
bind "Alt -" { Resize "Decrease"; }
|
||||||
|
bind "Alt [" { PreviousSwapLayout; }
|
||||||
|
bind "Alt ]" { NextSwapLayout; }
|
||||||
|
}
|
||||||
|
shared_except "normal" "locked" {
|
||||||
|
bind "Enter" "Esc" { SwitchToMode "Normal"; }
|
||||||
|
}
|
||||||
|
shared_except "pane" "locked" {
|
||||||
|
bind "Ctrl p" { SwitchToMode "Pane"; }
|
||||||
|
}
|
||||||
|
shared_except "resize" "locked" {
|
||||||
|
bind "Ctrl n" { SwitchToMode "Resize"; }
|
||||||
|
}
|
||||||
|
shared_except "scroll" "locked" {
|
||||||
|
bind "Ctrl s" { SwitchToMode "Scroll"; }
|
||||||
|
}
|
||||||
|
shared_except "session" "locked" {
|
||||||
|
bind "Ctrl o" { SwitchToMode "Session"; }
|
||||||
|
}
|
||||||
|
shared_except "tab" "locked" {
|
||||||
|
bind "Ctrl t" { SwitchToMode "Tab"; }
|
||||||
|
}
|
||||||
|
shared_except "move" "locked" {
|
||||||
|
bind "Ctrl h" { SwitchToMode "Move"; }
|
||||||
|
}
|
||||||
|
shared_except "tmux" "locked" {
|
||||||
|
bind "Ctrl b" { SwitchToMode "Tmux"; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
tab-bar { path "tab-bar"; }
|
||||||
|
status-bar { path "status-bar"; }
|
||||||
|
strider { path "strider"; }
|
||||||
|
compact-bar { path "compact-bar"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
// Choose what to do when zellij receives SIGTERM, SIGINT, SIGQUIT or SIGHUP
|
||||||
|
// eg. when terminal window with an active zellij session is closed
|
||||||
|
// Options:
|
||||||
|
// - detach (Default)
|
||||||
|
// - quit
|
||||||
|
//
|
||||||
|
// on_force_close "quit"
|
||||||
|
|
||||||
|
// Send a request for a simplified ui (without arrow fonts) to plugins
|
||||||
|
// Options:
|
||||||
|
// - true
|
||||||
|
// - false (Default)
|
||||||
|
//
|
||||||
|
// simplified_ui true
|
||||||
|
|
||||||
|
// Choose the path to the default shell that zellij will use for opening new panes
|
||||||
|
// Default: $SHELL
|
||||||
|
// Change to nushell
|
||||||
|
//
|
||||||
|
default_shell "nu"
|
||||||
|
|
||||||
|
// Toggle between having pane frames around the panes
|
||||||
|
// Options:
|
||||||
|
// - true (default)
|
||||||
|
// - false
|
||||||
|
//
|
||||||
|
// pane_frames true
|
||||||
|
|
||||||
|
// Toggle between having Zellij lay out panes according to a predefined set of layouts whenever possible
|
||||||
|
// Options:
|
||||||
|
// - true (default)
|
||||||
|
// - false
|
||||||
|
//
|
||||||
|
// auto_layout true
|
||||||
|
|
||||||
|
// Define color themes for Zellij
|
||||||
|
// For more examples, see: https://github.com/zellij-org/zellij/tree/main/example/themes
|
||||||
|
// Once these themes are defined, one of them should to be selected in the "theme" section of this file
|
||||||
|
//
|
||||||
|
themes {
|
||||||
|
// https://github.com/zellij-org/zellij/blob/main/zellij-utils/assets/themes/catppuccin.kdl
|
||||||
|
catppuccin-latte {
|
||||||
|
bg "#acb0be" // Surface2
|
||||||
|
fg "#acb0be" // Surface2
|
||||||
|
red "#d20f39"
|
||||||
|
green "#40a02b"
|
||||||
|
blue "#1e66f5"
|
||||||
|
yellow "#df8e1d"
|
||||||
|
magenta "#ea76cb" // Pink
|
||||||
|
orange "#fe640b" // Peach
|
||||||
|
cyan "#04a5e5" // Sky
|
||||||
|
black "#dce0e8" // Crust
|
||||||
|
white "#4c4f69" // Text
|
||||||
|
}
|
||||||
|
|
||||||
|
catppuccin-frappe {
|
||||||
|
bg "#626880" // Surface2
|
||||||
|
fg "#c6d0f5"
|
||||||
|
red "#e78284"
|
||||||
|
green "#a6d189"
|
||||||
|
blue "#8caaee"
|
||||||
|
yellow "#e5c890"
|
||||||
|
magenta "#f4b8e4" // Pink
|
||||||
|
orange "#ef9f76" // Peach
|
||||||
|
cyan "#99d1db" // Sky
|
||||||
|
black "#292c3c" // Mantle
|
||||||
|
white "#c6d0f5"
|
||||||
|
}
|
||||||
|
|
||||||
|
catppuccin-macchiato {
|
||||||
|
bg "#5b6078" // Surface2
|
||||||
|
fg "#cad3f5"
|
||||||
|
red "#ed8796"
|
||||||
|
green "#a6da95"
|
||||||
|
blue "#8aadf4"
|
||||||
|
yellow "#eed49f"
|
||||||
|
magenta "#f5bde6" // Pink
|
||||||
|
orange "#f5a97f" // Peach
|
||||||
|
cyan "#91d7e3" // Sky
|
||||||
|
black "#1e2030" // Mantle
|
||||||
|
white "#cad3f5"
|
||||||
|
}
|
||||||
|
|
||||||
|
catppuccin-mocha {
|
||||||
|
bg "#585b70" // Surface2
|
||||||
|
fg "#cdd6f4"
|
||||||
|
red "#f38ba8"
|
||||||
|
green "#a6e3a1"
|
||||||
|
blue "#89b4fa"
|
||||||
|
yellow "#f9e2af"
|
||||||
|
magenta "#f5c2e7" // Pink
|
||||||
|
orange "#fab387" // Peach
|
||||||
|
cyan "#89dceb" // Sky
|
||||||
|
black "#181825" // Mantle
|
||||||
|
white "#cdd6f4"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Choose the theme that is specified in the themes section.
|
||||||
|
// Default: default
|
||||||
|
//
|
||||||
|
theme "catppuccin-mocha"
|
||||||
|
|
||||||
|
// The name of the default layout to load on startup
|
||||||
|
// Default: "default"
|
||||||
|
//
|
||||||
|
// default_layout "compact"
|
||||||
|
|
||||||
|
// Choose the mode that zellij uses when starting up.
|
||||||
|
// Default: normal
|
||||||
|
//
|
||||||
|
// default_mode "locked"
|
||||||
|
|
||||||
|
// Toggle enabling the mouse mode.
|
||||||
|
// On certain configurations, or terminals this could
|
||||||
|
// potentially interfere with copying text.
|
||||||
|
// Options:
|
||||||
|
// - true (default)
|
||||||
|
// - false
|
||||||
|
//
|
||||||
|
// mouse_mode false
|
||||||
|
|
||||||
|
// Configure the scroll back buffer size
|
||||||
|
// This is the number of lines zellij stores for each pane in the scroll back
|
||||||
|
// buffer. Excess number of lines are discarded in a FIFO fashion.
|
||||||
|
// Valid values: positive integers
|
||||||
|
// Default value: 10000
|
||||||
|
//
|
||||||
|
// scroll_buffer_size 10000
|
||||||
|
|
||||||
|
// Provide a command to execute when copying text. The text will be piped to
|
||||||
|
// the stdin of the program to perform the copy. This can be used with
|
||||||
|
// terminal emulators which do not support the OSC 52 ANSI control sequence
|
||||||
|
// that will be used by default if this option is not set.
|
||||||
|
// Examples:
|
||||||
|
//
|
||||||
|
// copy_command "xclip -selection clipboard" // x11
|
||||||
|
// copy_command "wl-copy" // wayland
|
||||||
|
// copy_command "pbcopy" // osx
|
||||||
|
|
||||||
|
// Choose the destination for copied text
|
||||||
|
// Allows using the primary selection buffer (on x11/wayland) instead of the system clipboard.
|
||||||
|
// Does not apply when using copy_command.
|
||||||
|
// Options:
|
||||||
|
// - system (default)
|
||||||
|
// - primary
|
||||||
|
//
|
||||||
|
// copy_clipboard "primary"
|
||||||
|
|
||||||
|
// Enable or disable automatic copy (and clear) of selection when releasing mouse
|
||||||
|
// Default: true
|
||||||
|
//
|
||||||
|
// copy_on_select false
|
||||||
|
|
||||||
|
// Path to the default editor to use to edit pane scrollbuffer
|
||||||
|
// Default: $EDITOR or $VISUAL
|
||||||
|
//
|
||||||
|
// scrollback_editor "/usr/bin/vim"
|
||||||
|
|
||||||
|
// When attaching to an existing session with other users,
|
||||||
|
// should the session be mirrored (true)
|
||||||
|
// or should each user have their own cursor (false)
|
||||||
|
// Default: false
|
||||||
|
//
|
||||||
|
// mirror_session true
|
||||||
|
|
||||||
|
// The folder in which Zellij will look for layouts
|
||||||
|
//
|
||||||
|
// layout_dir "/path/to/my/layout_dir"
|
||||||
|
|
||||||
|
// The folder in which Zellij will look for themes
|
||||||
|
//
|
||||||
|
// theme_dir "/path/to/my/theme_dir"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
{...}: {
|
||||||
|
programs.zellij = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
home.file.".config/zellij/config.kdl".source = ./config.kdl;
|
||||||
|
}
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
{config, pkgs, ...}:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
neofetch
|
|
||||||
nnn # terminal file manager
|
|
||||||
|
|
||||||
# archives
|
|
||||||
zip
|
|
||||||
xz
|
|
||||||
unzip
|
|
||||||
p7zip
|
|
||||||
|
|
||||||
# utils
|
|
||||||
ripgrep # recursively searches directories for a regex pattern
|
|
||||||
jq # A lightweight and flexible command-line JSON processor
|
|
||||||
yq-go # yaml processer https://github.com/mikefarah/yq
|
|
||||||
exa # A modern replacement for ‘ls’
|
|
||||||
fzf # A command-line fuzzy finder
|
|
||||||
|
|
||||||
# networking tools
|
|
||||||
mtr # A network diagnostic tool
|
|
||||||
iperf3
|
|
||||||
ldns # replacement of dig, it provide the command `drill`
|
|
||||||
aria2 # A lightweight multi-protocol & multi-source command-line download utility
|
|
||||||
socat # replacement of openbsd-netcat
|
|
||||||
nmap # A utility for network discovery and security auditing
|
|
||||||
|
|
||||||
# misc
|
|
||||||
cowsay
|
|
||||||
file
|
|
||||||
which
|
|
||||||
tree
|
|
||||||
gnused
|
|
||||||
gnutar
|
|
||||||
gawk
|
|
||||||
zstd
|
|
||||||
caddy
|
|
||||||
gnupg
|
|
||||||
|
|
||||||
# nix related
|
|
||||||
#
|
|
||||||
# it provides the command `nom` works just like `nix
|
|
||||||
# with more details log output
|
|
||||||
nix-output-monitor
|
|
||||||
|
|
||||||
# productivity
|
|
||||||
hugo # static site generator
|
|
||||||
glow # markdown previewer in terminal
|
|
||||||
];
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
# A terminal multiplexer
|
|
||||||
tmux = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# a cat(1) clone with syntax highlighting and Git integration.
|
|
||||||
bat = {
|
|
||||||
enable = true;
|
|
||||||
config = {
|
|
||||||
pager = "less -FR";
|
|
||||||
theme = "Catppuccin-mocha";
|
|
||||||
};
|
|
||||||
themes = {
|
|
||||||
Catppuccin-mocha = builtins.readFile (pkgs.fetchurl {
|
|
||||||
url = "https://raw.githubusercontent.com/catppuccin/bat/main/Catppuccin-mocha.tmTheme";
|
|
||||||
hash = "sha256-qMQNJGZImmjrqzy7IiEkY5IhvPAMZpq0W6skLLsng/w=";
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# skim provides a single executable: sk.
|
|
||||||
# Basically anywhere you would want to use grep, try sk instead.
|
|
||||||
skim = {
|
|
||||||
enable = true;
|
|
||||||
enableBashIntegration = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.bash = {
|
|
||||||
enable = true;
|
|
||||||
enableCompletion = true;
|
|
||||||
bashrcExtra = ''
|
|
||||||
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
home.shellAliases = {
|
|
||||||
k = "kubectl";
|
|
||||||
vim = "nvim";
|
|
||||||
|
|
||||||
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
|
||||||
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
|
||||||
httpproxy = "export https_proxy=http://127.0.0.1:7890; export http_proxy=http://127.0.0.1:7890;";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,117 +0,0 @@
|
|||||||
{config, pkgs, nil, ...}:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
nil.packages."${pkgs.system}".default # nix language server
|
|
||||||
|
|
||||||
# IDE
|
|
||||||
jetbrains.pycharm-community
|
|
||||||
jetbrains.idea-community
|
|
||||||
|
|
||||||
# cloud native
|
|
||||||
skopeo
|
|
||||||
docker-compose
|
|
||||||
dive # explore docker layers
|
|
||||||
kubectl
|
|
||||||
kubernetes-helm
|
|
||||||
terraform
|
|
||||||
# terraformer # generate terraform configs from existing cloud resources
|
|
||||||
pulumi
|
|
||||||
pulumictl
|
|
||||||
k9s
|
|
||||||
# istioctl
|
|
||||||
|
|
||||||
# cloud provider
|
|
||||||
awscli
|
|
||||||
aws-iam-authenticator
|
|
||||||
eksctl
|
|
||||||
|
|
||||||
# DO NOT install build tools for C/C++, set it per project by devShell instead
|
|
||||||
gnumake # used by this repo, to simplify the deployment
|
|
||||||
clang-tools
|
|
||||||
clang-analyzer
|
|
||||||
# lldb
|
|
||||||
# cmake
|
|
||||||
# autoconf
|
|
||||||
# automake
|
|
||||||
# bison
|
|
||||||
# cppcheck
|
|
||||||
# fakeroot
|
|
||||||
# flex
|
|
||||||
# gettext
|
|
||||||
# groff
|
|
||||||
# libtool
|
|
||||||
# m4
|
|
||||||
# patch
|
|
||||||
# pkgconf
|
|
||||||
# texinfo
|
|
||||||
# binutils
|
|
||||||
|
|
||||||
# Golang
|
|
||||||
delve
|
|
||||||
go
|
|
||||||
go-outline
|
|
||||||
go-tools
|
|
||||||
go2nix
|
|
||||||
gomodifytags
|
|
||||||
gopls
|
|
||||||
gotests
|
|
||||||
impl
|
|
||||||
|
|
||||||
# Rust
|
|
||||||
rustup
|
|
||||||
|
|
||||||
# python
|
|
||||||
(python310.withPackages(ps: with ps; [
|
|
||||||
ipython
|
|
||||||
pandas
|
|
||||||
requests
|
|
||||||
pyquery
|
|
||||||
]))
|
|
||||||
|
|
||||||
# db related
|
|
||||||
dbeaver
|
|
||||||
mycli
|
|
||||||
pgcli
|
|
||||||
mongosh
|
|
||||||
sqlite
|
|
||||||
|
|
||||||
# embedded development
|
|
||||||
minicom
|
|
||||||
|
|
||||||
# other languages
|
|
||||||
# julia
|
|
||||||
zig
|
|
||||||
# elixir
|
|
||||||
# solidity
|
|
||||||
|
|
||||||
# java
|
|
||||||
# adoptopenjdk-openj9-bin-17
|
|
||||||
|
|
||||||
# other tools
|
|
||||||
k6 # load testing tool
|
|
||||||
mitmproxy # http/https proxy tool
|
|
||||||
protobuf # protocol buffer compiler
|
|
||||||
];
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
# modern vim
|
|
||||||
neovim = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = ''
|
|
||||||
set number relativenumber
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
direnv = {
|
|
||||||
enable = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# GitHub CLI tool
|
|
||||||
programs.gh = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
# `programs.git` will generate the config file: ~/.config/git/config
|
|
||||||
# to make git use this config file, `~/.gitconfig` should not exist!
|
|
||||||
#
|
|
||||||
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
|
|
||||||
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
|
||||||
rm -f ~/.gitconfig
|
|
||||||
'';
|
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
lfs.enable = true;
|
|
||||||
|
|
||||||
userName = "Ryan Yin";
|
|
||||||
userEmail = "xiaoyin_c@qq.com";
|
|
||||||
|
|
||||||
includes = [
|
|
||||||
{
|
|
||||||
# use diffrent email & name for work
|
|
||||||
path = "~/work/.gitconfig";
|
|
||||||
condition = "gitdir:~/work/";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
extraConfig = {
|
|
||||||
pull = {
|
|
||||||
rebase = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# replace https with ssh
|
|
||||||
url = {
|
|
||||||
"ssh://git@github.com/" = {
|
|
||||||
insteadOf = "https://github.com/";
|
|
||||||
};
|
|
||||||
"ssh://git@gitlab.com/" = {
|
|
||||||
insteadOf = "https://gitlab.com/";
|
|
||||||
};
|
|
||||||
"ssh://git@bitbucket.com/" = {
|
|
||||||
insteadOf = "https://bitbucket.com/";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# signing = {
|
|
||||||
# key = "xxx";
|
|
||||||
# signByDefault = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
delta = {
|
|
||||||
enable = true;
|
|
||||||
options = {
|
|
||||||
features = "side-by-side";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
programs.nushell = {
|
|
||||||
enable = true;
|
|
||||||
# configFile.source = ./config.nu;
|
|
||||||
# envFile.source = ./env.nu;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
{config, ...}: {
|
|
||||||
programs.starship = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
enableBashIntegration = true;
|
|
||||||
enableNushellIntegration = true;
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
character = {
|
|
||||||
success_symbol = "[›](bold green)";
|
|
||||||
error_symbol = "[›](bold red)";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# Home Manager's Darwin Submodules
|
||||||
|
|
||||||
|
1. `core.nix`: some basic configuration.
|
||||||
|
2. `nushell.nix`: nushell's configuration for darwin.
|
||||||
|
3. `rime-squirrel.nix`: [rime-squirrel](https://github.com/rime/squirrel)'s configuration.
|
||||||
|
4. `default.nix`: the entrypoint of darwin's configuration, it import all the submodules above.
|
||||||
|
|
||||||
@@ -1,730 +0,0 @@
|
|||||||
# Configuration for Alacritty, the GPU enhanced terminal emulator.
|
|
||||||
|
|
||||||
# Import additional configuration files
|
|
||||||
#
|
|
||||||
# Imports are loaded in order, skipping all missing files, with the importing
|
|
||||||
# file being loaded last. If a field is already present in a previous import, it
|
|
||||||
# will be replaced.
|
|
||||||
#
|
|
||||||
# All imports must either be absolute paths starting with `/`, or paths relative
|
|
||||||
# to the user's home directory starting with `~/`.
|
|
||||||
import:
|
|
||||||
# all alacritty themes can be found at
|
|
||||||
# https://github.com/alacritty/alacritty-theme
|
|
||||||
- ~/.config/alacritty/theme_github_dark.yml
|
|
||||||
|
|
||||||
# Any items in the `env` entry below will be added as
|
|
||||||
# environment variables. Some entries may override variables
|
|
||||||
# set by alacritty itself.
|
|
||||||
#env:
|
|
||||||
# TERM variable
|
|
||||||
#
|
|
||||||
# This value is used to set the `$TERM` environment variable for
|
|
||||||
# each instance of Alacritty. If it is not present, alacritty will
|
|
||||||
# check the local terminfo database and use `alacritty` if it is
|
|
||||||
# available, otherwise `xterm-256color` is used.
|
|
||||||
#TERM: alacritty
|
|
||||||
|
|
||||||
window:
|
|
||||||
# Window dimensions (changes require restart)
|
|
||||||
#
|
|
||||||
# Number of lines/columns (not pixels) in the terminal. Both lines and columns
|
|
||||||
# must be non-zero for this to take effect. The number of columns must be at
|
|
||||||
# least `2`, while using a value of `0` for columns and lines will fall back
|
|
||||||
# to the window manager's recommended size
|
|
||||||
#dimensions:
|
|
||||||
# columns: 0
|
|
||||||
# lines: 0
|
|
||||||
|
|
||||||
# Window position (changes require restart)
|
|
||||||
#
|
|
||||||
# Specified in number of pixels.
|
|
||||||
# If the position is not set, the window manager will handle the placement.
|
|
||||||
#position:
|
|
||||||
# x: 0
|
|
||||||
# y: 0
|
|
||||||
|
|
||||||
# Window padding (changes require restart)
|
|
||||||
#
|
|
||||||
# Blank space added around the window in pixels. This padding is scaled
|
|
||||||
# by DPI and the specified value is always added at both opposing sides.
|
|
||||||
padding:
|
|
||||||
x: 5
|
|
||||||
y: 5
|
|
||||||
|
|
||||||
# Spread additional padding evenly around the terminal content.
|
|
||||||
dynamic_padding: true
|
|
||||||
|
|
||||||
# Window decorations
|
|
||||||
#
|
|
||||||
# Values for `decorations`:
|
|
||||||
# - full: Borders and title bar
|
|
||||||
# - none: Neither borders nor title bar
|
|
||||||
#
|
|
||||||
# Values for `decorations` (macOS only):
|
|
||||||
# - transparent: Title bar, transparent background and title bar buttons
|
|
||||||
# - buttonless: Title bar, transparent background and no title bar buttons
|
|
||||||
#decorations: full
|
|
||||||
|
|
||||||
# Background opacity
|
|
||||||
#
|
|
||||||
# Window opacity as a floating point number from `0.0` to `1.0`.
|
|
||||||
# The value `0.0` is completely transparent and `1.0` is opaque.
|
|
||||||
opacity: 0.98
|
|
||||||
|
|
||||||
# Startup Mode (changes require restart)
|
|
||||||
#
|
|
||||||
# Values for `startup_mode`:
|
|
||||||
# - Windowed
|
|
||||||
# - Maximized
|
|
||||||
# - Fullscreen
|
|
||||||
#
|
|
||||||
# Values for `startup_mode` (macOS only):
|
|
||||||
# - SimpleFullscreen
|
|
||||||
startup_mode: Windowed
|
|
||||||
|
|
||||||
# Window title
|
|
||||||
title: Alacritty
|
|
||||||
|
|
||||||
# Allow terminal applications to change Alacritty's window title.
|
|
||||||
dynamic_title: true
|
|
||||||
|
|
||||||
# Window class (Linux/BSD only):
|
|
||||||
#class:
|
|
||||||
# Application instance name
|
|
||||||
#instance: Alacritty
|
|
||||||
# General application class
|
|
||||||
#general: Alacritty
|
|
||||||
|
|
||||||
# Decorations theme variant
|
|
||||||
#
|
|
||||||
# Override the variant of the System theme/GTK theme/Wayland client side
|
|
||||||
# decorations. Commonly supported values are `Dark`, `Light`, and `None` for
|
|
||||||
# auto pick-up. Set this to `None` to use the default theme variant.
|
|
||||||
#decorations_theme_variant: None
|
|
||||||
|
|
||||||
# Resize increments
|
|
||||||
#
|
|
||||||
# Prefer resizing window by discrete steps equal to cell dimensions.
|
|
||||||
#resize_increments: false
|
|
||||||
|
|
||||||
# Make `Option` key behave as `Alt` (macOS only):
|
|
||||||
# - OnlyLeft
|
|
||||||
# - OnlyRight
|
|
||||||
# - Both
|
|
||||||
# - None (default)
|
|
||||||
#option_as_alt: None
|
|
||||||
|
|
||||||
scrolling:
|
|
||||||
# Maximum number of lines in the scrollback buffer.
|
|
||||||
# Specifying '0' will disable scrolling.
|
|
||||||
history: 10000
|
|
||||||
|
|
||||||
# Scrolling distance multiplier.
|
|
||||||
#multiplier: 3
|
|
||||||
|
|
||||||
# Font configuration
|
|
||||||
font:
|
|
||||||
# Normal (roman) font face
|
|
||||||
bold:
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
italic:
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
normal:
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
bold_italic:
|
|
||||||
# Font family
|
|
||||||
#
|
|
||||||
# If the bold italic family is not specified, it will fall back to the
|
|
||||||
# value specified for the normal font.
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
# Point size
|
|
||||||
size: 14
|
|
||||||
|
|
||||||
# Offset is the extra space around each character. `offset.y` can be thought
|
|
||||||
# of as modifying the line spacing, and `offset.x` as modifying the letter
|
|
||||||
# spacing.
|
|
||||||
#offset:
|
|
||||||
# x: 0
|
|
||||||
# y: 0
|
|
||||||
|
|
||||||
# Glyph offset determines the locations of the glyphs within their cells with
|
|
||||||
# the default being at the bottom. Increasing `x` moves the glyph to the
|
|
||||||
# right, increasing `y` moves the glyph upward.
|
|
||||||
#glyph_offset:
|
|
||||||
# x: 0
|
|
||||||
# y: 0
|
|
||||||
|
|
||||||
# Use built-in font for box drawing characters.
|
|
||||||
#
|
|
||||||
# If `true`, Alacritty will use a custom built-in font for box drawing
|
|
||||||
# characters (Unicode points 2500 - 259f).
|
|
||||||
#
|
|
||||||
#builtin_box_drawing: true
|
|
||||||
|
|
||||||
# If `true`, bold text is drawn using the bright color variants.
|
|
||||||
#draw_bold_text_with_bright_colors: false
|
|
||||||
|
|
||||||
# Bell
|
|
||||||
#
|
|
||||||
# The bell is rung every time the BEL control character is received.
|
|
||||||
#bell:
|
|
||||||
# Visual Bell Animation
|
|
||||||
#
|
|
||||||
# Animation effect for flashing the screen when the visual bell is rung.
|
|
||||||
#
|
|
||||||
# Values for `animation`:
|
|
||||||
# - Ease
|
|
||||||
# - EaseOut
|
|
||||||
# - EaseOutSine
|
|
||||||
# - EaseOutQuad
|
|
||||||
# - EaseOutCubic
|
|
||||||
# - EaseOutQuart
|
|
||||||
# - EaseOutQuint
|
|
||||||
# - EaseOutExpo
|
|
||||||
# - EaseOutCirc
|
|
||||||
# - Linear
|
|
||||||
#animation: EaseOutExpo
|
|
||||||
|
|
||||||
# Duration of the visual bell flash in milliseconds. A `duration` of `0` will
|
|
||||||
# disable the visual bell animation.
|
|
||||||
#duration: 0
|
|
||||||
|
|
||||||
# Visual bell animation color.
|
|
||||||
#color: '#ffffff'
|
|
||||||
|
|
||||||
# Bell Command
|
|
||||||
#
|
|
||||||
# This program is executed whenever the bell is rung.
|
|
||||||
#
|
|
||||||
# When set to `command: None`, no command will be executed.
|
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
# command:
|
|
||||||
# program: notify-send
|
|
||||||
# args: ["Hello, World!"]
|
|
||||||
#
|
|
||||||
#command: None
|
|
||||||
|
|
||||||
#selection:
|
|
||||||
# This string contains all characters that are used as separators for
|
|
||||||
# "semantic words" in Alacritty.
|
|
||||||
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
|
|
||||||
|
|
||||||
# When set to `true`, selected text will be copied to the primary clipboard.
|
|
||||||
#save_to_clipboard: false
|
|
||||||
|
|
||||||
#cursor:
|
|
||||||
# Cursor style
|
|
||||||
#style:
|
|
||||||
# Cursor shape
|
|
||||||
#
|
|
||||||
# Values for `shape`:
|
|
||||||
# - ▇ Block
|
|
||||||
# - _ Underline
|
|
||||||
# - | Beam
|
|
||||||
#shape: Block
|
|
||||||
|
|
||||||
# Cursor blinking state
|
|
||||||
#
|
|
||||||
# Values for `blinking`:
|
|
||||||
# - Never: Prevent the cursor from ever blinking
|
|
||||||
# - Off: Disable blinking by default
|
|
||||||
# - On: Enable blinking by default
|
|
||||||
# - Always: Force the cursor to always blink
|
|
||||||
#blinking: Off
|
|
||||||
|
|
||||||
# Vi mode cursor style
|
|
||||||
#
|
|
||||||
# If the vi mode cursor style is `None` or not specified, it will fall back to
|
|
||||||
# the style of the active value of the normal cursor.
|
|
||||||
#
|
|
||||||
# See `cursor.style` for available options.
|
|
||||||
#vi_mode_style: None
|
|
||||||
|
|
||||||
# Cursor blinking interval in milliseconds.
|
|
||||||
#blink_interval: 750
|
|
||||||
|
|
||||||
# Time after which cursor stops blinking, in seconds.
|
|
||||||
#
|
|
||||||
# Specifying '0' will disable timeout for blinking.
|
|
||||||
#blink_timeout: 5
|
|
||||||
|
|
||||||
# If this is `true`, the cursor will be rendered as a hollow box when the
|
|
||||||
# window is not focused.
|
|
||||||
#unfocused_hollow: true
|
|
||||||
|
|
||||||
# Thickness of the cursor relative to the cell width as floating point number
|
|
||||||
# from `0.0` to `1.0`.
|
|
||||||
#thickness: 0.15
|
|
||||||
|
|
||||||
# Live config reload (changes require restart)
|
|
||||||
live_config_reload: true
|
|
||||||
# Shell
|
|
||||||
#
|
|
||||||
# You can set `shell.program` to the path of your favorite shell, e.g.
|
|
||||||
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
|
|
||||||
# shell.
|
|
||||||
#
|
|
||||||
# Default:
|
|
||||||
# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset
|
|
||||||
# - (Windows) powershell
|
|
||||||
# shell:
|
|
||||||
# program: /bin/bash
|
|
||||||
# args:
|
|
||||||
# - --login
|
|
||||||
|
|
||||||
# Startup directory
|
|
||||||
#
|
|
||||||
# Directory the shell is started in. If this is unset, or `None`, the working
|
|
||||||
# directory of the parent process will be used.
|
|
||||||
#working_directory: None
|
|
||||||
|
|
||||||
# Offer IPC using `alacritty msg` (unix only)
|
|
||||||
#ipc_socket: true
|
|
||||||
|
|
||||||
#mouse:
|
|
||||||
# Click settings
|
|
||||||
#
|
|
||||||
# The `double_click` and `triple_click` settings control the time
|
|
||||||
# alacritty should wait for accepting multiple clicks as one double
|
|
||||||
# or triple click.
|
|
||||||
#double_click: { threshold: 300 }
|
|
||||||
#triple_click: { threshold: 300 }
|
|
||||||
|
|
||||||
# If this is `true`, the cursor is temporarily hidden when typing.
|
|
||||||
#hide_when_typing: false
|
|
||||||
|
|
||||||
# Hints
|
|
||||||
#
|
|
||||||
# Terminal hints can be used to find text or hyperlink in the visible part of
|
|
||||||
# the terminal and pipe it to other applications.
|
|
||||||
#hints:
|
|
||||||
# Keys used for the hint labels.
|
|
||||||
#alphabet: "jfkdls;ahgurieowpq"
|
|
||||||
|
|
||||||
# List with all available hints
|
|
||||||
#
|
|
||||||
# Each hint must have any of `regex` or `hyperlinks` field and either an
|
|
||||||
# `action` or a `command` field. The fields `mouse`, `binding` and
|
|
||||||
# `post_processing` are optional.
|
|
||||||
#
|
|
||||||
# The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be
|
|
||||||
# highlighted.
|
|
||||||
#
|
|
||||||
# The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and
|
|
||||||
# `mouse.mods` accept the same values as they do in the `key_bindings` section.
|
|
||||||
#
|
|
||||||
# The `mouse.enabled` field controls if the hint should be underlined while
|
|
||||||
# the mouse with all `mouse.mods` keys held or the vi mode cursor is above it.
|
|
||||||
#
|
|
||||||
# If the `post_processing` field is set to `true`, heuristics will be used to
|
|
||||||
# shorten the match if there are characters likely not to be part of the hint
|
|
||||||
# (e.g. a trailing `.`). This is most useful for URIs and applies only to
|
|
||||||
# `regex` matches.
|
|
||||||
#
|
|
||||||
# Values for `action`:
|
|
||||||
# - Copy
|
|
||||||
# Copy the hint's text to the clipboard.
|
|
||||||
# - Paste
|
|
||||||
# Paste the hint's text to the terminal or search.
|
|
||||||
# - Select
|
|
||||||
# Select the hint's text.
|
|
||||||
# - MoveViModeCursor
|
|
||||||
# Move the vi mode cursor to the beginning of the hint.
|
|
||||||
#enabled:
|
|
||||||
# - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
|
|
||||||
# [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
|
|
||||||
# hyperlinks: true
|
|
||||||
# command: xdg-open
|
|
||||||
# post_processing: true
|
|
||||||
# mouse:
|
|
||||||
# enabled: true
|
|
||||||
# mods: None
|
|
||||||
# binding:
|
|
||||||
# key: U
|
|
||||||
# mods: Control|Shift
|
|
||||||
|
|
||||||
# Mouse bindings
|
|
||||||
#
|
|
||||||
# Mouse bindings are specified as a list of objects, much like the key
|
|
||||||
# bindings further below.
|
|
||||||
#
|
|
||||||
# To trigger mouse bindings when an application running within Alacritty
|
|
||||||
# captures the mouse, the `Shift` modifier is automatically added as a
|
|
||||||
# requirement.
|
|
||||||
#
|
|
||||||
# Each mouse binding will specify a:
|
|
||||||
#
|
|
||||||
# - `mouse`:
|
|
||||||
#
|
|
||||||
# - Middle
|
|
||||||
# - Left
|
|
||||||
# - Right
|
|
||||||
# - Numeric identifier such as `5`
|
|
||||||
#
|
|
||||||
# - `action` (see key bindings for actions not exclusive to mouse mode)
|
|
||||||
#
|
|
||||||
# - Mouse exclusive actions:
|
|
||||||
#
|
|
||||||
# - ExpandSelection
|
|
||||||
# Expand the selection to the current mouse cursor location.
|
|
||||||
#
|
|
||||||
# And optionally:
|
|
||||||
#
|
|
||||||
# - `mods` (see key bindings)
|
|
||||||
#mouse_bindings:
|
|
||||||
# - { mouse: Right, action: ExpandSelection }
|
|
||||||
# - { mouse: Right, mods: Control, action: ExpandSelection }
|
|
||||||
# - { mouse: Middle, mode: ~Vi, action: PasteSelection }
|
|
||||||
|
|
||||||
# Key bindings
|
|
||||||
#
|
|
||||||
# Key bindings are specified as a list of objects. For example, this is the
|
|
||||||
# default paste binding:
|
|
||||||
#
|
|
||||||
# `- { key: V, mods: Control|Shift, action: Paste }`
|
|
||||||
#
|
|
||||||
# Each key binding will specify a:
|
|
||||||
#
|
|
||||||
# - `key`: Identifier of the key pressed
|
|
||||||
#
|
|
||||||
# - A-Z
|
|
||||||
# - F1-F24
|
|
||||||
# - Key0-Key9
|
|
||||||
#
|
|
||||||
# A full list with available key codes can be found here:
|
|
||||||
# https://docs.rs/winit/*/winit/event/enum.VirtualKeyCode.html#variants
|
|
||||||
#
|
|
||||||
# Instead of using the name of the keys, the `key` field also supports using
|
|
||||||
# the scancode of the desired key. Scancodes have to be specified as a
|
|
||||||
# decimal number. This command will allow you to display the hex scancodes
|
|
||||||
# for certain keys:
|
|
||||||
#
|
|
||||||
# `showkey --scancodes`.
|
|
||||||
#
|
|
||||||
# Then exactly one of:
|
|
||||||
#
|
|
||||||
# - `chars`: Send a byte sequence to the running application
|
|
||||||
#
|
|
||||||
# The `chars` field writes the specified string to the terminal. This makes
|
|
||||||
# it possible to pass escape sequences. To find escape codes for bindings
|
|
||||||
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
|
|
||||||
# of tmux. Note that applications use terminfo to map escape sequences back
|
|
||||||
# to keys. It is therefore required to update the terminfo when changing an
|
|
||||||
# escape sequence.
|
|
||||||
#
|
|
||||||
# - `action`: Execute a predefined action
|
|
||||||
#
|
|
||||||
# - ToggleViMode
|
|
||||||
# - SearchForward
|
|
||||||
# Start searching toward the right of the search origin.
|
|
||||||
# - SearchBackward
|
|
||||||
# Start searching toward the left of the search origin.
|
|
||||||
# - Copy
|
|
||||||
# - Paste
|
|
||||||
# - IncreaseFontSize
|
|
||||||
# - DecreaseFontSize
|
|
||||||
# - ResetFontSize
|
|
||||||
# - ScrollPageUp
|
|
||||||
# - ScrollPageDown
|
|
||||||
# - ScrollHalfPageUp
|
|
||||||
# - ScrollHalfPageDown
|
|
||||||
# - ScrollLineUp
|
|
||||||
# - ScrollLineDown
|
|
||||||
# - ScrollToTop
|
|
||||||
# - ScrollToBottom
|
|
||||||
# - ClearHistory
|
|
||||||
# Remove the terminal's scrollback history.
|
|
||||||
# - Hide
|
|
||||||
# Hide the Alacritty window.
|
|
||||||
# - Minimize
|
|
||||||
# Minimize the Alacritty window.
|
|
||||||
# - Quit
|
|
||||||
# Quit Alacritty.
|
|
||||||
# - ToggleFullscreen
|
|
||||||
# - ToggleMaximized
|
|
||||||
# - SpawnNewInstance
|
|
||||||
# Spawn a new instance of Alacritty.
|
|
||||||
# - CreateNewWindow
|
|
||||||
# Create a new Alacritty window from the current process.
|
|
||||||
# - ClearLogNotice
|
|
||||||
# Clear Alacritty's UI warning and error notice.
|
|
||||||
# - ClearSelection
|
|
||||||
# Remove the active selection.
|
|
||||||
# - ReceiveChar
|
|
||||||
# - None
|
|
||||||
#
|
|
||||||
# - Vi mode exclusive actions:
|
|
||||||
#
|
|
||||||
# - Open
|
|
||||||
# Perform the action of the first matching hint under the vi mode cursor
|
|
||||||
# with `mouse.enabled` set to `true`.
|
|
||||||
# - ToggleNormalSelection
|
|
||||||
# - ToggleLineSelection
|
|
||||||
# - ToggleBlockSelection
|
|
||||||
# - ToggleSemanticSelection
|
|
||||||
# Toggle semantic selection based on `selection.semantic_escape_chars`.
|
|
||||||
# - CenterAroundViCursor
|
|
||||||
# Center view around vi mode cursor
|
|
||||||
#
|
|
||||||
# - Vi mode exclusive cursor motion actions:
|
|
||||||
#
|
|
||||||
# - Up
|
|
||||||
# One line up.
|
|
||||||
# - Down
|
|
||||||
# One line down.
|
|
||||||
# - Left
|
|
||||||
# One character left.
|
|
||||||
# - Right
|
|
||||||
# One character right.
|
|
||||||
# - First
|
|
||||||
# First column, or beginning of the line when already at the first column.
|
|
||||||
# - Last
|
|
||||||
# Last column, or beginning of the line when already at the last column.
|
|
||||||
# - FirstOccupied
|
|
||||||
# First non-empty cell in this terminal row, or first non-empty cell of
|
|
||||||
# the line when already at the first cell of the row.
|
|
||||||
# - High
|
|
||||||
# Top of the screen.
|
|
||||||
# - Middle
|
|
||||||
# Center of the screen.
|
|
||||||
# - Low
|
|
||||||
# Bottom of the screen.
|
|
||||||
# - SemanticLeft
|
|
||||||
# Start of the previous semantically separated word.
|
|
||||||
# - SemanticRight
|
|
||||||
# Start of the next semantically separated word.
|
|
||||||
# - SemanticLeftEnd
|
|
||||||
# End of the previous semantically separated word.
|
|
||||||
# - SemanticRightEnd
|
|
||||||
# End of the next semantically separated word.
|
|
||||||
# - WordLeft
|
|
||||||
# Start of the previous whitespace separated word.
|
|
||||||
# - WordRight
|
|
||||||
# Start of the next whitespace separated word.
|
|
||||||
# - WordLeftEnd
|
|
||||||
# End of the previous whitespace separated word.
|
|
||||||
# - WordRightEnd
|
|
||||||
# End of the next whitespace separated word.
|
|
||||||
# - Bracket
|
|
||||||
# Character matching the bracket at the cursor's location.
|
|
||||||
# - SearchNext
|
|
||||||
# Beginning of the next match.
|
|
||||||
# - SearchPrevious
|
|
||||||
# Beginning of the previous match.
|
|
||||||
# - SearchStart
|
|
||||||
# Start of the match to the left of the vi mode cursor.
|
|
||||||
# - SearchEnd
|
|
||||||
# End of the match to the right of the vi mode cursor.
|
|
||||||
#
|
|
||||||
# - Search mode exclusive actions:
|
|
||||||
# - SearchFocusNext
|
|
||||||
# Move the focus to the next search match.
|
|
||||||
# - SearchFocusPrevious
|
|
||||||
# Move the focus to the previous search match.
|
|
||||||
# - SearchConfirm
|
|
||||||
# - SearchCancel
|
|
||||||
# - SearchClear
|
|
||||||
# Reset the search regex.
|
|
||||||
# - SearchDeleteWord
|
|
||||||
# Delete the last word in the search regex.
|
|
||||||
# - SearchHistoryPrevious
|
|
||||||
# Go to the previous regex in the search history.
|
|
||||||
# - SearchHistoryNext
|
|
||||||
# Go to the next regex in the search history.
|
|
||||||
#
|
|
||||||
# - macOS exclusive actions:
|
|
||||||
# - ToggleSimpleFullscreen
|
|
||||||
# Enter fullscreen without occupying another space.
|
|
||||||
#
|
|
||||||
# - Linux/BSD exclusive actions:
|
|
||||||
#
|
|
||||||
# - CopySelection
|
|
||||||
# Copy from the selection buffer.
|
|
||||||
# - PasteSelection
|
|
||||||
# Paste from the selection buffer.
|
|
||||||
#
|
|
||||||
# - `command`: Fork and execute a specified command plus arguments
|
|
||||||
#
|
|
||||||
# The `command` field must be a map containing a `program` string and an
|
|
||||||
# `args` array of command line parameter strings. For example:
|
|
||||||
# `{ program: "alacritty", args: ["-e", "vttest"] }`
|
|
||||||
#
|
|
||||||
# And optionally:
|
|
||||||
#
|
|
||||||
# - `mods`: Key modifiers to filter binding actions
|
|
||||||
#
|
|
||||||
# - Command
|
|
||||||
# - Control
|
|
||||||
# - Option
|
|
||||||
# - Super
|
|
||||||
# - Shift
|
|
||||||
# - Alt
|
|
||||||
#
|
|
||||||
# Multiple `mods` can be combined using `|` like this:
|
|
||||||
# `mods: Control|Shift`.
|
|
||||||
# Whitespace and capitalization are relevant and must match the example.
|
|
||||||
#
|
|
||||||
# - `mode`: Indicate a binding for only specific terminal reported modes
|
|
||||||
#
|
|
||||||
# This is mainly used to send applications the correct escape sequences
|
|
||||||
# when in different modes.
|
|
||||||
#
|
|
||||||
# - AppCursor
|
|
||||||
# - AppKeypad
|
|
||||||
# - Search
|
|
||||||
# - Alt
|
|
||||||
# - Vi
|
|
||||||
#
|
|
||||||
# A `~` operator can be used before a mode to apply the binding whenever
|
|
||||||
# the mode is *not* active, e.g. `~Alt`.
|
|
||||||
#
|
|
||||||
# Bindings are always filled by default, but will be replaced when a new
|
|
||||||
# binding with the same triggers is defined. To unset a default binding, it can
|
|
||||||
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
|
|
||||||
# a no-op if you do not wish to receive input characters for that binding.
|
|
||||||
#
|
|
||||||
# If the same trigger is assigned to multiple actions, all of them are executed
|
|
||||||
# in the order they were defined in.
|
|
||||||
#key_bindings:
|
|
||||||
#- { key: Paste, action: Paste }
|
|
||||||
#- { key: Copy, action: Copy }
|
|
||||||
#- { key: L, mods: Control, action: ClearLogNotice }
|
|
||||||
#- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" }
|
|
||||||
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp }
|
|
||||||
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
|
|
||||||
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop }
|
|
||||||
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
|
|
||||||
|
|
||||||
# Vi Mode
|
|
||||||
#- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode }
|
|
||||||
#- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom }
|
|
||||||
#- { key: Escape, mode: Vi|~Search, action: ClearSelection }
|
|
||||||
#- { key: I, mode: Vi|~Search, action: ToggleViMode }
|
|
||||||
#- { key: I, mode: Vi|~Search, action: ScrollToBottom }
|
|
||||||
#- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode }
|
|
||||||
#- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp }
|
|
||||||
#- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown }
|
|
||||||
#- { key: G, mode: Vi|~Search, action: ScrollToTop }
|
|
||||||
#- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom }
|
|
||||||
#- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp }
|
|
||||||
#- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown }
|
|
||||||
#- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp }
|
|
||||||
#- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown }
|
|
||||||
#- { key: Y, mode: Vi|~Search, action: Copy }
|
|
||||||
#- { key: Y, mode: Vi|~Search, action: ClearSelection }
|
|
||||||
#- { key: Copy, mode: Vi|~Search, action: ClearSelection }
|
|
||||||
#- { key: V, mode: Vi|~Search, action: ToggleNormalSelection }
|
|
||||||
#- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection }
|
|
||||||
#- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection }
|
|
||||||
#- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection }
|
|
||||||
#- { key: Return, mode: Vi|~Search, action: Open }
|
|
||||||
#- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor }
|
|
||||||
#- { key: K, mode: Vi|~Search, action: Up }
|
|
||||||
#- { key: J, mode: Vi|~Search, action: Down }
|
|
||||||
#- { key: H, mode: Vi|~Search, action: Left }
|
|
||||||
#- { key: L, mode: Vi|~Search, action: Right }
|
|
||||||
#- { key: Up, mode: Vi|~Search, action: Up }
|
|
||||||
#- { key: Down, mode: Vi|~Search, action: Down }
|
|
||||||
#- { key: Left, mode: Vi|~Search, action: Left }
|
|
||||||
#- { key: Right, mode: Vi|~Search, action: Right }
|
|
||||||
#- { key: Key0, mode: Vi|~Search, action: First }
|
|
||||||
#- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last }
|
|
||||||
#- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied }
|
|
||||||
#- { key: H, mods: Shift, mode: Vi|~Search, action: High }
|
|
||||||
#- { key: M, mods: Shift, mode: Vi|~Search, action: Middle }
|
|
||||||
#- { key: L, mods: Shift, mode: Vi|~Search, action: Low }
|
|
||||||
#- { key: B, mode: Vi|~Search, action: SemanticLeft }
|
|
||||||
#- { key: W, mode: Vi|~Search, action: SemanticRight }
|
|
||||||
#- { key: E, mode: Vi|~Search, action: SemanticRightEnd }
|
|
||||||
#- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft }
|
|
||||||
#- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight }
|
|
||||||
#- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd }
|
|
||||||
#- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket }
|
|
||||||
#- { key: Slash, mode: Vi|~Search, action: SearchForward }
|
|
||||||
#- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward }
|
|
||||||
#- { key: N, mode: Vi|~Search, action: SearchNext }
|
|
||||||
#- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious }
|
|
||||||
|
|
||||||
# Search Mode
|
|
||||||
#- { key: Return, mode: Search|Vi, action: SearchConfirm }
|
|
||||||
#- { key: Escape, mode: Search, action: SearchCancel }
|
|
||||||
#- { key: C, mods: Control, mode: Search, action: SearchCancel }
|
|
||||||
#- { key: U, mods: Control, mode: Search, action: SearchClear }
|
|
||||||
#- { key: W, mods: Control, mode: Search, action: SearchDeleteWord }
|
|
||||||
#- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious }
|
|
||||||
#- { key: N, mods: Control, mode: Search, action: SearchHistoryNext }
|
|
||||||
#- { key: Up, mode: Search, action: SearchHistoryPrevious }
|
|
||||||
#- { key: Down, mode: Search, action: SearchHistoryNext }
|
|
||||||
#- { key: Return, mode: Search|~Vi, action: SearchFocusNext }
|
|
||||||
#- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious }
|
|
||||||
|
|
||||||
# (Windows, Linux, and BSD only)
|
|
||||||
#- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste }
|
|
||||||
#- { key: C, mods: Control|Shift, action: Copy }
|
|
||||||
#- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward }
|
|
||||||
#- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward }
|
|
||||||
#- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection }
|
|
||||||
#- { key: Insert, mods: Shift, action: PasteSelection }
|
|
||||||
#- { key: Key0, mods: Control, action: ResetFontSize }
|
|
||||||
#- { key: Equals, mods: Control, action: IncreaseFontSize }
|
|
||||||
#- { key: Plus, mods: Control, action: IncreaseFontSize }
|
|
||||||
#- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
|
|
||||||
#- { key: Minus, mods: Control, action: DecreaseFontSize }
|
|
||||||
#- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
|
|
||||||
|
|
||||||
# (Windows only)
|
|
||||||
#- { key: Return, mods: Alt, action: ToggleFullscreen }
|
|
||||||
|
|
||||||
# (macOS only)
|
|
||||||
#- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" }
|
|
||||||
#- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory }
|
|
||||||
#- { key: Key0, mods: Command, action: ResetFontSize }
|
|
||||||
#- { key: Equals, mods: Command, action: IncreaseFontSize }
|
|
||||||
#- { key: Plus, mods: Command, action: IncreaseFontSize }
|
|
||||||
#- { key: NumpadAdd, mods: Command, action: IncreaseFontSize }
|
|
||||||
#- { key: Minus, mods: Command, action: DecreaseFontSize }
|
|
||||||
#- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize }
|
|
||||||
#- { key: V, mods: Command, action: Paste }
|
|
||||||
#- { key: C, mods: Command, action: Copy }
|
|
||||||
#- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection }
|
|
||||||
#- { key: H, mods: Command, action: Hide }
|
|
||||||
#- { key: H, mods: Command|Alt, action: HideOtherApplications }
|
|
||||||
#- { key: M, mods: Command, action: Minimize }
|
|
||||||
#- { key: Q, mods: Command, action: Quit }
|
|
||||||
#- { key: W, mods: Command, action: Quit }
|
|
||||||
#- { key: N, mods: Command, action: CreateNewWindow }
|
|
||||||
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
|
|
||||||
#- { key: F, mods: Command, mode: ~Search, action: SearchForward }
|
|
||||||
#- { key: B, mods: Command, mode: ~Search, action: SearchBackward }
|
|
||||||
|
|
||||||
#debug:
|
|
||||||
# Display the time it takes to redraw each frame.
|
|
||||||
#render_timer: false
|
|
||||||
|
|
||||||
# Keep the log file after quitting Alacritty.
|
|
||||||
#persistent_logging: false
|
|
||||||
|
|
||||||
# Log level
|
|
||||||
#
|
|
||||||
# Values for `log_level`:
|
|
||||||
# - Off
|
|
||||||
# - Error
|
|
||||||
# - Warn
|
|
||||||
# - Info
|
|
||||||
# - Debug
|
|
||||||
# - Trace
|
|
||||||
#log_level: Warn
|
|
||||||
|
|
||||||
# Renderer override.
|
|
||||||
# - glsl3
|
|
||||||
# - gles2
|
|
||||||
# - gles2_pure
|
|
||||||
#renderer: None
|
|
||||||
|
|
||||||
# Print all received window events.
|
|
||||||
#print_events: false
|
|
||||||
|
|
||||||
# Highlight window damage information.
|
|
||||||
#highlight_damage: false
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.alacritty = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.configFile."alacritty/alacritty.yml".source = ./alacritty.yml;
|
|
||||||
xdg.configFile."alacritty/theme_github_dark.yml".source = ./theme_github_dark.yml;
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
# github Alacritty Colors
|
|
||||||
colors:
|
|
||||||
# Default colors
|
|
||||||
primary:
|
|
||||||
background: '0x24292e'
|
|
||||||
foreground: '0xd1d5da'
|
|
||||||
|
|
||||||
# Normal colors
|
|
||||||
normal:
|
|
||||||
black: '0x586069'
|
|
||||||
red: '0xea4a5a'
|
|
||||||
green: '0x34d058'
|
|
||||||
yellow: '0xffea7f'
|
|
||||||
blue: '0x2188ff'
|
|
||||||
magenta: '0xb392f0'
|
|
||||||
cyan: '0x39c5cf'
|
|
||||||
white: '0xd1d5da'
|
|
||||||
|
|
||||||
# Bright colors
|
|
||||||
bright:
|
|
||||||
black: '0x959da5'
|
|
||||||
red: '0xf97583'
|
|
||||||
green: '0x85e89d'
|
|
||||||
yellow: '0xffea7f'
|
|
||||||
blue: '0x79b8ff'
|
|
||||||
magenta: '0xb392f0'
|
|
||||||
cyan: '0x56d4dd'
|
|
||||||
white: '0xfafbfc'
|
|
||||||
|
|
||||||
indexed_colors:
|
|
||||||
- { index: 16, color: '0xd18616' }
|
|
||||||
- { index: 17, color: '0xf97583' }
|
|
||||||
@@ -1,23 +1,10 @@
|
|||||||
# Install those apps using brew, instead of nix
|
{pkgs, ...}: {
|
||||||
# because they are not available in nixpkgs with the support of darwin
|
##########################################################################
|
||||||
# ==> Brew Casks
|
#
|
||||||
# jdk-mission-control
|
# MacOS specific home configuration
|
||||||
# anki firefox iina openinterminal-lite
|
#
|
||||||
# insomnia orbstack
|
##########################################################################
|
||||||
# clashx google-chrome
|
programs.zsh = {
|
||||||
# google-cloud-sdk telegram wireshark
|
|
||||||
|
|
||||||
|
|
||||||
{pkgs, ...}:
|
|
||||||
{
|
|
||||||
# MacOS specific configuration
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
mpv
|
|
||||||
discord
|
|
||||||
];
|
|
||||||
|
|
||||||
# stable version of vscode
|
|
||||||
programs.vscode = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -32,6 +19,9 @@
|
|||||||
# format in details:
|
# format in details:
|
||||||
# https://www.ssh.com/academy/ssh/config
|
# https://www.ssh.com/academy/ssh/config
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
# a private key that is used during authentication will be added to ssh-agent if it is running
|
||||||
|
AddKeysToAgent yes
|
||||||
|
|
||||||
Host 192.168.*
|
Host 192.168.*
|
||||||
# allow to securely use local SSH agent to authenticate on the remote machine.
|
# allow to securely use local SSH agent to authenticate on the remote machine.
|
||||||
# It has the same effect as adding cli option `ssh -A user@host`
|
# It has the same effect as adding cli option `ssh -A user@host`
|
||||||
@@ -50,10 +40,5 @@
|
|||||||
# required to prevent sending default identity files first.
|
# required to prevent sending default identity files first.
|
||||||
IdentitiesOnly yes
|
IdentitiesOnly yes
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# use ssh-agent so we only need to input passphrase once
|
|
||||||
# run `ssh-add /path/to/key` for every identity file
|
|
||||||
# check imported keys by `ssh-add -l`
|
|
||||||
# TODO `ssh-add` can only add keys temporary, use gnome-keyring to unlock all keys after login.
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,19 @@
|
|||||||
{ pkgs, ... }:
|
{ username, ... }: {
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
../common/nushell
|
../base/desktop
|
||||||
|
|
||||||
../common/core.nix
|
./proxychains
|
||||||
../common/git.nix
|
|
||||||
../common/development.nix
|
|
||||||
../common/media.nix
|
|
||||||
../common/starship.nix
|
|
||||||
|
|
||||||
./alacritty
|
|
||||||
./core.nix
|
./core.nix
|
||||||
|
./rime-squirrel.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Home Manager needs a bit of information about you and the
|
# Home Manager needs a bit of information about you and the
|
||||||
# paths it should manage.
|
# paths it should manage.
|
||||||
home = {
|
home = {
|
||||||
username = "admin";
|
username = username;
|
||||||
# set homeDirectory make build fail
|
# set homeDirectory make build fail
|
||||||
homeDirectory = "/Users/admin";
|
homeDirectory = "/Users/${username}";
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
home.file.".proxychains/proxychains.conf".source = ./proxychains.conf;
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
|
||||||
|
# proxychains.conf VER 4.x
|
||||||
|
#
|
||||||
|
# HTTP, SOCKS4a, SOCKS5 tunneling proxifier with DNS.
|
||||||
|
|
||||||
|
|
||||||
|
# The option below identifies how the ProxyList is treated.
|
||||||
|
# only one option should be uncommented at time,
|
||||||
|
# otherwise the last appearing option will be accepted
|
||||||
|
#
|
||||||
|
#dynamic_chain
|
||||||
|
#
|
||||||
|
# Dynamic - Each connection will be done via chained proxies
|
||||||
|
# all proxies chained in the order as they appear in the list
|
||||||
|
# at least one proxy must be online to play in chain
|
||||||
|
# (dead proxies are skipped)
|
||||||
|
# otherwise EINTR is returned to the app
|
||||||
|
#
|
||||||
|
strict_chain
|
||||||
|
#
|
||||||
|
# Strict - Each connection will be done via chained proxies
|
||||||
|
# all proxies chained in the order as they appear in the list
|
||||||
|
# all proxies must be online to play in chain
|
||||||
|
# otherwise EINTR is returned to the app
|
||||||
|
#
|
||||||
|
#round_robin_chain
|
||||||
|
#
|
||||||
|
# Round Robin - Each connection will be done via chained proxies
|
||||||
|
# of chain_len length
|
||||||
|
# all proxies chained in the order as they appear in the list
|
||||||
|
# at least one proxy must be online to play in chain
|
||||||
|
# (dead proxies are skipped).
|
||||||
|
# the start of the current proxy chain is the proxy after the last
|
||||||
|
# proxy in the previously invoked proxy chain.
|
||||||
|
# if the end of the proxy chain is reached while looking for proxies
|
||||||
|
# start at the beginning again.
|
||||||
|
# otherwise EINTR is returned to the app
|
||||||
|
# These semantics are not guaranteed in a multithreaded environment.
|
||||||
|
#
|
||||||
|
#random_chain
|
||||||
|
#
|
||||||
|
# Random - Each connection will be done via random proxy
|
||||||
|
# (or proxy chain, see chain_len) from the list.
|
||||||
|
# this option is good to test your IDS :)
|
||||||
|
|
||||||
|
# Make sense only if random_chain or round_robin_chain
|
||||||
|
#chain_len = 2
|
||||||
|
|
||||||
|
# Quiet mode (no output from library)
|
||||||
|
#quiet_mode
|
||||||
|
|
||||||
|
## Proxy DNS requests - no leak for DNS data
|
||||||
|
# (disable all of the 3 items below to not proxy your DNS requests)
|
||||||
|
|
||||||
|
# method 1. this uses the proxychains4 style method to do remote dns:
|
||||||
|
# a thread is spawned that serves DNS requests and hands down an ip
|
||||||
|
# assigned from an internal list (via remote_dns_subnet).
|
||||||
|
# this is the easiest (setup-wise) and fastest method, however on
|
||||||
|
# systems with buggy libcs and very complex software like webbrowsers
|
||||||
|
# this might not work and/or cause crashes.
|
||||||
|
proxy_dns
|
||||||
|
|
||||||
|
# method 2. use the old proxyresolv script to proxy DNS requests
|
||||||
|
# in proxychains 3.1 style. requires `proxyresolv` in $PATH
|
||||||
|
# plus a dynamically linked `dig` binary.
|
||||||
|
# this is a lot slower than `proxy_dns`, doesn't support .onion URLs,
|
||||||
|
# but might be more compatible with complex software like webbrowsers.
|
||||||
|
#proxy_dns_old
|
||||||
|
|
||||||
|
# method 3. use proxychains4-daemon process to serve remote DNS requests.
|
||||||
|
# this is similar to the threaded `proxy_dns` method, however it requires
|
||||||
|
# that proxychains4-daemon is already running on the specified address.
|
||||||
|
# on the plus side it doesn't do malloc/threads so it should be quite
|
||||||
|
# compatible with complex, async-unsafe software.
|
||||||
|
# note that if you don't start proxychains4-daemon before using this,
|
||||||
|
# the process will simply hang.
|
||||||
|
#proxy_dns_daemon 127.0.0.1:1053
|
||||||
|
|
||||||
|
# set the class A subnet number to use for the internal remote DNS mapping
|
||||||
|
# we use the reserved 224.x.x.x range by default,
|
||||||
|
# if the proxified app does a DNS request, we will return an IP from that range.
|
||||||
|
# on further accesses to this ip we will send the saved DNS name to the proxy.
|
||||||
|
# in case some control-freak app checks the returned ip, and denies to
|
||||||
|
# connect, you can use another subnet, e.g. 10.x.x.x or 127.x.x.x.
|
||||||
|
# of course you should make sure that the proxified app does not need
|
||||||
|
# *real* access to this subnet.
|
||||||
|
# i.e. dont use the same subnet then in the localnet section
|
||||||
|
#remote_dns_subnet 127
|
||||||
|
#remote_dns_subnet 10
|
||||||
|
remote_dns_subnet 224
|
||||||
|
|
||||||
|
# Some timeouts in milliseconds
|
||||||
|
tcp_read_time_out 15000
|
||||||
|
tcp_connect_time_out 8000
|
||||||
|
|
||||||
|
### Examples for localnet exclusion
|
||||||
|
## localnet ranges will *not* use a proxy to connect.
|
||||||
|
## note that localnet works only when plain IP addresses are passed to the app,
|
||||||
|
## the hostname resolves via /etc/hosts, or proxy_dns is disabled or proxy_dns_old used.
|
||||||
|
|
||||||
|
## Exclude connections to 192.168.1.0/24 with port 80
|
||||||
|
# localnet 192.168.1.0:80/255.255.255.0
|
||||||
|
|
||||||
|
## Exclude connections to 192.168.100.0/24
|
||||||
|
# localnet 192.168.100.0/255.255.255.0
|
||||||
|
|
||||||
|
## Exclude connections to ANYwhere with port 80
|
||||||
|
# localnet 0.0.0.0:80/0.0.0.0
|
||||||
|
# localnet [::]:80/0
|
||||||
|
|
||||||
|
## RFC6890 Loopback address range
|
||||||
|
## if you enable this, you have to make sure remote_dns_subnet is not 127
|
||||||
|
## you'll need to enable it if you want to use an application that
|
||||||
|
## connects to localhost.
|
||||||
|
# localnet 127.0.0.0/255.0.0.0
|
||||||
|
# localnet ::1/128
|
||||||
|
|
||||||
|
## RFC1918 Private Address Ranges
|
||||||
|
# localnet 10.0.0.0/255.0.0.0
|
||||||
|
# localnet 172.16.0.0/255.240.0.0
|
||||||
|
# localnet 192.168.0.0/255.255.0.0
|
||||||
|
|
||||||
|
### Examples for dnat
|
||||||
|
## Trying to proxy connections to destinations which are dnatted,
|
||||||
|
## will result in proxying connections to the new given destinations.
|
||||||
|
## Whenever I connect to 1.1.1.1 on port 1234 actually connect to 1.1.1.2 on port 443
|
||||||
|
# dnat 1.1.1.1:1234 1.1.1.2:443
|
||||||
|
|
||||||
|
## Whenever I connect to 1.1.1.1 on port 443 actually connect to 1.1.1.2 on port 443
|
||||||
|
## (no need to write :443 again)
|
||||||
|
# dnat 1.1.1.2:443 1.1.1.2
|
||||||
|
|
||||||
|
## No matter what port I connect to on 1.1.1.1 port actually connect to 1.1.1.2 on port 443
|
||||||
|
# dnat 1.1.1.1 1.1.1.2:443
|
||||||
|
|
||||||
|
## Always, instead of connecting to 1.1.1.1, connect to 1.1.1.2
|
||||||
|
# dnat 1.1.1.1 1.1.1.2
|
||||||
|
|
||||||
|
# ProxyList format
|
||||||
|
# type ip port [user pass]
|
||||||
|
# (values separated by 'tab' or 'blank')
|
||||||
|
#
|
||||||
|
# only numeric ipv4 addresses are valid
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Examples:
|
||||||
|
#
|
||||||
|
# socks5 192.168.67.78 1080 lamer secret
|
||||||
|
# http 192.168.89.3 8080 justu hidden
|
||||||
|
# socks4 192.168.1.49 1080
|
||||||
|
# http 192.168.39.93 8080
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# proxy types: http, socks4, socks5, raw
|
||||||
|
# * raw: The traffic is simply forwarded to the proxy without modification.
|
||||||
|
# ( auth types supported: "basic"-http "user/pass"-socks )
|
||||||
|
#
|
||||||
|
[ProxyList]
|
||||||
|
# add proxy here ...
|
||||||
|
# set to clash's http/socks5 port
|
||||||
|
socks5 127.0.0.1 7890
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
# remove existing rime data (squirrel)
|
||||||
|
home.activation.removeExistingRimeData = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
||||||
|
rm -rf "~/Library/Rime/build/flypy.prism.bin"
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Squirrel Input Method
|
||||||
|
home.file."Library/Rime" = {
|
||||||
|
# my custom squirrel data (flypy input method)
|
||||||
|
source = "${pkgs.flypy-squirrel}/share/rime-data";
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
# Home Manager's Linux Submodules
|
||||||
|
|
||||||
|
1. `base`: The base module that is suitable for any NixOS environment.
|
||||||
|
2. `desktop`: Configuration for desktop environments, such as Hyprland, I3, etc.
|
||||||
|
3. `fcitx5`: fcitx5's configuration(Chinese input method).
|
||||||
|
4. `hyprland`: Hyprland's configuration.
|
||||||
|
5. `i3`: i3's configuration.
|
||||||
|
6. `server.nix`: Configuration which is suitable for both servers and desktops. It import only `base` as its submodule.
|
||||||
|
1. used by all my nixos servers.
|
||||||
|
6. `desktop-hyprland.nix`: the entrypoint of hyprland's configuration, it import all the submodules above, except `i3`.
|
||||||
|
1. used by my hyprland desktop.
|
||||||
|
7. `desktop-i3.nix`: the entrypoint of i3's configuration, it import all the submodules above, except `hyprland`.
|
||||||
|
1. used by my i3 desktop.
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./shell.nix
|
||||||
|
./system-tools.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
{config, ...}:
|
{config, nushell-scripts, ...}: let
|
||||||
|
|
||||||
let
|
|
||||||
d = config.xdg.dataHome;
|
d = config.xdg.dataHome;
|
||||||
c = config.xdg.configHome;
|
c = config.xdg.configHome;
|
||||||
cache = config.xdg.cacheHome;
|
cache = config.xdg.cacheHome;
|
||||||
@@ -19,8 +17,6 @@ in rec {
|
|||||||
|
|
||||||
# set default applications
|
# set default applications
|
||||||
BROWSER = "firefox";
|
BROWSER = "firefox";
|
||||||
TERMINAL = "alacritty";
|
|
||||||
TERM = "xterm-256color";
|
|
||||||
|
|
||||||
# enable scrolling in git diff
|
# enable scrolling in git diff
|
||||||
DELTA_PAGER = "less -R";
|
DELTA_PAGER = "less -R";
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{pkgs, ...}: {
|
||||||
|
# Linux Only Packages, not available on Darwin
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
nmon
|
||||||
|
iotop
|
||||||
|
iftop
|
||||||
|
|
||||||
|
# misc
|
||||||
|
libnotify
|
||||||
|
wireguard-tools # manage wireguard vpn manually, via wg-quick
|
||||||
|
|
||||||
|
# system call monitoring
|
||||||
|
strace # system call monitoring
|
||||||
|
ltrace # library call monitoring
|
||||||
|
bpftrace # powerful tracing tool
|
||||||
|
tcpdump # network sniffer
|
||||||
|
lsof # list open files
|
||||||
|
|
||||||
|
# system tools
|
||||||
|
sysstat
|
||||||
|
lm_sensors # for `sensors` command
|
||||||
|
ethtool
|
||||||
|
pciutils # lspci
|
||||||
|
usbutils # lsusb
|
||||||
|
hdparm # for disk performance, command
|
||||||
|
dmidecode # a tool that reads information about your system's hardware from the BIOS according to the SMBIOS/DMI standard
|
||||||
|
];
|
||||||
|
|
||||||
|
# auto mount usb drives
|
||||||
|
services = {
|
||||||
|
udiskie.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services = {
|
||||||
|
# syncthing.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,730 +0,0 @@
|
|||||||
# Configuration for Alacritty, the GPU enhanced terminal emulator.
|
|
||||||
|
|
||||||
# Import additional configuration files
|
|
||||||
#
|
|
||||||
# Imports are loaded in order, skipping all missing files, with the importing
|
|
||||||
# file being loaded last. If a field is already present in a previous import, it
|
|
||||||
# will be replaced.
|
|
||||||
#
|
|
||||||
# All imports must either be absolute paths starting with `/`, or paths relative
|
|
||||||
# to the user's home directory starting with `~/`.
|
|
||||||
import:
|
|
||||||
# all alacritty themes can be found at
|
|
||||||
# https://github.com/alacritty/alacritty-theme
|
|
||||||
- ~/.config/alacritty/theme_github_dark.yml
|
|
||||||
|
|
||||||
# Any items in the `env` entry below will be added as
|
|
||||||
# environment variables. Some entries may override variables
|
|
||||||
# set by alacritty itself.
|
|
||||||
#env:
|
|
||||||
# TERM variable
|
|
||||||
#
|
|
||||||
# This value is used to set the `$TERM` environment variable for
|
|
||||||
# each instance of Alacritty. If it is not present, alacritty will
|
|
||||||
# check the local terminfo database and use `alacritty` if it is
|
|
||||||
# available, otherwise `xterm-256color` is used.
|
|
||||||
#TERM: alacritty
|
|
||||||
|
|
||||||
window:
|
|
||||||
# Window dimensions (changes require restart)
|
|
||||||
#
|
|
||||||
# Number of lines/columns (not pixels) in the terminal. Both lines and columns
|
|
||||||
# must be non-zero for this to take effect. The number of columns must be at
|
|
||||||
# least `2`, while using a value of `0` for columns and lines will fall back
|
|
||||||
# to the window manager's recommended size
|
|
||||||
#dimensions:
|
|
||||||
# columns: 0
|
|
||||||
# lines: 0
|
|
||||||
|
|
||||||
# Window position (changes require restart)
|
|
||||||
#
|
|
||||||
# Specified in number of pixels.
|
|
||||||
# If the position is not set, the window manager will handle the placement.
|
|
||||||
#position:
|
|
||||||
# x: 0
|
|
||||||
# y: 0
|
|
||||||
|
|
||||||
# Window padding (changes require restart)
|
|
||||||
#
|
|
||||||
# Blank space added around the window in pixels. This padding is scaled
|
|
||||||
# by DPI and the specified value is always added at both opposing sides.
|
|
||||||
padding:
|
|
||||||
x: 5
|
|
||||||
y: 5
|
|
||||||
|
|
||||||
# Spread additional padding evenly around the terminal content.
|
|
||||||
dynamic_padding: true
|
|
||||||
|
|
||||||
# Window decorations
|
|
||||||
#
|
|
||||||
# Values for `decorations`:
|
|
||||||
# - full: Borders and title bar
|
|
||||||
# - none: Neither borders nor title bar
|
|
||||||
#
|
|
||||||
# Values for `decorations` (macOS only):
|
|
||||||
# - transparent: Title bar, transparent background and title bar buttons
|
|
||||||
# - buttonless: Title bar, transparent background and no title bar buttons
|
|
||||||
#decorations: full
|
|
||||||
|
|
||||||
# Background opacity
|
|
||||||
#
|
|
||||||
# Window opacity as a floating point number from `0.0` to `1.0`.
|
|
||||||
# The value `0.0` is completely transparent and `1.0` is opaque.
|
|
||||||
opacity: 0.98
|
|
||||||
|
|
||||||
# Startup Mode (changes require restart)
|
|
||||||
#
|
|
||||||
# Values for `startup_mode`:
|
|
||||||
# - Windowed
|
|
||||||
# - Maximized
|
|
||||||
# - Fullscreen
|
|
||||||
#
|
|
||||||
# Values for `startup_mode` (macOS only):
|
|
||||||
# - SimpleFullscreen
|
|
||||||
startup_mode: Windowed
|
|
||||||
|
|
||||||
# Window title
|
|
||||||
title: Alacritty
|
|
||||||
|
|
||||||
# Allow terminal applications to change Alacritty's window title.
|
|
||||||
dynamic_title: true
|
|
||||||
|
|
||||||
# Window class (Linux/BSD only):
|
|
||||||
#class:
|
|
||||||
# Application instance name
|
|
||||||
#instance: Alacritty
|
|
||||||
# General application class
|
|
||||||
#general: Alacritty
|
|
||||||
|
|
||||||
# Decorations theme variant
|
|
||||||
#
|
|
||||||
# Override the variant of the System theme/GTK theme/Wayland client side
|
|
||||||
# decorations. Commonly supported values are `Dark`, `Light`, and `None` for
|
|
||||||
# auto pick-up. Set this to `None` to use the default theme variant.
|
|
||||||
#decorations_theme_variant: None
|
|
||||||
|
|
||||||
# Resize increments
|
|
||||||
#
|
|
||||||
# Prefer resizing window by discrete steps equal to cell dimensions.
|
|
||||||
#resize_increments: false
|
|
||||||
|
|
||||||
# Make `Option` key behave as `Alt` (macOS only):
|
|
||||||
# - OnlyLeft
|
|
||||||
# - OnlyRight
|
|
||||||
# - Both
|
|
||||||
# - None (default)
|
|
||||||
#option_as_alt: None
|
|
||||||
|
|
||||||
scrolling:
|
|
||||||
# Maximum number of lines in the scrollback buffer.
|
|
||||||
# Specifying '0' will disable scrolling.
|
|
||||||
history: 10000
|
|
||||||
|
|
||||||
# Scrolling distance multiplier.
|
|
||||||
#multiplier: 3
|
|
||||||
|
|
||||||
# Font configuration
|
|
||||||
font:
|
|
||||||
# Normal (roman) font face
|
|
||||||
bold:
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
italic:
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
normal:
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
bold_italic:
|
|
||||||
# Font family
|
|
||||||
#
|
|
||||||
# If the bold italic family is not specified, it will fall back to the
|
|
||||||
# value specified for the normal font.
|
|
||||||
family: JetBrainsMono Nerd Font
|
|
||||||
# Point size
|
|
||||||
size: 12
|
|
||||||
|
|
||||||
# Offset is the extra space around each character. `offset.y` can be thought
|
|
||||||
# of as modifying the line spacing, and `offset.x` as modifying the letter
|
|
||||||
# spacing.
|
|
||||||
#offset:
|
|
||||||
# x: 0
|
|
||||||
# y: 0
|
|
||||||
|
|
||||||
# Glyph offset determines the locations of the glyphs within their cells with
|
|
||||||
# the default being at the bottom. Increasing `x` moves the glyph to the
|
|
||||||
# right, increasing `y` moves the glyph upward.
|
|
||||||
#glyph_offset:
|
|
||||||
# x: 0
|
|
||||||
# y: 0
|
|
||||||
|
|
||||||
# Use built-in font for box drawing characters.
|
|
||||||
#
|
|
||||||
# If `true`, Alacritty will use a custom built-in font for box drawing
|
|
||||||
# characters (Unicode points 2500 - 259f).
|
|
||||||
#
|
|
||||||
#builtin_box_drawing: true
|
|
||||||
|
|
||||||
# If `true`, bold text is drawn using the bright color variants.
|
|
||||||
#draw_bold_text_with_bright_colors: false
|
|
||||||
|
|
||||||
# Bell
|
|
||||||
#
|
|
||||||
# The bell is rung every time the BEL control character is received.
|
|
||||||
#bell:
|
|
||||||
# Visual Bell Animation
|
|
||||||
#
|
|
||||||
# Animation effect for flashing the screen when the visual bell is rung.
|
|
||||||
#
|
|
||||||
# Values for `animation`:
|
|
||||||
# - Ease
|
|
||||||
# - EaseOut
|
|
||||||
# - EaseOutSine
|
|
||||||
# - EaseOutQuad
|
|
||||||
# - EaseOutCubic
|
|
||||||
# - EaseOutQuart
|
|
||||||
# - EaseOutQuint
|
|
||||||
# - EaseOutExpo
|
|
||||||
# - EaseOutCirc
|
|
||||||
# - Linear
|
|
||||||
#animation: EaseOutExpo
|
|
||||||
|
|
||||||
# Duration of the visual bell flash in milliseconds. A `duration` of `0` will
|
|
||||||
# disable the visual bell animation.
|
|
||||||
#duration: 0
|
|
||||||
|
|
||||||
# Visual bell animation color.
|
|
||||||
#color: '#ffffff'
|
|
||||||
|
|
||||||
# Bell Command
|
|
||||||
#
|
|
||||||
# This program is executed whenever the bell is rung.
|
|
||||||
#
|
|
||||||
# When set to `command: None`, no command will be executed.
|
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
# command:
|
|
||||||
# program: notify-send
|
|
||||||
# args: ["Hello, World!"]
|
|
||||||
#
|
|
||||||
#command: None
|
|
||||||
|
|
||||||
#selection:
|
|
||||||
# This string contains all characters that are used as separators for
|
|
||||||
# "semantic words" in Alacritty.
|
|
||||||
#semantic_escape_chars: ",│`|:\"' ()[]{}<>\t"
|
|
||||||
|
|
||||||
# When set to `true`, selected text will be copied to the primary clipboard.
|
|
||||||
#save_to_clipboard: false
|
|
||||||
|
|
||||||
#cursor:
|
|
||||||
# Cursor style
|
|
||||||
#style:
|
|
||||||
# Cursor shape
|
|
||||||
#
|
|
||||||
# Values for `shape`:
|
|
||||||
# - ▇ Block
|
|
||||||
# - _ Underline
|
|
||||||
# - | Beam
|
|
||||||
#shape: Block
|
|
||||||
|
|
||||||
# Cursor blinking state
|
|
||||||
#
|
|
||||||
# Values for `blinking`:
|
|
||||||
# - Never: Prevent the cursor from ever blinking
|
|
||||||
# - Off: Disable blinking by default
|
|
||||||
# - On: Enable blinking by default
|
|
||||||
# - Always: Force the cursor to always blink
|
|
||||||
#blinking: Off
|
|
||||||
|
|
||||||
# Vi mode cursor style
|
|
||||||
#
|
|
||||||
# If the vi mode cursor style is `None` or not specified, it will fall back to
|
|
||||||
# the style of the active value of the normal cursor.
|
|
||||||
#
|
|
||||||
# See `cursor.style` for available options.
|
|
||||||
#vi_mode_style: None
|
|
||||||
|
|
||||||
# Cursor blinking interval in milliseconds.
|
|
||||||
#blink_interval: 750
|
|
||||||
|
|
||||||
# Time after which cursor stops blinking, in seconds.
|
|
||||||
#
|
|
||||||
# Specifying '0' will disable timeout for blinking.
|
|
||||||
#blink_timeout: 5
|
|
||||||
|
|
||||||
# If this is `true`, the cursor will be rendered as a hollow box when the
|
|
||||||
# window is not focused.
|
|
||||||
#unfocused_hollow: true
|
|
||||||
|
|
||||||
# Thickness of the cursor relative to the cell width as floating point number
|
|
||||||
# from `0.0` to `1.0`.
|
|
||||||
#thickness: 0.15
|
|
||||||
|
|
||||||
# Live config reload (changes require restart)
|
|
||||||
live_config_reload: true
|
|
||||||
# Shell
|
|
||||||
#
|
|
||||||
# You can set `shell.program` to the path of your favorite shell, e.g.
|
|
||||||
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
|
|
||||||
# shell.
|
|
||||||
#
|
|
||||||
# Default:
|
|
||||||
# - (Linux/BSD/macOS) `$SHELL` or the user's login shell, if `$SHELL` is unset
|
|
||||||
# - (Windows) powershell
|
|
||||||
# shell:
|
|
||||||
# program: /bin/bash
|
|
||||||
# args:
|
|
||||||
# - --login
|
|
||||||
|
|
||||||
# Startup directory
|
|
||||||
#
|
|
||||||
# Directory the shell is started in. If this is unset, or `None`, the working
|
|
||||||
# directory of the parent process will be used.
|
|
||||||
#working_directory: None
|
|
||||||
|
|
||||||
# Offer IPC using `alacritty msg` (unix only)
|
|
||||||
#ipc_socket: true
|
|
||||||
|
|
||||||
#mouse:
|
|
||||||
# Click settings
|
|
||||||
#
|
|
||||||
# The `double_click` and `triple_click` settings control the time
|
|
||||||
# alacritty should wait for accepting multiple clicks as one double
|
|
||||||
# or triple click.
|
|
||||||
#double_click: { threshold: 300 }
|
|
||||||
#triple_click: { threshold: 300 }
|
|
||||||
|
|
||||||
# If this is `true`, the cursor is temporarily hidden when typing.
|
|
||||||
#hide_when_typing: false
|
|
||||||
|
|
||||||
# Hints
|
|
||||||
#
|
|
||||||
# Terminal hints can be used to find text or hyperlink in the visible part of
|
|
||||||
# the terminal and pipe it to other applications.
|
|
||||||
#hints:
|
|
||||||
# Keys used for the hint labels.
|
|
||||||
#alphabet: "jfkdls;ahgurieowpq"
|
|
||||||
|
|
||||||
# List with all available hints
|
|
||||||
#
|
|
||||||
# Each hint must have any of `regex` or `hyperlinks` field and either an
|
|
||||||
# `action` or a `command` field. The fields `mouse`, `binding` and
|
|
||||||
# `post_processing` are optional.
|
|
||||||
#
|
|
||||||
# The `hyperlinks` option will cause OSC 8 escape sequence hyperlinks to be
|
|
||||||
# highlighted.
|
|
||||||
#
|
|
||||||
# The fields `command`, `binding.key`, `binding.mods`, `binding.mode` and
|
|
||||||
# `mouse.mods` accept the same values as they do in the `key_bindings` section.
|
|
||||||
#
|
|
||||||
# The `mouse.enabled` field controls if the hint should be underlined while
|
|
||||||
# the mouse with all `mouse.mods` keys held or the vi mode cursor is above it.
|
|
||||||
#
|
|
||||||
# If the `post_processing` field is set to `true`, heuristics will be used to
|
|
||||||
# shorten the match if there are characters likely not to be part of the hint
|
|
||||||
# (e.g. a trailing `.`). This is most useful for URIs and applies only to
|
|
||||||
# `regex` matches.
|
|
||||||
#
|
|
||||||
# Values for `action`:
|
|
||||||
# - Copy
|
|
||||||
# Copy the hint's text to the clipboard.
|
|
||||||
# - Paste
|
|
||||||
# Paste the hint's text to the terminal or search.
|
|
||||||
# - Select
|
|
||||||
# Select the hint's text.
|
|
||||||
# - MoveViModeCursor
|
|
||||||
# Move the vi mode cursor to the beginning of the hint.
|
|
||||||
#enabled:
|
|
||||||
# - regex: "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\
|
|
||||||
# [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+"
|
|
||||||
# hyperlinks: true
|
|
||||||
# command: xdg-open
|
|
||||||
# post_processing: true
|
|
||||||
# mouse:
|
|
||||||
# enabled: true
|
|
||||||
# mods: None
|
|
||||||
# binding:
|
|
||||||
# key: U
|
|
||||||
# mods: Control|Shift
|
|
||||||
|
|
||||||
# Mouse bindings
|
|
||||||
#
|
|
||||||
# Mouse bindings are specified as a list of objects, much like the key
|
|
||||||
# bindings further below.
|
|
||||||
#
|
|
||||||
# To trigger mouse bindings when an application running within Alacritty
|
|
||||||
# captures the mouse, the `Shift` modifier is automatically added as a
|
|
||||||
# requirement.
|
|
||||||
#
|
|
||||||
# Each mouse binding will specify a:
|
|
||||||
#
|
|
||||||
# - `mouse`:
|
|
||||||
#
|
|
||||||
# - Middle
|
|
||||||
# - Left
|
|
||||||
# - Right
|
|
||||||
# - Numeric identifier such as `5`
|
|
||||||
#
|
|
||||||
# - `action` (see key bindings for actions not exclusive to mouse mode)
|
|
||||||
#
|
|
||||||
# - Mouse exclusive actions:
|
|
||||||
#
|
|
||||||
# - ExpandSelection
|
|
||||||
# Expand the selection to the current mouse cursor location.
|
|
||||||
#
|
|
||||||
# And optionally:
|
|
||||||
#
|
|
||||||
# - `mods` (see key bindings)
|
|
||||||
#mouse_bindings:
|
|
||||||
# - { mouse: Right, action: ExpandSelection }
|
|
||||||
# - { mouse: Right, mods: Control, action: ExpandSelection }
|
|
||||||
# - { mouse: Middle, mode: ~Vi, action: PasteSelection }
|
|
||||||
|
|
||||||
# Key bindings
|
|
||||||
#
|
|
||||||
# Key bindings are specified as a list of objects. For example, this is the
|
|
||||||
# default paste binding:
|
|
||||||
#
|
|
||||||
# `- { key: V, mods: Control|Shift, action: Paste }`
|
|
||||||
#
|
|
||||||
# Each key binding will specify a:
|
|
||||||
#
|
|
||||||
# - `key`: Identifier of the key pressed
|
|
||||||
#
|
|
||||||
# - A-Z
|
|
||||||
# - F1-F24
|
|
||||||
# - Key0-Key9
|
|
||||||
#
|
|
||||||
# A full list with available key codes can be found here:
|
|
||||||
# https://docs.rs/winit/*/winit/event/enum.VirtualKeyCode.html#variants
|
|
||||||
#
|
|
||||||
# Instead of using the name of the keys, the `key` field also supports using
|
|
||||||
# the scancode of the desired key. Scancodes have to be specified as a
|
|
||||||
# decimal number. This command will allow you to display the hex scancodes
|
|
||||||
# for certain keys:
|
|
||||||
#
|
|
||||||
# `showkey --scancodes`.
|
|
||||||
#
|
|
||||||
# Then exactly one of:
|
|
||||||
#
|
|
||||||
# - `chars`: Send a byte sequence to the running application
|
|
||||||
#
|
|
||||||
# The `chars` field writes the specified string to the terminal. This makes
|
|
||||||
# it possible to pass escape sequences. To find escape codes for bindings
|
|
||||||
# like `PageUp` (`"\x1b[5~"`), you can run the command `showkey -a` outside
|
|
||||||
# of tmux. Note that applications use terminfo to map escape sequences back
|
|
||||||
# to keys. It is therefore required to update the terminfo when changing an
|
|
||||||
# escape sequence.
|
|
||||||
#
|
|
||||||
# - `action`: Execute a predefined action
|
|
||||||
#
|
|
||||||
# - ToggleViMode
|
|
||||||
# - SearchForward
|
|
||||||
# Start searching toward the right of the search origin.
|
|
||||||
# - SearchBackward
|
|
||||||
# Start searching toward the left of the search origin.
|
|
||||||
# - Copy
|
|
||||||
# - Paste
|
|
||||||
# - IncreaseFontSize
|
|
||||||
# - DecreaseFontSize
|
|
||||||
# - ResetFontSize
|
|
||||||
# - ScrollPageUp
|
|
||||||
# - ScrollPageDown
|
|
||||||
# - ScrollHalfPageUp
|
|
||||||
# - ScrollHalfPageDown
|
|
||||||
# - ScrollLineUp
|
|
||||||
# - ScrollLineDown
|
|
||||||
# - ScrollToTop
|
|
||||||
# - ScrollToBottom
|
|
||||||
# - ClearHistory
|
|
||||||
# Remove the terminal's scrollback history.
|
|
||||||
# - Hide
|
|
||||||
# Hide the Alacritty window.
|
|
||||||
# - Minimize
|
|
||||||
# Minimize the Alacritty window.
|
|
||||||
# - Quit
|
|
||||||
# Quit Alacritty.
|
|
||||||
# - ToggleFullscreen
|
|
||||||
# - ToggleMaximized
|
|
||||||
# - SpawnNewInstance
|
|
||||||
# Spawn a new instance of Alacritty.
|
|
||||||
# - CreateNewWindow
|
|
||||||
# Create a new Alacritty window from the current process.
|
|
||||||
# - ClearLogNotice
|
|
||||||
# Clear Alacritty's UI warning and error notice.
|
|
||||||
# - ClearSelection
|
|
||||||
# Remove the active selection.
|
|
||||||
# - ReceiveChar
|
|
||||||
# - None
|
|
||||||
#
|
|
||||||
# - Vi mode exclusive actions:
|
|
||||||
#
|
|
||||||
# - Open
|
|
||||||
# Perform the action of the first matching hint under the vi mode cursor
|
|
||||||
# with `mouse.enabled` set to `true`.
|
|
||||||
# - ToggleNormalSelection
|
|
||||||
# - ToggleLineSelection
|
|
||||||
# - ToggleBlockSelection
|
|
||||||
# - ToggleSemanticSelection
|
|
||||||
# Toggle semantic selection based on `selection.semantic_escape_chars`.
|
|
||||||
# - CenterAroundViCursor
|
|
||||||
# Center view around vi mode cursor
|
|
||||||
#
|
|
||||||
# - Vi mode exclusive cursor motion actions:
|
|
||||||
#
|
|
||||||
# - Up
|
|
||||||
# One line up.
|
|
||||||
# - Down
|
|
||||||
# One line down.
|
|
||||||
# - Left
|
|
||||||
# One character left.
|
|
||||||
# - Right
|
|
||||||
# One character right.
|
|
||||||
# - First
|
|
||||||
# First column, or beginning of the line when already at the first column.
|
|
||||||
# - Last
|
|
||||||
# Last column, or beginning of the line when already at the last column.
|
|
||||||
# - FirstOccupied
|
|
||||||
# First non-empty cell in this terminal row, or first non-empty cell of
|
|
||||||
# the line when already at the first cell of the row.
|
|
||||||
# - High
|
|
||||||
# Top of the screen.
|
|
||||||
# - Middle
|
|
||||||
# Center of the screen.
|
|
||||||
# - Low
|
|
||||||
# Bottom of the screen.
|
|
||||||
# - SemanticLeft
|
|
||||||
# Start of the previous semantically separated word.
|
|
||||||
# - SemanticRight
|
|
||||||
# Start of the next semantically separated word.
|
|
||||||
# - SemanticLeftEnd
|
|
||||||
# End of the previous semantically separated word.
|
|
||||||
# - SemanticRightEnd
|
|
||||||
# End of the next semantically separated word.
|
|
||||||
# - WordLeft
|
|
||||||
# Start of the previous whitespace separated word.
|
|
||||||
# - WordRight
|
|
||||||
# Start of the next whitespace separated word.
|
|
||||||
# - WordLeftEnd
|
|
||||||
# End of the previous whitespace separated word.
|
|
||||||
# - WordRightEnd
|
|
||||||
# End of the next whitespace separated word.
|
|
||||||
# - Bracket
|
|
||||||
# Character matching the bracket at the cursor's location.
|
|
||||||
# - SearchNext
|
|
||||||
# Beginning of the next match.
|
|
||||||
# - SearchPrevious
|
|
||||||
# Beginning of the previous match.
|
|
||||||
# - SearchStart
|
|
||||||
# Start of the match to the left of the vi mode cursor.
|
|
||||||
# - SearchEnd
|
|
||||||
# End of the match to the right of the vi mode cursor.
|
|
||||||
#
|
|
||||||
# - Search mode exclusive actions:
|
|
||||||
# - SearchFocusNext
|
|
||||||
# Move the focus to the next search match.
|
|
||||||
# - SearchFocusPrevious
|
|
||||||
# Move the focus to the previous search match.
|
|
||||||
# - SearchConfirm
|
|
||||||
# - SearchCancel
|
|
||||||
# - SearchClear
|
|
||||||
# Reset the search regex.
|
|
||||||
# - SearchDeleteWord
|
|
||||||
# Delete the last word in the search regex.
|
|
||||||
# - SearchHistoryPrevious
|
|
||||||
# Go to the previous regex in the search history.
|
|
||||||
# - SearchHistoryNext
|
|
||||||
# Go to the next regex in the search history.
|
|
||||||
#
|
|
||||||
# - macOS exclusive actions:
|
|
||||||
# - ToggleSimpleFullscreen
|
|
||||||
# Enter fullscreen without occupying another space.
|
|
||||||
#
|
|
||||||
# - Linux/BSD exclusive actions:
|
|
||||||
#
|
|
||||||
# - CopySelection
|
|
||||||
# Copy from the selection buffer.
|
|
||||||
# - PasteSelection
|
|
||||||
# Paste from the selection buffer.
|
|
||||||
#
|
|
||||||
# - `command`: Fork and execute a specified command plus arguments
|
|
||||||
#
|
|
||||||
# The `command` field must be a map containing a `program` string and an
|
|
||||||
# `args` array of command line parameter strings. For example:
|
|
||||||
# `{ program: "alacritty", args: ["-e", "vttest"] }`
|
|
||||||
#
|
|
||||||
# And optionally:
|
|
||||||
#
|
|
||||||
# - `mods`: Key modifiers to filter binding actions
|
|
||||||
#
|
|
||||||
# - Command
|
|
||||||
# - Control
|
|
||||||
# - Option
|
|
||||||
# - Super
|
|
||||||
# - Shift
|
|
||||||
# - Alt
|
|
||||||
#
|
|
||||||
# Multiple `mods` can be combined using `|` like this:
|
|
||||||
# `mods: Control|Shift`.
|
|
||||||
# Whitespace and capitalization are relevant and must match the example.
|
|
||||||
#
|
|
||||||
# - `mode`: Indicate a binding for only specific terminal reported modes
|
|
||||||
#
|
|
||||||
# This is mainly used to send applications the correct escape sequences
|
|
||||||
# when in different modes.
|
|
||||||
#
|
|
||||||
# - AppCursor
|
|
||||||
# - AppKeypad
|
|
||||||
# - Search
|
|
||||||
# - Alt
|
|
||||||
# - Vi
|
|
||||||
#
|
|
||||||
# A `~` operator can be used before a mode to apply the binding whenever
|
|
||||||
# the mode is *not* active, e.g. `~Alt`.
|
|
||||||
#
|
|
||||||
# Bindings are always filled by default, but will be replaced when a new
|
|
||||||
# binding with the same triggers is defined. To unset a default binding, it can
|
|
||||||
# be mapped to the `ReceiveChar` action. Alternatively, you can use `None` for
|
|
||||||
# a no-op if you do not wish to receive input characters for that binding.
|
|
||||||
#
|
|
||||||
# If the same trigger is assigned to multiple actions, all of them are executed
|
|
||||||
# in the order they were defined in.
|
|
||||||
#key_bindings:
|
|
||||||
#- { key: Paste, action: Paste }
|
|
||||||
#- { key: Copy, action: Copy }
|
|
||||||
#- { key: L, mods: Control, action: ClearLogNotice }
|
|
||||||
#- { key: L, mods: Control, mode: ~Vi|~Search, chars: "\x0c" }
|
|
||||||
#- { key: PageUp, mods: Shift, mode: ~Alt, action: ScrollPageUp }
|
|
||||||
#- { key: PageDown, mods: Shift, mode: ~Alt, action: ScrollPageDown }
|
|
||||||
#- { key: Home, mods: Shift, mode: ~Alt, action: ScrollToTop }
|
|
||||||
#- { key: End, mods: Shift, mode: ~Alt, action: ScrollToBottom }
|
|
||||||
|
|
||||||
# Vi Mode
|
|
||||||
#- { key: Space, mods: Shift|Control, mode: ~Search, action: ToggleViMode }
|
|
||||||
#- { key: Space, mods: Shift|Control, mode: Vi|~Search, action: ScrollToBottom }
|
|
||||||
#- { key: Escape, mode: Vi|~Search, action: ClearSelection }
|
|
||||||
#- { key: I, mode: Vi|~Search, action: ToggleViMode }
|
|
||||||
#- { key: I, mode: Vi|~Search, action: ScrollToBottom }
|
|
||||||
#- { key: C, mods: Control, mode: Vi|~Search, action: ToggleViMode }
|
|
||||||
#- { key: Y, mods: Control, mode: Vi|~Search, action: ScrollLineUp }
|
|
||||||
#- { key: E, mods: Control, mode: Vi|~Search, action: ScrollLineDown }
|
|
||||||
#- { key: G, mode: Vi|~Search, action: ScrollToTop }
|
|
||||||
#- { key: G, mods: Shift, mode: Vi|~Search, action: ScrollToBottom }
|
|
||||||
#- { key: B, mods: Control, mode: Vi|~Search, action: ScrollPageUp }
|
|
||||||
#- { key: F, mods: Control, mode: Vi|~Search, action: ScrollPageDown }
|
|
||||||
#- { key: U, mods: Control, mode: Vi|~Search, action: ScrollHalfPageUp }
|
|
||||||
#- { key: D, mods: Control, mode: Vi|~Search, action: ScrollHalfPageDown }
|
|
||||||
#- { key: Y, mode: Vi|~Search, action: Copy }
|
|
||||||
#- { key: Y, mode: Vi|~Search, action: ClearSelection }
|
|
||||||
#- { key: Copy, mode: Vi|~Search, action: ClearSelection }
|
|
||||||
#- { key: V, mode: Vi|~Search, action: ToggleNormalSelection }
|
|
||||||
#- { key: V, mods: Shift, mode: Vi|~Search, action: ToggleLineSelection }
|
|
||||||
#- { key: V, mods: Control, mode: Vi|~Search, action: ToggleBlockSelection }
|
|
||||||
#- { key: V, mods: Alt, mode: Vi|~Search, action: ToggleSemanticSelection }
|
|
||||||
#- { key: Return, mode: Vi|~Search, action: Open }
|
|
||||||
#- { key: Z, mode: Vi|~Search, action: CenterAroundViCursor }
|
|
||||||
#- { key: K, mode: Vi|~Search, action: Up }
|
|
||||||
#- { key: J, mode: Vi|~Search, action: Down }
|
|
||||||
#- { key: H, mode: Vi|~Search, action: Left }
|
|
||||||
#- { key: L, mode: Vi|~Search, action: Right }
|
|
||||||
#- { key: Up, mode: Vi|~Search, action: Up }
|
|
||||||
#- { key: Down, mode: Vi|~Search, action: Down }
|
|
||||||
#- { key: Left, mode: Vi|~Search, action: Left }
|
|
||||||
#- { key: Right, mode: Vi|~Search, action: Right }
|
|
||||||
#- { key: Key0, mode: Vi|~Search, action: First }
|
|
||||||
#- { key: Key4, mods: Shift, mode: Vi|~Search, action: Last }
|
|
||||||
#- { key: Key6, mods: Shift, mode: Vi|~Search, action: FirstOccupied }
|
|
||||||
#- { key: H, mods: Shift, mode: Vi|~Search, action: High }
|
|
||||||
#- { key: M, mods: Shift, mode: Vi|~Search, action: Middle }
|
|
||||||
#- { key: L, mods: Shift, mode: Vi|~Search, action: Low }
|
|
||||||
#- { key: B, mode: Vi|~Search, action: SemanticLeft }
|
|
||||||
#- { key: W, mode: Vi|~Search, action: SemanticRight }
|
|
||||||
#- { key: E, mode: Vi|~Search, action: SemanticRightEnd }
|
|
||||||
#- { key: B, mods: Shift, mode: Vi|~Search, action: WordLeft }
|
|
||||||
#- { key: W, mods: Shift, mode: Vi|~Search, action: WordRight }
|
|
||||||
#- { key: E, mods: Shift, mode: Vi|~Search, action: WordRightEnd }
|
|
||||||
#- { key: Key5, mods: Shift, mode: Vi|~Search, action: Bracket }
|
|
||||||
#- { key: Slash, mode: Vi|~Search, action: SearchForward }
|
|
||||||
#- { key: Slash, mods: Shift, mode: Vi|~Search, action: SearchBackward }
|
|
||||||
#- { key: N, mode: Vi|~Search, action: SearchNext }
|
|
||||||
#- { key: N, mods: Shift, mode: Vi|~Search, action: SearchPrevious }
|
|
||||||
|
|
||||||
# Search Mode
|
|
||||||
#- { key: Return, mode: Search|Vi, action: SearchConfirm }
|
|
||||||
#- { key: Escape, mode: Search, action: SearchCancel }
|
|
||||||
#- { key: C, mods: Control, mode: Search, action: SearchCancel }
|
|
||||||
#- { key: U, mods: Control, mode: Search, action: SearchClear }
|
|
||||||
#- { key: W, mods: Control, mode: Search, action: SearchDeleteWord }
|
|
||||||
#- { key: P, mods: Control, mode: Search, action: SearchHistoryPrevious }
|
|
||||||
#- { key: N, mods: Control, mode: Search, action: SearchHistoryNext }
|
|
||||||
#- { key: Up, mode: Search, action: SearchHistoryPrevious }
|
|
||||||
#- { key: Down, mode: Search, action: SearchHistoryNext }
|
|
||||||
#- { key: Return, mode: Search|~Vi, action: SearchFocusNext }
|
|
||||||
#- { key: Return, mods: Shift, mode: Search|~Vi, action: SearchFocusPrevious }
|
|
||||||
|
|
||||||
# (Windows, Linux, and BSD only)
|
|
||||||
#- { key: V, mods: Control|Shift, mode: ~Vi, action: Paste }
|
|
||||||
#- { key: C, mods: Control|Shift, action: Copy }
|
|
||||||
#- { key: F, mods: Control|Shift, mode: ~Search, action: SearchForward }
|
|
||||||
#- { key: B, mods: Control|Shift, mode: ~Search, action: SearchBackward }
|
|
||||||
#- { key: C, mods: Control|Shift, mode: Vi|~Search, action: ClearSelection }
|
|
||||||
#- { key: Insert, mods: Shift, action: PasteSelection }
|
|
||||||
#- { key: Key0, mods: Control, action: ResetFontSize }
|
|
||||||
#- { key: Equals, mods: Control, action: IncreaseFontSize }
|
|
||||||
#- { key: Plus, mods: Control, action: IncreaseFontSize }
|
|
||||||
#- { key: NumpadAdd, mods: Control, action: IncreaseFontSize }
|
|
||||||
#- { key: Minus, mods: Control, action: DecreaseFontSize }
|
|
||||||
#- { key: NumpadSubtract, mods: Control, action: DecreaseFontSize }
|
|
||||||
|
|
||||||
# (Windows only)
|
|
||||||
#- { key: Return, mods: Alt, action: ToggleFullscreen }
|
|
||||||
|
|
||||||
# (macOS only)
|
|
||||||
#- { key: K, mods: Command, mode: ~Vi|~Search, chars: "\x0c" }
|
|
||||||
#- { key: K, mods: Command, mode: ~Vi|~Search, action: ClearHistory }
|
|
||||||
#- { key: Key0, mods: Command, action: ResetFontSize }
|
|
||||||
#- { key: Equals, mods: Command, action: IncreaseFontSize }
|
|
||||||
#- { key: Plus, mods: Command, action: IncreaseFontSize }
|
|
||||||
#- { key: NumpadAdd, mods: Command, action: IncreaseFontSize }
|
|
||||||
#- { key: Minus, mods: Command, action: DecreaseFontSize }
|
|
||||||
#- { key: NumpadSubtract, mods: Command, action: DecreaseFontSize }
|
|
||||||
#- { key: V, mods: Command, action: Paste }
|
|
||||||
#- { key: C, mods: Command, action: Copy }
|
|
||||||
#- { key: C, mods: Command, mode: Vi|~Search, action: ClearSelection }
|
|
||||||
#- { key: H, mods: Command, action: Hide }
|
|
||||||
#- { key: H, mods: Command|Alt, action: HideOtherApplications }
|
|
||||||
#- { key: M, mods: Command, action: Minimize }
|
|
||||||
#- { key: Q, mods: Command, action: Quit }
|
|
||||||
#- { key: W, mods: Command, action: Quit }
|
|
||||||
#- { key: N, mods: Command, action: CreateNewWindow }
|
|
||||||
#- { key: F, mods: Command|Control, action: ToggleFullscreen }
|
|
||||||
#- { key: F, mods: Command, mode: ~Search, action: SearchForward }
|
|
||||||
#- { key: B, mods: Command, mode: ~Search, action: SearchBackward }
|
|
||||||
|
|
||||||
#debug:
|
|
||||||
# Display the time it takes to redraw each frame.
|
|
||||||
#render_timer: false
|
|
||||||
|
|
||||||
# Keep the log file after quitting Alacritty.
|
|
||||||
#persistent_logging: false
|
|
||||||
|
|
||||||
# Log level
|
|
||||||
#
|
|
||||||
# Values for `log_level`:
|
|
||||||
# - Off
|
|
||||||
# - Error
|
|
||||||
# - Warn
|
|
||||||
# - Info
|
|
||||||
# - Debug
|
|
||||||
# - Trace
|
|
||||||
#log_level: Warn
|
|
||||||
|
|
||||||
# Renderer override.
|
|
||||||
# - glsl3
|
|
||||||
# - gles2
|
|
||||||
# - gles2_pure
|
|
||||||
#renderer: None
|
|
||||||
|
|
||||||
# Print all received window events.
|
|
||||||
#print_events: false
|
|
||||||
|
|
||||||
# Highlight window damage information.
|
|
||||||
#highlight_damage: false
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.alacritty = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.configFile."alacritty/alacritty.yml".source = ./alacritty.yml;
|
|
||||||
xdg.configFile."alacritty/theme_github_dark.yml".source = ./theme_github_dark.yml;
|
|
||||||
}
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
# github Alacritty Colors
|
|
||||||
colors:
|
|
||||||
# Default colors
|
|
||||||
primary:
|
|
||||||
background: '0x24292e'
|
|
||||||
foreground: '0xd1d5da'
|
|
||||||
|
|
||||||
# Normal colors
|
|
||||||
normal:
|
|
||||||
black: '0x586069'
|
|
||||||
red: '0xea4a5a'
|
|
||||||
green: '0x34d058'
|
|
||||||
yellow: '0xffea7f'
|
|
||||||
blue: '0x2188ff'
|
|
||||||
magenta: '0xb392f0'
|
|
||||||
cyan: '0x39c5cf'
|
|
||||||
white: '0xd1d5da'
|
|
||||||
|
|
||||||
# Bright colors
|
|
||||||
bright:
|
|
||||||
black: '0x959da5'
|
|
||||||
red: '0xf97583'
|
|
||||||
green: '0x85e89d'
|
|
||||||
yellow: '0xffea7f'
|
|
||||||
blue: '0x79b8ff'
|
|
||||||
magenta: '0xb392f0'
|
|
||||||
cyan: '0x56d4dd'
|
|
||||||
white: '0xfafbfc'
|
|
||||||
|
|
||||||
indexed_colors:
|
|
||||||
- { index: 16, color: '0xd18616' }
|
|
||||||
- { index: 17, color: '0xf97583' }
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
{config, pkgs, nil, ...}:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
nil.packages."${pkgs.system}".default # nix language server
|
|
||||||
|
|
||||||
# GUI IDE
|
|
||||||
insomnia # REST client
|
|
||||||
|
|
||||||
# need to run `conda-install` before using it
|
|
||||||
# need to run `conda-shell` before using command `conda`
|
|
||||||
# conda is not available for MacOS
|
|
||||||
conda
|
|
||||||
];
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
# modern vim
|
|
||||||
neovim = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = ''
|
|
||||||
set number relativenumber
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
direnv = {
|
|
||||||
enable = true;
|
|
||||||
nix-direnv.enable = true;
|
|
||||||
enableZshIntegration = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# GitHub CLI tool
|
|
||||||
programs.gh = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
{pkgs, config, ...}:
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
# Linux Only Packages, not available on Darwin
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
btop # replacement of htop/nmon
|
|
||||||
htop
|
|
||||||
iotop
|
|
||||||
nmon
|
|
||||||
|
|
||||||
## networking tools
|
|
||||||
wireguard-tools # manage wireguard vpn manually, via wg-quick
|
|
||||||
iftop
|
|
||||||
|
|
||||||
# misc
|
|
||||||
libnotify
|
|
||||||
|
|
||||||
# system call monitoring
|
|
||||||
strace
|
|
||||||
ltrace # library call monitoring
|
|
||||||
lsof
|
|
||||||
|
|
||||||
# system tools
|
|
||||||
ethtool
|
|
||||||
sysstat
|
|
||||||
lm_sensors # for `sensors` command
|
|
||||||
cifs-utils # for mounting windows shares
|
|
||||||
];
|
|
||||||
|
|
||||||
# auto mount usb drives
|
|
||||||
services = {
|
|
||||||
udiskie.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
# syncthing.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
# XDG stands for "Cross-Desktop Group", with X used to mean "cross".
|
|
||||||
# It's a bunch of specifications from freedesktop.org intended to standardize desktops and
|
|
||||||
# other GUI applications on various systems (primarily Unix-like) to be interoperable:
|
|
||||||
# https://www.freedesktop.org/wiki/Specifications/
|
|
||||||
{config, pkgs, ...}:
|
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
|
|
||||||
xdg-user-dirs
|
|
||||||
];
|
|
||||||
|
|
||||||
xdg = {
|
|
||||||
enable = true;
|
|
||||||
cacheHome = config.home.homeDirectory + "/.local/cache";
|
|
||||||
|
|
||||||
# manage $XDG_CONFIG_HOME/mimeapps.list
|
|
||||||
# xdg search all desktop entries from $XDG_DATA_DIRS, check it by command:
|
|
||||||
# echo $XDG_DATA_DIRS
|
|
||||||
# the system-level desktop entries can be list by command:
|
|
||||||
# ls -l /run/current-system/sw/share/applications/
|
|
||||||
# the user-level desktop entries can be list by command(user ryan):
|
|
||||||
# ls /etc/profiles/per-user/ryan/share/applications/
|
|
||||||
mimeApps = {
|
|
||||||
enable = true;
|
|
||||||
defaultApplications =
|
|
||||||
let
|
|
||||||
browser = ["firefox.desktop"];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
"application/json" = browser;
|
|
||||||
"application/pdf" = browser; # TODO: pdf viewer
|
|
||||||
|
|
||||||
"text/html" = browser;
|
|
||||||
"text/xml" = browser;
|
|
||||||
"application/xml" = browser;
|
|
||||||
"application/xhtml+xml" = browser;
|
|
||||||
"application/xhtml_xml" = browser;
|
|
||||||
"application/rdf+xml" = browser;
|
|
||||||
"application/rss+xml" = browser;
|
|
||||||
"application/x-extension-htm" = browser;
|
|
||||||
"application/x-extension-html" = browser;
|
|
||||||
"application/x-extension-shtml" = browser;
|
|
||||||
"application/x-extension-xht" = browser;
|
|
||||||
"application/x-extension-xhtml" = browser;
|
|
||||||
|
|
||||||
"x-scheme-handler/about" = browser;
|
|
||||||
"x-scheme-handler/ftp" = browser;
|
|
||||||
"x-scheme-handler/http" = browser;
|
|
||||||
"x-scheme-handler/https" = browser;
|
|
||||||
"x-scheme-handler/unknown" = browser;
|
|
||||||
|
|
||||||
"x-scheme-handler/discord" = ["discord.desktop"];
|
|
||||||
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
|
|
||||||
|
|
||||||
"audio/*" = ["mpv.desktop"];
|
|
||||||
"video/*" = ["mpv.dekstop"];
|
|
||||||
"image/*" = ["imv.desktop"];
|
|
||||||
};
|
|
||||||
|
|
||||||
associations.removed =
|
|
||||||
let
|
|
||||||
browser = ["google-chrome.desktop"];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
"text/html" = browser;
|
|
||||||
"text/xml" = browser;
|
|
||||||
"application/xml" = browser;
|
|
||||||
"application/xhtml+xml" = browser;
|
|
||||||
"application/xhtml_xml" = browser;
|
|
||||||
"application/rdf+xml" = browser;
|
|
||||||
"application/rss+xml" = browser;
|
|
||||||
"image/gif" = browser;
|
|
||||||
"image/jpeg" = browser;
|
|
||||||
"image/png" = browser;
|
|
||||||
"image/webp" = browser;
|
|
||||||
"x-scheme-handler/http" = browser;
|
|
||||||
"x-scheme-handler/https" = browser;
|
|
||||||
"application/pdf" = browser;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
userDirs = {
|
|
||||||
enable = true;
|
|
||||||
createDirectories = true;
|
|
||||||
extraConfig = {
|
|
||||||
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,27 +1,19 @@
|
|||||||
{ config, pkgs, ... }:
|
{ username, ... }: {
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
../common
|
../base/desktop
|
||||||
|
|
||||||
./hyprland
|
|
||||||
|
|
||||||
|
./base
|
||||||
./fcitx5
|
./fcitx5
|
||||||
./desktop
|
./desktop
|
||||||
|
|
||||||
./common/alacritty
|
./hyprland
|
||||||
./common/development.nix
|
|
||||||
./common/shell.nix
|
|
||||||
./common/ssh.nix
|
|
||||||
./common/system-tools.nix
|
|
||||||
./common/xdg.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Home Manager needs a bit of information about you and the
|
# Home Manager needs a bit of information about you and the
|
||||||
# paths it should manage.
|
# paths it should manage.
|
||||||
home = {
|
home = {
|
||||||
username = "ryan";
|
username = username;
|
||||||
homeDirectory = "/home/ryan";
|
homeDirectory = "/home/${username}";
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
@@ -1,27 +1,19 @@
|
|||||||
{ config, pkgs, ... }:
|
{ username, ... }: {
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
../common
|
../base/desktop
|
||||||
|
|
||||||
./i3
|
|
||||||
|
|
||||||
|
./base
|
||||||
./fcitx5
|
./fcitx5
|
||||||
./desktop
|
./desktop
|
||||||
|
|
||||||
./common/alacritty
|
./i3
|
||||||
./common/development.nix
|
|
||||||
./common/shell.nix
|
|
||||||
./common/ssh.nix
|
|
||||||
./common/system-tools.nix
|
|
||||||
./common/xdg.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Home Manager needs a bit of information about you and the
|
# Home Manager needs a bit of information about you and the
|
||||||
# paths it should manage.
|
# paths it should manage.
|
||||||
home = {
|
home = {
|
||||||
username = "ryan";
|
username = username;
|
||||||
homeDirectory = "/home/ryan";
|
homeDirectory = "/home/${username}";
|
||||||
|
|
||||||
# This value determines the Home Manager release that your
|
# This value determines the Home Manager release that your
|
||||||
# configuration is compatible with. This helps avoid breakage
|
# configuration is compatible with. This helps avoid breakage
|
||||||
@@ -1,20 +1,28 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
pkgs-unstable,
|
||||||
|
nur-ryan4yin,
|
||||||
...
|
...
|
||||||
}:
|
}: {
|
||||||
{
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# creative
|
# creative
|
||||||
# blender # 3d modeling
|
blender # 3d modeling
|
||||||
# gimp # image editing, I prefer using figma in browser instead of this one
|
# gimp # image editing, I prefer using figma in browser instead of this one
|
||||||
inkscape # vector graphics
|
inkscape # vector graphics
|
||||||
krita # digital painting
|
krita # digital painting
|
||||||
musescore # music notation
|
musescore # music notation
|
||||||
reaper # audio production
|
# reaper # audio production
|
||||||
|
pkgs-unstable.sonic-pi # music programming
|
||||||
|
|
||||||
# this app consumes a lot of storage, so do not install it currently
|
# this app consumes a lot of storage, so do not install it currently
|
||||||
# kicad # 3d printing, eletrical engineering
|
# kicad # 3d printing, eletrical engineering
|
||||||
|
|
||||||
|
# fpga
|
||||||
|
pkgs-unstable.python311Packages.apycula # gowin fpga
|
||||||
|
pkgs-unstable.yosys # fpga synthesis
|
||||||
|
pkgs-unstable.nextpnr # fpga place and route
|
||||||
|
pkgs-unstable.openfpgaloader # fpga programming
|
||||||
|
nur-ryan4yin.packages.${pkgs.system}.gowin-eda-edu-ide # app: `gowin-env` => `gw_ide` / `gw_pack` / ...
|
||||||
];
|
];
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
|
|||||||
@@ -1,14 +1,16 @@
|
|||||||
{ pkgs, ... }:
|
{pkgs, ...}: {
|
||||||
{
|
|
||||||
imports = [
|
imports = [
|
||||||
./creative.nix
|
./creative.nix
|
||||||
|
./gtk.nix
|
||||||
|
./immutable-file.nix
|
||||||
./media.nix
|
./media.nix
|
||||||
|
./ssh.nix
|
||||||
|
./wallpaper.nix
|
||||||
|
./xdg.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# networking
|
# GUI apps
|
||||||
wireshark
|
|
||||||
|
|
||||||
# e-book viewer(.epub/.mobi/...)
|
# e-book viewer(.epub/.mobi/...)
|
||||||
# do not support .pdf
|
# do not support .pdf
|
||||||
foliate
|
foliate
|
||||||
@@ -16,13 +18,19 @@
|
|||||||
# instant messaging
|
# instant messaging
|
||||||
telegram-desktop
|
telegram-desktop
|
||||||
discord
|
discord
|
||||||
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
|
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
|
||||||
|
|
||||||
# remote desktop(rdp connect)
|
# remote desktop(rdp connect)
|
||||||
remmina
|
remmina
|
||||||
freerdp # required by remmina
|
freerdp # required by remmina
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
flameshot
|
flameshot
|
||||||
|
ventoy # multi-boot usb creator
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# GitHub CLI tool
|
||||||
|
programs.gh = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.pointerCursor = {
|
||||||
|
package = pkgs.bibata-cursors;
|
||||||
|
name = "Bibata-Modern-Classic";
|
||||||
|
size = 24;
|
||||||
|
gtk.enable = true;
|
||||||
|
x11.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# set dpi for 4k monitor
|
||||||
|
xresources.properties = {
|
||||||
|
# dpi for Xorg's font
|
||||||
|
"Xft.dpi" = 150;
|
||||||
|
# or set a generic dpi
|
||||||
|
"*.dpi" = 150;
|
||||||
|
};
|
||||||
|
|
||||||
|
# gtk's theme settings, generate files:
|
||||||
|
# 1. ~/.gtkrc-2.0
|
||||||
|
# 2. ~/.config/gtk-3.0/settings.ini
|
||||||
|
# 3. ~/.config/gtk-4.0/settings.ini
|
||||||
|
gtk = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
font = {
|
||||||
|
name = "Roboto";
|
||||||
|
package = pkgs.roboto;
|
||||||
|
};
|
||||||
|
|
||||||
|
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||||
|
|
||||||
|
iconTheme = {
|
||||||
|
name = "Papirus-Dark";
|
||||||
|
package = pkgs.papirus-icon-theme;
|
||||||
|
};
|
||||||
|
|
||||||
|
theme = {
|
||||||
|
# https://github.com/catppuccin/gtk
|
||||||
|
name = "Catppuccin-Macchiato-Compact-Pink-dark";
|
||||||
|
package = pkgs.catppuccin-gtk.override {
|
||||||
|
# https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/data/themes/catppuccin-gtk/default.nix
|
||||||
|
accents = [ "pink" ];
|
||||||
|
size = "compact";
|
||||||
|
variant = "mocha";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
##############################################################################################
|
||||||
|
#
|
||||||
|
# Provide a option `home.immutable-file`, it works like `home.file` but make the generated file immutable.
|
||||||
|
#
|
||||||
|
# Copy from https://github.com/iosmanthus/nixos-config/blob/349917b/modules/immutable-file.nix
|
||||||
|
#
|
||||||
|
# this module use the `chattr +i` to make the file immutable, `i` indicates `immutable`,
|
||||||
|
# it's a i-node flags only works on Linux.
|
||||||
|
#
|
||||||
|
# TODO not used yet, need to test it.
|
||||||
|
#
|
||||||
|
##############################################################################################
|
||||||
|
with lib; let
|
||||||
|
cfg = config.home.immutable-file;
|
||||||
|
immutableFileOpts = {...}: {
|
||||||
|
options = {
|
||||||
|
src = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
};
|
||||||
|
dst = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
mkImmutableFile = pkgs.writeScript "make_immutable_file" ''
|
||||||
|
# $1: dst
|
||||||
|
# $2: src
|
||||||
|
if [ ! -d "$(dirname $1)" ]; then
|
||||||
|
mkdir -p $1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -f $1 ]; then
|
||||||
|
sudo chattr -i $1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sudo cp $2 $1
|
||||||
|
sudo chattr +i $1
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
options.home.immutable-file = mkOption {
|
||||||
|
type = with types; attrsOf (submodule immutableFileOpts);
|
||||||
|
default = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf (cfg != {}) {
|
||||||
|
home.activation =
|
||||||
|
mapAttrs'
|
||||||
|
(name: {
|
||||||
|
src,
|
||||||
|
dst,
|
||||||
|
}:
|
||||||
|
nameValuePair
|
||||||
|
"make-immutable-${name}"
|
||||||
|
(lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||||
|
${mkImmutableFile} ${dst} ${src}
|
||||||
|
''))
|
||||||
|
cfg;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
catppuccin-cava,
|
||||||
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
# media - control and enjoy audio/video
|
# media - control and enjoy audio/video
|
||||||
@@ -10,23 +11,38 @@
|
|||||||
pavucontrol
|
pavucontrol
|
||||||
playerctl
|
playerctl
|
||||||
pulsemixer
|
pulsemixer
|
||||||
imv # simple image viewer
|
imv # simple image viewer
|
||||||
|
|
||||||
nvtop
|
nvtop
|
||||||
|
|
||||||
# video/audio tools
|
# video/audio tools
|
||||||
|
cava # for visualizing audio
|
||||||
libva-utils
|
libva-utils
|
||||||
vdpauinfo
|
vdpauinfo
|
||||||
vulkan-tools
|
vulkan-tools
|
||||||
glxinfo
|
glxinfo
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# https://github.com/catppuccin/cava
|
||||||
|
home.file.".config/cava/config".text = ''
|
||||||
|
# custom cava config
|
||||||
|
'' + builtins.readFile "${catppuccin-cava}/mocha.cava";
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
mpv = {
|
mpv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultProfiles = ["gpu-hq"];
|
defaultProfiles = ["gpu-hq"];
|
||||||
scripts = [pkgs.mpvScripts.mpris];
|
scripts = [pkgs.mpvScripts.mpris];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# terminal file manager
|
||||||
|
yazi = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs-unstable.yazi;
|
||||||
|
enableBashIntegration = true;
|
||||||
|
# TODO: nushellIntegration is broken on release-23.11, wait for master's fix to be released
|
||||||
|
enableNushellIntegration = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
{
|
{pkgs, ...}: {
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
@@ -13,6 +10,9 @@
|
|||||||
# format in details:
|
# format in details:
|
||||||
# https://www.ssh.com/academy/ssh/config
|
# https://www.ssh.com/academy/ssh/config
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
# a private key that is used during authentication will be added to ssh-agent if it is running
|
||||||
|
AddKeysToAgent yes
|
||||||
|
|
||||||
Host 192.168.*
|
Host 192.168.*
|
||||||
# allow to securely use local SSH agent to authenticate on the remote machine.
|
# allow to securely use local SSH agent to authenticate on the remote machine.
|
||||||
# It has the same effect as adding cli option `ssh -A user@host`
|
# It has the same effect as adding cli option `ssh -A user@host`
|
||||||
@@ -29,11 +29,36 @@
|
|||||||
# Specifies that ssh should only use the identity file explicitly configured above
|
# Specifies that ssh should only use the identity file explicitly configured above
|
||||||
# required to prevent sending default identity files first.
|
# required to prevent sending default identity files first.
|
||||||
IdentitiesOnly yes
|
IdentitiesOnly yes
|
||||||
'';
|
|
||||||
|
|
||||||
# use ssh-agent so we only need to input passphrase once
|
Host gtr5
|
||||||
# run `ssh-add /path/to/key` for every identity file
|
HostName 192.168.5.172
|
||||||
# check imported keys by `ssh-add -l`
|
Port 22
|
||||||
# TODO `ssh-add` can only add keys temporary, use gnome-keyring to unlock all keys after login.
|
|
||||||
|
Host um560
|
||||||
|
HostName 192.168.5.173
|
||||||
|
Port 22
|
||||||
|
|
||||||
|
Host s500plus
|
||||||
|
HostName 192.168.5.174
|
||||||
|
Port 22
|
||||||
|
|
||||||
|
Host k8s-main
|
||||||
|
HostName 192.168.5.181
|
||||||
|
ForwardAgent yes
|
||||||
|
IdentityFile ~/.ssh/romantic
|
||||||
|
IdentitiesOnly yes
|
||||||
|
|
||||||
|
Host k8s-data1
|
||||||
|
HostName 192.168.5.182
|
||||||
|
ForwardAgent yes
|
||||||
|
IdentityFile ~/.ssh/romantic
|
||||||
|
IdentitiesOnly yes
|
||||||
|
|
||||||
|
Host k8s-data2
|
||||||
|
HostName 192.168.5.183
|
||||||
|
ForwardAgent yes
|
||||||
|
IdentityFile ~/.ssh/romantic
|
||||||
|
IdentitiesOnly yes
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{ wallpapers, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# https://github.com/ryan4yin/wallpapers
|
||||||
|
home.file.".config/wallpapers".source = wallpapers;
|
||||||
|
home.file.".local/bin/wallpaper_random" = {
|
||||||
|
source = "${wallpapers}/wallpaper_random.py";
|
||||||
|
executable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
# XDG stands for "Cross-Desktop Group", with X used to mean "cross".
|
||||||
|
# It's a bunch of specifications from freedesktop.org intended to standardize desktops and
|
||||||
|
# other GUI applications on various systems (primarily Unix-like) to be interoperable:
|
||||||
|
# https://www.freedesktop.org/wiki/Specifications/
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
|
||||||
|
xdg-user-dirs
|
||||||
|
];
|
||||||
|
|
||||||
|
xdg = {
|
||||||
|
enable = true;
|
||||||
|
cacheHome = config.home.homeDirectory + "/.local/cache";
|
||||||
|
|
||||||
|
# manage $XDG_CONFIG_HOME/mimeapps.list
|
||||||
|
# xdg search all desktop entries from $XDG_DATA_DIRS, check it by command:
|
||||||
|
# echo $XDG_DATA_DIRS
|
||||||
|
# the system-level desktop entries can be list by command:
|
||||||
|
# ls -l /run/current-system/sw/share/applications/
|
||||||
|
# the user-level desktop entries can be list by command(user ryan):
|
||||||
|
# ls /etc/profiles/per-user/ryan/share/applications/
|
||||||
|
mimeApps = {
|
||||||
|
enable = true;
|
||||||
|
defaultApplications = let
|
||||||
|
browser = ["firefox.desktop"];
|
||||||
|
in {
|
||||||
|
"application/json" = browser;
|
||||||
|
"application/pdf" = browser; # TODO: pdf viewer
|
||||||
|
|
||||||
|
"text/html" = browser;
|
||||||
|
"text/xml" = browser;
|
||||||
|
"application/xml" = browser;
|
||||||
|
"application/xhtml+xml" = browser;
|
||||||
|
"application/xhtml_xml" = browser;
|
||||||
|
"application/rdf+xml" = browser;
|
||||||
|
"application/rss+xml" = browser;
|
||||||
|
"application/x-extension-htm" = browser;
|
||||||
|
"application/x-extension-html" = browser;
|
||||||
|
"application/x-extension-shtml" = browser;
|
||||||
|
"application/x-extension-xht" = browser;
|
||||||
|
"application/x-extension-xhtml" = browser;
|
||||||
|
|
||||||
|
"x-scheme-handler/about" = browser;
|
||||||
|
"x-scheme-handler/ftp" = browser;
|
||||||
|
"x-scheme-handler/http" = browser;
|
||||||
|
"x-scheme-handler/https" = browser;
|
||||||
|
"x-scheme-handler/unknown" = browser;
|
||||||
|
|
||||||
|
"x-scheme-handler/discord" = ["discord.desktop"];
|
||||||
|
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
|
||||||
|
|
||||||
|
"audio/*" = ["mpv.desktop"];
|
||||||
|
"video/*" = ["mpv.dekstop"];
|
||||||
|
"image/*" = ["imv.desktop"];
|
||||||
|
"image/gif" = ["imv.desktop"];
|
||||||
|
"image/jpeg" = ["imv.desktop"];
|
||||||
|
"image/png" = ["imv.desktop"];
|
||||||
|
"image/webp" = ["imv.desktop"];
|
||||||
|
};
|
||||||
|
|
||||||
|
associations.removed =
|
||||||
|
{
|
||||||
|
# ......
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
userDirs = {
|
||||||
|
enable = true;
|
||||||
|
createDirectories = true;
|
||||||
|
extraConfig = {
|
||||||
|
XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Vertical Candidate List
|
||||||
|
Vertical Candidate List=False
|
||||||
|
# Use Per Screen DPI
|
||||||
|
PerScreenDPI=True
|
||||||
|
# Use mouse wheel to go to prev or next page
|
||||||
|
WheelForPaging=True
|
||||||
|
# Font
|
||||||
|
Font="Sans 10"
|
||||||
|
# Menu Font
|
||||||
|
MenuFont="Sans 10"
|
||||||
|
# Tray Font
|
||||||
|
TrayFont="Sans Bold 10"
|
||||||
|
# Tray Label Outline Color
|
||||||
|
TrayOutlineColor=#000000
|
||||||
|
# Tray Label Text Color
|
||||||
|
TrayTextColor=#ffffff
|
||||||
|
# Prefer Text Icon
|
||||||
|
PreferTextIcon=False
|
||||||
|
# Show Layout Name In Icon
|
||||||
|
ShowLayoutNameInIcon=True
|
||||||
|
# Use input method language to display text
|
||||||
|
UseInputMethodLangaugeToDisplayText=True
|
||||||
|
# Theme macchiato, frappe, latte, mocha
|
||||||
|
Theme=catppuccin-mocha
|
||||||
|
# Force font DPI on Wayland
|
||||||
|
ForceWaylandDPI=0
|
||||||
@@ -1,9 +1,19 @@
|
|||||||
{pkgs, config, lib, ... }: {
|
{
|
||||||
|
pkgs,
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
catppuccin-fcitx5,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
home.file.".config/fcitx5/profile".source = ./profile;
|
home.file.".config/fcitx5/profile".source = ./profile;
|
||||||
home.file.".config/fcitx5/profile-bak".source = ./profile; # used for backup
|
|
||||||
# fcitx5 每次切换输入法,就会修改 ~/.config/fcitx5/profile 文件,导致我用 hm 管理的配置被覆盖
|
# color schema
|
||||||
# 解决方法是通过如下内置,每次 rebuild 前都先删除下 profile 文件
|
home.file.".local/share/fcitx5/themes".source = "${catppuccin-fcitx5}/src";
|
||||||
|
home.file.".config/fcitx5/conf/classicui.conf".source = ./classicui.conf;
|
||||||
|
|
||||||
|
# every time fcitx5 switch input method, it will modify ~/.config/fcitx5/profile file,
|
||||||
|
# which will override my config managed by home-manager
|
||||||
|
# so we need to remove it before everytime we rebuild the config
|
||||||
home.activation.removeExistingFcitx5Profile = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
home.activation.removeExistingFcitx5Profile = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
||||||
rm -f "${config.xdg.configHome}/fcitx5/profile"
|
rm -f "${config.xdg.configHome}/fcitx5/profile"
|
||||||
'';
|
'';
|
||||||
@@ -11,23 +21,13 @@
|
|||||||
i18n.inputMethod = {
|
i18n.inputMethod = {
|
||||||
enabled = "fcitx5";
|
enabled = "fcitx5";
|
||||||
fcitx5.addons = with pkgs; [
|
fcitx5.addons = with pkgs; [
|
||||||
# for flypy chinese input method
|
# for flypy chinese input method
|
||||||
fcitx5-rime
|
fcitx5-rime
|
||||||
# needed enable rime using configtool after installed
|
# needed enable rime using configtool after installed
|
||||||
fcitx5-configtool
|
fcitx5-configtool
|
||||||
fcitx5-chinese-addons
|
fcitx5-chinese-addons
|
||||||
# fcitx5-mozc # japanese input method
|
# fcitx5-mozc # japanese input method
|
||||||
fcitx5-gtk # gtk im module
|
fcitx5-gtk # gtk im module
|
||||||
];
|
];
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.sessionVariables = {
|
|
||||||
# copy from https://github.com/nix-community/home-manager/blob/master/modules/i18n/input-method/fcitx5.nix
|
|
||||||
GLFW_IM_MODULE = "fcitx";
|
|
||||||
GTK_IM_MODULE = "fcitx";
|
|
||||||
QT_IM_MODULE = "fcitx";
|
|
||||||
XMODIFIERS = "@im=fcitx";
|
|
||||||
INPUT_METHOD = "fcitx";
|
|
||||||
IMSETTINGS_MODULE = "fcitx";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
{ pkgs, anyrun, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
anyrun.homeManagerModules.default
|
||||||
|
];
|
||||||
|
|
||||||
|
programs.anyrun = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
plugins = with anyrun.packages.${pkgs.system}; [
|
||||||
|
applications
|
||||||
|
randr
|
||||||
|
rink
|
||||||
|
shell
|
||||||
|
symbols
|
||||||
|
translate
|
||||||
|
];
|
||||||
|
|
||||||
|
width.fraction = 0.3;
|
||||||
|
y.absolute = 15;
|
||||||
|
hidePluginInfo = true;
|
||||||
|
closeOnClick = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# custom css for anyrun, based on catppuccin-mocha
|
||||||
|
extraCss = ''
|
||||||
|
@define-color bg-col rgba(30, 30, 46, 0.7);
|
||||||
|
@define-color bg-col-light rgba(150, 220, 235, 0.7);
|
||||||
|
@define-color border-col rgba(30, 30, 46, 0.7);
|
||||||
|
@define-color selected-col rgba(150, 205, 251, 0.7);
|
||||||
|
@define-color fg-col #D9E0EE;
|
||||||
|
@define-color fg-col2 #F28FAD;
|
||||||
|
|
||||||
|
* {
|
||||||
|
transition: 200ms ease;
|
||||||
|
font-family: "JetBrainsMono Nerd Font";
|
||||||
|
font-size: 1.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#window {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#plugin,
|
||||||
|
#main {
|
||||||
|
border: 3px solid @border-col;
|
||||||
|
color: @fg-col;
|
||||||
|
background-color: @bg-col;
|
||||||
|
}
|
||||||
|
/* anyrun's input window - Text */
|
||||||
|
#entry {
|
||||||
|
color: @fg-col;
|
||||||
|
background-color: @bg-col;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* anyrun's ouput matches entries - Base */
|
||||||
|
#match {
|
||||||
|
color: @fg-col;
|
||||||
|
background: @bg-col;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* anyrun's selected entry - Red */
|
||||||
|
#match:selected {
|
||||||
|
color: @fg-col2;
|
||||||
|
background: @selected-col;
|
||||||
|
}
|
||||||
|
|
||||||
|
#match {
|
||||||
|
padding: 3px;
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#entry, #plugin:hover {
|
||||||
|
border-radius: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
box#main {
|
||||||
|
background: rgba(30, 30, 46, 0.7);
|
||||||
|
border: 1px solid @border-col;
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,32 +1,33 @@
|
|||||||
{
|
{pkgs, hyprland, catppuccin-hyprland, ...}: {
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
imports = [
|
||||||
|
# hyprland.homeManagerModules.default
|
||||||
|
|
||||||
|
./anyrun.nix
|
||||||
./wayland-apps.nix
|
./wayland-apps.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# wayland.windowManager.hyprland.enable = true;
|
||||||
|
|
||||||
# hyprland configs, based on https://github.com/notwidow/hyprland
|
# hyprland configs, based on https://github.com/notwidow/hyprland
|
||||||
home.file.".config/hypr" = {
|
home.file.".config/hypr" = {
|
||||||
source = ./hypr-conf;
|
source = ./hypr-conf;
|
||||||
# copy the scripts directory recursively
|
# copy the scripts directory recursively
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
home.file.".config/gtk-3.0" = {
|
home.file.".config/hypr/themes".source = "${catppuccin-hyprland}/themes";
|
||||||
source = ./gtk-3.0;
|
|
||||||
|
# music player - mpd
|
||||||
|
home.file.".config/mpd" = {
|
||||||
|
source = ./mpd;
|
||||||
recursive = true;
|
recursive = true;
|
||||||
};
|
};
|
||||||
home.file.".gtkrc-2.0".source = ./gtkrc-2.0;
|
|
||||||
home.file.".config/hypr/wallpapers/wallpaper.png".source = ../wallpapers/wallpaper.png;
|
|
||||||
|
|
||||||
# allow fontconfig to discover fonts and configurations installed through home.packages
|
# allow fontconfig to discover fonts and configurations installed through home.packages
|
||||||
fonts.fontconfig.enable = true;
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
systemd.user.sessionVariables = {
|
systemd.user.sessionVariables = {
|
||||||
"NIXOS_OZONE_WL" = "1"; # for any ozone-based browser & electron apps to run on wayland
|
"NIXOS_OZONE_WL" = "1"; # for any ozone-based browser & electron apps to run on wayland
|
||||||
"MOZ_ENABLE_WAYLAND" = "1"; # for firefox to run on wayland
|
"MOZ_ENABLE_WAYLAND" = "1"; # for firefox to run on wayland
|
||||||
"MOZ_WEBRENDER" = "1";
|
"MOZ_WEBRENDER" = "1";
|
||||||
|
|
||||||
# for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/
|
# for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/
|
||||||
@@ -38,18 +39,4 @@
|
|||||||
"WLR_EGL_NO_MODIFIRES" = "1";
|
"WLR_EGL_NO_MODIFIRES" = "1";
|
||||||
};
|
};
|
||||||
|
|
||||||
# this is for xwayland
|
|
||||||
# set dpi for 4k monitor
|
|
||||||
xresources.properties = {
|
|
||||||
"Xft.dpi" = 162;
|
|
||||||
};
|
|
||||||
|
|
||||||
# set Xcursor.theme & Xcursor.size in ~/.Xresources automatically
|
|
||||||
home.pointerCursor = {
|
|
||||||
name = "Qogir-dark";
|
|
||||||
package = pkgs.qogir-theme;
|
|
||||||
size = 64;
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
[Settings]
|
|
||||||
gtk-theme-name=Arc-Dark
|
|
||||||
gtk-icon-theme-name=Qogir-dark
|
|
||||||
gtk-font-name=Noto Sans 10
|
|
||||||
gtk-cursor-theme-name=Qogir-dark
|
|
||||||
gtk-cursor-theme-size=64
|
|
||||||
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
|
|
||||||
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
|
|
||||||
gtk-button-images=0
|
|
||||||
gtk-menu-images=0
|
|
||||||
gtk-enable-event-sounds=1
|
|
||||||
gtk-enable-input-feedback-sounds=1
|
|
||||||
gtk-xft-antialias=1
|
|
||||||
gtk-xft-hinting=1
|
|
||||||
gtk-xft-hintstyle=hintmedium
|
|
||||||
gtk-xft-rgba=rgb
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# DO NOT EDIT! This file will be overwritten by LXAppearance.
|
|
||||||
# Any customization should be done in ~/.gtkrc-2.0.mine instead.
|
|
||||||
|
|
||||||
include "~/.gtkrc-2.0.mine"
|
|
||||||
gtk-theme-name="Arc-Dark"
|
|
||||||
gtk-icon-theme-name="Qogir-dark"
|
|
||||||
gtk-font-name="Noto Sans 10"
|
|
||||||
gtk-cursor-theme-name="Qogir-dark"
|
|
||||||
gtk-cursor-theme-size=64
|
|
||||||
gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ
|
|
||||||
gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR
|
|
||||||
gtk-button-images=0
|
|
||||||
gtk-menu-images=0
|
|
||||||
gtk-enable-event-sounds=1
|
|
||||||
gtk-enable-input-feedback-sounds=1
|
|
||||||
gtk-xft-antialias=1
|
|
||||||
gtk-xft-hinting=1
|
|
||||||
gtk-xft-hintstyle="hintmedium"
|
|
||||||
gtk-xft-rgba="rgb"
|
|
||||||
@@ -1,4 +1,12 @@
|
|||||||
## Hyprland configuration file for Archcraft
|
## Hyprland configuration file
|
||||||
|
|
||||||
|
# color-scheme: cappuccin-mocha
|
||||||
|
source=~/.config/hypr/themes/mocha.conf
|
||||||
|
|
||||||
|
env = _JAVA_AWT_WM_NONREPARENTING,1
|
||||||
|
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
|
||||||
|
# fix https://github.com/hyprwm/Hyprland/issues/1520
|
||||||
|
env = WLR_NO_HARDWARE_CURSORS,1
|
||||||
|
|
||||||
#-- Output ----------------------------------------------------
|
#-- Output ----------------------------------------------------
|
||||||
# Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info.
|
# Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info.
|
||||||
@@ -42,16 +50,17 @@ general {
|
|||||||
# Decoration settings like Rounded Corners, Opacity, Blur, etc.
|
# Decoration settings like Rounded Corners, Opacity, Blur, etc.
|
||||||
decoration {
|
decoration {
|
||||||
rounding=8 # Original: rounding=-1
|
rounding=8 # Original: rounding=-1
|
||||||
multisample_edges=0
|
|
||||||
|
|
||||||
active_opacity=1.0
|
active_opacity=1.0
|
||||||
inactive_opacity=0.9
|
inactive_opacity=0.9
|
||||||
fullscreen_opacity=1.0
|
fullscreen_opacity=1.0
|
||||||
|
|
||||||
blur=0
|
blur {
|
||||||
blur_size=3 # minimum 1
|
enabled=true
|
||||||
blur_passes=1 # minimum 1, more passes = more resource intensive.
|
size=3 # minimum 1
|
||||||
blur_ignore_opacity=0
|
passes=1 # minimum 1, more passes = more resource intensive.
|
||||||
|
ignore_opacity=false
|
||||||
|
}
|
||||||
|
|
||||||
# Your blur "amount" is blur_size * blur_passes, but high blur_size (over around 5-ish) will produce artifacts.
|
# Your blur "amount" is blur_size * blur_passes, but high blur_size (over around 5-ish) will produce artifacts.
|
||||||
# if you want heavy blur, you need to up the blur_passes.
|
# if you want heavy blur, you need to up the blur_passes.
|
||||||
@@ -91,7 +100,7 @@ windowrule=size 100% 100%,wlogout
|
|||||||
windowrule=animation slide,wlogout
|
windowrule=animation slide,wlogout
|
||||||
|
|
||||||
#-- Keybindings ----------------------------------------------------
|
#-- Keybindings ----------------------------------------------------
|
||||||
$term = alacritty
|
$term = kitty
|
||||||
$app_launcher = ~/.config/hypr/scripts/menu
|
$app_launcher = ~/.config/hypr/scripts/menu
|
||||||
$volume = ~/.config/hypr/scripts/volume
|
$volume = ~/.config/hypr/scripts/volume
|
||||||
$backlight = ~/.config/hypr/scripts/brightness
|
$backlight = ~/.config/hypr/scripts/brightness
|
||||||
@@ -100,13 +109,12 @@ $lockscreen = ~/.config/hypr/scripts/lockscreen
|
|||||||
$wlogout = ~/.config/hypr/scripts/wlogout
|
$wlogout = ~/.config/hypr/scripts/wlogout
|
||||||
$colorpicker = ~/.config/hypr/scripts/colorpicker
|
$colorpicker = ~/.config/hypr/scripts/colorpicker
|
||||||
$files = thunar
|
$files = thunar
|
||||||
$editor = code # vscode
|
|
||||||
$browser = firefox
|
$browser = firefox
|
||||||
|
|
||||||
# -- Terminal --
|
# -- Terminal --
|
||||||
bind=SUPER,Return,exec,$term
|
bind=SUPER,Return,exec,$term
|
||||||
|
|
||||||
# -- Wofi --
|
# -- App Launcher --
|
||||||
bind=SUPER,D,exec,$app_launcher
|
bind=SUPER,D,exec,$app_launcher
|
||||||
|
|
||||||
# -- Hyprland --
|
# -- Hyprland --
|
||||||
@@ -198,6 +206,10 @@ exec-once=cp ~/.config/fcitx5/profile-bak ~/.config/fcitx5/profile # restore
|
|||||||
exec-once=fcitx5 -d --replace # start fcitx5 daemon
|
exec-once=fcitx5 -d --replace # start fcitx5 daemon
|
||||||
bind=ALT,E,exec,pkill fcitx5 -9;sleep 1;fcitx5 -d --replace; sleep 1;fcitx5-remote -r
|
bind=ALT,E,exec,pkill fcitx5 -9;sleep 1;fcitx5 -d --replace; sleep 1;fcitx5-remote -r
|
||||||
|
|
||||||
|
# fix xwayland apps
|
||||||
|
windowrulev2 = rounding 0, xwayland:1, floating:1
|
||||||
|
windowrulev2 = center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$
|
||||||
|
windowrulev2 = size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$
|
||||||
|
|
||||||
# -- Fix input method in vscode
|
# -- Fix input method in vscode
|
||||||
exec-once = hyprctl setcursor "Bibata-Modern-Ice" 24
|
exec-once = hyprctl setcursor "Bibata-Modern-Ice" 24
|
||||||
@@ -205,6 +217,7 @@ exec-once = hyprctl setcursor "Bibata-Modern-Ice" 24
|
|||||||
# xwayland 窗口先渲染到 200% 再降到 hyprland config 里 monitor 设置的值,看上去和原生没啥区别
|
# xwayland 窗口先渲染到 200% 再降到 hyprland config 里 monitor 设置的值,看上去和原生没啥区别
|
||||||
# 相比较一开始的方案输入法字体大小也正确了.唯一有点问题的可能是 xwayland 窗口下的鼠标指针大小不对
|
# 相比较一开始的方案输入法字体大小也正确了.唯一有点问题的可能是 xwayland 窗口下的鼠标指针大小不对
|
||||||
exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
|
exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
|
||||||
|
|
||||||
exec-once = xrdb -merge ~/.Xresources
|
exec-once = xrdb -merge ~/.Xresources
|
||||||
# env = GDK_SCALE,2
|
# env = GDK_SCALE,2
|
||||||
env = XCURSOR_SIZE,48
|
env = XCURSOR_SIZE,48
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
## Script To Manage Brightness For Archcraft (in Wayland).
|
## Script To Manage Brightness (in Wayland).
|
||||||
|
|
||||||
iDIR="$HOME/.config/hypr/mako/icons"
|
iDIR="$HOME/.config/hypr/mako/icons"
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
## launch wofi with alt config
|
if [[ ! $(pidof anyrun) ]]; then
|
||||||
|
anyrun
|
||||||
CONFIG="$HOME/.config/hypr/wofi/config"
|
|
||||||
STYLE="$HOME/.config/hypr/wofi/style.css"
|
|
||||||
COLORS="$HOME/.config/hypr/wofi/colors"
|
|
||||||
|
|
||||||
if [[ ! $(pidof wofi) ]]; then
|
|
||||||
wofi --show drun --prompt 'Search...' --conf ${CONFIG} --style ${STYLE} --color ${COLORS}
|
|
||||||
else
|
else
|
||||||
pkill wofi
|
pkill anyrun
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ for _prs in "${_ps[@]}"; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
# Set wallpaper
|
# Set wallpaper
|
||||||
swaybg --output '*' --mode fill --image ~/.config/hypr/wallpapers/wallpaper.png &
|
swaybg --output '*' --mode fill --image ~/.config/wallpapers/default_wallpaper &
|
||||||
|
|
||||||
# Lauch notification daemon (mako)
|
# Lauch notification daemon (mako)
|
||||||
~/.config/hypr/scripts/notifications &
|
~/.config/hypr/scripts/notifications &
|
||||||
|
|||||||