Compare commits

...

453 Commits

Author SHA1 Message Date
Ryan Yin 1d6ffd7785 Merge pull request #33 from ryan4yin/modular-home
feat: Modular home
2023-12-25 00:10:56 +08:00
Ryan Yin 647f56d213 chore: remove useless config in hyprland 2023-12-25 00:08:11 +08:00
Ryan Yin 210aa544fc fix: user environment variables do not take effects 2023-12-25 00:01:15 +08:00
Ryan Yin 5e83259bcb fix: enable nvidia on idol-ai 2023-12-24 23:32:08 +08:00
Ryan Yin 0a2aae246a fix: neovim fzf 2023-12-24 23:05:58 +08:00
Ryan Yin 30881f356a feat: modular i3's configurations 2023-12-24 22:51:32 +08:00
Ryan Yin 3aaaeb49ca feat: modular hyprland's configurations 2023-12-24 22:39:27 +08:00
Ryan Yin 55e12cddaf feat: modular ssh config 2023-12-24 21:43:14 +08:00
Ryan Yin ac4f625768 feat: modular home 2023-12-24 20:56:44 +08:00
Ryan Yin 2d44bc6006 Merge pull request #32 from ryan4yin/apple-t2
feat: new host - shoukei
2023-12-24 19:29:38 +08:00
Ryan Yin 03c1d14ed9 feat: new host - shoukei 2023-12-24 19:27:31 +08:00
Ryan Yin 73a746cebd fix: darwin 2023-12-24 01:00:56 +08:00
Ryan Yin 1e9dc4df4b feat: share openssh's authorizedKeys between darwin & NixOS 2023-12-23 22:00:40 +08:00
Ryan Yin 7dd55a5de9 chore: nix fmt 2023-12-23 21:39:51 +08:00
Ryan Yin e61116140d Merge pull request #31 from ryan4yin/modular
feat: refactoring configuration with `options` to make it more modular
2023-12-23 21:36:09 +08:00
Ryan Yin b75b79057b feat: refactoring configuration with options to make it more modular 2023-12-23 21:35:12 +08:00
Ryan Yin 1f08d10ac7 fix: man page show odd characters 2023-12-23 19:57:57 +08:00
Ryan Yin b2cf885637 fix: missing hyprland's packages 2023-12-23 19:31:37 +08:00
Ryan Yin 44eb487df9 refactor: home-manager 2023-12-23 17:43:57 +08:00
Ryan Yin 006bf56fd7 docs: why install i3/hyprland in home-manager instead of NixOS 2023-12-23 17:36:07 +08:00
Ryan Yin 73e3707570 refactor: start i3/hyprland in home-manager instead of NixOS 2023-12-23 17:23:25 +08:00
Ryan Yin 82cfa4c6f7 feat: my custom libAttrs 2023-12-23 11:06:50 +08:00
Ryan Yin 27dd5ebb13 docs: update README 2023-12-23 11:06:50 +08:00
Ryan Yin a589feee7b feat: homebrew - darwin 2023-12-22 21:23:23 +08:00
Ryan Yin a9459e7606 feat: darwin 2023-12-22 21:20:02 +08:00
Ryan Yin ad86ed60dc feat: update PATH 2023-12-22 21:03:25 +08:00
Ryan Yin 2a42da46ad fix: mitmproxy on macOS 2023-12-22 17:01:30 +08:00
Ryan Yin 1817f41423 feat: update for shells 2023-12-22 16:59:56 +08:00
Ryan Yin 217057612c feat: migrate yazi into base 2023-12-22 16:43:37 +08:00
Ryan Yin a1b5572eea refactor: via statix 2023-12-22 12:07:37 +08:00
Ryan Yin cddd8101c7 fix: darwin fern 2023-12-22 09:49:09 +08:00
Ryan Yin d6f6154a22 fix: suzu - orangepi5 2023-12-22 01:49:28 +08:00
Ryan Yin 8ac24e4f13 refactor: replace mapAttrs' with mapAttrs 2023-12-22 01:43:28 +08:00
Ryan Yin e4abf62ec3 refactor: replace listToAttrs with mapAttrs' to get a cleaner definition 2023-12-22 01:28:48 +08:00
Ryan Yin 05aa451895 refactor: systems 2023-12-22 01:18:25 +08:00
Ryan Yin c49a96ae29 docs: update docs for idols - ai 2023-12-22 00:18:04 +08:00
Ryan Yin ac3c05545f fix: typo 2023-12-22 00:15:30 +08:00
Ryan Yin b12af73ff6 fix: increase of tmpfs's size by mount a btrfs subvolume for it
feat: migrate nixos-installer from a separate branch into a folder
2023-12-22 00:13:21 +08:00
Ryan Yin 45b52845f7 feat: disable flake_check in ci 2023-12-21 17:48:18 +08:00
Ryan Yin 434b3bfe81 feat: enable zram 2023-12-21 17:10:11 +08:00
Ryan Yin 6c1cd365a0 feat: enable zram 2023-12-21 17:09:34 +08:00
Ryan Yin b1d9bbc26e feat: enable zram 2023-12-21 17:08:39 +08:00
Ryan Yin 76b0b1c68d fix: disable flake_check in ci temporarily 2023-12-21 15:37:28 +08:00
Ryan Yin 6dca4d1492 docs: README 2023-12-21 15:32:28 +08:00
Ryan Yin a237c108d1 fix: bash in mkShell 2023-12-21 14:46:20 +08:00
Ryan Yin 9832a955e4 feat: darwin - homebrew mirror, replace iglance with stats 2023-12-21 12:24:12 +08:00
Ryan Yin c90bb514d0 feat: new aarch64-darwin host - fern 2023-12-21 12:03:16 +08:00
Ryan Yin 932e1a236c Merge pull request #30 from ryan4yin/fern
feat: new aarch64-darwin host - fern
2023-12-20 23:02:46 +08:00
Ryan Yin e70f7269f4 feat: new aarch64-darwin host - fern 2023-12-20 21:43:16 +08:00
Ryan Yin a07dfbe36a feat: replace agenix with ragenix 2023-12-20 15:37:33 +08:00
Ryan Yin d57e3ff61b fix: fcitx5 theme 2023-12-20 13:29:25 +08:00
Ryan Yin 6f38faef79 fix: ci 2023-12-20 13:25:42 +08:00
Ryan Yin 50d9301e13 feat: migrate capptuccin themes into my nur-packages, add nix's access-tokens into secrets 2023-12-20 13:13:54 +08:00
Ryan Yin 58b02a6b16 feat: replace home.activation.xxx via home.file.<name>.force 2023-12-20 10:45:01 +08:00
Ryan Yin 29511fa574 feat: refactor flake.nix 2023-12-20 02:19:40 +08:00
Ryan Yin 809a68fa27 feat: add github workflow - flake_check 2023-12-19 21:03:59 +08:00
Ryan Yin 2ac43c8a33 feat: add github workflow - flake_check 2023-12-19 20:45:53 +08:00
Ryan Yin 802e9e6e39 feat: auto nix develop - direnv 2023-12-19 20:45:27 +08:00
Ryan Yin 625691084a fix: The following files have unrecognized content and would be overwritten: /etc/bashrc /etc/zshrc /etc/zshenv 2023-12-18 15:09:43 +08:00
Ryan Yin 38e7a45bb8 fix: agenix on nix-darwin 2023-12-18 14:42:03 +08:00
Ryan Yin dbe62811c7 fix: agenix on nix-darwin, update flake.nix 2023-12-18 14:05:45 +08:00
Ryan Yin 8d83ded0fb feat: update git pre-commit checks 2023-12-18 11:14:17 +08:00
Ryan Yin 74cec7dd8e feat: nix fmt 2023-12-18 01:06:28 +08:00
Ryan Yin b2f75a37dc feat: nix fmt 2023-12-18 00:36:59 +08:00
Ryan Yin a04a058077 feat: refactor, hyprland - greet with autologin 2023-12-18 00:32:41 +08:00
Ryan Yin 7d03e63bdd feat: upgrade system.stateVersion
feat: autologin - hyprland / i3
feat: 256color for console tty
2023-12-17 05:59:22 +08:00
Ryan Yin 1cf34add85 fix: fcitx - macOS 2023-12-17 00:09:13 +08:00
Ryan Yin 20b6aa07af feat: update flake.lock, add eye-protection.nix 2023-12-17 00:08:54 +08:00
Ryan Yin ab5a68ce9d feat: change linux kernel to xanmod 2023-12-16 21:44:05 +08:00
Ryan Yin da729c1ade feat: add aws ssm plugin 2023-12-13 18:10:05 +08:00
Ryan Yin f899d59da9 docs: impermanence - ai 2023-12-13 12:23:21 +08:00
Ryan Yin ca8f0dc166 feat: disable nix channel 2023-12-13 11:57:59 +08:00
Ryan Yin 393338a23d fix: disable docker storageDriver 2023-12-12 23:39:35 +08:00
Ryan Yin 5ca251646a feat: docker - pulling using containerd 2023-12-12 22:08:32 +08:00
Ryan Yin 75ef84913f fix: agenix failed to decrypt secrets when booting 2023-12-12 20:37:03 +08:00
Ryan Yin b92537e264 fix: nix-darwin 2023-12-12 11:28:24 +08:00
Ryan Yin e3a17925f2 fix: nix optimise storage 2023-12-09 16:37:54 +08:00
Ryan Yin c170e251ac fix: nixConfig.extra-sbustituers https://github.com/ryan4yin/nixos-and-flakes-book/discussions/62#discussioncomment-7805510 2023-12-09 14:18:19 +08:00
Ryan Yin ec1747707b fix: terminfo 2023-12-08 17:50:32 +08:00
Ryan Yin 56f2abc737 fix: terminfo error on macOS 2023-12-08 14:24:44 +08:00
Ryan Yin cb6f46aea8 fix: syntax error, optimise tmux 2023-12-07 22:38:04 +08:00
Ryan Yin dfab5ddacc fix: TERM and TERMINFO 2023-12-07 22:02:01 +08:00
Ryan Yin 0e2faec44f docs: wezterm crash with the latest hyprland 2023-12-07 21:12:17 +08:00
Ryan Yin 88671c40e7 Merge pull request #27 from ryan4yin/fix-nushell-neovim
fix: environment variables missed in nushell
2023-12-07 20:10:01 +08:00
Ryan Yin 9f59301a0e fix: environment variables missed in nushell
fix: https://github.com/ryan4yin/nix-config/issues/26
2023-12-07 13:10:15 +08:00
Ryan Yin d13a353921 revert: shell wrapper for neovim's terminal still useless on macOS 2023-12-07 10:47:08 +08:00
Ryan Yin 989989ecc6 docs: update comments 2023-12-07 10:39:03 +08:00
Ryan Yin 0a66a3b0a3 docs: comment for nvim-shell 2023-12-07 00:27:30 +08:00
Ryan Yin be036118ca feat: optimise autosave.nvim 2023-12-06 23:50:07 +08:00
Ryan Yin 601fcafd31 fix: autosave.nvim & yazi 2023-12-06 23:07:01 +08:00
Ryan Yin 087d38487c feat: access extraPackages in neovim's terminal - add a shell wrapper 2023-12-06 22:39:10 +08:00
Ryan Yin b0e481a1f1 fix: package collisions 2023-12-06 11:45:26 +08:00
Ryan Yin 1ca7607814 feat: update yazi, add tools for java development 2023-12-05 21:05:37 +08:00
Ryan Yin 59ea29a7ab feat: auto chmod agenix's secrets on darwin 2023-12-05 12:12:32 +08:00
Ryan Yin 486a3b343c feat: disable flatpak 2023-12-05 12:01:07 +08:00
Ryan Yin 3b7772712e docs: update README 2023-12-05 11:44:19 +08:00
Ryan Yin 37b34beca4 feat: enable waydroid & lxd 2023-12-05 11:18:15 +08:00
Ryan Yin ef60e7bf91 fix: warning for i3wm - xdg-portal 2023-12-03 01:10:36 +08:00
Ryan Yin 05bfd2df13 fix: persistent files 2023-12-03 00:40:13 +08:00
Ryan Yin 9d00eb39f9 fix: pipewire-pulse.service failed to start 2023-12-02 23:56:45 +08:00
Ryan Yin 30a9619f2c feat: add groups for udev rules 2023-12-02 23:50:56 +08:00
Ryan Yin da2ab6f86b fix: docker storage driver - btrfs 2023-12-02 22:57:35 +08:00
Ryan Yin 7c61a58808 feat: secureboot 2023-12-02 22:46:52 +08:00
ryan4yin 67c62534e8 feat: impermanence 2023-12-02 20:56:50 +08:00
Ryan Yin 26dc7bb149 fix: wezterm's chinese font on macOS 2023-12-01 16:42:21 +08:00
Ryan Yin a1120fd930 Merge pull request #22 from zhpjy/main
修正简体中文显示为异体(日文)字形问题
2023-12-01 16:41:14 +08:00
zhpjy 13c72a8256 修正简体中文显示为异体(日文)字形问题
参考:https://wiki.archlinuxcn.org/wiki/%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%E6%9C%AC%E5%9C%B0%E5%8C%96#%E4%B9%B1%E7%A0%81%E9%97%AE%E9%A2%98:~:text=%E5%AD%97%E4%BD%93%E8%B0%83%E6%A0%A1%E6%8C%87%E5%8D%97-,%E4%BF%AE%E6%AD%A3%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%E6%98%BE%E7%A4%BA%E4%B8%BA%E5%BC%82%E4%BD%93%EF%BC%88%E6%97%A5%E6%96%87%EF%BC%89%E5%AD%97%E5%BD%A2,-%5B%E7%BC%96%E8%BE%91%20%7C
2023-12-01 00:54:52 +08:00
Ryan Yin 0322de2622 feat: add istioctl 2023-11-30 17:39:35 +08:00
Ryan Yin d9be6f9213 fix: wezterm on darwin 2023-11-30 11:01:53 +08:00
Ryan Yin b977203d15 feat: mount swap subvolume in read-only mode 2023-11-28 22:10:39 +08:00
Ryan Yin db4e3b5fdd feat: enable btrfs's zstd compression 2023-11-28 00:26:40 +08:00
Ryan Yin a1f4764526 fix: nix-darwin with nixos-23.11 2023-11-27 16:16:24 +08:00
Ryan Yin 0996ec71e9 docs: update comments 2023-11-27 01:14:17 +08:00
ryan4yin 2e8d068070 feat: encrypted boot partition, fix nix.gc args 2023-11-27 00:38:13 +08:00
Ryan Yin ee606e5518 fix: replace gparted with parted 2023-11-26 22:54:01 +08:00
Ryan Yin 440eb287ed feat: add gparted & ventoy 2023-11-26 22:50:53 +08:00
Ryan Yin ee9828151c docs: README 2023-11-26 22:40:32 +08:00
Ryan Yin 0b6bafb39c feat: minor updates for neovim & bat 2023-11-26 19:52:07 +08:00
Ryan Yin df570294b4 Merge pull request #20 from ryan4yin/nixos-23.11
feat: upgrade nixpkgs to 23.11
2023-11-26 19:27:20 +08:00
Ryan Yin 5e0c7e90ff feat: encrypted root partition with btrfs(except /boot partition) 2023-11-26 19:17:09 +08:00
Ryan Yin ada780afc8 feat: upgrade nixpkgs to 23.11 2023-11-15 01:24:42 +08:00
Ryan Yin d624ab4323 feat: update flake.lock 2023-10-29 14:59:35 +08:00
Ryan Yin f2dfb10c1b fix: sync to gitee 2023-10-04 12:35:09 +08:00
Ryan Yin f10666ff7c feat: sync to gitee 2023-10-04 12:30:36 +08:00
Ryan Yin a378fa3d60 feat: rime-data - update user dict 2023-10-02 16:56:20 +08:00
Ryan Yin dfefa53e6b feat: terraformer 2023-09-26 12:21:59 +08:00
Ryan Yin 09a6af9d36 docs: secrets 2023-09-19 11:44:31 +08:00
Ryan Yin 1172968a93 feat: add guile 2023-09-15 17:05:51 +08:00
Ryan Yin 6d2ba3f0c1 fix: typo 2023-09-11 01:06:34 +08:00
Ryan Yin 262988949c feat: gowin eda - fpga 2023-09-08 22:27:03 +08:00
Ryan Yin f5a745f37e feat: aliyun-cli 2023-09-08 18:42:21 +08:00
Ryan Yin 02b6079198 feat: add btop for macOS, remove verible from macOS 2023-09-07 16:35:59 +08:00
Ryan Yin c645d31dd3 feat: neovim - support verilog / systemverilog 2023-09-06 22:23:57 +08:00
Ryan Yin 32a6789f44 feat: adjust font's dpi 2023-09-06 21:53:38 +08:00
Ryan Yin f173808e10 fix: sonic-pi 2023-08-28 20:38:23 +08:00
Ryan Yin 7ba80d4458 feat: add sonic-pi - music programming 2023-08-28 13:36:26 +08:00
Ryan Yin e63a1a92e8 Merge pull request #16 from DataEraserC/main-2
Remove extra curly brace
2023-08-21 21:38:09 +08:00
雑魚~雑魚~ 90cb0f987b Remove extra curly brace 2023-08-21 05:08:07 -06:00
Ryan Yin bfd05251f2 feat: bump flake.lock 2023-08-19 02:41:04 +08:00
Ryan Yin 13b70df944 feat: use wireless interface for nozomi & yukina 2023-08-19 02:40:48 +08:00
Ryan Yin a0c6965438 feat: add nur-ryan4yin, install yazi 2023-08-17 22:57:08 +08:00
Ryan Yin e36daaa48c fix: macOS - commands like are required by some tools 2023-08-17 14:44:26 +08:00
Ryan Yin ca239579d5 feat: add pictures for 12kingdoms 2023-08-17 02:22:25 +08:00
Ryan Yin d34d2adb42 feat: update Makefile for aarch SBCs 2023-08-17 02:17:03 +08:00
Ryan Yin cc80f0e885 docs: add comments 2023-08-17 02:15:12 +08:00
Ryan Yin 737603403a feat: aarch64 host - suzu 2023-08-17 02:14:00 +08:00
Ryan Yin 05a94aae60 chore: fcitx5 - remove useless config 2023-08-16 23:45:36 +08:00
Ryan Yin b02b7c0af8 feat: more ssh keys 2023-08-16 20:40:54 +08:00
Ryan Yin 24cd473387 feat: README for /lib 2023-08-16 18:38:44 +08:00
Ryan Yin f6630bc6e0 feat: README for /lib 2023-08-16 18:35:11 +08:00
Ryan Yin 417e6658dc Merge pull request #15 from DataEraserC/main-1
Fix typo
2023-08-16 18:27:08 +08:00
雑魚~雑魚~ f626371732 Fix typo 2023-08-16 04:25:29 -06:00
Ryan Yin d318e35a93 feat: README - add pictures 2023-08-16 03:28:58 +08:00
Ryan Yin 7ddac56e17 feat: README - add pictures 2023-08-16 03:28:44 +08:00
Ryan Yin b060b69114 feat: README - add pictures 2023-08-16 03:26:15 +08:00
Ryan Yin 12f3032d8d feat: deploy via colmena 2023-08-16 03:12:31 +08:00
Ryan Yin bbd300422b fix: licheepi4a - mount boot partition 2023-08-16 02:44:34 +08:00
Ryan Yin b2d19ee218 Merge pull request #14 from ryan4yin/riscv64
feat: add riscv64 cluster - rolling girls
2023-08-16 02:07:38 +08:00
Ryan Yin f5c1148c94 feat: add riscv64 cluster - rolling girls 2023-08-16 02:06:48 +08:00
Ryan Yin f682523804 feat: deploy remotely via colmena(instead of nixos-rebuild) 2023-08-16 00:14:13 +08:00
Ryan Yin b635efba09 feat: add color picker 2023-08-16 00:14:13 +08:00
Ryan Yin bd474f798e Merge pull request #13 from Balssh/main-1
Fix typo
2023-08-15 08:36:38 +08:00
George Bals 1575e50fea Fix typo
I love this repo, is very helpful in learning nixos
2023-08-15 00:02:01 +03:00
Ryan Yin ae851875a9 fix: wezterm - font 2023-08-14 14:43:09 +08:00
Ryan Yin 24630c5e5d feat: add docs for terminal 2023-08-14 13:37:56 +08:00
Ryan Yin ae35522d11 feat: kitty - toggle maximized 2023-08-14 13:29:50 +08:00
Ryan Yin 6634eb7cb0 feat: wezterm - toggle window size 2023-08-14 13:21:16 +08:00
Ryan Yin d0568b9f19 feat: wezterm - toggle opacity 2023-08-14 13:16:01 +08:00
Ryan Yin 803992635f feat: enable wezterm 2023-08-14 12:25:14 +08:00
Ryan Yin 9dbf2293ce fix: neovim & wezterm 2023-08-14 11:51:16 +08:00
Ryan Yin bc9b29f62b feat: neovim - using configs from astrocommunity 2023-08-14 02:20:16 +08:00
Ryan Yin 7347bcb842 feat: neovim - markdown-preview 2023-08-14 01:41:34 +08:00
Ryan Yin cc9dfa7940 Update FUNDING.yml 2023-08-13 17:34:37 +08:00
Ryan Yin 0db7703857 docs: neovim - flash.nvim 2023-08-13 00:47:20 +08:00
Ryan Yin c8e84fbc36 feat: neovim - add flash.nvim 2023-08-13 00:38:33 +08:00
Ryan Yin d3553ae104 feat: neovim - add flash.nvim 2023-08-13 00:26:06 +08:00
Ryan Yin 9c5a1b12ef feat: neovim - fix performance issue of telescope preview 2023-08-12 22:42:35 +08:00
Ryan Yin d282a3b0b6 feat: neovim - more plugins 2023-08-12 22:03:02 +08:00
Ryan Yin 62487cc5ca docs: neovim 2023-08-12 21:36:21 +08:00
Ryan Yin f81c62dc0a feat: neovim - noice.nvim 2023-08-12 21:30:20 +08:00
Ryan Yin f02f673012 feat: update flake inputs 2023-08-12 21:15:49 +08:00
Ryan Yin 0be942efe2 feat: neovim - more plugins 2023-08-12 21:00:48 +08:00
Ryan Yin 9f91849707 docs: neovim 2023-08-12 20:28:10 +08:00
Ryan Yin 1cdf80adff docs: neovim 2023-08-12 20:26:01 +08:00
Ryan Yin 8be00a52c8 docs: neovim 2023-08-12 20:22:22 +08:00
Ryan Yin eb5c35d670 docs: neovim 2023-08-12 20:21:11 +08:00
Ryan Yin d00d8cd43b docs: neovim 2023-08-12 20:17:33 +08:00
Ryan Yin b4ea5aa354 docs: neovim 2023-08-12 20:16:05 +08:00
Ryan Yin 8a9af081fc docs: neovim 2023-08-12 20:10:09 +08:00
Ryan Yin ef86bc96f6 docs: neovim 2023-08-12 20:09:17 +08:00
Ryan Yin 289888aa50 feat: neovim - more plugins 2023-08-12 18:43:27 +08:00
Ryan Yin 5b1b79a760 fix: hyprland - cursor disapper with Nvidia GPU 2023-08-12 15:02:05 +08:00
Ryan Yin c60388668c feat: remove vscode 2023-08-12 14:57:59 +08:00
Ryan Yin 9c3e4bea8d feat: neovim - find and search globally, refactoring 2023-08-12 14:52:48 +08:00
Ryan Yin 2f6d1aa482 feat: add comments 2023-08-12 14:09:50 +08:00
Ryan Yin c5267e7932 feat: add tools for CLI search and replace, with diff preview 2023-08-12 13:57:30 +08:00
Ryan Yin 08baea2e22 feat: disable remote building 2023-08-12 11:54:18 +08:00
Ryan Yin 356ed4bfdc feat: add git-trim 2023-08-09 14:35:17 +08:00
Ryan Yin 3799aa0c90 fix: git delmerged 2023-08-09 13:13:39 +08:00
Ryan Yin 28779f60ea feat: git config 2023-08-09 12:40:31 +08:00
Ryan Yin d0a9bdd002 feat: git config 2023-08-09 12:00:51 +08:00
Ryan Yin 0ee541c9e4 feat: git config 2023-08-09 12:00:32 +08:00
Ryan Yin e1baf45441 feat: proxychains's conf for macOS 2023-08-09 11:25:18 +08:00
Ryan Yin e6c1b945f3 feat: proxychains-ng on macOS 2023-08-09 11:17:59 +08:00
Ryan Yin 0efb7dfba1 Update FUNDING.yml 2023-08-09 00:19:29 +08:00
Ryan Yin 4760e508be Create FUNDING.yml 2023-08-09 00:18:48 +08:00
Ryan Yin 682346a66a feat: update flake.lock 2023-08-07 15:25:33 +08:00
Ryan Yin 0fac56f612 fix: typo(tab instead of space) 2023-08-07 15:19:31 +08:00
Ryan Yin 270d43251f feat: update packages to the latest version, disable wezterm 2023-08-07 15:05:04 +08:00
Ryan Yin c3cf8138f8 feat: rime-data - add chinese character - 矽 2023-08-07 15:04:22 +08:00
Ryan Yin 7ccccfc84c feat: remove duplicate configs 2023-08-07 01:16:11 +08:00
Ryan Yin e39b79c508 feat: use the same nixpkgs as much as possible - macOS 2023-08-04 22:40:15 +08:00
Ryan Yin 664506b6cb feat: use the same nixpkgs as much as possible 2023-08-04 22:37:18 +08:00
Ryan Yin a946ff7cce feat: disable neovim's experimental plugin - noice.nvim 2023-08-04 00:40:17 +08:00
Ryan Yin 99819c1df5 docs: minor updates 2023-08-04 00:32:40 +08:00
Ryan Yin c515ea9807 feat: start dockerd on boot 2023-08-03 23:53:04 +08:00
Ryan Yin 7ce3e9a391 feat: add tcpdump, update comments 2023-08-03 23:36:15 +08:00
Ryan Yin f61271a323 feat: comments 2023-08-03 23:22:20 +08:00
Ryan Yin 4a988dbce7 refactor: development environment 2023-08-03 23:16:12 +08:00
Ryan Yin 79a866a287 feat: bump astronvim's version to v3.34.5 2023-08-03 17:31:15 +08:00
Ryan Yin bd53ef65ec feat: add sshconfig for k8s masters 2023-08-03 01:10:26 +08:00
Ryan Yin 804bf99e74 fix: remote building - virtual machines 2023-08-03 00:02:37 +08:00
Ryan Yin 6e7fa3e223 docs: how to search in kitty/alacritty 2023-08-01 17:49:33 +08:00
Ryan Yin 508a45d801 feat: kitty - tab bar on top 2023-08-01 13:16:43 +08:00
Ryan Yin 7c9cb5156f feat: update macOS's system config 2023-08-01 13:16:43 +08:00
Ryan Yin 08d8c4cbc5 fix: firefox gets wrong timezone on NixOS 2023-07-31 21:24:25 +08:00
Ryan Yin 7dc0adee72 feat: add bpftrace 2023-07-31 14:44:28 +08:00
Ryan Yin d61b27bcb5 feat: add bfg-repo-cleaner 2023-07-31 10:56:12 +08:00
Ryan Yin 0030a41a8f feat: install jdk17(Adoptium prebuilt jdk on macOS) 2023-07-31 10:52:43 +08:00
Ryan Yin 66fa46afb6 feat: adjust alacritty & kitty for macOS 2023-07-31 10:33:56 +08:00
Ryan Yin 26da19ba38 fix: grim(wayland): Failed to create image. https://github.com/ryan4yin/nix-config/issues/11 2023-07-30 17:45:17 +08:00
Ryan Yin 81a4104973 docs: README 2023-07-30 17:08:44 +08:00
Ryan Yin 6b55dfca46 docs: README 2023-07-30 17:00:56 +08:00
Ryan Yin b3676ccbe6 fix: correct waybar's config format 2023-07-30 16:44:41 +08:00
Ryan Yin 71af10ff3b feat: update readme, adjust nix settings 2023-07-30 16:32:05 +08:00
Ryan Yin a99adf065d feat: update for hyprland(wayland)
refactor: core-desktop.nix & core-server.nix
2023-07-30 16:18:44 +08:00
Ryan Yin 2485f24fcc docs: remove useless comments 2023-07-30 15:23:33 +08:00
Ryan Yin 777d915cd2 fix: https://github.com/ryan4yin/nix-config/issues/10 2023-07-30 15:16:48 +08:00
Ryan Yin 5df740ca6e docs: README 2023-07-30 05:06:20 +08:00
Ryan Yin dd27f9eaeb fix: add psmisc(killall) 2023-07-30 05:04:52 +08:00
Ryan Yin d370d96f47 feat: update for gtk/x11/xwayland 2023-07-30 04:48:46 +08:00
Ryan Yin 1e98f591f5 feat: replace wofi by anyrun - wayland 2023-07-30 04:19:03 +08:00
Ryan Yin 5e2bec4ac5 docs: README - WARNGING 2023-07-30 01:52:14 +08:00
Ryan Yin 0c30883e22 docs: README - secrets 2023-07-30 01:45:49 +08:00
Ryan Yin c9a42f1a13 feat: update Makefile 2023-07-30 01:37:02 +08:00
Ryan Yin a9c123d9d4 feat: update specific input 2023-07-30 01:35:55 +08:00
Ryan Yin e4c9e863cf feat: update comments 2023-07-30 01:25:28 +08:00
Ryan Yin 2970073d5e feat: add README for lib 2023-07-30 01:20:47 +08:00
Ryan Yin 8bef422482 fix: README 2023-07-30 00:58:52 +08:00
Ryan Yin 6247cecf0b fix: README 2023-07-30 00:56:02 +08:00
Ryan Yin 721e74845a fix: typo 2023-07-30 00:51:30 +08:00
Ryan Yin 349ff8b5a1 feat: migrate wallpaper_random.py into another repo: ryan4yin/wallpapers 2023-07-30 00:43:27 +08:00
Ryan Yin 4cf9b16faf feat: replace nnn with ranger 2023-07-30 00:28:44 +08:00
Ryan Yin 8fc95549bf feat: replace nnn with ranger 2023-07-30 00:28:14 +08:00
Ryan Yin f2dbaba802 feat: replace nnn with ranger 2023-07-30 00:24:14 +08:00
Ryan Yin 538c81ca47 feat: comments for wallpaper_random.py 2023-07-30 00:06:06 +08:00
Ryan Yin 32161dd090 feat: comments for wallpaper_random.py 2023-07-30 00:04:39 +08:00
Ryan Yin a310ab4d4a feat: wallpaper_random 2023-07-30 00:00:38 +08:00
Ryan Yin bc290e371b feat: update README 2023-07-29 22:33:32 +08:00
Ryan Yin b407453836 feat: add README into subfolders 2023-07-29 22:15:01 +08:00
Ryan Yin 6ff9c397c8 feat: update README 2023-07-29 21:52:23 +08:00
Ryan Yin 033d50c738 fix: fcitx5's theme - catppuccin-mocha 2023-07-29 21:18:37 +08:00
Ryan Yin 7dc223a77e feat: update README 2023-07-29 20:49:51 +08:00
Ryan Yin c472654934 feat: add useful nushell scripts - auto-completion 2023-07-29 20:44:52 +08:00
Ryan Yin 189a3a4689 docs: add wallpapers link into README 2023-07-29 19:01:28 +08:00
Ryan Yin 1f0040a9dd feat: update flake.lock 2023-07-29 18:59:41 +08:00
Ryan Yin 5d8615cdb0 feat: update wallpapers
feat: update screenshots for hyprland
2023-07-29 18:53:59 +08:00
Ryan Yin 2f96ab5464 fix: nvidia with hyprland 2023-07-29 16:53:49 +08:00
Ryan Yin c8bd133e49 docs: update screenshots for i3 2023-07-29 16:34:27 +08:00
Ryan Yin 5778d72dd4 feat: catppuccin-mocha for cava 2023-07-29 16:09:58 +08:00
Ryan Yin 01285af535 docs: update README for catppuccin 2023-07-29 16:01:48 +08:00
Ryan Yin e1cd93d6d1 feat: customize all app's theme to catppuccin-mocha 2023-07-29 15:57:40 +08:00
Ryan Yin 714c45f5f9 feat: update README's NOTE 2023-07-29 12:37:50 +08:00
Ryan Yin 87df015862 feat: update README 2023-07-29 12:22:43 +08:00
Ryan Yin c09091fa25 feat: update README 2023-07-29 12:18:52 +08:00
Ryan Yin 8b4a0a7055 fix: typo 2023-07-28 14:33:58 +08:00
Ryan Yin 78319f4ef6 feat: add new editor - helix 2023-07-27 18:23:22 +08:00
Ryan Yin f66e73c5a6 docs: README - add starship 2023-07-27 13:08:28 +08:00
Ryan Yin cf9d5acd95 feat: add components into README 2023-07-27 13:04:20 +08:00
Ryan Yin 98fed47741 fix: minor changes in README 2023-07-27 12:01:49 +08:00
Ryan Yin ed57391eb0 feat: update mimeApps 2023-07-27 03:52:18 +08:00
Ryan Yin fc4a44c023 feat: hyprland - add screenshots 2023-07-27 03:45:04 +08:00
Ryan Yin c158f17c63 feat: switch wallpaper 2023-07-27 03:00:45 +08:00
Ryan Yin e61bd9ae14 feat: aqua/kana/ruby - switch to nixos-stable(23.05) 2023-07-27 02:56:58 +08:00
Ryan Yin 4f6b899643 docs: comments 2023-07-27 02:39:38 +08:00
Ryan Yin 5d2cf3e5dd refactor: flake.nix - adjust nixosConfigurations 2023-07-27 02:33:39 +08:00
Ryan Yin befddfe476 refactor: do not hardcode username/email in sub modules 2023-07-27 02:28:29 +08:00
Ryan Yin 204cb03922 feat: simplify flake.nix 2023-07-27 02:22:08 +08:00
Ryan Yin eebbb9f5e6 feat: update README 2023-07-26 01:59:38 +08:00
Ryan Yin ad76bb3451 feat: update wallpapers 2023-07-26 01:20:39 +08:00
Ryan Yin 0564357a9c feat: add wallpapers 2023-07-26 01:16:13 +08:00
Ryan Yin b44672d16c feat: add screenshot for hyprland 2023-07-26 00:54:44 +08:00
Ryan Yin 1164bebee4 feat: update README 2023-07-26 00:47:36 +08:00
Ryan Yin 29129215a5 fix: waybar, mpd 2023-07-26 00:29:39 +08:00
Ryan Yin bc08dc1949 feat: ai with both i3 & hyprland
replace archcraft's icon by snowflake(nixos)
feat: update waybar's settings
2023-07-25 23:36:25 +08:00
Ryan Yin 6e825eef7f feat: add private key to ssh-agent when using ssh 2023-07-25 13:09:50 +08:00
Ryan Yin 6ae4d4ba80 fix: platformio - failed to upload firmware 2023-07-24 23:32:56 +08:00
Ryan Yin c34911ba26 fix: skip load alias_for_work if it does not exist 2023-07-24 23:12:54 +08:00
Ryan Yin 82819ff091 feat: do not hide any files - neotree 2023-07-24 18:13:08 +08:00
Ryan Yin 12ef055135 feat: search and replace across multiple files in neovim 2023-07-24 00:35:19 +08:00
Ryan Yin 5beb15c165 feat: comments of astronvim 2023-07-24 00:17:01 +08:00
Ryan Yin cf6584ea71 feat: add devbox from nixpkgs-unstable 2023-07-21 12:15:46 +08:00
Ryan Yin 3bbe86cb55 feat: add LINCENSE - MIT 2023-07-20 20:07:08 +08:00
Ryan Yin 18c6e79d0c feat: update README 2023-07-20 20:00:12 +08:00
Ryan Yin 6fbefd0a67 feat: comments for darwin's secrets 2023-07-19 19:32:57 +08:00
Ryan Yin d502490bf6 fix: secrets 2023-07-19 19:31:57 +08:00
Ryan Yin 3f6b5b321a update flake.lock, add comments for tailscale on macOS 2023-07-18 19:43:45 +08:00
Ryan Yin 2d06846467 fix: comments for kitty 2023-07-18 14:37:35 +08:00
Ryan Yin baac168826 feat: comments for kitty/alacritty, bump astronvim to v3.33.3 2023-07-18 14:34:19 +08:00
Ryan Yin 78e5053ae5 fix: correct error info related to secrets 2023-07-18 00:17:24 +08:00
Ryan Yin 25ac706450 feat: bump AstroNvim to v3.33.2 2023-07-17 23:27:48 +08:00
Ryan Yin edff2bdc6c fix: DNS for WireGuard on macOS 2023-07-17 18:09:51 +08:00
Ryan Yin 337f67109e fix: DNS for WireGuard on macOS 2023-07-17 17:31:59 +08:00
Ryan Yin 450389400a feat: zsh on macOS 2023-07-17 17:02:45 +08:00
Ryan Yin f52d604d42 fix: disable neovim's smartidentent 2023-07-17 16:48:59 +08:00
Ryan Yin d12e3b979a fix: do not auto start tmux on boot 2023-07-17 16:24:06 +08:00
Ryan Yin 7b482f8cfa feat: macOS - adjust terminal's font size, starship for zsh, squirrel input method 2023-07-17 16:20:07 +08:00
Ryan Yin de1bc12b1b feat: flypy - add custom symbols Δ 2023-07-17 15:15:37 +08:00
Ryan Yin a6fb453c9e feat: input method for macOS - squirrel 2023-07-17 14:17:56 +08:00
Ryan Yin 32429619ab feat: rime-data for both linux & macOS 2023-07-17 13:25:17 +08:00
Ryan Yin cc6e5ea071 feat: start kitty as fullscreen on macOS 2023-07-17 11:38:38 +08:00
Ryan Yin ba29d32d80 fix: i3 - do not assign all kitty terminal to window 1 2023-07-17 11:32:42 +08:00
Ryan Yin 0f08976902 fix: macOS 2023-07-17 11:31:25 +08:00
Ryan Yin b3ac7784ca feat: enable copilot for markdown & yaml, try to fix nix comment identation 2023-07-16 19:37:18 +08:00
Ryan Yin b271e43df4 fix: kitty settings on linux 2023-07-16 17:03:18 +08:00
Ryan Yin 3dff682ceb fix: identation 2023-07-16 17:01:01 +08:00
Ryan Yin 8d05c3a204 feat: change default terminal from alacritty to kitty 2023-07-16 16:53:36 +08:00
Ryan Yin 887825d254 feat: use different font size on macOS 2023-07-16 16:48:48 +08:00
Ryan Yin 8061e07a00 feat: default to nushell - zellij 2023-07-16 16:46:45 +08:00
Ryan Yin fa1cf24af5 fix: typo 2023-07-16 16:45:31 +08:00
Ryan Yin 1ab318b6db fix: kitty + nushell on macOS 2023-07-16 16:35:33 +08:00
Ryan Yin 59493d03fa feat: exa -> ls 2023-07-16 16:13:47 +08:00
Ryan Yin c06504032c feat: bat with theme - catppuccino 2023-07-16 16:08:55 +08:00
Ryan Yin cf80c7549e refactor: alacritty's config 2023-07-16 15:59:11 +08:00
Ryan Yin e6b7e24a36 feat: add terminal - kitty 2023-07-16 15:31:26 +08:00
Ryan Yin 1b5a415d7a fix: missing base packages - linux 2023-07-16 00:38:11 +08:00
Ryan Yin 95d9cd0a27 fix: macOS 2023-07-15 19:49:39 +08:00
Ryan Yin cca05de49b feat: static hostname - macOS 2023-07-15 19:45:10 +08:00
Ryan Yin fa9f23751c docs: remap capslock key 2023-07-15 19:12:48 +08:00
Ryan Yin cf33721ec1 feat: refactor codes
feat: custom rime - disable full_shape punctuations
feat: remap capslock key
2023-07-15 19:10:04 +08:00
Ryan Yin 52c72bd45d fix: lock agenix's commit 2023-07-15 16:38:07 +08:00
Ryan Yin c6e736d64b feat: install some apps from apple store instead of homebrew
feat: replace username with ryan
fix: secrets
2023-07-15 16:33:22 +08:00
Ryan Yin c90d1c0208 fix: migrate secrets from /run/agenix(deleted after reboot) to /etc/agenix 2023-07-15 12:31:18 +08:00
Ryan Yin 5ed0ece058 fix: secrets for work 2023-07-14 23:12:47 +08:00
Ryan Yin 8684376b98 feat: astronvim - nushell hightlight(wip) 2023-07-14 19:04:31 +08:00
Ryan Yin 03cee6582f docs: secrets 2023-07-14 18:24:11 +08:00
Ryan Yin 86291af053 docs: secrets 2023-07-14 18:13:46 +08:00
Ryan Yin 54bb672d9e feat: harden my private secrets 2023-07-14 17:59:15 +08:00
Ryan Yin f34bf79884 docs: comments - astronvim 2023-07-14 16:14:20 +08:00
Ryan Yin db9ebd5ffd fix: comment - astronvim 2023-07-14 16:04:20 +08:00
Ryan Yin 64e384c18a docs: comment - astronvim 2023-07-14 15:59:22 +08:00
Ryan Yin 1e325739b1 docs: comment for raycast 2023-07-14 15:26:26 +08:00
Ryan Yin 2bf5d295d4 feat: add comment - astronvim on macOS 2023-07-14 15:21:25 +08:00
Ryan Yin 040d8a210c feat: customize keyrepeat & other preferences - macOS 2023-07-14 15:07:40 +08:00
Ryan Yin df63bce926 feat: set args about key repeat - macOS 2023-07-14 13:19:04 +08:00
Ryan Yin b5707d8457 feat: disabled guest login - macOS 2023-07-14 13:13:40 +08:00
Ryan Yin cd4ed3679c docs: comments 2023-07-14 12:56:38 +08:00
Ryan Yin 55b6aadf00 feat: remove visual-studio-code-insider, it's replaced by copilot-lua-cmp.nvim now 2023-07-14 12:52:43 +08:00
Ryan Yin 849ecfd6b7 fix: customize macOS, fix alacritty 2023-07-14 12:50:55 +08:00
Ryan Yin ca60e962f0 feat: alacritty 2023-07-14 10:03:28 +08:00
Ryan Yin 7bf52e7a75 fix: typo 2023-07-14 02:10:16 +08:00
Ryan Yin 872caa0407 feat: astronvim - comments 2023-07-14 02:08:47 +08:00
Ryan Yin 580a08841f feat: add zellij - a modern tmux 2023-07-14 01:58:43 +08:00
Ryan Yin ff6442e588 feat: astronvim - markdown preview - glow 2023-07-14 01:27:21 +08:00
Ryan Yin 271846703f fix: astronvim - formatting & diagnostic & code actions 2023-07-14 01:17:44 +08:00
Ryan Yin 298affd460 fix: astronvim - formatting 2023-07-14 00:15:59 +08:00
Ryan Yin d718c8084a fix: astronvim - lsp 2023-07-14 00:02:20 +08:00
Ryan Yin 39d35091d6 fix: astronvim - lsp 2023-07-13 23:36:22 +08:00
Ryan Yin cf9b184c9f fix: astronvim - install lsp via home-manager instead of mason.nvim 2023-07-13 23:28:32 +08:00
Ryan Yin 4abe5d7b8d feat: astronvim - autosave 2023-07-13 12:28:28 +08:00
Ryan Yin 54ebad9151 fix: astronvim - install lsp, fomatters and others via home-manager instead of mason.nvim 2023-07-13 12:28:23 +08:00
Ryan Yin 3234d0db2e feat: astronvim - update TODO 2023-07-13 11:18:47 +08:00
Ryan Yin c9b5a1d39b feat: update TODO 2023-07-13 01:59:04 +08:00
Ryan Yin fc8d43982b feat: add node2nix 2023-07-13 01:42:20 +08:00
Ryan Yin c4a47b9e53 feat: astronvim - Temporary solution 2023-07-13 01:23:37 +08:00
Ryan Yin 34182f3e45 feat: astronvim - add TODO 2023-07-13 01:05:33 +08:00
Ryan Yin 87de22fec4 fix: astronvim - missing markdown lsp 2023-07-13 00:51:11 +08:00
Ryan Yin 787010ac34 feat: update README 2023-07-13 00:47:01 +08:00
Ryan Yin 874a1ab939 fix: astronvim - fix copilot's completion by <tab>, add comments 2023-07-13 00:26:48 +08:00
Ryan Yin 95df12c59e fix: astronvim - dependencies for languages support 2023-07-12 23:12:59 +08:00
Ryan Yin 25c0938a64 feat: astronvim - languages 2023-07-12 13:24:33 +08:00
Ryan Yin 5731b52d3c feat: astronvim comments 2023-07-12 12:17:40 +08:00
Ryan Yin c7d88c1f57 fix: astronvim with noice.nvim 2023-07-12 12:12:47 +08:00
Ryan Yin 678016e391 feat: neovim - add noice.nvim - enhanced ui 2023-07-12 11:37:01 +08:00
Ryan Yin e14d6f8405 feat: migrate to astronvim 2023-07-12 11:10:59 +08:00
Ryan Yin 588cbabbc2 fix: neovim 2023-07-11 02:49:15 +08:00
Ryan Yin 7cc49c29f1 fix: neovim 2023-07-11 02:22:00 +08:00
Ryan Yin 21b3d4ad37 feat: neovim 2023-07-10 19:11:49 +08:00
Ryan Yin b6629a38a1 feat: remove alias for http_proxy & https_proxy 2023-07-10 00:24:43 +08:00
Ryan Yin a88afaaab3 feat: adjsut brightness(x11) 2023-07-09 22:09:27 +08:00
Ryan Yin 2acda6e977 feat: install ipython for root 2023-07-09 22:01:09 +08:00
Ryan Yin d1dd9bfdd6 fix: typo 2023-07-09 17:31:04 +08:00
Ryan Yin 027d819860 fix: typo 2023-07-09 17:30:37 +08:00
Ryan Yin 7e02cc8566 feat: update readme, comments & flake.lock 2023-07-09 17:26:33 +08:00
Ryan Yin bacc1bf9cd fix: nushell's PATH on darwin 2023-07-06 17:18:00 +08:00
Ryan Yin 6e7815ce22 fix: nushell's PATH on darwin 2023-07-06 17:13:17 +08:00
Ryan Yin 0193f84847 fix: nushell's PATH on darwin 2023-07-06 17:11:08 +08:00
Ryan Yin bb2c967981 feat: add darwin packages using homebrew 2023-07-06 16:45:59 +08:00
Ryan Yin 8d24a094bf chore: update README 2023-07-06 09:47:23 +08:00
Ryan Yin cb0dc30c7e feat: add tailscale for macOS 2023-07-05 18:40:59 +08:00
Ryan Yin 190d409992 feat: update for macOS 2023-07-05 18:35:05 +08:00
Ryan Yin acd7f8308c feat: add apps(using homebrew), update shells 2023-07-05 18:03:12 +08:00
Ryan Yin 4af3fa88dd feat: install apps using homebrew instead of nix 2023-07-05 16:38:04 +08:00
Ryan Yin e90d2eca1e chore: update flake.lock 2023-07-04 21:19:07 +08:00
Ryan Yin 462f671a76 feat: disable remote building for now 2023-07-02 21:17:38 +08:00
Ryan Yin 5d2371dda4 docs: add comment 2023-07-01 22:50:48 +08:00
Ryan Yin 379032a40b feat: enable libvirt(qemu/kvm), install qemu_full(qemu-system-riscv64/qemu-system-loongarch64/...) 2023-07-01 22:47:39 +08:00
Ryan Yin 65b5146dcb feat: enable libvirt(qemu/kvm), install qemu_full(qemu-system-riscv64/qemu-system-loongarch64/...) 2023-07-01 22:46:54 +08:00
Ryan Yin 4c53b59e89 feat: enable libvirt(qemu/kvm) for ai 2023-07-01 22:28:31 +08:00
Ryan Yin 9bd5cac675 feat: update flake.lock 2023-07-01 10:56:35 +08:00
Ryan Yin 2e65d0aa03 fix: install awscli2 instead of awscli 2023-06-30 14:52:36 +08:00
Ryan Yin afc74dcf68 feat: update README.md 2023-06-28 14:54:09 +08:00
Ryan Yin e7e3d0040a feat: update README 2023-06-25 12:52:37 +08:00
Ryan Yin 14c174890e docs: README 2023-06-23 02:32:44 +08:00
Ryan Yin dd472488b6 fix: fallback from unstable to stable caused NixOS failed to boot(precondition: the system image is created with unstable nixpkgs) 2023-06-21 01:09:46 +08:00
Ryan Yin ec4d00509e feat: update idols separately - update Makefile 2023-06-21 00:54:06 +08:00
Ryan Yin aa0c789b6e feat: replace sudo by '--use-remote-sudo', so we will change to sudo only when we need. 2023-06-21 00:49:57 +08:00
Ryan Yin 016115faa5 fix: problem in proxmox-hardware-configuration, update ruby & kana's publicKey 2023-06-21 00:37:09 +08:00
Ryan Yin f6ade7c612 fix: problem in proxmox-hardware-configuration 2023-06-21 00:30:58 +08:00
Ryan Yin 0bfd154437 docs: remove some TODOs 2023-06-18 22:13:23 +08:00
Ryan Yin 9a752121ba feat: adjust idols's max-jobs 2023-06-18 13:39:47 +08:00
Ryan Yin 3ea707245b feat: adjust remote builder's max-jobs 2023-06-18 03:07:07 +08:00
Ryan Yin e31ae3f553 feat: update i3 layout's readme & comments 2023-06-18 02:02:04 +08:00
Ryan Yin c38db38207 fix: remove useless i3block configs 2023-06-18 01:22:00 +08:00
Ryan Yin 6b364e19de fix: autostart in i3 2023-06-18 01:21:12 +08:00
Ryan Yin dae0504f5c feat: save i3 layout and auto load it 2023-06-18 01:09:52 +08:00
Ryan Yin d53ed4ef7e feat: add comments 2023-06-17 22:57:30 +08:00
Ryan Yin 530f8498a1 feat: add comments 2023-06-17 22:53:09 +08:00
Ryan Yin ef3c903582 feat: using nixos's stable branch by default, update Makefile 2023-06-17 22:45:51 +08:00
Ryan Yin 8314b91324 feat: using nixos's stable branch by default to stablize the system 2023-06-17 22:32:19 +08:00
Ryan Yin ccd4752d04 feat: add posters of [推しの子] 2023-06-17 22:10:53 +08:00
Ryan Yin 1bfeeacf2f feat: use 'chatter +i' to make a file immutable on linux 2023-06-17 22:00:32 +08:00
Ryan Yin bfac95b71e feat: idols & nix's distributed building 2023-06-17 12:55:53 +08:00
Ryan Yin b91508af5f feat: harmonica 2023-06-17 12:29:38 +08:00
Ryan Yin e51486a796 feat: yep, it's Oshi no Ko 2023-06-17 12:27:29 +08:00
Ryan Yin 897af2712f feat: dstributed builds 2023-06-17 10:46:05 +08:00
Ryan Yin ed5b4d121c fix: dstributed builds 2023-06-17 10:24:48 +08:00
Ryan Yin 45a7973553 feat: add distributed-builds & many hosts
feat: remove nur & devenv
feat: adjust the structure to make it suitable for servers
feat: add iso/proxmox generators and add docs about it
feat: update ryan's openssh keys & add hashedPassword
feat: add proxmox's nodes into ssh_config, with alias
2023-06-17 09:51:29 +08:00
Ryan Yin a5f0922ba7 feat: add support for riscv64-linux 2023-06-16 21:23:25 +08:00
Ryan Yin 792a7e7bfc feat: import all base configs in darwin
feat: change darwin's default shell to nushell
feat: update starship's config
2023-06-13 13:44:50 +08:00
Ryan Yin 8f512eb0bd feat: add some system tools - lspci/lsusb/hdparm/dmidecode/dig/nslookup 2023-06-13 03:03:47 +08:00
Ryan Yin 4936c0c46e feat: udpate README 2023-06-13 02:45:55 +08:00
Ryan Yin fe54e220e4 feat: update configs for tmux 2023-06-13 02:43:46 +08:00
Ryan Yin 0c5b01b5f0 feat: update git's config 2023-06-13 01:41:51 +08:00
Ryan Yin 0024dff048 fix: polish README 2023-06-13 01:11:01 +08:00
Ryan Yin 7c42d4d950 feat: update comments 2023-06-13 01:07:25 +08:00
Ryan Yin dc0fc97cb9 feat: add comments, format all nix files 2023-06-13 01:05:13 +08:00
Ryan Yin 86114a4db1 feat: polish, add comments 2023-06-13 00:56:40 +08:00
Ryan Yin 24ef3ed105 feat: rename 'common' to 'base' 2023-06-13 00:54:08 +08:00
Ryan Yin be437c3417 feat: change desktop's default shell to nushell 2023-06-13 00:54:08 +08:00
Ryan Yin e2e75407c9 feat: update README.md 2023-06-12 11:47:31 +08:00
Ryan Yin b99f77e0de feat: udpate README for command 'fhs' 2023-06-11 16:48:35 +08:00
Ryan Yin 909409ff29 feat: udpate README for command 'fhs' 2023-06-11 16:41:22 +08:00
298 changed files with 9900 additions and 5102 deletions
+1
View File
@@ -0,0 +1 @@
use flake
+2
View File
@@ -0,0 +1,2 @@
patreon: ryan4yin
custom: ['https://buymeacoffee.com/ryan4yin', 'https://afdian.net/a/ryan4yin']
+24
View File
@@ -0,0 +1,24 @@
name: Nix Flake Check
on: [push, pull_request, workflow_dispatch]
jobs:
checks:
name: Check expressions
runs-on: ubuntu-latest
steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Install nix
# uses: cachix/install-nix-action@v24
# with:
# install_url: https://nixos.org/nix/install
# extra_nix_config: |
# access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
# experimental-features = nix-command flakes
- name: Run Nix Flake Check
run: |
echo 'TODO: nix flake check'
# nix flake check
+29
View File
@@ -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/*"
+4 -1
View File
@@ -1,2 +1,5 @@
result result
result/ result/
.direnv/
.DS_Store
.pre-commit-config.yaml
+21
View File
@@ -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.
+143 -19
View File
@@ -1,37 +1,161 @@
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
s-i3:
nixos-rebuild switch --flake .#shoukei_i3 --use-remote-sudo
hypr:
nixos-rebuild switch --flake .#ai_hyprland --use-remote-sudo
s-hypr:
nixos-rebuild switch --flake .#shoukei_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
repl:
nix repl -f flake:nixpkgs
gc: 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 sudo python3 scripts/darwin_set_proxy.py
sleep 1
darwin: darwin-set-proxy darwin-rollback:
nix build .#darwinConfigurations.harmonica.system \ ./result/sw/bin/darwin-rebuild rollback
--extra-experimental-features 'nix-command flakes'
./result/sw/bin/darwin-rebuild switch --flake .
darwin-debug: darwin-set-proxy ha: darwin-set-proxy
nix build .#darwinConfigurations.harmonica.system \ nix build .#darwinConfigurations.harmonica.system
--show-trace --verbose \ ./result/sw/bin/darwin-rebuild switch --flake .#harmonica
--extra-experimental-features 'nix-command flakes'
./result/sw/bin/darwin-rebuild switch --flake . --show-trace --verbose ha-debug: darwin-set-proxy
nom build .#darwinConfigurations.harmonica.system --show-trace --verbose
./result/sw/bin/darwin-rebuild switch --flake .#harmonica --show-trace --verbose
fe: darwin-set-proxy
nix build .#darwinConfigurations.fern.system
./result/sw/bin/darwin-rebuild switch --flake .#fern
fe-debug: darwin-set-proxy
nom build .#darwinConfigurations.fern.system --show-trace --verbose
./result/sw/bin/darwin-rebuild switch --flake .#fern --show-trace --verbose
.PHONY: clean ############################################################################
clean: #
rm -rf result # 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
+176 -55
View File
@@ -1,90 +1,211 @@
# 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 ## Why NixOS & Flakes?
![](./_img/screenshot_2023-05-07-21-21.webp) Nix allows for easy-to-manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works (almost) forever. If someone else shares their configuration, anyone can make use of it(if you really understand what you're copying/refering now).
## TODO As for Flakes, refer to [Introduction to Flakes - NixOS & Nix Flakes Book](https://nixos-and-flakes.thiscute.world/nixos-with-flakes/introduction-to-flakes)
- enable disk encryption to enhance data security **Want to know NixOS & Flaks in detail? Looking for a beginner-friendly tutorial or best practices? You don't have to go through the pain I've experienced again! Check out my [NixOS & Nix Flakes Book - 🛠️ ❤️ An unofficial & opinionated :book: for beginners](https://github.com/ryan4yin/nixos-and-flakes-book)!**
- 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? > If you're using macOS, check out [ryan4yin/nix-darwin-kickstarter](https://github.com/ryan4yin/nix-darwin-kickstarter) for a quick start.
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. ## Components
**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/)!** | | 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
![](./_img/hyprland_2023-07-29_1.webp)
![](./_img/hyprland_2023-07-29_2.webp)
## I3 + AstroNvim
![](./_img/i3_2023-07-29_1.webp)
![](./_img/i3_2023-07-29_2.webp)
## 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 NixOS:
For NixOS, use the following commands: > To deploy this flake from NixOS's official ISO image(purest installation method), please refer to [./nixos-installer/](./nixos-installer/)
> Need to restart the machine when switching between `wayland` and `xorg`.
```bash ```bash
# deploy my test configuration # deploy one of the configuration based on the hostname
sudo nixos-rebuild switch --flake .#nixos-test sudo nixos-rebuild switch --flake .#ai_i3
# sudo nixos-rebuild switch --flake .#ai_hyprland
# we can also deploy using `make`, which is defined in Makefile
make i3 # deploy my pc with i3 window manager
# make hypr # deploy my pc with hyprland compositor
# deploy my PC's configuration # or we can deploy with details
sudo nixos-rebuild switch --flake .#msi-rtx4090 make i3-debug
# make hypr-debug
# 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: For macOS:
```bash ```bash
# deploy the darwin configuration(harmonicia) # deploy harmonicia's configuration(macOS Intel)
make darwin make ha
# deploy fern's configuration(Apple Silicon)
make fe
# deploy with details # deploy with details
make darwin-debug make ha-debug
# make fe
``` ```
## Install Apps from Flatpak > [What y'all will need when Nix drives you to drink.](https://www.youtube.com/watch?v=Eni9PPPPBpg) (copy from hlissner's dotfiles, it really matches my feelings when I first started using NixOS...)
We can install apps from flathub, which has a lot of apps that are not supported well in nixpkgs. ## How to create & managage VM from this flake?
```bash use `aquamarine` as an example, we can create a virtual machine with the following command:
# Add the Flathub repository
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
# install apps from flathub ```shell
flatpak install netease-cloud-music-gtk # 1. generate a proxmox vma image file
nom build .#aquamarine # `nom`(nix-output-monitor) can be replaced by the standard command `nix`
# install 3d printer slicer - cura # 2. upload the genereated image to proxmox server's backup directory `/var/lib/vz/dump`
flatpak install flathub com.ultimaker.cura # please replace the vma file name with the one you generated in step 1.
scp result/vzdump-qemu-aquamarine-nixos-23.11.20230603.dd49825.vma.zst root@192.168.5.174:/var/lib/vz/dump
# or you can search apps from flathub # 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.
flatpak search <keyword>
# search on website is also supported: https://flathub.org/
``` ```
## Other Interesting Dotfiles Once the virtual machine `aquamarine` is created, we can deploy updates to it with the following commands:
Other configurations that inspired me: ```shell
# 1. add the ssh key to ssh-agent
ssh-add ~/.ssh/ai-idols
- [notwidow/hyprland](https://github.com/notwidow/hyprland): hyprland configuration # 2. deploy the configuration to all the remote host with tag `@dist-build`
- [denisse-dev/dotfiles](https://github.com/denisse-dev/dotfiles) # using the ssh key we added in step 1
- [notusknot/dotfiles-nix](https://github.com/notusknot/dotfiles-nix) colmena apply --on '@dist-build' --show-trace
- [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) 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)
- [fufexan/dotfiles](https://github.com/fufexan/dotfiles)
- [davidtwco/veritas](https://github.com/davidtwco/veritas) ## References
- [NixOS-CN/NixOS-CN-telegram](https://github.com/NixOS-CN/NixOS-CN-telegram)
- [Tips&Tricks for NixOS Desktop](https://discourse.nixos.org/t/tips-tricks-for-nixos-desktop/28488/2) 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.
- Modularized NixOS Configuration
- [hlissner/dotfiles](https://github.com/hlissner/dotfiles)
- [viperML/dotfiles](https://github.com/viperML/dotfiles)
- 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
Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 450 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 841 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 350 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 336 KiB

+17
View File
@@ -0,0 +1,17 @@
rec {
# user information
username = "ryan";
userfullname = "Ryan Yin";
useremail = "xiaoyin_c@qq.com";
allSystemAttrs = {
# linux systems
x64_system = "x86_64-linux";
riscv64_system = "riscv64-linux";
aarch64_system = "aarch64-linux";
# darwin systems
x64_darwin = "x86_64-darwin";
aarch64_darwin = "aarch64-darwin";
};
allSystems = builtins.attrValues allSystemAttrs;
}
Generated
+548 -318
View File
File diff suppressed because it is too large Load Diff
+155 -169
View File
@@ -1,212 +1,198 @@
{ {
description = "NixOS configuration of Ryan Yin"; description = "NixOS & macOS configuration of Ryan Yin";
##################################################################################################################
#
# Want to know Nix in details? Looking for a beginner-friendly tutorial?
# Check out https://github.com/ryan4yin/nixos-and-flakes-book !
#
##################################################################################################################
# The `outputs` function will return all the build results of the flake.
# A flake can have many use cases and different types of outputs,
# parameters in `outputs` are defined in `inputs` and can be referenced by their names.
# However, `self` is an exception, this special parameter points to the `outputs` itself (self-reference)
# 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,
pre-commit-hooks,
...
}: let
constants = import ./constants.nix;
# `lib.genAttrs [ "foo" "bar" ] (name: "x_" + name)` => `{ foo = "x_foo"; bar = "x_bar"; }`
forEachSystem = func: (nixpkgs.lib.genAttrs constants.allSystems func);
allSystemConfigurations = import ./systems {inherit self inputs constants;};
in
allSystemConfigurations
// {
# format the nix code in this flake
# alejandra is a nix formatter with a beautiful output
formatter = forEachSystem (
system: nixpkgs.legacyPackages.${system}.alejandra
);
# pre-commit hooks for nix code
checks = forEachSystem (
system: {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
alejandra.enable = true; # formatter
# deadnix.enable = true; # detect unused variable bindings in `*.nix`
statix.enable = true; # lints and suggestions for Nix code(auto suggestions)
prettier = {
enable = true;
excludes = [".js" ".md" ".ts"];
};
};
};
}
);
devShells = forEachSystem (
system: {
default = nixpkgs.legacyPackages.${system}.mkShell {
packages = [
# fix https://discourse.nixos.org/t/non-interactive-bash-errors-from-flake-nix-mkshell/33310
nixpkgs.legacyPackages.${system}.bashInteractive
];
name = "dots";
shellHook = ''
${self.checks.${system}.pre-commit-check.shellHook}
'';
};
}
);
};
# the nixConfig here only affects the flake itself, not the system configuration! # the nixConfig here only affects the flake itself, not the system configuration!
# for more information, see:
# https://nixos-and-flakes.thiscute.world/nixos-with-flakes/add-custom-cache-servers
nixConfig = { nixConfig = {
experimental-features = [ "nix-command" "flakes" ]; # substituers will be appended to the default substituters when fetching packages
substituters = [
# replace official cache with a mirror located in China
"https://mirrors.bfsu.edu.cn/nix-channels/store"
"https://mirrors.ustc.edu.cn/nix-channels/store"
"https://cache.nixos.org"
];
# nix community's cache server
extra-substituters = [ extra-substituters = [
"https://nix-community.cachix.org" "https://anyrun.cachix.org"
"https://nixpkgs-wayland.cachix.org" "https://hyprland.cachix.org"
"https://xddxdd.cachix.org" # "https://nixpkgs-wayland.cachix.org"
]; ];
extra-trusted-public-keys = [ extra-trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" # "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
"xddxdd.cachix.org-1:ay1HJyNDYmlSwj5NXQG065C8LfoqqKaTNCyzeixGjf8="
]; ];
}; };
# 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";
}; };
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
# 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";
}; };
# modern window compositor lanzaboote = {
hyprland.url = "github:hyprwm/Hyprland/v0.25.0"; url = "github:nix-community/lanzaboote/v0.3.0";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence.url = "github:nix-community/impermanence";
hyprland = {
url = "github:hyprwm/Hyprland/v0.33.1";
inputs.nixpkgs.follows = "nixpkgs";
};
# 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 = {
url = "github:nix-community/nixos-generators"; url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# secrets management
# use devenv to manage my development environment agenix = {
devenv.url = "github:cachix/devenv/v0.6.2"; # lock with git commit at 0.14.0
url = "github:ryantm/agenix/54693c91d923fecb4cf04c4535e3d84f8dec7919";
# secrets management, lock with git commit at 2023/5/15 # replaced with a type-safe reimplementation to get a better error message and less bugs.
agenix.url = "github:ryantm/agenix/db5637d10f797bb251b94ef9040b237f4702cde3"; # url = "github:ryan4yin/ragenix";
inputs.nixpkgs.follows = "nixpkgs";
# nix language server, used by vscode & neovim
nil.url = "github:oxalica/nil/2023-05-09";
};
# `outputs` are all the build result of the flake.
# A flake can have many use cases and different types of outputs.
# parameters in `outputs` are defined in `inputs` and can be referenced by their names.
# However, `self` is an exception, This special parameter points to the `outputs` itself (self-reference)
# 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,
darwin,
home-manager,
...
}: {
nixosConfigurations = {
# By default, NixOS will try to refer the nixosConfiguration with its hostname.
# so the system named `msi-rtx4090` will use this configuration.
# However, the configuration name can also be specified using `sudo nixos-rebuild switch --flake /path/to/flakes/directory#<name>`.
# The `nixpkgs.lib.nixosSystem` function is used to build this configuration, the following attribute set is its parameter.
# 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 # add git hooks to format nix code before commit
darwinConfigurations."harmonica" = darwin.lib.darwinSystem { pre-commit-hooks = {
system = "x86_64-darwin"; url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
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 ######################## Some non-flake repositories #########################################
# 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 { # AstroNvim is an aesthetic and feature-rich neovim config.
# system = "x86_64-linux"; astronvim = {
# modules = [ url = "github:AstroNvim/AstroNvim/v3.40.3";
# # you can include your own nixos configuration here, i.e. flake = false;
# # ./configuration.nix };
# ];
# format = "iso"; # 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";
}; };
} }
-35
View File
@@ -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;
};
}
+6
View File
@@ -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.
+6
View File
@@ -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.
+4 -22
View File
@@ -1,27 +1,9 @@
{ config, pkgs, ... }: {username, ...}: {
{
imports = [
../common
./i3
./fcitx5
./desktop
./common/alacritty
./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"; inherit username;
homeDirectory = "/home/ryan";
# 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
@@ -31,7 +13,7 @@
# You can update Home Manager without changing this value. See # You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version # the Home Manager release notes for a list of state version
# changes in each release. # changes in each release.
stateVersion = "22.11"; stateVersion = "23.11";
}; };
# Let Home Manager install and manage itself. # Let Home Manager install and manage itself.
+28
View File
@@ -0,0 +1,28 @@
{pkgs, ...}: {
home.packages = with pkgs;
[
# general tools
pulumi
pulumictl
# istioctl
# aws
awscli2
ssm-session-manager-plugin # Amazon SSM Session Manager Plugin
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 []
);
}
+14
View File
@@ -0,0 +1,14 @@
{
pkgs,
pkgs-unstable,
...
}: {
home.packages = with pkgs; [
skopeo
docker-compose
dive # explore docker layers
];
programs = {
};
}
+3
View File
@@ -0,0 +1,3 @@
{mylib, ...}: {
imports = mylib.scanPaths ./.;
}
@@ -0,0 +1,30 @@
{
pkgs,
nur-ryan4yin,
...
}: {
home.packages = with pkgs; [
kubectl
kubernetes-helm
];
programs = {
k9s = {
enable = true;
skin = let
skin_file = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-k9s}/dist/mocha.yml"; # theme - catppuccin 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;
};
};
}
+3
View File
@@ -0,0 +1,3 @@
{mylib, ...}: {
imports = mylib.scanPaths ./.;
}
+87
View File
@@ -0,0 +1,87 @@
{
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
# ai related
python311Packages.huggingface-hub # huggingface-cli
# 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;
};
};
}
+36
View File
@@ -0,0 +1,36 @@
{
pkgs,
nur-ryan4yin,
...
}: {
# https://github.com/catppuccin/helix
xdg.configFile."helix/themes".source = "${nur-ryan4yin.packages.${pkgs.system}.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";
w = ":w";
q = ":q";
};
esc = ["collapse_selection" "keep_primary_selection"];
};
};
};
}
@@ -9,8 +9,8 @@
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
]; ];
} }
+228
View File
@@ -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
![](/_img/astronvim_2023-07-13_00-39.webp)
![](/_img/hyprland_2023-07-29_2.webp)
## 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 = "stdout" -- 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" },
},
}
+160
View File
@@ -0,0 +1,160 @@
{
pkgs,
astronvim,
...
}:
###############################################################################
#
# AstroNvim's configuration and all its dependencies(lsp, formatter, etc.)
#
#e#############################################################################
{
xdg.configFile = {
# astronvim's config
"nvim" = {
source = astronvim;
force = true;
};
# 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
telescope-fzf-native-nvim
];
# 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
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
gdb
]
);
};
};
}
+31
View File
@@ -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 *
'';
};
}
@@ -1,7 +1,4 @@
{ _: {
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`
@@ -23,17 +23,35 @@
# required to prevent sending default identity files first. # required to prevent sending default identity files first.
IdentitiesOnly yes IdentitiesOnly yes
Host github.com Host gtr5
# github is controlled by gluttony~ HostName 192.168.5.172
IdentityFile ~/.ssh/gluttony Port 22
# Specifies that ssh should only use the identity file explicitly configured above
# required to prevent sending default identity files first.
IdentitiesOnly yes
'';
# use ssh-agent so we only need to input passphrase once Host um560
# run `ssh-add /path/to/key` for every identity file HostName 192.168.5.173
# 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 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
'';
}; };
} }
+61
View File
@@ -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
```
+113
View File
@@ -0,0 +1,113 @@
{
pkgs,
nur-ryan4yin,
...
}:
###########################################################
#
# 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 = "${nur-ryan4yin.packages.${pkgs.system}.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
''
);
}
+3
View File
@@ -0,0 +1,3 @@
{mylib, ...}: {
imports = mylib.scanPaths ./.;
}
+66
View File
@@ -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"];
};
}
+104
View File
@@ -0,0 +1,104 @@
{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 {}
);
}
+10
View File
@@ -0,0 +1,10 @@
{pkgs-unstable, ...}: {
# terminal file manager
programs.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;
};
}
+21
View File
@@ -0,0 +1,21 @@
{
pkgs,
nur-ryan4yin,
...
}: {
# 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 = nur-ryan4yin.packages.${pkgs.system}.catppuccin-bat;
file = "Catppuccin-mocha.tmTheme";
};
};
};
}
+17
View File
@@ -0,0 +1,17 @@
{
pkgs,
nur-ryan4yin,
...
}: {
# https://github.com/catppuccin/btop/blob/main/themes/catppuccin_mocha.theme
xdg.configFile."btop/themes".source = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-btop}/themes";
# replacement of htop/nmon
programs.btop = {
enable = true;
settings = {
color_theme = "catppuccin_mocha";
theme_background = false; # make btop transparent
};
};
}
+97
View File
@@ -0,0 +1,97 @@
{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 = {
# A modern replacement for ls
# useful in bash/zsh prompt, not in nushell.
eza = {
enable = true;
enableAliases = false; # do not enable aliases in nushell!
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;
};
};
}
+3
View File
@@ -0,0 +1,3 @@
{mylib, ...}: {
imports = mylib.scanPaths ./.;
}
+99
View File
@@ -0,0 +1,99 @@
{
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 ${config.home.homeDirectory}/.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";
};
};
}
+120
View File
@@ -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.
}
+25
View File
@@ -0,0 +1,25 @@
let
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()))'";
};
in {
# only works in bash/zsh, not nushell
home.shellAliases = shellAliases;
programs.nushell = {
enable = true;
configFile.source = ./config.nu;
shellAliases = shellAliases;
};
programs.bash = {
enable = true;
enableCompletion = true;
bashrcExtra = ''
export PATH="$HOME/.local/bin:$HOME/go/bin:$PATH"
'';
};
}
+33
View File
@@ -0,0 +1,33 @@
{
pkgs,
nur-ryan4yin,
...
}: {
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 "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-starship}/palettes/mocha.toml");
};
}
+61
View File
@@ -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 '
'';
}
];
};
}
+355
View File
@@ -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"
+7
View File
@@ -0,0 +1,7 @@
_: {
programs.zellij = {
enable = true;
};
xdg.configFile."zellij/config.kdl".source = ./config.kdl;
}
-98
View File
@@ -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;";
};
}
-13
View File
@@ -1,13 +0,0 @@
{config, pkgs, ...}:
{
imports = [
./nushell
./core.nix
./development.nix
./git.nix
./media.nix
./starship.nix
];
}
-117
View File
@@ -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;
};
}
-61
View File
@@ -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";
};
};
};
}
-7
View File
@@ -1,7 +0,0 @@
{
programs.nushell = {
enable = true;
# configFile.source = ./config.nu;
# envFile.source = ./env.nu;
};
}
-15
View File
@@ -1,15 +0,0 @@
{config, ...}: {
programs.starship = {
enable = true;
enableBashIntegration = true;
enableNushellIntegration = true;
settings = {
character = {
success_symbol = "[](bold green)";
error_symbol = "[](bold red)";
};
};
};
}
+7
View File
@@ -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.
-730
View File
@@ -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
-10
View File
@@ -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' }
+2 -58
View File
@@ -1,59 +1,3 @@
# Install those apps using brew, instead of nix {username, ...}: {
# because they are not available in nixpkgs with the support of darwin home.homeDirectory = "/Users/${username}";
# ==> Brew Casks
# jdk-mission-control
# anki firefox iina openinterminal-lite
# insomnia orbstack
# clashx google-chrome
# google-cloud-sdk telegram wireshark
{pkgs, ...}:
{
# MacOS specific configuration
home.packages = with pkgs; [
mpv
discord
];
# stable version of vscode
programs.vscode = {
enable = true;
};
programs.ssh = {
enable = true;
# all my ssh private key are generated by `ssh-keygen -t ed25519 -C "ryan@nickname"`
# the config's format:
# Host — given the pattern used to match against the host name given on the command line.
# HostName — specify nickname or abbreviation for host
# IdentityFile — the location of your SSH key authentication file for the account.
# format in details:
# https://www.ssh.com/academy/ssh/config
extraConfig = ''
Host 192.168.*
# 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`
ForwardAgent yes
# romantic holds my homelab~
IdentityFile ~/.ssh/romantic
# Specifies that ssh should only use the identity file explicitly configured above
# required to prevent sending default identity files first.
IdentitiesOnly yes
Host github.com
Hostname github.com
# github is controlled by gluttony~
IdentityFile ~/.ssh/harmonica
# Specifies that ssh should only use the identity file explicitly configured above
# required to prevent sending default identity files first.
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.
};
} }
+9 -37
View File
@@ -1,37 +1,9 @@
{ pkgs, ... }: {mylib, ...}: {
imports =
{ (mylib.scanPaths ./.)
imports = [ ++ [
../common/nushell ../base/server
../base/desktop
../common/core.nix ../base/core.nix
../common/git.nix ];
../common/development.nix }
../common/media.nix
../common/starship.nix
./alacritty
./core.nix
];
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = {
username = "admin";
# set homeDirectory make build fail
homeDirectory = "/Users/admin";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
stateVersion = "22.11";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
}
+3
View File
@@ -0,0 +1,3 @@
{
home.file.".proxychains/proxychains.conf".source = ./proxychains.conf;
}
+161
View File
@@ -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
+11
View File
@@ -0,0 +1,11 @@
{pkgs, ...}: {
# Squirrel Input Method
home.file."Library/Rime" = {
# my custom squirrel data (flypy input method)
source = "${pkgs.flypy-squirrel}/share/rime-data";
recursive = true;
# overwrite possible existing data dynamically generated by squirrel
# https://github.com/nix-community/home-manager/blob/release-23.05/modules/lib/file-type.nix#L101-L111
force = true;
};
}
+19
View File
@@ -0,0 +1,19 @@
{
# Homebrew's default install location:
# /opt/homebrew for Apple Silicon
# /usr/local for macOS Intel
# The prefix /opt/homebrew was chosen to allow installations
# in /opt/homebrew for Apple Silicon and /usr/local for Rosetta 2 to coexist and use bottles.
programs.bash = {
enable = true;
bashrcExtra = ''
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
'';
};
programs.zsh = {
enable = true;
envExtra = ''
export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
'';
};
}
+23
View File
@@ -0,0 +1,23 @@
# 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.
## Why install I3/Hyprland in Home Manager instead of a NixOS Module?
1. I3 & Hyprland's configuration file is located in `~/.config`, which can be easily managed by Home Manager.
2. There're other user-specific systemd servcies, such gammastep, wallpaper-switcher, etc. which can be easily managed by Home Manager, but if we start i3/hyprland in NixOS Module, they may failed to start automatically. With i3/hyprland installed via home-manager, we can control their systemd service's dependent order, to avoid issues like this.
3. By install as less as possible in NixOS Module, we can:
1. Make the NixOS system more secure and stable.
2. Make this flake more portable to other non-NixOS systems, as home-manager can be installed on any Linux system.
+3
View File
@@ -0,0 +1,3 @@
{mylib, ...}: {
imports = mylib.scanPaths ./.;
}
@@ -1,12 +1,14 @@
{config, ...}:
let {config, username, ...}: 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;
in rec { in rec {
# add environment variables
systemd.user.sessionVariables = { home.homeDirectory = "/home/${username}";
# environment variables that always set at login
home.sessionVariables = {
# clean up ~ # clean up ~
LESSHISTFILE = cache + "/less/history"; LESSHISTFILE = cache + "/less/history";
LESSKEY = c + "/less/lesskey"; LESSKEY = c + "/less/lesskey";
@@ -19,14 +21,8 @@ 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";
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
}; };
}
home.sessionVariables = systemd.user.sessionVariables;
}
+37
View File
@@ -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;
};
}
-730
View File
@@ -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
-10
View File
@@ -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' }
-36
View File
@@ -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;
};
}
-40
View File
@@ -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;
};
}
-90
View File
@@ -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";
};
};
};
}
+10
View File
@@ -0,0 +1,10 @@
{
imports = [
../base/server
../base/desktop
../base/core.nix
./base
./desktop
];
}
+32
View File
@@ -0,0 +1,32 @@
{
pkgs,
pkgs-unstable,
nur-ryan4yin,
...
}: {
home.packages = with pkgs; [
# creative
blender # 3d modeling
# gimp # image editing, I prefer using figma in browser instead of this one
inkscape # vector graphics
krita # digital painting
musescore # music notation
# reaper # audio production
pkgs-unstable.sonic-pi # music programming
# this app consumes a lot of storage, so do not install it currently
# 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 = {
# live streaming
obs-studio.enable = true;
};
}
+3
View File
@@ -0,0 +1,3 @@
{mylib, ...}: {
imports = mylib.scanPaths ./.;
}
@@ -0,0 +1,45 @@
{
pkgs,
lib,
...
}: {
# Adjust the color temperature(& brightness) of your screen according to
# your surroundings. This may help your eyes hurt less if you are
# working in front of the screen at night.
#
# works fine with both x11 & wayland(hyprland)
#
# https://gitlab.com/chinstrap/gammastep
services.gammastep = {
enable = true;
# add a gammastep icon in the system tray
# has problem with wayland, so disable it
tray = false;
temperature = {
day = 5700;
night = 4000;
};
# https://gitlab.com/chinstrap/gammastep/-/blob/master/gammastep.conf.sample?ref_type=heads
settings = {
general = {
fade = "1"; # gradually apply the new screen temperature/brightness over a couple of seconds.
# it is a fake brightness adjustment obtained by manipulating the gamma ramps,
# which means that it does not reduce the backlight of the screen.
# Preferably only use it if your normal backlight adjustment is too coarse-grained.
brightness-day = "1.0";
brightness-night = "0.8";
location-provider = "manual";
# by default, Redshift will use the current elevation of the sun
# to determine whether it is daytime, night or in transition (dawn/dusk).
# dawn-time = "6:00-8:45";
# dusk-time = "18:35-20:15";
};
manual = {
# China, Shenzhen
lat = "22.5"; # latitude
lon = "114.1"; # longitude
};
};
};
}
@@ -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
@@ -0,0 +1,30 @@
{
pkgs,
nur-ryan4yin,
...
}: {
home.file.".local/share/fcitx5/themes".source = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-fcitx5}/src";
xdg.configFile = {
"fcitx5/profile" = {
source = ./profile;
# every time fcitx5 switch input method, it will modify ~/.config/fcitx5/profile,
# so we need to force replace it in every rebuild to avoid file conflict.
force = true;
};
"fcitx5/conf/classicui.conf".source = ./classicui.conf;
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
# for flypy chinese input method
fcitx5-rime
# needed enable rime using configtool after installed
fcitx5-configtool
fcitx5-chinese-addons
# fcitx5-mozc # japanese input method
fcitx5-gtk # gtk im module
];
};
}
+57
View File
@@ -0,0 +1,57 @@
{
pkgs,
config,
...
}: {
# If your themes for mouse cursor, icons or windows dont load correctly,
# try setting them with home.pointerCursor and gtk.theme,
# which enable a bunch of compatibility options that should make the themes load in all situations.
home.pointerCursor = {
gtk.enable = true;
x11.enable = true;
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
# 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 = "Noto Sans";
package = pkgs.noto-fonts;
size = 11;
};
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, pkgs-unstable,
nur-ryan4yin,
... ...
}: }:
# media - control and enjoy audio/video # media - control and enjoy audio/video
@@ -10,17 +11,25 @@
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
xdg.configFile."cava/config".text =
''
# custom cava config
''
+ builtins.readFile "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-cava}/mocha.cava";
programs = { programs = {
mpv = { mpv = {
enable = true; enable = true;
@@ -32,4 +41,4 @@
services = { services = {
playerctld.enable = true; playerctld.enable = true;
}; };
} }
+26
View File
@@ -0,0 +1,26 @@
{pkgs, ...}: {
home.packages = with pkgs; [
# GUI apps
# e-book viewer(.epub/.mobi/...)
# do not support .pdf
foliate
# instant messaging
telegram-desktop
discord
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
# remote desktop(rdp connect)
remmina
freerdp # required by remmina
# misc
flameshot
ventoy # multi-boot usb creator
];
# GitHub CLI tool
programs.gh = {
enable = true;
};
}
@@ -0,0 +1,31 @@
{
pkgs,
config,
lib,
wallpapers,
...
}: {
systemd.user.services.wallpaper = {
Unit = {
Description = "Wallpaper Switcher daemon";
After = ["graphical-session-pre.target" "xdg-desktop-autostart.target"];
Wants = ["graphical-session-pre.target"];
};
Install.WantedBy = ["graphical-session.target"];
Service = {
ExecStart = lib.getExe (pkgs.writeShellApplication {
name = "wallpaper";
runtimeInputs = with pkgs; [procps feh swaybg python3];
text = ''
export WALLPAPERS_DIR="${wallpapers}"
export WALLPAPERS_STATE_FILEPATH="${config.xdg.stateHome}/wallpaper-switcher/switcher_state"
export WALLPAPER_WAIT_MIN=10
export WALLPAPER_WAIT_MAX=20
exec ${./wallpaper-switcher.py}
'';
});
RestartSec = 3;
Restart = "on-failure";
};
};
}
+169
View File
@@ -0,0 +1,169 @@
#!/usr/bin/env python3
"""
This script will randomly select a wallpaper from the wallpapers directory.
It will skip the last wallpaper used, so that you don't get the same wallpaper.
It will also set the wallpaper using `feh` for X11, or `swaybg` for Wayland.
Maintainer: ryan4yin [xiaoyin_c@qq.com]
"""
import os
import time
import random
import json
from pathlib import Path
from typing import Union
import subprocess
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
class WallpaperSwitcher:
def __init__(
self,
wait_min,
wait_max,
wallpapers_dir: Path,
state_filepath: Path,
image_extensions: Union[tuple, list],
) -> None:
self.wallpapers_dir = wallpapers_dir
self.image_extensions = image_extensions
self.state_filepath = state_filepath
self.wait_min = wait_min
self.wait_max = wait_max
# initialize the state file
self.state_filepath.parent.mkdir(parents=True, exist_ok=True)
self.current_state = self.state_filepath.open("a+", encoding="utf-8")
self.current_wallpaper_list = list()
def run(self):
"""
Iterate on all wallpapers in the wallpapers directory, cycling through them in a random order.
"""
self.initialize_state()
while True:
for i, w in enumerate(self.current_wallpaper_list):
if i < self.current_wallpaper_index:
continue
logger.info(
f"Setting wallpaper {i+1}/{len(self.current_wallpaper_list)}: {w}"
)
self.set_wallpaper(w)
# update the state
self.current_wallpaper_index = i
self.save_state()
wait_time = random.randint(self.wait_min, self.wait_max)
logger.info(f"Waiting {wait_time} seconds...")
time.sleep(wait_time)
# reset the state
self.reset_state()
def save_state(self):
wallpaper_list = [w.as_posix() for w in self.current_wallpaper_list]
state = {
"current_wallpaper_list": wallpaper_list,
"current_wallpaper_index": self.current_wallpaper_index,
}
self.current_state.truncate(0)
self.current_state.write(json.dumps(state, indent=4))
self.current_state.flush()
def initialize_state(self):
self.current_state.seek(0)
data = self.current_state.read()
if not data:
logger.info("No state found, resetting...")
self.reset_state()
else:
logger.info("State found, reloading...")
state = json.loads(data)
wallpapers = [Path(w) for w in state["current_wallpaper_list"]]
self.current_wallpaper_list = wallpapers
self.current_wallpaper_index = state["current_wallpaper_index"]
def reset_state(self):
logger.info(f"Rescanning & shuffle wallpapers in {self.wallpapers_dir} ...")
wallpapers = list(
filter(
lambda x: x.suffix in self.image_extensions,
self.wallpapers_dir.iterdir(),
)
)
random.shuffle(wallpapers)
self.current_wallpaper_list = wallpapers
self.current_wallpaper_index = 0
def set_wallpaper(self, path: Path):
# check if we are running under x11 or wayland
if (
"WAYLAND_DISPLAY" in os.environ
or os.environ.get("XDG_SESSION_TYPE") == "wayland"
):
self.set_wallpaper_wayland(path)
else:
self.set_wallpaper_x11(path)
def set_wallpaper_x11(self, path: Path):
subprocess.run(["feh", "--bg-fill", path])
def set_wallpaper_wayland(self, path: Path):
# find all swaybg processes
swaybg_pids = subprocess.run(
["pgrep", "-f", "swaybg"], stdout=subprocess.PIPE
).stdout.decode("utf-8")
# run swaybg in the background, and make it running even after the parent process exits
subprocess.Popen(
["swaybg", "--output", "*", "--mode", "fill", "--image", path],
start_new_session=True,
)
time.sleep(1)
# kill all old swaybg processes
for pid in swaybg_pids.splitlines():
try:
os.kill(int(pid), 9)
except ProcessLookupError:
pass
def main():
wallpapers_dir = os.getenv("WALLPAPERS_DIR")
state_filepath = os.getenv("WALLPAPERS_STATE_FILEPATH")
if not wallpapers_dir:
raise Exception("WALLPAPERS_DIR not set")
if not state_filepath:
raise Exception("WALLPAPERS_STATE_FILEPATH not set")
image_postfix = (
".jpg",
".jpeg",
".png",
# ".gif",
# ".webp"
)
wait_min = int(os.getenv("WALLPAPER_WAIT_MIN", 60))
wait_max = int(os.getenv("WALLPAPER_WAIT_MAX", 300))
wallpaper_switcher = WallpaperSwitcher(
wait_min,
wait_max,
Path(wallpapers_dir).expanduser(),
Path(state_filepath).expanduser(),
image_postfix,
)
wallpaper_switcher.run()
if __name__ == "__main__":
main()
+83
View File
@@ -0,0 +1,83 @@
# 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.configFile."mimeapps.list".force = true;
xdg = {
enable = true;
cacheHome = "${config.home.homeDirectory}/.cache";
configHome = "${config.home.homeDirectory}/.config";
dataHome = "${config.home.homeDirectory}/.local/share";
stateHome = "${config.home.homeDirectory}/.local/state";
# 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" = ["org.telegram.desktop.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";
};
};
};
}

Some files were not shown because too many files have changed in this diff Show More