Compare commits
97 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d6ffd7785 | |||
| 647f56d213 | |||
| 210aa544fc | |||
| 5e83259bcb | |||
| 0a2aae246a | |||
| 30881f356a | |||
| 3aaaeb49ca | |||
| 55e12cddaf | |||
| ac4f625768 | |||
| 2d44bc6006 | |||
| 03c1d14ed9 | |||
| 73a746cebd | |||
| 1e9dc4df4b | |||
| 7dd55a5de9 | |||
| e61116140d | |||
| b75b79057b | |||
| 1f08d10ac7 | |||
| b2cf885637 | |||
| 44eb487df9 | |||
| 006bf56fd7 | |||
| 73e3707570 | |||
| 82cfa4c6f7 | |||
| 27dd5ebb13 | |||
| a589feee7b | |||
| a9459e7606 | |||
| ad86ed60dc | |||
| 2a42da46ad | |||
| 1817f41423 | |||
| 217057612c | |||
| a1b5572eea | |||
| cddd8101c7 | |||
| d6f6154a22 | |||
| 8ac24e4f13 | |||
| e4abf62ec3 | |||
| 05aa451895 | |||
| c49a96ae29 | |||
| ac3c05545f | |||
| b12af73ff6 | |||
| 45b52845f7 | |||
| 434b3bfe81 | |||
| 6c1cd365a0 | |||
| b1d9bbc26e | |||
| 76b0b1c68d | |||
| 6dca4d1492 | |||
| a237c108d1 | |||
| 9832a955e4 | |||
| c90bb514d0 | |||
| 932e1a236c | |||
| e70f7269f4 | |||
| a07dfbe36a | |||
| d57e3ff61b | |||
| 6f38faef79 | |||
| 50d9301e13 | |||
| 58b02a6b16 | |||
| 29511fa574 | |||
| 809a68fa27 | |||
| 2ac43c8a33 | |||
| 802e9e6e39 | |||
| 625691084a | |||
| 38e7a45bb8 | |||
| dbe62811c7 | |||
| 8d83ded0fb | |||
| 74cec7dd8e | |||
| b2f75a37dc | |||
| a04a058077 | |||
| 7d03e63bdd | |||
| 1cf34add85 | |||
| 20b6aa07af | |||
| ab5a68ce9d | |||
| da729c1ade | |||
| f899d59da9 | |||
| ca8f0dc166 | |||
| 393338a23d | |||
| 5ca251646a | |||
| 75ef84913f | |||
| b92537e264 | |||
| e3a17925f2 | |||
| c170e251ac | |||
| ec1747707b | |||
| 56f2abc737 | |||
| cb6f46aea8 | |||
| dfab5ddacc | |||
| 0e2faec44f | |||
| 88671c40e7 | |||
| 9f59301a0e | |||
| d13a353921 | |||
| 989989ecc6 | |||
| 0a66a3b0a3 | |||
| be036118ca | |||
| 601fcafd31 | |||
| 087d38487c | |||
| b0e481a1f1 | |||
| 1ca7607814 | |||
| 59ea29a7ab | |||
| 486a3b343c | |||
| 3b7772712e | |||
| 37b34beca4 |
@@ -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
|
||||
@@ -1,3 +1,5 @@
|
||||
result
|
||||
result/
|
||||
.direnv/
|
||||
.DS_Store
|
||||
.pre-commit-config.yaml
|
||||
|
||||
@@ -13,9 +13,15 @@
|
||||
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
|
||||
|
||||
@@ -33,12 +39,15 @@ upp:
|
||||
history:
|
||||
nix profile history --profile /nix/var/nix/profiles/system
|
||||
|
||||
repl:
|
||||
nix repl -f flake:nixpkgs
|
||||
|
||||
gc:
|
||||
# remove all generations older than 7 days
|
||||
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
|
||||
|
||||
# garbage collect all unused nix store entries
|
||||
sudo nix store gc --debug
|
||||
# sudo nix store gc --debug
|
||||
|
||||
############################################################################
|
||||
#
|
||||
@@ -48,15 +57,27 @@ gc:
|
||||
|
||||
darwin-set-proxy:
|
||||
sudo python3 scripts/darwin_set_proxy.py
|
||||
sleep 1
|
||||
|
||||
darwin-rollback:
|
||||
./result/sw/bin/darwin-rebuild rollback
|
||||
|
||||
ha: darwin-set-proxy
|
||||
nix build .#darwinConfigurations.harmonica.system
|
||||
./result/sw/bin/darwin-rebuild switch --flake .
|
||||
./result/sw/bin/darwin-rebuild switch --flake .#harmonica
|
||||
|
||||
ha-debug: darwin-set-proxy
|
||||
nix build .#darwinConfigurations.harmonica.system --show-trace --verbose
|
||||
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
|
||||
|
||||
|
||||
############################################################################
|
||||
#
|
||||
@@ -138,6 +159,3 @@ fmt:
|
||||
# format the nix files in this repo
|
||||
nix fmt
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf result
|
||||
|
||||
@@ -16,37 +16,41 @@
|
||||
|
||||
This repository is home to the nix code that builds my systems.
|
||||
|
||||
## Why Nix?
|
||||
## Why NixOS & Flakes?
|
||||
|
||||
Nix allows for easy-to-manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works forever. If someone else shares their configuration, anyone can make use of it.
|
||||
Nix allows for easy-to-manage, collaborative, reproducible deployments. This means that once something is setup and configured once, it works (almost) forever. If someone else shares their configuration, anyone can make use of it(if you really understand what you're copying/refering now).
|
||||
|
||||
**Want to know Nix in detail? Looking for a beginner-friendly tutorial or best practices? Check out [NixOS & Nix Flakes Book - 🛠️ ❤️ An unofficial & opinionated :book: for beginners](https://github.com/ryan4yin/nixos-and-flakes-book)!**
|
||||
As for Flakes, refer to [Introduction to Flakes - NixOS & Nix Flakes Book](https://nixos-and-flakes.thiscute.world/nixos-with-flakes/introduction-to-flakes)
|
||||
|
||||
> If you're using macOS, you can also check out [ryan4yin/nix-darwin-kickstarter](https://github.com/ryan4yin/nix-darwin-kickstarter) for a quick start.
|
||||
**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)!**
|
||||
|
||||
> If you're using macOS, check out [ryan4yin/nix-darwin-kickstarter](https://github.com/ryan4yin/nix-darwin-kickstarter) for a quick start.
|
||||
|
||||
## Components
|
||||
|
||||
| | NixOS(Wayland) | NixOS(Xorg) |
|
||||
| --------------------------- | :--------------------------------------------------------------------------------------------- | :------------------------------------------------------ |
|
||||
| **Window Manager** | [Hyprland][Hyprland] | [i3][i3] |
|
||||
| **Terminal Emulator** | [Kitty][Kitty] | [Kitty][Kitty] |
|
||||
| **Bar** | [Waybar][Waybar] | [i3block][i3block] |
|
||||
| **Application Launcher** | [anyrun][anyrun] | [rofi][rofi] |
|
||||
| **Notification Daemon** | [Mako][Mako] | [Dunst][Dunst] |
|
||||
| **Display Manager** | [GDM][GDM] | [GDM][GDM] |
|
||||
| **Color Scheme** | [Catppuccin][Catppuccin] | [Catppuccin][Catppuccin] |
|
||||
| **network management tool** | [NetworkManager][NetworkManager] | [NetworkManager][NetworkManager] |
|
||||
| **Input method framework** | [Fcitx5][Fcitx5] | [Fcitx5][Fcitx5] |
|
||||
| **System resource monitor** | [Btop][Btop] | [Btop][Btop] |
|
||||
| **File Manager** | [ranger][ranger] + [thunar][thunar] | [ranger][ranger] + [thunar][thunar] |
|
||||
| **Shell** | [Nushell][Nushell] + [Starship][Starship] | [Nushell][Nushell] + [Starship][Starship] |
|
||||
| **Music Player** | [mpd][mpd], [ncmpcpp][ncmpcpp], [mpc][mpc], [Netease-cloud-music-gtk][netease-cloud-music-gtk] | [Netease-cloud-music-gtk][netease-cloud-music-gtk] |
|
||||
| **Media Player** | [mpv][mpv] | [mpv][mpv] |
|
||||
| **Text Editor** | [Neovim][Neovim] | [Neovim][Neovim] |
|
||||
| **Fonts** | [Nerd fonts][Nerd fonts] | [Nerd fonts][Nerd fonts] |
|
||||
| **Image Viewer** | [imv][imv] | [imv][imv] |
|
||||
| **Screenshot Software** | [grim][grim] | [flameshot](https://github.com/flameshot-org/flameshot) |
|
||||
| **Screen Recording** | [OBS][OBS] | [OBS][OBS] |
|
||||
| | 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
|
||||
|
||||
@@ -69,7 +73,6 @@ See [./home/base/desktop/neovim](./home/base/desktop/neovim) for details.
|
||||
|
||||
See [./hosts](./hosts) for details.
|
||||
|
||||
|
||||
## Secrets Management
|
||||
|
||||
See [./secrets](./secrets) for details.
|
||||
@@ -78,18 +81,10 @@ See [./secrets](./secrets) for details.
|
||||
|
||||
> :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.
|
||||
|
||||
For MacOS:
|
||||
|
||||
```bash
|
||||
# deploy the darwin configuration(harmonicia)
|
||||
make ha
|
||||
|
||||
# deploy with details
|
||||
make ha-debug
|
||||
```
|
||||
|
||||
For NixOS:
|
||||
|
||||
> 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
|
||||
@@ -106,27 +101,22 @@ make i3-debug
|
||||
# make hypr-debug
|
||||
```
|
||||
|
||||
To deploy this flake from NixOS's official ISO image(purest installation method), please refer to [ryan4yin/nix-config/nixos-install](https://github.com/ryan4yin/nix-config/tree/nixos-install)
|
||||
|
||||
## Install Apps from Flatpak
|
||||
|
||||
We can install apps from flathub, which has a lot of apps that are not supported well in nixpkgs.
|
||||
For macOS:
|
||||
|
||||
```bash
|
||||
# Add the Flathub repository
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
# deploy harmonicia's configuration(macOS Intel)
|
||||
make ha
|
||||
|
||||
# install apps from flathub
|
||||
flatpak install netease-cloud-music-gtk
|
||||
# deploy fern's configuration(Apple Silicon)
|
||||
make fe
|
||||
|
||||
# install 3d printer slicer - cura
|
||||
flatpak install flathub com.ultimaker.cura
|
||||
|
||||
# or you can search apps from flathub
|
||||
flatpak search <keyword>
|
||||
# search on website is also supported: https://flathub.org/
|
||||
# deploy with details
|
||||
make ha-debug
|
||||
# make fe
|
||||
```
|
||||
|
||||
> [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...)
|
||||
|
||||
## How to create & managage VM from this flake?
|
||||
|
||||
use `aquamarine` as an example, we can create a virtual machine with the following command:
|
||||
@@ -169,6 +159,9 @@ Other dotfiles that inspired me:
|
||||
- [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.
|
||||
@@ -213,3 +206,6 @@ Other dotfiles that inspired me:
|
||||
[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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -16,258 +16,72 @@
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
nix-darwin,
|
||||
home-manager,
|
||||
nixos-generators,
|
||||
nixos-licheepi4a,
|
||||
nixos-rk3588,
|
||||
pre-commit-hooks,
|
||||
...
|
||||
}: let
|
||||
username = "ryan";
|
||||
userfullname = "Ryan Yin";
|
||||
useremail = "xiaoyin_c@qq.com";
|
||||
constants = import ./constants.nix;
|
||||
|
||||
x64_system = "x86_64-linux";
|
||||
x64_darwin = "x86_64-darwin";
|
||||
riscv64_system = "riscv64-linux";
|
||||
aarch64_system = "aarch64-linux";
|
||||
allSystems = [x64_system x64_darwin riscv64_system aarch64_system];
|
||||
# `lib.genAttrs [ "foo" "bar" ] (name: "x_" + name)` => `{ foo = "x_foo"; bar = "x_bar"; }`
|
||||
forEachSystem = func: (nixpkgs.lib.genAttrs constants.allSystems func);
|
||||
|
||||
nixosSystem = import ./lib/nixosSystem.nix;
|
||||
macosSystem = import ./lib/macosSystem.nix;
|
||||
colmenaSystem = import ./lib/colmenaSystem.nix;
|
||||
|
||||
# 星野 アイ, Hoshino Ai
|
||||
idol_ai_modules_i3 = {
|
||||
nixos-modules = [
|
||||
./hosts/idols/ai
|
||||
./modules/nixos/i3.nix
|
||||
];
|
||||
home-module = import ./home/linux/desktop-i3.nix;
|
||||
};
|
||||
idol_ai_modules_hyprland = {
|
||||
nixos-modules = [
|
||||
./hosts/idols/ai
|
||||
./modules/nixos/hyprland.nix
|
||||
];
|
||||
home-module = import ./home/linux/desktop-hyprland.nix;
|
||||
};
|
||||
|
||||
# 星野 愛久愛海, Hoshino Akuamarin
|
||||
idol_aquamarine_modules = {
|
||||
nixos-modules = [
|
||||
./hosts/idols/aquamarine
|
||||
];
|
||||
home-module = import ./home/linux/server.nix;
|
||||
};
|
||||
idol_aquamarine_tags = ["dist-build" "aqua"];
|
||||
|
||||
# 星野 瑠美衣, Hoshino Rubii
|
||||
idol_ruby_modules = {
|
||||
nixos-modules = [
|
||||
./hosts/idols/ruby
|
||||
];
|
||||
home-module = import ./home/linux/server.nix;
|
||||
};
|
||||
idol_ruby_tags = ["dist-build" "ruby"];
|
||||
|
||||
# 有馬 かな, Arima Kana
|
||||
idol_kana_modules = {
|
||||
nixos-modules = [
|
||||
./hosts/idols/kana
|
||||
];
|
||||
home-module = import ./home/linux/server.nix;
|
||||
};
|
||||
idol_kana_tags = ["dist-build" "kana"];
|
||||
|
||||
# 森友 望未, Moritomo Nozomi
|
||||
rolling_nozomi_modules = {
|
||||
nixos-modules = [
|
||||
./hosts/rolling_girls/nozomi
|
||||
];
|
||||
# home-module = import ./home/linux/server-riscv64.nix;
|
||||
};
|
||||
rolling_nozomi_tags = ["riscv" "nozomi"];
|
||||
|
||||
# 小坂 結季奈, Kosaka Yukina
|
||||
rolling_yukina_modules = {
|
||||
nixos-modules = [
|
||||
./hosts/rolling_girls/yukina
|
||||
];
|
||||
# home-module = import ./home/linux/server-riscv64.nix;
|
||||
};
|
||||
rolling_yukina_tags = ["riscv" "yukina"];
|
||||
|
||||
# 大木 鈴, Ōki Suzu
|
||||
_12kingdoms_suzu_modules = {
|
||||
nixos-modules = [
|
||||
./hosts/12kingdoms/suzu
|
||||
];
|
||||
# home-module = import ./home/linux/server.nix;
|
||||
};
|
||||
_12kingdoms_suzu_tags = ["aarch" "suzu"];
|
||||
|
||||
x64_specialArgs =
|
||||
{
|
||||
inherit username userfullname useremail;
|
||||
# use unstable branch for some packages to get the latest updates
|
||||
pkgs-unstable = import nixpkgs-unstable {
|
||||
system = x64_system; # refer the `system` parameter form outer scope recursively
|
||||
# To use chrome, we need to allow the installation of non-free software
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
}
|
||||
// inputs;
|
||||
in {
|
||||
nixosConfigurations = let
|
||||
base_args = {
|
||||
inherit home-manager nixos-generators;
|
||||
nixpkgs = nixpkgs; # or nixpkgs-unstable
|
||||
system = x64_system;
|
||||
specialArgs = x64_specialArgs;
|
||||
};
|
||||
in {
|
||||
# ai with i3 window manager
|
||||
ai_i3 = nixosSystem (idol_ai_modules_i3 // base_args);
|
||||
# ai with hyprland compositor
|
||||
ai_hyprland = nixosSystem (idol_ai_modules_hyprland // base_args);
|
||||
|
||||
# three virtual machines without desktop environment.
|
||||
aquamarine = nixosSystem (idol_aquamarine_modules // base_args);
|
||||
ruby = nixosSystem (idol_ruby_modules // base_args);
|
||||
kana = nixosSystem (idol_kana_modules // base_args);
|
||||
};
|
||||
|
||||
# colmena - remote deployment via SSH
|
||||
colmena = let
|
||||
# x86_64 related
|
||||
x64_base_args = {
|
||||
inherit home-manager;
|
||||
nixpkgs = nixpkgs; # or nixpkgs-unstable
|
||||
specialArgs = x64_specialArgs;
|
||||
};
|
||||
|
||||
# riscv64 related
|
||||
# using the same nixpkgs as nixos-licheepi4a to utilize the cross-compilation cache.
|
||||
lpi4a_pkgs = import nixos-licheepi4a.inputs.nixpkgs {system = x64_system;};
|
||||
lpi4a_specialArgs =
|
||||
{
|
||||
inherit username userfullname useremail;
|
||||
pkgsKernel = nixos-licheepi4a.packages.${x64_system}.pkgsKernelCross;
|
||||
}
|
||||
// inputs;
|
||||
lpi4a_base_args = {
|
||||
inherit home-manager;
|
||||
nixpkgs = nixos-licheepi4a.inputs.nixpkgs; # or nixpkgs-unstable
|
||||
specialArgs = lpi4a_specialArgs;
|
||||
targetUser = "root";
|
||||
};
|
||||
|
||||
# aarch64 related
|
||||
# using the same nixpkgs as nixos-rk3588 to utilize the cross-compilation cache.
|
||||
rk3588_pkgs = import nixos-rk3588.inputs.nixpkgs {system = x64_system;};
|
||||
rk3588_specialArgs =
|
||||
{
|
||||
inherit username userfullname useremail;
|
||||
}
|
||||
// nixos-rk3588.inputs;
|
||||
rk3588_base_args = {
|
||||
inherit home-manager;
|
||||
nixpkgs = nixos-rk3588.inputs.nixpkgs; # or nixpkgs-unstable
|
||||
specialArgs = rk3588_specialArgs;
|
||||
targetUser = "root";
|
||||
};
|
||||
in {
|
||||
meta = {
|
||||
nixpkgs = import nixpkgs {system = x64_system;};
|
||||
specialArgs = x64_specialArgs;
|
||||
|
||||
nodeSpecialArgs = {
|
||||
# riscv64 SBCs
|
||||
nozomi = lpi4a_specialArgs;
|
||||
yukina = lpi4a_specialArgs;
|
||||
|
||||
# aarch64 SBCs
|
||||
suzu = rk3588_specialArgs;
|
||||
};
|
||||
nodeNixpkgs = {
|
||||
nozomi = lpi4a_pkgs;
|
||||
yukina = lpi4a_pkgs;
|
||||
|
||||
# aarch64 SBCs
|
||||
suzu = rk3588_pkgs;
|
||||
};
|
||||
};
|
||||
|
||||
# proxmox virtual machines(x86_64)
|
||||
aquamarine = colmenaSystem (idol_aquamarine_modules // x64_base_args // {host_tags = idol_aquamarine_tags;});
|
||||
ruby = colmenaSystem (idol_ruby_modules // x64_base_args // {host_tags = idol_ruby_tags;});
|
||||
kana = colmenaSystem (idol_kana_modules // x64_base_args // {host_tags = idol_kana_tags;});
|
||||
|
||||
# riscv64 SBCs
|
||||
nozomi = colmenaSystem (rolling_nozomi_modules // lpi4a_base_args // {host_tags = rolling_nozomi_tags;});
|
||||
yukina = colmenaSystem (rolling_yukina_modules // lpi4a_base_args // {host_tags = rolling_yukina_tags;});
|
||||
|
||||
# aarch64 SBCs
|
||||
suzu = colmenaSystem (_12kingdoms_suzu_modules // rk3588_base_args // {host_tags = _12kingdoms_suzu_tags;});
|
||||
};
|
||||
|
||||
# take system images for idols
|
||||
# https://github.com/nix-community/nixos-generators
|
||||
packages."${x64_system}" =
|
||||
# genAttrs returns an attribute set with the given keys and values(host => image).
|
||||
nixpkgs.lib.genAttrs [
|
||||
"ai_i3"
|
||||
"ai_hyprland"
|
||||
] (
|
||||
# generate iso image for hosts with desktop environment
|
||||
host:
|
||||
self.nixosConfigurations.${host}.config.formats.iso
|
||||
)
|
||||
// nixpkgs.lib.genAttrs [
|
||||
"aquamarine"
|
||||
"ruby"
|
||||
"kana"
|
||||
] (
|
||||
# generate proxmox image for virtual machines without desktop environment
|
||||
host:
|
||||
self.nixosConfigurations.${host}.config.formats.proxmox
|
||||
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
|
||||
);
|
||||
|
||||
# macOS's configuration, for work.
|
||||
darwinConfigurations = let
|
||||
system = x64_darwin;
|
||||
specialArgs =
|
||||
{
|
||||
inherit username userfullname useremail;
|
||||
# use unstable branch for some packages to get the latest updates
|
||||
pkgs-unstable = import nixpkgs-unstable {
|
||||
inherit system; # refer the `system` parameter form outer scope recursively
|
||||
# To use chrome, we need to allow the installation of non-free software
|
||||
config.allowUnfree = true;
|
||||
# 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"];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
// inputs;
|
||||
base_args = {
|
||||
inherit nix-darwin home-manager system specialArgs nixpkgs;
|
||||
};
|
||||
in {
|
||||
harmonica = macosSystem (base_args
|
||||
// {
|
||||
darwin-modules = [
|
||||
./hosts/harmonica
|
||||
];
|
||||
home-module = import ./home/darwin;
|
||||
});
|
||||
);
|
||||
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}
|
||||
'';
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
# format the nix code in this flake
|
||||
# alejandra is a nix formatter with a beautiful output
|
||||
formatter = nixpkgs.lib.genAttrs allSystems (
|
||||
system:
|
||||
nixpkgs.legacyPackages.${system}.alejandra
|
||||
);
|
||||
# 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 = {
|
||||
# substituers will be appended to the default substituters when fetching packages
|
||||
extra-substituters = [
|
||||
"https://anyrun.cachix.org"
|
||||
"https://hyprland.cachix.org"
|
||||
# "https://nixpkgs-wayland.cachix.org"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
# "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
||||
];
|
||||
};
|
||||
|
||||
# This is the standard format for flake.nix. `inputs` are the dependencies of the flake,
|
||||
@@ -287,6 +101,7 @@
|
||||
url = "github:lnl7/nix-darwin";
|
||||
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
||||
};
|
||||
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
|
||||
|
||||
# home-manager, used for managing user configuration
|
||||
home-manager = {
|
||||
@@ -306,10 +121,13 @@
|
||||
|
||||
impermanence.url = "github:nix-community/impermanence";
|
||||
|
||||
# modern window compositor
|
||||
hyprland.url = "github:hyprwm/Hyprland/v0.32.3";
|
||||
hyprland = {
|
||||
url = "github:hyprwm/Hyprland/v0.33.1";
|
||||
inputs.nixpkgs.follows = "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";
|
||||
@@ -321,15 +139,26 @@
|
||||
url = "github:nix-community/nixos-generators";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# secrets management
|
||||
agenix = {
|
||||
# lock with git commit at 0.14.0
|
||||
url = "github:ryantm/agenix/54693c91d923fecb4cf04c4535e3d84f8dec7919";
|
||||
# replaced with a type-safe reimplementation to get a better error message and less bugs.
|
||||
# url = "github:ryan4yin/ragenix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# secrets management, lock with git commit at 2023/7/15
|
||||
agenix.url = "github:ryantm/agenix/0d8c5325fc81daf00532e3e26c6752f7bcde1143";
|
||||
# add git hooks to format nix code before commit
|
||||
pre-commit-hooks = {
|
||||
url = "github:cachix/pre-commit-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
######################## Some non-flake repositories #########################################
|
||||
|
||||
# AstroNvim is an aesthetic and feature-rich neovim config.
|
||||
astronvim = {
|
||||
url = "github:AstroNvim/AstroNvim/v3.37.12";
|
||||
url = "github:AstroNvim/AstroNvim/v3.40.3";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
@@ -365,77 +194,5 @@
|
||||
|
||||
# aarch64 SBCs
|
||||
nixos-rk3588.url = "github:ryan4yin/nixos-rk3588";
|
||||
|
||||
######################## Color Schemes #########################################
|
||||
|
||||
# color scheme - catppuccin
|
||||
catppuccin-btop = {
|
||||
url = "github:catppuccin/btop";
|
||||
flake = false;
|
||||
};
|
||||
catppuccin-fcitx5 = {
|
||||
url = "github:catppuccin/fcitx5";
|
||||
flake = false;
|
||||
};
|
||||
catppuccin-bat = {
|
||||
url = "github:catppuccin/bat";
|
||||
flake = false;
|
||||
};
|
||||
catppuccin-alacritty = {
|
||||
url = "github:catppuccin/alacritty";
|
||||
flake = false;
|
||||
};
|
||||
catppuccin-helix = {
|
||||
url = "github:catppuccin/helix";
|
||||
flake = false;
|
||||
};
|
||||
catppuccin-starship = {
|
||||
url = "github:catppuccin/starship";
|
||||
flake = false;
|
||||
};
|
||||
catppuccin-hyprland = {
|
||||
url = "github:catppuccin/hyprland";
|
||||
flake = false;
|
||||
};
|
||||
catppuccin-cava = {
|
||||
url = "github:catppuccin/cava";
|
||||
flake = false;
|
||||
};
|
||||
cattppuccin-k9s = {
|
||||
url = "github:catppuccin/k9s";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
# the nixConfig here only affects the flake itself, not the system configuration!
|
||||
nixConfig = {
|
||||
substituters = [
|
||||
# cache mirror located in China
|
||||
# status: https://mirror.sjtu.edu.cn/
|
||||
"https://mirror.sjtu.edu.cn/nix-channels/store"
|
||||
# status: https://mirrors.ustc.edu.cn/status/
|
||||
# "https://mirrors.ustc.edu.cn/nix-channels/store"
|
||||
|
||||
# my own cache server
|
||||
"https://ryan4yin.cachix.org"
|
||||
"https://anyrun.cachix.org"
|
||||
"https://hyprland.cachix.org"
|
||||
|
||||
"https://cache.nixos.org"
|
||||
];
|
||||
|
||||
# nix community's cache server
|
||||
extra-substituters = [
|
||||
"https://nix-community.cachix.org"
|
||||
"https://nixpkgs-wayland.cachix.org"
|
||||
];
|
||||
extra-trusted-public-keys = [
|
||||
"ryan4yin.cachix.org-1:Gbk27ZU5AYpGS9i3ssoLlwdvMIh0NxG0w8it/cv9kbU="
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
|
||||
"anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s="
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
{ username, ... }: {
|
||||
imports = [
|
||||
];
|
||||
|
||||
{username, ...}: {
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home = {
|
||||
username = username;
|
||||
homeDirectory = "/home/${username}";
|
||||
inherit username;
|
||||
|
||||
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
@@ -16,7 +13,7 @@
|
||||
# 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 = "23.05";
|
||||
stateVersion = "23.11";
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
@@ -1,23 +1,28 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
# general tools
|
||||
pulumi
|
||||
pulumictl
|
||||
# istioctl
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
# general tools
|
||||
pulumi
|
||||
pulumictl
|
||||
# istioctl
|
||||
|
||||
# aws
|
||||
awscli2
|
||||
aws-iam-authenticator
|
||||
eksctl
|
||||
istioctl
|
||||
# aws
|
||||
awscli2
|
||||
ssm-session-manager-plugin # Amazon SSM Session Manager Plugin
|
||||
aws-iam-authenticator
|
||||
eksctl
|
||||
istioctl
|
||||
|
||||
# aliyun
|
||||
aliyun-cli
|
||||
];
|
||||
|
||||
programs = {
|
||||
};
|
||||
# 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 []
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
skopeo
|
||||
docker-compose
|
||||
dive # explore docker layers
|
||||
];
|
||||
];
|
||||
|
||||
programs = {
|
||||
};
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
{ ... }: {
|
||||
imports = [
|
||||
./container.nix
|
||||
./kubernetes.nix
|
||||
];
|
||||
{mylib, ...}: {
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
pkgs-unstable,
|
||||
cattppuccin-k9s,
|
||||
nur-ryan4yin,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
@@ -12,20 +11,20 @@
|
||||
programs = {
|
||||
k9s = {
|
||||
enable = true;
|
||||
skin =
|
||||
let
|
||||
skin_file = "${cattppuccin-k9s}/dist/mocha.yml"; # theme - cattppuccin mocha
|
||||
skin_attr = builtins.fromJSON (builtins.readFile
|
||||
# replace 'base: &base "#1e1e2e"' with 'base: &base "default"'
|
||||
# to make fg/bg color transparent. "default" means transparent in k9s skin.
|
||||
(pkgs.runCommandNoCC "get-skin-json" {} ''
|
||||
cat ${skin_file} \
|
||||
| sed -E 's@(base: &base ).+@\1 "default"@g' \
|
||||
| ${pkgs.yj}/bin/yj > $out
|
||||
'')
|
||||
);
|
||||
in
|
||||
skin_attr;
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,15 +1,3 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
../server
|
||||
|
||||
./cloud
|
||||
./container
|
||||
./neovim
|
||||
./terminal
|
||||
|
||||
./development.nix
|
||||
./helix.nix
|
||||
./media.nix
|
||||
./shell.nix
|
||||
];
|
||||
{mylib, ...}: {
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
|
||||
@@ -8,46 +8,71 @@
|
||||
# Basic settings for development environment
|
||||
#
|
||||
# Please avoid to install language specific packages here(globally),
|
||||
# instead, install them independently using dev-templates:
|
||||
# https://github.com/the-nix-way/dev-templates
|
||||
# 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; [
|
||||
pkgs-unstable.devbox
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
(python3.withPackages (
|
||||
ps:
|
||||
with ps; [
|
||||
ipython
|
||||
pandas
|
||||
requests
|
||||
pyquery
|
||||
pyyaml
|
||||
]
|
||||
))
|
||||
|
||||
# DO NOT install build tools for C/C++ and others, set it per project by devShell instead
|
||||
gnumake # used by this repo, to simplify the deployment
|
||||
jdk17 # used to run some java based tools(.jar)
|
||||
cargo # rust package manager
|
||||
go
|
||||
jdk17
|
||||
guile # scheme language
|
||||
|
||||
# scheme related
|
||||
guile
|
||||
# db related
|
||||
dbeaver
|
||||
mycli
|
||||
pgcli
|
||||
mongosh
|
||||
sqlite
|
||||
|
||||
# python
|
||||
(python311.withPackages (ps:
|
||||
with ps; [
|
||||
ipython
|
||||
pandas
|
||||
requests
|
||||
pyquery
|
||||
pyyaml
|
||||
]))
|
||||
# embedded development
|
||||
minicom
|
||||
|
||||
# db related
|
||||
dbeaver
|
||||
mycli
|
||||
pgcli
|
||||
mongosh
|
||||
sqlite
|
||||
# ai related
|
||||
python311Packages.huggingface-hub # huggingface-cli
|
||||
|
||||
# embedded development
|
||||
minicom
|
||||
# misc
|
||||
pkgs-unstable.devbox
|
||||
glow # markdown previewer
|
||||
fzf
|
||||
gdu # disk usage analyzer, required by AstroNvim
|
||||
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
|
||||
bfg-repo-cleaner # remove large files from git history
|
||||
k6 # load testing tool
|
||||
protobuf # protocol buffer compiler
|
||||
]
|
||||
++ (
|
||||
if pkgs.stdenv.isLinux
|
||||
then [
|
||||
# Automatically trims your branches whose tracking remote refs are merged or gone
|
||||
# It's really useful when you work on a project for a long time.
|
||||
git-trim
|
||||
|
||||
# other tools
|
||||
bfg-repo-cleaner # remove large files from git history
|
||||
k6 # load testing tool
|
||||
protobuf # protocol buffer compiler
|
||||
];
|
||||
# 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 = {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
{ pkgs, catppuccin-helix, ... }:
|
||||
|
||||
{
|
||||
pkgs,
|
||||
nur-ryan4yin,
|
||||
...
|
||||
}: {
|
||||
# https://github.com/catppuccin/helix
|
||||
xdg.configFile."helix/themes".source = "${catppuccin-helix}/themes/default";
|
||||
xdg.configFile."helix/themes".source = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-helix}/themes/default";
|
||||
|
||||
programs.helix = {
|
||||
enable = true;
|
||||
@@ -22,10 +24,12 @@
|
||||
indent-guides.render = true;
|
||||
};
|
||||
keys.normal = {
|
||||
space.space = "file_picker";
|
||||
space.w = ":w";
|
||||
space.q = ":q";
|
||||
esc = [ "collapse_selection" "keep_primary_selection" ];
|
||||
space = {
|
||||
space = "file_picker";
|
||||
w = ":w";
|
||||
q = ":q";
|
||||
};
|
||||
esc = ["collapse_selection" "keep_primary_selection"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -5,9 +5,9 @@ return {
|
||||
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
|
||||
spell = false, -- Spell checking
|
||||
swapfile = false, -- Swapfile
|
||||
smartindent = false, -- fix https://github.com/ryan4yin/nix-config/issues/4
|
||||
},
|
||||
},
|
||||
|
||||
@@ -17,14 +17,13 @@ return {
|
||||
{ import = "astrocommunity.colorscheme.catppuccin" },
|
||||
-- Highly experimental plugin that completely replaces
|
||||
-- the UI for messages, cmdline and the popupmenu.
|
||||
{ import = "astrocommunity.utility.noice-nvim" },
|
||||
-- { 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.auto-save-nvim" },
|
||||
{ import = "astrocommunity.editing-support.todo-comments-nvim" },
|
||||
-- Language Support
|
||||
---- Frontend & NodeJS
|
||||
@@ -57,7 +56,7 @@ return {
|
||||
-- https://github.com/echasnovski/mini.ai
|
||||
{ import = "astrocommunity.motion.mini-ai" },
|
||||
{ import = "astrocommunity.motion.flash-nvim" },
|
||||
{ "folke/flash.nvim", vscode = false },
|
||||
{ "folke/flash.nvim", vscode = false },
|
||||
-- Lua implementation of CamelCaseMotion, with extra consideration of punctuation.
|
||||
{ import = "astrocommunity.motion.nvim-spider" },
|
||||
-- AI Assistant
|
||||
@@ -67,22 +66,31 @@ return {
|
||||
"zbirenbaum/copilot.lua",
|
||||
opts = function(_, opts)
|
||||
opts.filetypes = {
|
||||
yaml = true;
|
||||
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'},
|
||||
"0x00-ketsu/markdown-preview.nvim",
|
||||
ft = { "md", "markdown", "mkd", "mkdn", "mdwn", "mdown", "mdtxt", "mdtext", "rmd", "wiki" },
|
||||
config = function()
|
||||
require('markdown-preview').setup {
|
||||
require("markdown-preview").setup({
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the setup section below
|
||||
}
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -90,7 +98,7 @@ return {
|
||||
{
|
||||
"gbprod/yanky.nvim",
|
||||
opts = function()
|
||||
local mapping = require "yanky.telescope.mapping"
|
||||
local mapping = require("yanky.telescope.mapping")
|
||||
local mappings = mapping.get_defaults()
|
||||
mappings.i["<c-p>"] = nil
|
||||
return {
|
||||
@@ -104,23 +112,48 @@ return {
|
||||
}
|
||||
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" },
|
||||
{
|
||||
"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" },
|
||||
{ "<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" },
|
||||
},
|
||||
},
|
||||
|
||||
@@ -140,11 +173,12 @@ return {
|
||||
|
||||
-- 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' },
|
||||
"Wansmer/treesj",
|
||||
keys = { "<space>m", "<space>j", "<space>s" },
|
||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||
config = function()
|
||||
require('treesj').setup({--[[ your config ]]})
|
||||
require("treesj").setup({ --[[ your config ]]
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
@@ -154,31 +188,31 @@ return {
|
||||
opts = {
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = true, -- visible by default
|
||||
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"}
|
||||
}
|
||||
{ "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"},
|
||||
}
|
||||
{ "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
},
|
||||
|
||||
-- full signature help, docs and completion for the nvim lua API.
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
{ "folke/neodev.nvim", opts = {} },
|
||||
|
||||
{ "RRethy/vim-illuminate", config = function() end },
|
||||
|
||||
@@ -186,14 +220,14 @@ return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
local utils = require "astronvim.utils";
|
||||
local utils = require("astronvim.utils")
|
||||
opts.incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>", -- Ctrl + Space
|
||||
init_selection = "<C-space>", -- Ctrl + Space
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = "<A-space>", -- Alt + Space
|
||||
node_decremental = "<bs>", -- Backspace
|
||||
scope_incremental = "<A-space>", -- Alt + Space
|
||||
node_decremental = "<bs>", -- Backspace
|
||||
},
|
||||
}
|
||||
opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, {
|
||||
@@ -213,14 +247,14 @@ return {
|
||||
|
||||
-- implementation/definition preview
|
||||
{
|
||||
'rmagatti/goto-preview',
|
||||
"rmagatti/goto-preview",
|
||||
config = function()
|
||||
require('goto-preview').setup {}
|
||||
end
|
||||
require("goto-preview").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Undo tree
|
||||
{ "debugloop/telescope-undo.nvim", },
|
||||
{ "debugloop/telescope-undo.nvim" },
|
||||
|
||||
-- Install lsp, formmatter and others via home manager instead of Mason.nvim
|
||||
-- LSP installations
|
||||
@@ -245,7 +279,7 @@ return {
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
opts = function(_, opts)
|
||||
local null_ls = require "null-ls"
|
||||
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
|
||||
@@ -258,34 +292,34 @@ return {
|
||||
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.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.
|
||||
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.
|
||||
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.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
|
||||
formatting.nginx_beautifier, -- Nginx formatter
|
||||
null_ls.builtins.formatting.verible_verilog_format, -- Verilog formatter
|
||||
})
|
||||
end
|
||||
@@ -302,8 +336,9 @@ return {
|
||||
},
|
||||
|
||||
{
|
||||
'nvim-telescope/telescope.nvim', branch = '0.1.x',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
"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
|
||||
@@ -322,7 +357,9 @@ return {
|
||||
|
||||
local new_maker = function(filepath, bufnr, opts)
|
||||
opts = opts or {}
|
||||
if opts.use_ft_detect == nil then opts.use_ft_detect = true end
|
||||
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)
|
||||
@@ -330,7 +367,9 @@ return {
|
||||
-- 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 not stat then
|
||||
return
|
||||
end
|
||||
if stat.size > filesize_threshold then
|
||||
return
|
||||
else
|
||||
@@ -339,13 +378,13 @@ return {
|
||||
end)
|
||||
end
|
||||
|
||||
require("telescope").setup {
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
buffer_previewer_maker = new_maker,
|
||||
}
|
||||
}
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
-- Configure require("lazy").setup() options
|
||||
@@ -354,7 +393,7 @@ return {
|
||||
performance = {
|
||||
rtp = {
|
||||
-- customize default disabled vim plugins
|
||||
disabled_plugins = { };
|
||||
disabled_plugins = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -373,36 +412,36 @@ return {
|
||||
-- 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
|
||||
"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
|
||||
"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
|
||||
"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
|
||||
"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
|
||||
"bashls", -- bash
|
||||
"cmake", -- cmake language server
|
||||
"clangd", -- c/c++
|
||||
"dockerls", -- dockerfile
|
||||
"jsonnet_ls", -- jsonnet language server
|
||||
"terraformls", -- terraform hcl
|
||||
},
|
||||
formatting = {
|
||||
disabled = {},
|
||||
|
||||
@@ -17,7 +17,12 @@ return {
|
||||
["<leader>bn"] = { "<cmd>tabnew<cr>", desc = "New tab" },
|
||||
-- quick save
|
||||
["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
|
||||
["<leader>tp"] = { function() utils.toggle_term_cmd("ipython") end, desc = "ToggleTerm python" },
|
||||
|
||||
-- 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" },
|
||||
|
||||
@@ -11,7 +11,10 @@
|
||||
{
|
||||
xdg.configFile = {
|
||||
# astronvim's config
|
||||
"nvim".source = astronvim;
|
||||
"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
|
||||
@@ -27,114 +30,131 @@
|
||||
programs = {
|
||||
neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
|
||||
viAlias = false;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
withPython3 = true;
|
||||
withNodeJs = true;
|
||||
extraPackages = with pkgs; [];
|
||||
|
||||
# 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
|
||||
# ];
|
||||
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
|
||||
]
|
||||
);
|
||||
};
|
||||
};
|
||||
home = {
|
||||
packages = with pkgs;
|
||||
[
|
||||
#-- c/c++
|
||||
cmake
|
||||
cmake-language-server
|
||||
gnumake
|
||||
checkmake
|
||||
gcc # c/c++ compiler, required by nvim-treesitter!
|
||||
llvmPackages.clang-unwrapped # c/c++ tools with clang-tools such as clangd
|
||||
gdb
|
||||
# lldb # TODO - fix python3.11's package conflict - six.py
|
||||
|
||||
#-- python
|
||||
nodePackages.pyright # python language server
|
||||
python311Packages.black # python formatter
|
||||
python311Packages.ruff-lsp
|
||||
|
||||
#-- 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
|
||||
|
||||
#-- lua
|
||||
stylua
|
||||
lua-language-server
|
||||
|
||||
#-- bash
|
||||
nodePackages.bash-language-server
|
||||
shellcheck
|
||||
shfmt
|
||||
|
||||
#-- javascript/typescript --#
|
||||
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
|
||||
|
||||
#-- 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
|
||||
]
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ nushell-scripts, ...}: {
|
||||
{nushell-scripts, ...}: {
|
||||
programs.bash = {
|
||||
# load the alias file for work
|
||||
bashrcExtra = ''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{pkgs, ...}: {
|
||||
_: {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
|
||||
@@ -23,13 +23,6 @@
|
||||
# required to prevent sending default identity files first.
|
||||
IdentitiesOnly yes
|
||||
|
||||
Host github.com
|
||||
# github is controlled by gluttony~
|
||||
IdentityFile ~/.ssh/gluttony
|
||||
# Specifies that ssh should only use the identity file explicitly configured above
|
||||
# required to prevent sending default identity files first.
|
||||
IdentitiesOnly yes
|
||||
|
||||
Host gtr5
|
||||
HostName 192.168.5.172
|
||||
Port 22
|
||||
@@ -5,3 +5,57 @@
|
||||
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
|
||||
```
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{pkgs, catppuccin-alacritty, ...}:
|
||||
{
|
||||
pkgs,
|
||||
nur-ryan4yin,
|
||||
...
|
||||
}:
|
||||
###########################################################
|
||||
#
|
||||
# Alacritty Configuration
|
||||
@@ -20,7 +24,7 @@
|
||||
#
|
||||
###########################################################
|
||||
{
|
||||
xdg.configFile."alacritty/theme_catppuccin.yml".source = "${catppuccin-alacritty}/catppuccin-mocha.yml";
|
||||
xdg.configFile."alacritty/theme_catppuccin.yml".source = "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-alacritty}/catppuccin-mocha.yml";
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
};
|
||||
@@ -83,14 +87,22 @@
|
||||
# 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
|
||||
shell: # force nushell as default shell on macOS
|
||||
program: /run/current-system/sw/bin/nu
|
||||
# Point size
|
||||
size: 14
|
||||
''
|
||||
else ''
|
||||
# holder identation
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./alacritty.nix
|
||||
./kitty.nix
|
||||
./wezterm.nix
|
||||
];
|
||||
{mylib, ...}: {
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
|
||||
@@ -47,22 +47,18 @@
|
||||
"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
|
||||
}
|
||||
// (
|
||||
if pkgs.stdenv.isDarwin
|
||||
then {
|
||||
# macOS specific settings, force kitty to use nushell as default shell
|
||||
shell = "/run/current-system/sw/bin/nu";
|
||||
}
|
||||
else {}
|
||||
);
|
||||
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"];
|
||||
|
||||
@@ -10,85 +10,86 @@
|
||||
# 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'
|
||||
in ''
|
||||
-- Pull in the wezterm API
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
-- This table will hold the configuration.
|
||||
local config = {}
|
||||
-- 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()
|
||||
-- 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-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)
|
||||
|
||||
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",
|
||||
|
||||
-- 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"
|
||||
}
|
||||
|
||||
-- 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.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}
|
||||
|
||||
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',
|
||||
},
|
||||
}
|
||||
-- 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' }
|
||||
|
||||
config.font_size = ${fontsize}
|
||||
''
|
||||
+ (
|
||||
if pkgs.stdenv.isDarwin
|
||||
then ''
|
||||
-- Spawn a fish shell in login mod
|
||||
config.default_prog = { '/run/current-system/sw/bin/nu', '-l' }
|
||||
''
|
||||
else ""
|
||||
)
|
||||
+ ''
|
||||
return config
|
||||
'';
|
||||
return config
|
||||
'';
|
||||
}
|
||||
// (
|
||||
if pkgs.stdenv.isDarwin
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
{...}: {
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
bashrcExtra = ''
|
||||
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
|
||||
'';
|
||||
|
||||
shellAliases = {
|
||||
k = "kubectl";
|
||||
|
||||
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
{ catppuccin-bat, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
nur-ryan4yin,
|
||||
...
|
||||
}: {
|
||||
# a cat(1) clone with syntax highlighting and Git integration.
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
@@ -9,7 +13,7 @@
|
||||
themes = {
|
||||
# https://raw.githubusercontent.com/catppuccin/bat/main/Catppuccin-mocha.tmTheme
|
||||
catppuccin-mocha = {
|
||||
src = catppuccin-bat;
|
||||
src = nur-ryan4yin.packages.${pkgs.system}.catppuccin-bat;
|
||||
file = "Catppuccin-mocha.tmTheme";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
{ catppuccin-btop, ... }:
|
||||
|
||||
{
|
||||
pkgs,
|
||||
nur-ryan4yin,
|
||||
...
|
||||
}: {
|
||||
# https://github.com/catppuccin/btop/blob/main/themes/catppuccin_mocha.theme
|
||||
home.file.".config/btop/themes".source = "${catppuccin-btop}/themes";
|
||||
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
|
||||
color_theme = "catppuccin_mocha";
|
||||
theme_background = false; # make btop transparent
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -19,15 +19,14 @@
|
||||
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
|
||||
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
|
||||
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
|
||||
@@ -58,18 +57,11 @@
|
||||
];
|
||||
|
||||
programs = {
|
||||
# modern vim
|
||||
neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
|
||||
# A modern replacement for ‘ls’
|
||||
# useful in bash/zsh prompt, not in nushell.
|
||||
eza = {
|
||||
enable = true;
|
||||
enableAliases = true;
|
||||
enableAliases = false; # do not enable aliases in nushell!
|
||||
git = true;
|
||||
icons = true;
|
||||
};
|
||||
|
||||
@@ -1,14 +1,3 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./nushell
|
||||
./tmux
|
||||
./zellij
|
||||
|
||||
./bash.nix
|
||||
./bat.nix
|
||||
./btop.nix
|
||||
./core.nix
|
||||
./git.nix
|
||||
./starship.nix
|
||||
];
|
||||
{mylib, ...}: {
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
|
||||
userfullname,
|
||||
useremail,
|
||||
...
|
||||
@@ -12,7 +11,7 @@
|
||||
#
|
||||
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
|
||||
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
||||
rm -f ~/.gitconfig
|
||||
rm -f ${config.home.homeDirectory}/.gitconfig
|
||||
'';
|
||||
|
||||
home.packages = with pkgs; [
|
||||
@@ -76,15 +75,15 @@
|
||||
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>`
|
||||
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`
|
||||
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
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
{ config, ...}: {
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
configFile.source = ./config.nu;
|
||||
|
||||
extraConfig = ''
|
||||
$env.PATH = ([
|
||||
"${config.home.homeDirectory}/bin"
|
||||
"${config.home.homeDirectory}/.local/bin"
|
||||
"${config.home.homeDirectory}/go/bin"
|
||||
|
||||
($env.PATH | split row (char esep))
|
||||
] | flatten)
|
||||
'';
|
||||
|
||||
# home-manager will merge the cotent in `environmentVariables` with the `envFile.source`
|
||||
# but basically, I set all environment variables via the shell-independent way, so I don't need to use those two options
|
||||
#
|
||||
# envFile.source = ./env.nu;
|
||||
# environmentVariables = { FOO="bar"; };
|
||||
|
||||
shellAliases = {
|
||||
k = "kubectl";
|
||||
|
||||
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,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"
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
{ catppuccin-starship, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
nur-ryan4yin,
|
||||
...
|
||||
}: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
|
||||
@@ -6,22 +10,24 @@
|
||||
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 = "🅶 ️";
|
||||
};
|
||||
settings =
|
||||
{
|
||||
character = {
|
||||
success_symbol = "[›](bold green)";
|
||||
error_symbol = "[›](bold red)";
|
||||
};
|
||||
aws = {
|
||||
symbol = "🅰 ";
|
||||
};
|
||||
gcloud = {
|
||||
# do not show the account/project's info
|
||||
# to avoid the leak of sensitive information when sharing the terminal
|
||||
format = "on [$symbol$active(\($region\))]($style) ";
|
||||
symbol = "🅶 ️";
|
||||
};
|
||||
|
||||
palette = "catppuccin_mocha";
|
||||
} // builtins.fromTOML (builtins.readFile "${catppuccin-starship}/palettes/mocha.toml");
|
||||
palette = "catppuccin_mocha";
|
||||
}
|
||||
// builtins.fromTOML (builtins.readFile "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-starship}/palettes/mocha.toml");
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
{pkgs, ...}: let
|
||||
buildTmuxPlugin = pkgs.tmuxPlugins.mkTmuxPlugin;
|
||||
in {
|
||||
draculaTheme = buildTmuxPlugin {
|
||||
pluginName = "dracula";
|
||||
version = "v2.2.0";
|
||||
src = builtins.fetchTarball {
|
||||
name = "dracula-tmux-v2.2.0";
|
||||
url = "https://github.com/dracula/tmux/archive/refs/tags/v2.2.0.tar.gz";
|
||||
sha256 = "sha256:0v2k994yy4xx2iw8qxg7qphw46gq2qmg496i3a3h9b6jgwxqm7zn";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,4 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
plugins = pkgs.tmuxPlugins // pkgs.callPackage ./custom-plugins.nix {};
|
||||
in {
|
||||
{pkgs, ...}: {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
shell = "${pkgs.nushell}/bin/nu";
|
||||
@@ -17,26 +11,33 @@ in {
|
||||
# tmux-sensible overwrites default tmux shortcuts, makes them more sane.
|
||||
sensibleOnTop = true;
|
||||
|
||||
# extraConfig = builtins.readFile ./tmux.conf;
|
||||
# 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
|
||||
terminal = "xterm-256color";
|
||||
|
||||
plugins = with plugins; [
|
||||
draculaTheme # theme
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
{
|
||||
# https://github.com/tmux-plugins/tmux-continuum
|
||||
# Continuous saving of tmux environment. Automatic restore when tmux is started.
|
||||
plugin = continuum;
|
||||
# theme
|
||||
# https://github.com/catppuccin/tmux
|
||||
plugin = catppuccin;
|
||||
extraConfig = ''
|
||||
set -g @continuum-save-interval '15'
|
||||
|
||||
# Option to display current status of tmux continuum in tmux status line.
|
||||
set -g status-right 'Continuum status: #{continuum_status}'
|
||||
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.
|
||||
@@ -47,11 +48,7 @@ in {
|
||||
# Restore Neovim sessions
|
||||
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
|
||||
}
|
||||
{
|
||||
# https://github.com/tmux-plugins/tmux-yank
|
||||
# Enables copying to system clipboard.
|
||||
plugin = yank;
|
||||
}
|
||||
|
||||
# set -g @plugin 'tmux-plugins/tmux-cpu'
|
||||
{
|
||||
plugin = cpu;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{...}: {
|
||||
_: {
|
||||
programs.zellij = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
home.file.".config/zellij/config.kdl".source = ./config.kdl;
|
||||
xdg.configFile."zellij/config.kdl".source = ./config.kdl;
|
||||
}
|
||||
|
||||
@@ -1,44 +1,3 @@
|
||||
{pkgs, ...}: {
|
||||
##########################################################################
|
||||
#
|
||||
# MacOS specific home configuration
|
||||
#
|
||||
##########################################################################
|
||||
programs.zsh = {
|
||||
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 = ''
|
||||
# a private key that is used during authentication will be added to ssh-agent if it is running
|
||||
AddKeysToAgent yes
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
{username, ...}: {
|
||||
home.homeDirectory = "/Users/${username}";
|
||||
}
|
||||
|
||||
@@ -1,32 +1,9 @@
|
||||
{ username, ... }: {
|
||||
imports = [
|
||||
../base/desktop
|
||||
|
||||
./proxychains
|
||||
|
||||
./core.nix
|
||||
./nushell.nix
|
||||
./rime-squirrel.nix
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home = {
|
||||
username = username;
|
||||
# set homeDirectory make build fail
|
||||
homeDirectory = "/Users/${username}";
|
||||
|
||||
# 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;
|
||||
{mylib, ...}: {
|
||||
imports =
|
||||
(mylib.scanPaths ./.)
|
||||
++ [
|
||||
../base/server
|
||||
../base/desktop
|
||||
../base/core.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
{config, ...}: {
|
||||
# nix-darwin do not set PATH for nushell! so we need to do it manually
|
||||
# this is a workaround to add nix's PATH to nushell
|
||||
programs.nushell.extraConfig = ''
|
||||
$env.PATH = ([
|
||||
"${config.home.homeDirectory}/bin"
|
||||
"${config.home.homeDirectory}/.local/bin"
|
||||
"${config.home.homeDirectory}/go/bin"
|
||||
"/usr/local/bin"
|
||||
"${config.home.homeDirectory}/.nix-profile/bin"
|
||||
"/etc/profiles/per-user/${config.home.username}/bin"
|
||||
"/run/current-system/sw/bin"
|
||||
"/nix/var/nix/profiles/default/bin"
|
||||
|
||||
($env.PATH | split row (char esep))
|
||||
] | flatten)
|
||||
'';
|
||||
}
|
||||
@@ -1,17 +1,11 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# remove existing rime data (squirrel)
|
||||
home.activation.removeExistingRimeData = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
|
||||
rm -rf "~/Library/Rime/build/flypy.prism.bin"
|
||||
'';
|
||||
|
||||
{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;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -11,3 +11,13 @@
|
||||
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.
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
{
|
||||
imports = [
|
||||
./shell.nix
|
||||
./system-tools.nix
|
||||
];
|
||||
{mylib, ...}: {
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
{config, nushell-scripts, ...}: let
|
||||
|
||||
{config, username, ...}: let
|
||||
d = config.xdg.dataHome;
|
||||
c = config.xdg.configHome;
|
||||
cache = config.xdg.cacheHome;
|
||||
in rec {
|
||||
# add environment variables
|
||||
systemd.user.sessionVariables = {
|
||||
|
||||
home.homeDirectory = "/home/${username}";
|
||||
|
||||
# environment variables that always set at login
|
||||
home.sessionVariables = {
|
||||
# clean up ~
|
||||
LESSHISTFILE = cache + "/less/history";
|
||||
LESSKEY = c + "/less/lesskey";
|
||||
@@ -17,13 +21,8 @@ in rec {
|
||||
|
||||
# set default applications
|
||||
BROWSER = "firefox";
|
||||
TERM = "xterm-256color";
|
||||
|
||||
# enable scrolling in git diff
|
||||
DELTA_PAGER = "less -R";
|
||||
|
||||
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
|
||||
};
|
||||
|
||||
home.sessionVariables = systemd.user.sessionVariables;
|
||||
}
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
{pkgs, ...}: {
|
||||
# Linux Only Packages, not available on Darwin
|
||||
home.packages = with pkgs; [
|
||||
# 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
|
||||
|
||||
# cloud tools that nix do not have cache for.
|
||||
terraform
|
||||
terraformer # generate terraform configs from existing cloud resources
|
||||
|
||||
nmon
|
||||
iotop
|
||||
iftop
|
||||
@@ -17,16 +9,11 @@
|
||||
libnotify
|
||||
wireguard-tools # manage wireguard vpn manually, via wg-quick
|
||||
|
||||
# need to run `conda-install` before using it
|
||||
# need to run `conda-shell` before using command `conda`
|
||||
# conda is not available for MacOS
|
||||
conda
|
||||
|
||||
# system call monitoring
|
||||
strace # system call monitoring
|
||||
ltrace # library call monitoring
|
||||
bpftrace # powerful tracing tool
|
||||
tcpdump # network sniffer
|
||||
tcpdump # network sniffer
|
||||
lsof # list open files
|
||||
|
||||
# system tools
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
{ username, ... }: {
|
||||
imports = [
|
||||
../base/desktop
|
||||
|
||||
./base
|
||||
./fcitx5
|
||||
./desktop
|
||||
|
||||
./hyprland
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home = {
|
||||
username = username;
|
||||
homeDirectory = "/home/${username}";
|
||||
|
||||
# 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;
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
{ username, ... }: {
|
||||
imports = [
|
||||
../base/desktop
|
||||
|
||||
./base
|
||||
./fcitx5
|
||||
./desktop
|
||||
|
||||
./i3
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home = {
|
||||
username = username;
|
||||
homeDirectory = "/home/${username}";
|
||||
|
||||
# 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;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
imports = [
|
||||
../base/server
|
||||
../base/desktop
|
||||
../base/core.nix
|
||||
|
||||
./base
|
||||
./desktop
|
||||
];
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
# creative
|
||||
# blender # 3d modeling
|
||||
blender # 3d modeling
|
||||
# gimp # image editing, I prefer using figma in browser instead of this one
|
||||
inkscape # vector graphics
|
||||
krita # digital painting
|
||||
@@ -22,7 +22,7 @@
|
||||
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` / ...
|
||||
nur-ryan4yin.packages.${pkgs.system}.gowin-eda-edu-ide # app: `gowin-env` => `gw_ide` / `gw_pack` / ...
|
||||
];
|
||||
|
||||
programs = {
|
||||
@@ -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,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
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -3,12 +3,16 @@
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
# If your themes for mouse cursor, icons or windows don’t 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 = {
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Classic";
|
||||
size = 24;
|
||||
gtk.enable = true;
|
||||
x11.enable = true;
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Ice";
|
||||
size = 24;
|
||||
};
|
||||
|
||||
# set dpi for 4k monitor
|
||||
@@ -27,8 +31,9 @@
|
||||
enable = true;
|
||||
|
||||
font = {
|
||||
name = "Roboto";
|
||||
package = pkgs.roboto;
|
||||
name = "Noto Sans";
|
||||
package = pkgs.noto-fonts;
|
||||
size = 11;
|
||||
};
|
||||
|
||||
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
|
||||
@@ -43,7 +48,7 @@
|
||||
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" ];
|
||||
accents = ["pink"];
|
||||
size = "compact";
|
||||
variant = "mocha";
|
||||
};
|
||||
@@ -18,7 +18,7 @@
|
||||
##############################################################################################
|
||||
with lib; let
|
||||
cfg = config.home.immutable-file;
|
||||
immutableFileOpts = {...}: {
|
||||
immutableFileOpts = _: {
|
||||
options = {
|
||||
src = mkOption {
|
||||
type = types.path;
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
catppuccin-cava,
|
||||
pkgs-unstable,
|
||||
nur-ryan4yin,
|
||||
...
|
||||
}:
|
||||
@@ -21,14 +21,14 @@
|
||||
vdpauinfo
|
||||
vulkan-tools
|
||||
glxinfo
|
||||
|
||||
nur-ryan4yin.packages.${pkgs.system}.yazi # terminal file manager
|
||||
];
|
||||
|
||||
# https://github.com/catppuccin/cava
|
||||
home.file.".config/cava/config".text = ''
|
||||
# custom cava config
|
||||
'' + builtins.readFile "${catppuccin-cava}/mocha.cava";
|
||||
xdg.configFile."cava/config".text =
|
||||
''
|
||||
# custom cava config
|
||||
''
|
||||
+ builtins.readFile "${nur-ryan4yin.packages.${pkgs.system}.catppuccin-cava}/mocha.cava";
|
||||
|
||||
programs = {
|
||||
mpv = {
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -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()
|
||||
@@ -12,9 +12,14 @@
|
||||
xdg-user-dirs
|
||||
];
|
||||
|
||||
xdg.configFile."mimeapps.list".force = true;
|
||||
xdg = {
|
||||
enable = true;
|
||||
cacheHome = config.home.homeDirectory + "/.local/cache";
|
||||
|
||||
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:
|
||||
@@ -51,7 +56,7 @@
|
||||
"x-scheme-handler/unknown" = browser;
|
||||
|
||||
"x-scheme-handler/discord" = ["discord.desktop"];
|
||||
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
|
||||
"x-scheme-handler/tg" = ["org.telegram.desktop.desktop "];
|
||||
|
||||
"audio/*" = ["mpv.desktop"];
|
||||
"video/*" = ["mpv.dekstop"];
|
||||
@@ -62,10 +67,9 @@
|
||||
"image/webp" = ["imv.desktop"];
|
||||
};
|
||||
|
||||
associations.removed =
|
||||
{
|
||||
# ......
|
||||
};
|
||||
associations.removed = {
|
||||
# ......
|
||||
};
|
||||
};
|
||||
|
||||
userDirs = {
|
||||
@@ -1,39 +1,3 @@
|
||||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./creative.nix
|
||||
./gtk.nix
|
||||
./immutable-file.nix
|
||||
./media.nix
|
||||
./ssh.nix
|
||||
./wallpaper.nix
|
||||
./xdg.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# GUI apps
|
||||
insomnia # REST client
|
||||
wireshark # network analyzer
|
||||
|
||||
# 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
|
||||
mitmproxy # http/https proxy tool
|
||||
];
|
||||
|
||||
# GitHub CLI tool
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
};
|
||||
{mylib, ...}: {
|
||||
imports = mylib.scanPaths ./.;
|
||||
}
|
||||
|
||||
@@ -1,21 +1,3 @@
|
||||
## Hyprland configuration file
|
||||
|
||||
# color-scheme: cappuccin-mocha
|
||||
source=~/.config/hypr/themes/mocha.conf
|
||||
|
||||
env = _JAVA_AWT_WM_NONREPARENTING,1
|
||||
env = QT_WAYLAND_DISABLE_WINDOWDECORATION,1
|
||||
# fix https://github.com/hyprwm/Hyprland/issues/1520
|
||||
env = WLR_NO_HARDWARE_CURSORS,1
|
||||
|
||||
#-- Output ----------------------------------------------------
|
||||
# Configure your Display resolution, offset, scale and Monitors here, use `hyprctl monitors` to get the info.
|
||||
|
||||
# format:
|
||||
# monitor=name,resolution,position,scale
|
||||
monitor=DP-2,3840x2160@144,0x0,1.6
|
||||
workspace=DP-2,1
|
||||
|
||||
#-- Input ----------------------------------------------------
|
||||
# Configure mouse and touchpad here.
|
||||
input {
|
||||
@@ -199,10 +181,9 @@ bind=SUPER,mouse_up,workspace,e-1
|
||||
#-- Startup ----------------------------------------------------
|
||||
exec-once=~/.config/hypr/scripts/startup
|
||||
|
||||
|
||||
#-- Fcitx5 input method ----------------------------------------------------
|
||||
# -- Fcitx5 input method
|
||||
windowrule=pseudo,fcitx # enable this will make fcitx5 works, but fcitx5-configtool will not work!
|
||||
exec-once=cp ~/.config/fcitx5/profile-bak ~/.config/fcitx5/profile # restore fcitx5 profile manged by nixos
|
||||
exec-once=cp ~/.config/fcitx5/profile-bak ~/.config/fcitx5/profile # restore fcitx5 profile managed by nixos
|
||||
exec-once=fcitx5 -d --replace # start fcitx5 daemon
|
||||
bind=ALT,E,exec,pkill fcitx5 -9;sleep 1;fcitx5 -d --replace; sleep 1;fcitx5-remote -r
|
||||
|
||||
@@ -211,14 +192,3 @@ windowrulev2 = rounding 0, xwayland:1, floating:1
|
||||
windowrulev2 = center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$
|
||||
windowrulev2 = size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$
|
||||
|
||||
# -- Fix input method in vscode
|
||||
exec-once = hyprctl setcursor "Bibata-Modern-Ice" 24
|
||||
# 效果是 wayland 原生窗口缩放完全正常
|
||||
# xwayland 窗口先渲染到 200% 再降到 hyprland config 里 monitor 设置的值,看上去和原生没啥区别
|
||||
# 相比较一开始的方案输入法字体大小也正确了.唯一有点问题的可能是 xwayland 窗口下的鼠标指针大小不对
|
||||
exec-once = xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2
|
||||
|
||||
exec-once = xrdb -merge ~/.Xresources
|
||||
# env = GDK_SCALE,2
|
||||
env = XCURSOR_SIZE,48
|
||||
env = XCURSOR_THEME,"Bibata-Modern-Ice"
|
||||
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
@@ -10,8 +10,9 @@ for _prs in "${_ps[@]}"; do
|
||||
fi
|
||||
done
|
||||
|
||||
# Set wallpaper
|
||||
swaybg --output '*' --mode fill --image ~/.config/wallpapers/default_wallpaper &
|
||||
# Set wallpaper via a wallpaper.service
|
||||
# it will by start by home-manager automatically, do not need to restart it here.
|
||||
# systemctl --user restart wallpaper.service
|
||||
|
||||
# Lauch notification daemon (mako)
|
||||
~/.config/hypr/scripts/notifications &
|
||||
@@ -5,6 +5,7 @@
|
||||
"modules-left": [
|
||||
"custom/launcher",
|
||||
"temperature",
|
||||
"backlight",
|
||||
"wlr/workspaces"
|
||||
],
|
||||
"modules-center": [
|
||||
@@ -13,11 +14,11 @@
|
||||
"modules-right": [
|
||||
"mpd",
|
||||
"pulseaudio",
|
||||
"backlight",
|
||||
"memory",
|
||||
"cpu",
|
||||
"network",
|
||||
"clock",
|
||||
"idle_inhibitor",
|
||||
"custom/powermenu",
|
||||
"tray"
|
||||
],
|
||||
@@ -50,7 +51,9 @@
|
||||
},
|
||||
"cpu": {
|
||||
"format": "\udb80\udf5b {usage}%",
|
||||
"interval": 1
|
||||
"interval": 1,
|
||||
"on-click-middle": "kitty btop",
|
||||
"on-click-right": "kitty btop"
|
||||
},
|
||||
"custom/launcher": {
|
||||
"format": "\uf313 ",
|
||||
@@ -122,8 +125,10 @@
|
||||
"format-linked": " {ifname} (No IP)",
|
||||
"format-disconnected": "睊 Disconnected",
|
||||
"format-disabled": "睊 Disabled",
|
||||
"format-alt": " {bandwidthUpBits} | {bandwidthDownBits}",
|
||||
"format-alt": " {bandwidthUpBytes} | {bandwidthDownBytes}",
|
||||
"tooltip-format": " {ifname} via {gwaddr}",
|
||||
"on-click-middle": "nm-connection-editor",
|
||||
"on-click-right": "kitty nmtui"
|
||||
},
|
||||
"pulseaudio": {
|
||||
//"format": "{volume}% {icon} {format_source}",
|
||||
@@ -156,6 +161,20 @@
|
||||
"format": "\uf2c9 {temperatureC}\u00b0C",
|
||||
"tooltip": false
|
||||
},
|
||||
"backlight": {
|
||||
"format": "{icon} {percent}%",
|
||||
"format-icons": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
]
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 15,
|
||||
"spacing": 5
|
||||
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |