Compare commits

...

141 Commits

Author SHA1 Message Date
237a62ea8a feat: init quickshell 2025-07-13 22:17:13 +08:00
a63be876f7 chore: fmt 2025-07-13 13:11:23 +08:00
2b5a96bc20 chore: update secrets 2025-07-12 21:54:26 +08:00
02216bfa0c fix: imxyy-nix-x16 2025-07-12 21:54:05 +08:00
793dbac197 feat(imxyy-nix-x16): update secrets 2025-07-12 20:32:29 +08:00
c584091e60 feat: init imxyy-nix-x16 2025-07-12 19:52:42 +08:00
68b1765582 fix(tealdeer): auto update 2025-07-12 16:00:35 +08:00
8a169dbfa1 fix(open-webui): use stable 2025-07-11 20:43:58 +08:00
2c035ac47a fix: immich 2025-07-11 20:43:58 +08:00
5648ae6b31 feat: tealdeer (tldr) 2025-07-11 20:34:30 +08:00
c504274eca chore: drop cht.sh 2025-07-11 20:34:21 +08:00
bd192f0443 feat(imxyy-nix-server): immich 2025-07-11 18:30:02 +08:00
99e5362345 feat(jj): signing 2025-07-11 16:58:50 +08:00
35693c9782 feat(starship): use "jj root" to determine whether to show jj module 2025-07-11 15:40:59 +08:00
aba70d46a9 feat(starship): only show git status if not in a jj repo 2025-07-11 15:27:24 +08:00
be4de25d84 feat(zsh): starship prompt 2025-07-11 14:52:46 +08:00
2177549100 chore: update flake.lock 2025-07-11 14:52:35 +08:00
abdc2f5c6c feat(coding/langs): QML 2025-07-06 14:29:49 +08:00
99121f72c9 feat(style): use papirus icon 2025-07-06 14:29:34 +08:00
b460cb58ef refactor(pkgs): use haumea for automatic callPackage 2025-07-06 14:29:10 +08:00
32232d08db fix: add self back to wheel group 2025-07-05 11:25:38 +08:00
2d9c505ad7 feat(sing-box): use qjebbs/sing-box 2025-07-04 21:57:03 +08:00
667af5a5a6 refactor: overlay 2025-07-04 21:33:46 +08:00
e79ed0f643 feat(doas): add sudo wrapper 2025-07-04 21:32:35 +08:00
d0fcde133d feat: move to doas 2025-07-04 20:06:59 +08:00
b953e5b7ce chore: update flake.lock 2025-07-04 20:06:39 +08:00
c8f098f1a2 feat(sing-box): use PuerNya/sing-box/building for outbound_provider 2025-06-29 16:40:08 +08:00
e454e12d2f feat(kitty): do not use "-1" option 2025-06-29 15:16:30 +08:00
44a72b39e4 feat: use both sjtu mirrors 2025-06-29 15:16:30 +08:00
4af7226777 chore: update imxyy-nix password 2025-06-29 15:16:30 +08:00
28c59be2a7 feat(nvim): add leap.nvim 2025-06-29 15:16:30 +08:00
51b882f2c5 feat: add ~/.npm-global/bin to PATH 2025-06-29 15:16:30 +08:00
13b69ccc95 refactor: persist 2025-06-29 15:16:30 +08:00
be5fd3b9ff fix(wine): add to all.nix 2025-06-29 15:16:30 +08:00
20ddfb5ddd chore: drop trash and dooit 2025-06-29 15:16:30 +08:00
4d2949ab93 chore: drop cinny 2025-06-29 15:16:30 +08:00
e0faac096b feat: wechat 2025-06-29 15:16:30 +08:00
1c6708bad5 feat(wine): use bottles 2025-06-29 15:16:30 +08:00
a07742a206 feat(qq): use unstable 2025-06-29 15:16:30 +08:00
7bacc8ae06 feat: remote build for EFLKumo 2025-06-28 23:27:26 +08:00
f400aaf570 feat(tmux): manage by home-manager 2025-06-28 18:38:51 +08:00
dbd3195430 feat(imxyy-nix-server/virt): ignore unhandled MSR 2025-06-27 23:40:57 +08:00
d041f61c46 feat: update README.md 2025-06-27 23:22:24 +08:00
705f702535 feat: use nh (yet another nix helper) 2025-06-27 23:22:16 +08:00
8fe373eeb5 chore: drop useless github-cli-comp 2025-06-27 23:21:52 +08:00
64dd1077b6 feat: add jujutsu VCS 2025-06-27 23:21:29 +08:00
8fe95f071a chore: update flake.lock 2025-06-27 22:03:38 +08:00
bd21506f0d fix: do not mkForce substituters 2025-06-27 22:03:30 +08:00
c8c6a09684 feat(desktop): use NIXOS_OZONE_WL 2025-06-22 09:51:17 +08:00
0c679290c5 feat: zed-editor 2025-06-21 22:55:37 +08:00
4685f31aa1 feat(xwayland-satellite): use builtin fractional scaling 2025-06-21 22:55:20 +08:00
77b8578379 fix(niri): avoid double spawning xsettingsd 2025-06-21 13:03:46 +08:00
5bf4a22e8f feat(siyuan): v3.1.24 -> v.3.1.30 2025-06-21 11:38:35 +08:00
91257fbcf8 chore(matrix-synapse): use stable deu to the build failure of unstable 2025-06-21 11:36:42 +08:00
13cc8234e1 feat: move to umport for automatic module import 2025-06-21 11:30:35 +08:00
89aa6186f2 chore: remove unused nerd-fonts.jetbrains-mono 2025-06-21 10:42:11 +08:00
794593222c fix(niri): buggy clipboard in kitty (maybe?) 2025-06-21 10:37:24 +08:00
8c64e8e7b9 fix: emoji display 2025-06-21 10:36:55 +08:00
8348cd9a54 chore: update flake.lock 2025-06-20 21:55:51 +08:00
83772d34dd feat(niri): place-within-backdrop 2025-06-20 21:55:31 +08:00
5e5f2ed1bb chore(mpd): use stable due to the build failure of unstable 2025-06-20 21:55:03 +08:00
d7a3fc7a07 chore: drop waydroid 2025-06-20 21:53:34 +08:00
3c4bc5043e feat(imxyy-nix): use linux-cachyos 2025-06-20 21:53:20 +08:00
a2261cacd1 feat(imxyy-nix-server): use linux-cachyos 2025-06-17 08:16:52 +08:00
558faa058d chore: update flake.lock 2025-06-15 15:45:42 +08:00
9c547b6207 fix: persist zoxide database 2025-06-15 15:45:17 +08:00
2a4694b633 feat(zsh): move to official omz 2025-06-15 13:54:03 +08:00
2f170b9e08 fix(nvim): ident-blankline should be loaded earlier 2025-06-15 09:12:57 +08:00
b762cb91fe feat(nvim): tweak lazy.nvim 2025-06-15 09:10:35 +08:00
53e15c2324 chore(nvim): a lot
format, fix nvim-tree startup, update telescope, drop unused plugins
2025-06-14 19:47:08 +08:00
6a1889722c fix(nvim): diagnostic sign 2025-06-14 19:27:05 +08:00
ae231ba132 feat(nvim): tidy old config, improve startup time 2025-06-14 19:26:45 +08:00
feda825add chore: update secrets 2025-06-14 16:51:47 +08:00
f231663fe9 Merge branch 'master' of ssh://git.imxyy.top:2222/imxyy1soope1/nixos-dotfiles 2025-06-14 16:51:03 +08:00
ca45d3da81 chore(Makefile): use-remote-sudo -> sudo 2025-06-14 16:50:48 +08:00
985cd8aa9d fix(niri): fractional scaling
This works in latest unstable niri
2025-06-14 16:50:25 +08:00
1b6cf3b07f chore: update flake.lock 2025-06-14 16:49:53 +08:00
16cddf0335 chore(stylix): tidy 2025-06-14 13:55:26 +08:00
91a0e56ef1 chore: update secrets 2025-06-14 13:54:02 +08:00
e5b07a6fbe feat(niri): gnome-keyring 2025-06-08 09:58:48 +08:00
506ca711b5 feat: ttf-wps-fonts 2025-06-08 09:58:20 +08:00
0267058530 Merge branch 'master' of ssh://git.imxyy.top:2222/imxyy1soope1/nixos-dotfiles 2025-06-07 15:51:37 +08:00
06317b6c70 chore(headscale): drop magic dns 2025-06-07 15:51:25 +08:00
ad5e7aa5e7 fix(neovim): remove unecessary override 2025-06-07 15:50:28 +08:00
2cf0562cb6 fix(xwayland-satellite): fractional scaling 2025-06-07 14:31:44 +08:00
8c7b85fa12 chore: update flake.lock 2025-06-07 14:31:27 +08:00
cdb232a484 feat(make): nom 2025-06-07 12:52:32 +08:00
0f55da26e1 fix(bluetooth): A2DP profile not available on auto connect
not sure if it works
2025-06-07 11:59:06 +08:00
2fdf5aa8fe feat(browser): move to zen 2025-06-02 16:35:53 +08:00
2d85716642 Revert "chore: update flake.lock"
This reverts commit 4d36ddff56
since updated xwayland-satellite breaks fractional scaling.
2025-06-01 13:22:52 +08:00
117ada55c2 feat(niri): update bindings 2025-06-01 11:36:01 +08:00
87018a1c06 Merge branch 'master' of ssh://git.imxyy.top:2222/imxyy1soope1/nixos-dotfiles 2025-06-01 09:38:01 +08:00
4d36ddff56 chore: update flake.lock 2025-06-01 09:37:35 +08:00
c477dbeae6 feat(nvim): better outline icon 2025-05-31 15:32:57 +08:00
07890c4d9f feat(git): disable rebase on pull 2025-05-31 15:32:24 +08:00
2e2f77fffe chore: update secrets 2025-05-31 15:28:39 +08:00
ab3fbe30a9 fix: headscale & easytier server ip 2025-05-28 19:01:52 +08:00
7522628517 chore: update secrets 2025-05-27 10:21:06 +08:00
ffc74c1e6f chore: drop legacy proxy configuration 2025-05-27 10:20:42 +08:00
c45dadafa3 feat(imxyy-nix/ssh): remove elf-nix from authorized keys 2025-05-23 19:15:40 +08:00
27b7718048 chore: update secrets 2025-05-23 19:15:40 +08:00
33d0b7a694 fix(imxyy-nix-server/dns): fix DNS lookup timeout 2025-05-23 19:15:40 +08:00
80f0feed39 feat(imxyy-nix-server/ddns-go): fix command execution 2025-05-23 19:15:40 +08:00
6daffb4d5e fix(imxyy-nix-server/frp): server address 2025-05-23 19:15:40 +08:00
68e83817a5 feat(imxyy-nix-server/ssh): add imxyy-cloudwin to authorized keys 2025-05-23 19:15:40 +08:00
454c12ce90 fix(imxyy-nix-server/dns): DNS lookup timeout 2025-05-23 19:15:40 +08:00
7e4c48c3f1 chore: update flake.lock 2025-05-23 19:11:41 +08:00
990224174f feat(chromium): use KISS translator 2025-05-23 19:11:26 +08:00
dbbafc5140 fix: sddm autologin 2025-05-18 15:22:47 +08:00
dea4d8ed4c feat: 0517 update 2025-05-17 23:15:16 +08:00
3a12722913 chore: replace { ... } with _ 2025-05-10 19:07:06 +08:00
06c670bf30 chore: fmt 2025-05-10 18:22:21 +08:00
713f430b6d chore: update secrets 2025-05-10 18:22:10 +08:00
3ec4bdaa9b feat: update imxyy-hisense-pad ssh public key 2025-05-10 18:21:57 +08:00
50be5cf024 feat: update server kernel 2025-05-10 18:21:36 +08:00
d69b965651 feat(kitty): copy paste keybind 2025-05-10 13:54:24 +08:00
e2e8e35b0e chore: update flake.lock 2025-05-10 13:54:16 +08:00
64d4085b98 feat: nixd 2025-05-10 12:40:10 +08:00
e380732f90 fix(nvim): diagnostic sign 2025-05-10 12:38:35 +08:00
48ebcb7104 feat(nixpkgs): disable set NIX_PATH (use customized instead) 2025-05-10 12:38:35 +08:00
90dc945353 fix(wsl): nixpkgs hostPlatform 2025-05-08 09:16:42 +08:00
c9dab71e9b feat(git): check signature 2025-05-04 11:40:04 +08:00
c40b78db93 chore: update secrets 2025-05-04 10:59:49 +08:00
8e2fe9ba0b chore: flake 2025-05-04 10:59:34 +08:00
7c627d2a42 fix: wsl 2025-05-04 10:59:22 +08:00
a477e7095b feat: lazygit 2025-05-04 10:59:05 +08:00
27041ff1fa feat(nvim): switch virtual_lines 2025-05-04 10:58:47 +08:00
bf1539e914 fix: vscode 2025-05-04 10:58:16 +08:00
0a52c5f1b2 fix: impermanence permission 2025-05-04 10:58:06 +08:00
1a7112c21d chore: remove useless comments 2025-05-04 10:57:03 +08:00
515cfe3866 feat: disable tailscale 2025-05-04 10:56:42 +08:00
8949fbea6b feat: move to sddm 2025-05-04 10:56:31 +08:00
ba30d87ef4 Revert "feat: move to ly"
This reverts commit ece19eadb8.
2025-05-04 10:14:54 +08:00
ece19eadb8 feat: move to ly
move to ly DM in order to fix the annoying xdg-desktop-portal
2025-05-04 09:24:32 +08:00
a0164ce7c0 feat: git signing 2025-05-03 14:24:24 +08:00
36d63a667c feat: infuse 2025-05-03 14:13:53 +08:00
095d9ecb67 feat: swich to kitty 2025-05-03 09:56:23 +08:00
1ff4475a8f feat: 0501 update 2025-05-01 10:49:14 +08:00
dd010c6271 feat: 0425 update 2025-04-25 20:50:45 +08:00
2242e26ede refactor: what can I say 2025-04-19 12:42:19 +08:00
d34da2b672 chore: update flake lock 2025-04-18 22:30:01 +08:00
289 changed files with 17989 additions and 2998 deletions

View File

@@ -1,11 +1,13 @@
keys:
- &imxyy-nix age1jf5pg2x6ta8amj40xdy0stvcvrdlkwc2nrwtmkpymu0qclk0eg5qmm9kns
- &imxyy-nix-server age1hpgg6psejh4y6jcdd34wxuml75fnweqpe0kh8376yqsctsfn9qxs037kk6
- &imxyy-nix-x16 age1r0fv0tagxupfacv0aaxk5ss7sqvswv6kq8tk3x46ndqrj6f5afvqegahxq
- &imxyy-cloudwin age1tp7th3rrv3x0l6jl76n0hjqjp223w2y586pkgr0hcjwdm254jd5shkj6a8
creation_rules:
- path_regex: secrets/.*\.(yaml|toml|json|env|dae|txt)$
- path_regex: secrets/.*\.(yaml|toml|json|env|dae|txt|conf)$
key_groups:
- age:
- *imxyy-nix
- *imxyy-nix-server
- *imxyy-nix-x16
- *imxyy-cloudwin

View File

@@ -2,15 +2,19 @@ all: fmt switch
switch:
@echo "Rebuilding NixOS..."
@nixos-rebuild switch --flake . --use-remote-sudo
@nh os switch .
boot:
@echo "Rebuilding NixOS..."
@nixos-rebuild boot --flake . --use-remote-sudo
@nh os boot .
test:
@echo "Rebuilding NixOS..."
@nh os test .
vm:
@echo "Building NixOS VM..."
@nixos-rebuild build-vm --flake .
@nh os build-vm .
update:
@echo "Updating flakes..."
@@ -23,17 +27,17 @@ replpkgs:
@nix repl -f flake:nixpkgs
repl:
@nixos-rebuild repl --flake .
@nh os repl .
cleandry:
@echo "Listing all generations older than 15 days..."
@sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --dry-run --older-than 15d
@nix run home-manager#home-manager -- expire-generations -15days --dry-run
@nix profile wipe-history --profile ~/.local/state/nix/profiles/home-manager --dry-run --older-than 15d
clean:
@echo "Removing all generations older than 15 days..."
@sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 15d
@nix run home-manager#home-manager -- expire-generations -15days
@nix profile wipe-history --profile ~/.local/state/nix/profiles/home-manager --older-than 15d
gc:
@nix store gc --debug

54
README.md Normal file
View File

@@ -0,0 +1,54 @@
<h2 align="center">:snowflake: imxyy_soope_'s NixOS Config :snowflake:</h2>
> This configuration and READMEs in this repo borrows heavily from [ryan4yin/nix-config](https://github.com/ryan4yin/nix-config) and his
> [cookbook](https://github.com/ryan4yin/nixos-and-flakes-book). Many thanks to his spirit of sharing!
This repository is home to the nix code that builds my systems:
Currently, this repository contains the nix code that builds:
1. NixOS Desktop: NixOS with home-manager, niri, neovim, etc.
2. NixOS home server
3. NixOS WSL
See [./config/hosts](./config/hosts) for details of each host.
## Why NixOS & Flakes?
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 else can just use it
(if you really understand what you're copying/refering now).
As for Flakes, refer to
[Introduction to Flakes - NixOS & Nix Flakes Book](https://nixos-and-flakes.thiscute.world/nixos-with-flakes/introduction-to-flakes)
## Components
| | NixOS(Wayland) |
| ----------------------------- | :------------------------------------------------------ |
| **Window Manager** | Niri |
| **Terminal Emulator** | Alacritty & Kitty & Foot & Ghostty |
| **Bar** | Waybar |
| **Application Launcher** | wofi |
| **Notification Daemon** | SwayNotificationCenter |
| **Input method framework** | Fcitx5 |
| **Shell** | Zsh |
| **Netease Cloudmusic Player** | go-musicfox |
| **Media Player** | mpv |
| **Text Editor** | Neovim |
| **Fonts** | Noto Sans CJK & Jetbrains Mono & Nerd Font |
| **Filesystem** | btrfs subvolumes, clean '/' every boot for impermanence |
And more...
## Folder Structure
- `modules/` - custom NixOS modules
- `config/base.nix` - generic configs
- `config/hosts/<name>/` - hosts-specific configs
- `lib/` - custom nix library
- `pkgs/` - custom packages
- `overlays/` - nixpkgs overlays
- `vars.nix` - my variables
- `secrets/` - secrets managed by sops-nix. see [./secrets](./secrets) for details
- `flake.nix` - flake entry

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -1,13 +1,18 @@
{ lib, hostname, ... }:
{ config, hostname, ... }:
{
# I prefer this to the default issue text
# ported from ArchLinux IIRC
environment.etc.issue.text = "\\e{lightcyan}\\S\\e{reset} Login (\\l)\n\n";
networking.hostName = hostname;
# don't change this unless you know what you are doing!
# for further information, see wiki.nixos.org
system.stateVersion = "24.11";
systemd.services."systemd-machine-id-commit".enable = lib.mkForce false;
# disable this since we already have machine-id persisted
systemd.services."systemd-machine-id-commit".enable = !config.my.persist.enable;
my = {
home = {
# Nicely reload system units when changing configs
# nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
home.stateVersion = "24.11";
};
@@ -17,10 +22,17 @@
nixosDirs = [
"/root"
"/var"
"/etc/ssh"
];
nixosFiles = [
"/etc/machine-id"
];
homeDirs = [
{
directory = ".ssh";
mode = "0700";
}
];
};
};
}

View File

@@ -1,9 +1,10 @@
{ ... }:
{ pkgs, ... }:
{
services.open-webui = {
enable = true;
host = "127.0.0.1";
port = 8089;
package = pkgs.stable.open-webui;
};
services.caddy.virtualHosts."ai.imxyy.top" = {
extraConfig = ''

View File

@@ -0,0 +1,47 @@
{
config,
lib,
pkgs,
sopsRoot,
...
}:
{
sops.secrets.et-imxyy-nix-server-nixremote = {
sopsFile = sopsRoot + /et-imxyy-nix-server-nixremote.toml;
format = "binary";
};
environment.systemPackages = [ pkgs.easytier ];
systemd.services."easytier-nixremote" = {
enable = true;
script = "${pkgs.easytier}/bin/easytier-core -c ${config.sops.secrets.et-imxyy-nix-server-nixremote.path}";
serviceConfig = {
Restart = lib.mkOverride 500 "always";
RestartMaxDelaySec = lib.mkOverride 500 "1m";
RestartSec = lib.mkOverride 500 "100ms";
RestartSteps = lib.mkOverride 500 9;
User = "root";
};
wantedBy = [ "multi-user.target" ];
after = [
"network.target"
"sops-nix.service"
];
};
users.groups.nixremote = { };
users.users.nixremote = {
isSystemUser = true;
description = "nix remote build user";
group = "nixremote";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEFLUkyeaK8ZPPZdVNEmtx8zvoxi7xqS2Z6oxRBuUPO imxyy@imxyy-nix"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBWOy0QmAyxENg/O5m3cus8U3c9jCLioivwcWsh5/a82 imxyy-hisense-pad"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK8pivvE8PMtsOxmccfNhH/4KehDKhBfUfJbQZxo/SZT imxyy-ace5"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKALTBn/QSGcSPgMg0ViSazFcaA0+nEF05EJpjbsI6dE imxyy_soope_@imxyy-cloudwin"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIENauvvhVMLsUwH9cPYsvnOg7VCL3a4yEiKm8I524TE efl@efl-nix"
];
};
nix.settings.trusted-users = [
"nixremote"
];
}

View File

@@ -1,4 +1,3 @@
{ ... }:
{
services.caddy = {
enable = true;

View File

@@ -1,4 +1,3 @@
{ ... }:
{
imports = [
./nixos.nix
@@ -22,5 +21,7 @@
./note.nix
./matrix.nix
./minio.nix
./build.nix
./immich.nix
];
}

View File

@@ -1,4 +1,3 @@
{ ... }:
{
services.caddy.virtualHosts."git.imxyy.top" = {
extraConfig = ''

View File

@@ -4,7 +4,9 @@
pkgs,
...
}:
let
btrfs = "/dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0";
in
{
boot.initrd.availableKernelModules = [
"xhci_pci"
@@ -16,20 +18,22 @@
];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ];
boot.kernelPackages = lib.mkForce pkgs.stable.linuxKernel.packages.linux_zen;
boot.kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos;
services.scx.enable = true;
boot.extraModulePackages = [ ];
boot.tmp.useTmpfs = true;
boot.supportedFilesystems = [ "zfs" ];
boot.zfs = {
extraPools = [ "data" ];
forceImportRoot = false;
package = pkgs.zfs_cachyos;
};
services.zfs.autoScrub.enable = true;
services.btrfs.autoScrub.enable = true;
networking.hostId = "10ca95b4";
fileSystems."/" = {
device = "/dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0";
device = btrfs;
fsType = "btrfs";
options = [
"compress=zstd"
@@ -38,7 +42,7 @@
};
fileSystems."/nix" = {
device = "/dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0";
device = btrfs;
fsType = "btrfs";
options = [
"compress=zstd"
@@ -46,8 +50,9 @@
];
};
fileSystems."/persistent" = {
device = "/dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0";
my.persist.location = "/nix/persist";
fileSystems."/nix/persist" = {
device = btrfs;
fsType = "btrfs";
options = [
"compress=zstd"
@@ -58,7 +63,7 @@
boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp
mount /dev/disk/by-uuid/c7889c5c-c5b6-4e3c-9645-dfd49c2e84d0 /btrfs_tmp
mount ${btrfs} /btrfs_tmp
mkdir -p /btrfs_tmp/old_roots
if [[ -e /btrfs_tmp/root ]]; then
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
@@ -84,6 +89,12 @@
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/32AA-2998";
fsType = "vfat";
options = [
"uid=0"
"gid=0"
"fmask=0077"
"dmask=0077"
];
};
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking

View File

@@ -1,37 +1,22 @@
{ lib, ... }:
{ ... }:
{
my.home = {
programs.zsh = {
shellAliases = {
proxy_on = lib.mkForce "export http_proxy=http://127.0.0.1:7890 https_proxy=http://127.0.0.1:7890 all_proxy=socks://127.0.0.1:7891";
};
sessionVariables = {
no_proxy = "192.168.3.0/24";
};
};
};
my = {
cmd.all.enable = true;
cli.all.enable = true;
coding.editor.neovim.enable = true;
coding.misc.enable = true;
coding.langs.lua.enable = true;
coding.langs.rust.enable = true;
persist = {
enable = true;
homeDirs = [
"workspace"
"Virt"
".ssh"
".local/state"
".local/share"
".local/share/nvim"
".cache"
".ollama"
];
nixosDirs = [
"/etc/ssh"
];
};
};
}

View File

@@ -1,4 +1,3 @@
{ ... }:
{
virtualisation.oci-containers = {
containers = {

View File

@@ -0,0 +1,17 @@
{ ... }:
{
services.immich = {
enable = true;
host = "127.0.0.1";
port = 8096;
mediaLocation = "/mnt/nas/immich";
group = "nextcloud";
};
services.caddy.virtualHosts."immich.imxyy.top" = {
extraConfig = ''
reverse_proxy :8096 {
header_up X-Real-IP {remote_host}
}
'';
};
}

View File

@@ -1,4 +1,3 @@
{ ... }:
{
services.matrix-synapse = {
enable = true;

View File

@@ -43,7 +43,7 @@
interface = "mac0";
};
nameservers = [
"192.168.3.1"
"192.168.3.2"
];
firewall.enable = false;
@@ -129,13 +129,15 @@
};
users.users.root.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEFLUkyeaK8ZPPZdVNEmtx8zvoxi7xqS2Z6oxRBuUPO imxyy@imxyy-nix"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqza/3b6a9JxsNxytHF5GPe4gQhbLrKxAPyZ0GpfVQt imxyy-hisense-pad"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBWOy0QmAyxENg/O5m3cus8U3c9jCLioivwcWsh5/a82 imxyy-hisense-pad"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK8pivvE8PMtsOxmccfNhH/4KehDKhBfUfJbQZxo/SZT imxyy-ace5"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKALTBn/QSGcSPgMg0ViSazFcaA0+nEF05EJpjbsI6dE imxyy_soope_@imxyy-cloudwin"
];
users.users.${username}.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEFLUkyeaK8ZPPZdVNEmtx8zvoxi7xqS2Z6oxRBuUPO imxyy@imxyy-nix"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqza/3b6a9JxsNxytHF5GPe4gQhbLrKxAPyZ0GpfVQt imxyy-hisense-pad"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBWOy0QmAyxENg/O5m3cus8U3c9jCLioivwcWsh5/a82 imxyy-hisense-pad"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK8pivvE8PMtsOxmccfNhH/4KehDKhBfUfJbQZxo/SZT imxyy-ace5"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKALTBn/QSGcSPgMg0ViSazFcaA0+nEF05EJpjbsI6dE imxyy_soope_@imxyy-cloudwin"
];
sops.secrets.dae-imxyy-nix-server = {
@@ -170,7 +172,7 @@
enable = true;
role = "client";
settings = {
serverAddr = "vkvm.imxyy.top";
serverAddr = "hk.vkvm.imxyy.top";
serverPort = 7000;
auth.token = "{{ .Envs.FRP_AUTH_TOKEN }}";
proxies = [
@@ -390,6 +392,21 @@
customDomains = [ "matrix.imxyy.top" ];
}
{
name = "immich-http";
type = "http";
localIP = "127.0.0.1";
localPort = 80;
customDomains = [ "immich.imxyy.top" ];
}
{
name = "immich-https";
type = "https";
localIP = "127.0.0.1";
localPort = 443;
customDomains = [ "immich.imxyy.top" ];
}
{
name = "minecraft";
type = "tcp";
@@ -413,82 +430,9 @@
settings = {
logtail.enabled = false;
server_url = "https://headscale.imxyy.top";
dns = {
base_domain = "tailnet.imxyy.top";
extra_records = [
{
"name" = "home.imxyy.top";
"type" = "A";
"value" = "100.64.0.2";
}
{
"name" = "nextcloud.imxyy.top";
"type" = "A";
"value" = "100.64.0.2";
}
{
"name" = "mail.imxyy.top";
"type" = "A";
"value" = "100.64.0.2";
}
{
"name" = "git.imxyy.top";
"type" = "A";
"value" = "100.64.0.2";
}
{
"name" = "vault.imxyy.top";
"type" = "A";
"value" = "100.64.0.2";
}
{
"name" = "mc.imxyy.top";
"type" = "A";
"value" = "100.64.0.2";
}
{
"name" = "home.imxyy.top";
"type" = "A";
"value" = "100.64.0.2";
}
{
"name" = "coder.imxyy.top";
"type" = "A";
"value" = "100.64.0.2";
}
{
"name" = "music.imxyy.top";
"type" = "A";
"value" = "100.64.0.2";
}
];
};
dns.magic_dns = false;
dns.override_local_dns = false;
ip_prefixes = "100.64.0.0/10";
derp.paths = [
(toString (
pkgs.writeText "derp.yaml" ''
regions:
900:
regionid: 900
regioncode: custom-tok
regionname: imxyy_soope_ Tokyo
nodes:
- name: 900a
regionid: 900
hostname: vkvm.imxyy.top
# 901:
# regionid: 901
# regioncode: custom-cn
# regionname: imxyy_soope_ Hu Bei
# nodes:
# - name: 901a
# regionid: 901
# hostname: ry.imxyy.top
# derpport: 1443
''
))
];
derp.urls = lib.mkForce [ ];
oidc = {
only_start_if_oidc_is_available = true;
@@ -501,7 +445,6 @@
client_secret = "";
expiry = 0;
extra_params.domain_hint = "imxyy.top";
strip_email_domain = true;
};
};
};
@@ -527,7 +470,7 @@
environment.systemPackages = [ pkgs.easytier ];
systemd.services."easytier" = {
enable = true;
script = "easytier-core -c ${config.sops.secrets.et-imxyy-nix-server.path}";
script = "${pkgs.easytier}/bin/easytier-core -c ${config.sops.secrets.et-imxyy-nix-server.path}";
serviceConfig = {
Restart = lib.mkOverride 500 "always";
RestartMaxDelaySec = lib.mkOverride 500 "1m";
@@ -540,11 +483,6 @@
"network.target"
"sops-nix.service"
];
path = with pkgs; [
easytier
iproute2
bash
];
};
virtualisation.oci-containers = {
@@ -609,6 +547,9 @@
Restart = "always";
RestartSec = 120;
};
path = [
pkgs.bash
];
};
services.dnsmasq =
@@ -621,10 +562,15 @@
"vault"
"coder"
"headscale"
"grafana"
"matrix"
"note"
"oidc"
"mc"
"music"
"ai"
"sy"
"minio"
];
in
{
@@ -640,6 +586,7 @@
"/imxyy-cloudwin/192.168.3.4"
"/printer.home/192.168.3.53"
];
cache-size = 0;
};
};
}

View File

@@ -1,4 +1,3 @@
{ ... }:
{
services.nginx = {
enable = true;

View File

@@ -27,7 +27,7 @@
ports = [ "8093:8080" ];
};
siyuan = {
image = "apkdv/siyuan-unlock:v3.1.24";
image = "apkdv/siyuan-unlock:v3.1.30";
volumes = [
"/mnt/nas/siyuan/workspace:/workspace"
"/mnt/nas/siyuan:/home/siyuan"

View File

@@ -1,4 +1,3 @@
{ ... }:
{
services.samba = {
enable = true;
@@ -27,9 +26,8 @@
];
users = {
users.nas = {
isNormalUser = true;
home = "/var/empty";
description = "nas user";
isSystemUser = true;
description = "NAS user";
group = "nextcloud";
};
};

View File

@@ -3,9 +3,10 @@ let
# T400
gpuIDs = [
"8086:56a0" # A770
"8086:4f90"
"10de:1f82" # 1650
"10de:10fa" # 1650
"10de:10fa"
"10de:1fb2" # T400
];
@@ -22,6 +23,10 @@ in
"amd_iommu=on"
"vfio-pci.ids=${lib.concatStringsSep "," gpuIDs}"
];
extraModprobeConfig = ''
options kvm ignore_msrs=Y
options kvm report_ignored_msrs=N
'';
};
virtualisation.spiceUSBRedirection.enable = true;
my.virt.enable = true;

View File

@@ -1,4 +1,3 @@
{ ... }:
{
virtualisation.oci-containers.containers."YesPlayMusic" = {
image = "git.imxyy.top/imxyy1soope1/yesplaymusic:latest";

View File

@@ -1,4 +1,3 @@
{ ... }:
{
imports = [
./nixos.nix

View File

@@ -7,8 +7,8 @@
sops.sshKeyPath = "/home/${username}/.ssh/id_ed25519";
coding.all.enable = true;
coding.editor.vscode.enable = lib.mkForce false;
cmd.misc.enable = true;
cli.misc.enable = true;
xdg.enable = true;
cmd.media.all.enable = true;
cli.media.all.enable = true;
};
}

View File

@@ -1,10 +1,15 @@
{ username, nixos-wsl, ... }:
{
lib,
username,
inputs,
...
}:
{
imports = [
nixos-wsl.nixosModules.wsl
inputs.nixos-wsl.nixosModules.wsl
];
wsl.enable = true;
wsl.defaultUser = "${username}";
wsl.defaultUser = username;
services.openssh = {
enable = true;
@@ -17,4 +22,6 @@
# fix vscode remote
programs.nix-ld.enable = true;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
}

View File

@@ -0,0 +1,8 @@
{
imports = [
./nixos.nix
./hardware.nix
./home.nix
./net.nix
];
}

View File

@@ -0,0 +1,106 @@
{
config,
lib,
pkgs,
username,
...
}:
let
btrfs = "/dev/disk/by-uuid/69ab72d4-6ced-4f70-8b5e-aa2daa8c0b6b";
in
{
boot = {
initrd = {
kernelModules = [ "amdgpu" ];
availableKernelModules = [
"nvme"
"xhci_pci"
"thunderbolt"
"uas"
"sd_mod"
];
verbose = false;
};
kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos;
kernelModules = [ "kvm-amd" ];
tmp.useTmpfs = true;
kernel.sysctl = {
"fs.file-max" = 9223372036854775807;
};
};
services.scx.enable = true;
fileSystems."/" = {
device = btrfs;
fsType = "btrfs";
options = [
"compress=zstd"
"subvol=root"
];
};
fileSystems."/nix" = {
device = btrfs;
fsType = "btrfs";
options = [
"compress=zstd"
"subvol=nix"
];
};
my.persist.location = "/nix/persist";
fileSystems."/nix/persist" = {
device = btrfs;
fsType = "btrfs";
options = [
"compress=zstd"
"subvol=persist"
];
neededForBoot = true;
};
boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp
mount ${btrfs} /btrfs_tmp
mkdir -p /btrfs_tmp/old_roots
if [[ -e /btrfs_tmp/root ]]; then
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
fi
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +14); do
delete_subvolume_recursively "$i"
done
btrfs subvolume create /btrfs_tmp/root
umount /btrfs_tmp
'';
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/96D3-93B0";
fsType = "vfat";
options = [
"uid=0"
"gid=0"
"fmask=0077"
"dmask=0077"
];
};
networking.useDHCP = lib.mkDefault false;
hardware.enableRedistributableFirmware = lib.mkDefault true;
hardware.cpu.amd.updateMicrocode = config.hardware.enableRedistributableFirmware;
nixpkgs.hostPlatform = lib.mkForce "x86_64-linux";
}

View File

@@ -0,0 +1,141 @@
{
config,
lib,
pkgs,
username,
...
}:
{
my.home = {
home.packages = with pkgs; [
localsend
rclone
wpsoffice-cn
wps-office-fonts
ttf-wps-fonts
evince
anki
ayugram-desktop
telegram-desktop
signal-desktop
discord
qq
wechat
gnome-clocks
wineWowPackages.waylandFull
pavucontrol
pamixer
];
programs.zsh = {
sessionVariables = {
PATH = "/home/${username}/bin:$PATH";
};
};
};
my = {
gpg.enable = true;
cli.all.enable = true;
coding.all.enable = true;
desktop.all.enable = true;
desktop.browser.librewolf.enable = lib.mkForce false;
i18n.fcitx5.enable = true;
xdg = {
enable = true;
defaultApplications =
let
browser = [ "zen-beta.desktop" ];
editor = [ "codium.desktop" ];
imageviewer = [ "org.gnome.Shotwell-Viewer.desktop" ];
in
{
"inode/directory" = [ "nemo.desktop" ];
"application/pdf" = [ "org.gnome.Evince.desktop" ];
"text/*" = editor;
"application/json" = editor;
"text/html" = editor;
"text/xml" = editor;
"application/xml" = editor;
"application/xhtml+xml" = editor;
"application/xhtml_xml" = editor;
"application/rdf+xml" = editor;
"application/rss+xml" = editor;
"application/x-extension-htm" = editor;
"application/x-extension-html" = editor;
"application/x-extension-shtml" = editor;
"application/x-extension-xht" = editor;
"application/x-extension-xhtml" = editor;
"x-scheme-handler/about" = browser;
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/unknown" = browser;
"audio/*" = imageviewer;
"video/*" = imageviewer;
"image/*" = imageviewer;
"image/gif" = imageviewer;
"image/jpeg" = imageviewer;
"image/png" = imageviewer;
"image/webp" = imageviewer;
};
extraBookmarks =
let
homedir = config.my.home.home.homeDirectory;
in
[
"file://${homedir}/NAS NAS"
"file://${homedir}/NAS/imxyy_soope_ NAS imxyy_soope_"
"file://${homedir}/NAS/imxyy_soope_/OS NAS OS"
];
};
persist = {
enable = true;
homeDirs = [
"Documents"
"Downloads"
"Videos"
"Music"
"Pictures"
"bin"
"workspace"
".cache"
".local/state"
".local/share/Anki2"
".local/share/shotwell"
".local/share/cheat.sh"
".local/share/Kingsoft"
".local/share/AyuGramDesktop"
".local/share/TelegramDesktop"
".config/Signal"
".config/discord"
".config/QQ"
".xwechat"
".config/Kingsoft"
".config/dconf"
".config/gh"
".config/pulse"
".config/pip"
".config/libreoffice"
".config/sunshine"
];
};
};
}

View File

@@ -0,0 +1,59 @@
{
config,
lib,
pkgs,
sopsRoot,
...
}:
{
boot.kernelParams = [
"biosdevname=0"
"net.ifnames=0"
];
networking.networkmanager.enable = true;
sops.secrets.dae-imxyy-nix-x16 = {
sopsFile = sopsRoot + /dae-imxyy-nix-x16.dae;
format = "binary";
};
services.dae = {
enable = true;
configFile = config.sops.secrets.dae-imxyy-nix-x16.path;
};
systemd.services.dae.after = [ "sops-nix.service" ];
sops.secrets.mihomo = {
sopsFile = sopsRoot + /mihomo.yaml;
format = "yaml";
key = "";
};
systemd.services.mihomo.after = [ "sops-nix.service" ];
services.mihomo = {
enable = true;
configFile = config.sops.secrets.mihomo.path;
webui = pkgs.metacubexd;
};
sops.secrets.et-imxyy-nix-x16 = {
sopsFile = sopsRoot + /et-imxyy-nix-x16.toml;
format = "binary";
};
environment.systemPackages = with pkgs; [
easytier
];
systemd.services."easytier" = {
enable = true;
script = "${pkgs.easytier}/bin/easytier-core -c ${config.sops.secrets.et-imxyy-nix-x16.path}";
serviceConfig = {
Restart = lib.mkOverride 500 "always";
RestartMaxDelaySec = lib.mkOverride 500 "1m";
RestartSec = lib.mkOverride 500 "100ms";
RestartSteps = lib.mkOverride 500 9;
User = "root";
};
wantedBy = [ "multi-user.target" ];
after = [
"network.target"
"sops-nix.service"
];
};
}

View File

@@ -0,0 +1,175 @@
{
lib,
pkgs,
config,
username,
sopsRoot,
...
}:
{
security.pam.loginLimits = [
{
domain = "*";
type = "soft";
item = "nofile";
value = "524288";
}
];
boot.kernelParams = [
"usbcore.autosuspend=-1" # Avoid usb autosuspend (for usb bluetooth adapter)
];
boot.loader = {
efi.canTouchEfiVariables = true;
systemd-boot.enable = true;
grub.enable = false;
timeout = 0;
};
hardware.graphics.enable = true;
hardware.graphics.enable32Bit = true;
systemd.services.nix-daemon = {
environment.TMPDIR = "/var/cache/nix";
serviceConfig.CacheDirectory = "nix";
};
environment.variables.NIX_REMOTE = "daemon";
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = false;
alsa.support32Bit = false;
pulse.enable = false;
audio.enable = false;
};
services.pulseaudio = {
enable = true;
support32Bit = true;
package = pkgs.pulseaudioFull;
extraConfig = ''
load-module module-switch-on-connect
unload-module module-suspend-on-idle
'';
};
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
Disable = "HeadSet";
MultiProfile = "multiple";
};
};
};
users.extraUsers.${username}.extraGroups = [ "audio" ];
fonts = {
enableDefaultPackages = false;
fontDir.enable = true;
packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
jetbrains-mono
nerd-fonts.symbols-only
];
fontconfig.defaultFonts = {
serif = [
"Noto Serif CJK SC"
"Noto Serif"
"Symbols Nerd Font"
];
sansSerif = [
"Noto Sans CJK SC"
"Noto Sans"
"Symbols Nerd Font"
];
monospace = [
"JetBrains Mono"
"Noto Sans Mono CJK SC"
"Symbols Nerd Font Mono"
];
emoji = [ "Noto Color Emoji" ];
};
};
services.printing.enable = true;
services.keyd = {
enable = true;
keyboards.default.settings = {
main = {
capslock = "overload(control, esc)";
home = "end";
};
shift = {
home = "home";
};
control = {
delete = "print";
};
};
};
services.gvfs.enable = true;
services.openssh = {
enable = true;
settings = {
# Forbid root login through SSH.
PermitRootLogin = null;
PasswordAuthentication = true;
};
};
environment.systemPackages = [
pkgs.rclone
];
sops.secrets.imxyy-nix-rclone = {
sopsFile = sopsRoot + /imxyy-nix-rclone.conf;
format = "binary";
};
fileSystems = {
"/home/${username}/Nextcloud" = {
device = "Nextcloud:";
fsType = "rclone";
options = [
"nodev"
"nofail"
"allow_other"
"args2env"
"config=${config.sops.secrets.imxyy-nix-rclone.path}"
"uid=1000"
"gid=100"
"rw"
"no-check-certificate"
"vfs-cache-mode=full"
];
};
"/home/${username}/NAS" = {
device = "//10.0.0.1/share";
fsType = "cifs";
options = [
"username=nas"
"password=nasshare"
"x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"
"nodev"
"nofail"
"uid=1000"
"gid=100"
"vers=3"
"rw"
];
};
};
my.persist.nixosDirs = [ "/etc/NetworkManager/system-connections" ];
}

View File

@@ -1,4 +1,3 @@
{ ... }:
{
imports = [
./nixos.nix

View File

@@ -5,7 +5,9 @@
username,
...
}:
let
btrfs = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
in
{
boot = {
initrd = {
@@ -21,7 +23,7 @@
verbose = false;
};
kernelPackages = lib.mkForce pkgs.linuxKernel.packages.linux_zen;
kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos;
kernelModules = [ "kvm-amd" ];
tmp.useTmpfs = true;
@@ -29,27 +31,15 @@
"fs.file-max" = 9223372036854775807;
};
resumeDevice = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
resumeDevice = btrfs;
kernelParams = [
"resume_offset=6444127"
# "quiet"
# "splash"
# "log_level=3"
];
consoleLogLevel = 3;
/*
plymouth = {
enable = true;
theme = "bgrt";
themePackages = [ pkgs.nixos-bgrt-plymouth ];
};
*/
};
services.scx.enable = true;
fileSystems."/" = {
device = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
device = btrfs;
fsType = "btrfs";
options = [
"compress=zstd"
@@ -63,8 +53,9 @@
options = [ "compress=zstd" ];
};
fileSystems."/persistent" = {
device = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
my.persist.location = "/nix/persist";
fileSystems."/nix/persist" = {
device = btrfs;
fsType = "btrfs";
options = [
"compress=zstd"
@@ -74,7 +65,7 @@
};
fileSystems."/swap" = {
device = "/dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c";
device = btrfs;
fsType = "btrfs";
options = [
"compress=zstd"
@@ -85,7 +76,7 @@
boot.initrd.postDeviceCommands = lib.mkAfter ''
mkdir /btrfs_tmp
mount /dev/disk/by-uuid/0404de0a-9c4d-4c98-b3e5-b8ff8115f36c /btrfs_tmp
mount ${btrfs} /btrfs_tmp
mkdir -p /btrfs_tmp/old_roots
if [[ -e /btrfs_tmp/root ]]; then
timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
@@ -111,6 +102,12 @@
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/B7DC-E9AC";
fsType = "vfat";
options = [
"uid=0"
"gid=0"
"fmask=0077"
"dmask=0077"
];
};
fileSystems."/home/${username}/Documents" = {

View File

@@ -14,17 +14,17 @@
wpsoffice-cn
wps-office-fonts
ttf-wps-fonts
evince
# siyuan-unlock
anki
ayugram-desktop
telegram-desktop
signal-desktop
cinny-desktop
discord
qq
wechat
gnome-clocks
@@ -44,16 +44,15 @@
PATH = "/home/${username}/bin:$PATH";
};
profileExtra = ''
if [ `tty` = "/dev/tty1" -a $XDG_RUNTIME_DIR ]; then
echo 'Starting Niri...'
exec uwsm start niri-uwsm.desktop
elif [ `tty` = "/dev/tty6" ]; then
if [ `tty` = "/dev/tty6" ]; then
clear
fi
'';
};
programs.niri.settings.outputs = {
programs.niri.settings = {
environment.STEAM_FORCE_DESKTOPUI_SCALING = "1.25";
outputs = {
DP-2 = {
enable = true;
mode = {
@@ -77,25 +76,21 @@
scale = 1.25;
};
};
};
};
my = {
autologin = {
enable = true;
user = "${username}";
ttys = [
1
6
];
user = username;
ttys = [ 6 ];
};
gpg.enable = true;
cmd.all.enable = true;
cli.all.enable = true;
coding.all.enable = true;
desktop.all.enable = true;
desktop.wm.dwm.enable = lib.mkForce false;
desktop.browser.librewolf.enable = lib.mkForce false;
i18n.fcitx5.enable = true;
@@ -104,14 +99,14 @@
enable = true;
defaultApplications =
let
browser = [ "chromium-browser.desktop" ];
browser = [ "zen-beta.desktop" ];
editor = [ "codium.desktop" ];
imageviewer = [ "org.gnome.Shotwell-Viewer.desktop" ];
in
{
"inode/directory" = [ "nemo.desktop" ];
"application/pdf" = [ "evince.desktop" ];
"application/pdf" = [ "org.gnome.Evince.desktop" ];
"text/*" = editor;
"application/json" = editor;
@@ -159,57 +154,32 @@
".android"
"Android"
".ssh"
"bin"
"workspace"
"WineApps"
"Virt"
".cache"
".local/state"
".local/share/Anki2"
".local/share/dooit"
".local/share/nvim"
".local/share/shotwell"
".local/share/Steam"
".local/share/SteamOS"
".local/share/Trash"
".local/share/cheat.sh"
".local/share/Kingsoft"
".local/share/oss.krtirtho.spotube"
".local/share/AyuGramDesktop"
".local/share/TelegramDesktop"
".local/share/cinny"
".config/Signal"
".config/discord"
".config/QQ"
".xwechat"
".config/Kingsoft"
".config/dconf"
".config/gh"
".config/pulse"
".config/chromium"
".config/go-musicfox/db"
".config/tmux/plugins"
".config/pip"
".config/obs-studio"
".config/libreoffice"
".config/Moonlight Game Streaming Project"
".config/sunshine"
];
nixosDirs = [
"/etc/ssh"
];
homeFiles = [
".config/mpd/mpd.db" # requires bindfs
".config/go-musicfox/cookie"
".hmcl.json"
];
nixosFiles = [
"/etc/davfs2/secrets"
];
};
};
}

View File

@@ -3,6 +3,7 @@
lib,
pkgs,
sopsRoot,
username,
...
}:
{
@@ -105,8 +106,6 @@
webui = pkgs.metacubexd;
};
services.tailscale.enable = true;
sops.secrets.et-imxyy-nix = {
sopsFile = sopsRoot + /et-imxyy-nix.toml;
format = "binary";
@@ -114,7 +113,7 @@
environment.systemPackages = [ pkgs.easytier ];
systemd.services."easytier" = {
enable = true;
script = "easytier-core -c ${config.sops.secrets.et-imxyy-nix.path}";
script = "${pkgs.easytier}/bin/easytier-core -c ${config.sops.secrets.et-imxyy-nix.path}";
serviceConfig = {
Restart = lib.mkOverride 500 "always";
RestartMaxDelaySec = lib.mkOverride 500 "1m";
@@ -127,10 +126,5 @@
"network.target"
"sops-nix.service"
];
path = with pkgs; [
easytier
iproute2
bash
];
};
}

View File

@@ -1,7 +1,9 @@
{
lib,
pkgs,
config,
username,
sopsRoot,
...
}:
let
@@ -109,56 +111,13 @@ in
};
environment.variables.NIX_REMOTE = "daemon";
# services.pipewire.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
# alsa.enable = true;
# alsa.support32Bit = true;
# pulse.enable = true;
alsa.enable = false;
alsa.support32Bit = false;
pulse.enable = false;
audio.enable = false;
configPackages = [
/*
(pkgs.writeTextDir "share/pipewire/media-session.d/bluez-monitor.conf" ''
rules = [
{
actions = {
update-props = {
bluez5.autoswitch-profile = true;
}
}
}
]
'')
*/
];
};
services.pipewire.wireplumber.extraConfig = {
/*
"10-bluez" = {
"monitor.bluez.properties" = {
"bluez5.enable-sbc-xq" = true;
"bluez5.enable-msbc" = true;
"bluez5.enable-hw-volume" = true;
"bluez5.roles" = [
"hsp_hs"
"hsp_ag"
"hfp_hf"
"hfp_ag"
];
};
};
*/
/*
"11-bluetooth-policy" = {
"wireplumber.settings" = {
"bluetooth.autoswitch-to-headset-profile" = false;
};
};
*/
};
services.pulseaudio = {
enable = true;
@@ -173,7 +132,11 @@ in
enable = true;
powerOnBoot = true;
settings = {
General.Enable = "Source,Sink,Media,Socket";
General = {
Enable = "Source,Sink,Media,Socket";
Disable = "HeadSet";
MultiProfile = "multiple";
};
};
};
users.extraUsers.${username}.extraGroups = [ "audio" ];
@@ -197,19 +160,16 @@ in
"Noto Serif CJK SC"
"Noto Serif"
"Symbols Nerd Font"
"Noto Color Emoji"
];
sansSerif = [
"Noto Sans CJK SC"
"Noto Sans"
"Symbols Nerd Font"
"Noto Color Emoji"
];
monospace = [
"JetBrains Mono"
"Noto Sans Mono CJK SC"
"Symbols Nerd Font Mono"
"Noto Color Emoji"
];
emoji = [ "Noto Color Emoji" ];
};
@@ -235,8 +195,6 @@ in
services.gvfs.enable = true;
virtualisation.waydroid.enable = true;
programs.wireshark.enable = true;
programs.wireshark.package = pkgs.wireshark;
users.users.${username}.extraGroups = [ "wireshark" ];
@@ -266,24 +224,11 @@ in
btreset
];
fileSystems =
let
config = pkgs.writeText "rclone.conf" ''
[Nextcloud]
type = webdav
url = https://192.168.3.2/remote.php/dav/files/imxyy_soope_
vendor = nextcloud
user = imxyy_soope_
pass = C2UUiMyPoynWWKS9kf_Fr8rcoXxgUswPYi4s
[NAS]
type = smb
host = 192.168.3.2
user = nas
pass = O74S6-7jDFykwCvZ8vuIxohh00Ty7XJF
'';
in
{
sops.secrets.imxyy-nix-rclone = {
sopsFile = sopsRoot + /imxyy-nix-rclone.conf;
format = "binary";
};
fileSystems = {
"/home/${username}/Nextcloud" = {
device = "Nextcloud:";
fsType = "rclone";
@@ -292,7 +237,7 @@ in
"nofail"
"allow_other"
"args2env"
"config=${toString config}"
"config=${config.sops.secrets.imxyy-nix-rclone.path}"
"uid=1000"
"gid=100"
"rw"

View File

@@ -1,35 +0,0 @@
{
"version": 1,
"rules": [
{
"domain": [
"cm.steampowered.com",
"ol.epicgames.com",
"csgo.wmsj.cn",
"dota2.wmsj.cn",
"wmsjsteam.com",
"dl.steam.clngaa.com",
"dl.steam.ksyna.com",
"gstore.val.manlaxy.com",
"st.dl.bscstorage.net",
"st.dl.eccdnx.com",
"st.dl.pinyuncloud.com",
"steampipe.steamcontent.tnkjmec.com",
"steampowered.com.8686c.com",
"steamstatic.com.8686c.com",
"steambroadcast.akamaized.net",
"steamcdn-a.akamaihd.net",
"steamcommunity-a.akamaihd.net",
"steamstore-a.akamaihd.net",
"steamusercontent-a.akamaihd.net",
"steamuserimages-a.akamaihd.net"
],
"domain_suffix": [
".steamcontent.com",
".steamserver.net",
".steamchina.com"
],
"invert": false
}
]
}

View File

@@ -1,11 +0,0 @@
#!/bin/sh
sudo mkdir -p /run/systemd/system/docker.service.d
sudo su -c 'cat << EOF >/run/systemd/system/docker.service.d/override.conf
[Service]
Environment="http_proxy=http://127.0.0.1:7890"
Environment="https_proxy=http://127.0.0.1:7890"
Environment="all_proxy=socks5h://127.0.0.1:7891"
EOF'
sudo systemctl daemon-reload
sudo systemctl restart docker

742
flake.lock generated

File diff suppressed because it is too large Load Diff

180
flake.nix
View File

@@ -4,10 +4,14 @@
inputs = {
# Nixpkgs
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable-small";
nixpkgs-stable.url = "github:nixos/nixpkgs/release-24.11";
nixpkgs-stable.url = "github:nixos/nixpkgs/release-25.05";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
# nixpkgs.follows = "nixpkgs-stable";
nixpkgs.follows = "nixpkgs-unstable";
# nixpkgs.follows = "nixpkgs-master";
# Nyxpkgs
chaotic.url = "github:chaotic-cx/nyx/nyxpkgs-unstable";
# SOPS
sops-nix.url = "github:Mic92/sops-nix";
@@ -23,20 +27,6 @@
# NUR
nur.url = "github:nix-community/NUR";
# NeoVim nightly
# neovim-nightly.url = "github:nix-community/neovim-nightly-overlay";
# neovim-nightly.inputs.nixpkgs.follows = "nixpkgs";
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
# OMZ
omz.url = "github:imxyy1soope1/omz/master";
omz.inputs.nixpkgs.follows = "nixpkgs";
# dwm
dwm.url = "github:imxyy1soope1/dwm/master";
dwm.inputs.nixpkgs.follows = "nixpkgs";
# Niri
niri.url = "github:sodiboo/niri-flake";
niri.inputs.nixpkgs.follows = "nixpkgs";
@@ -61,32 +51,60 @@
fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
zen.url = "github:0xc000022070/zen-browser-flake";
zen.inputs.nixpkgs.follows = "nixpkgs";
infuse.url = "git+https://codeberg.org/amjoseph/infuse.nix";
infuse.flake = false;
haumea.url = "github:nix-community/haumea/v0.2.2";
haumea.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
nixpkgs,
nixos-wsl,
...
}@inputs:
let
inherit (self) outputs;
variables = import ./variables.nix;
vars = import ./vars.nix;
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
forAllHosts =
gen:
mkSystem:
nixpkgs.lib.attrsets.mergeAttrsList (
builtins.map (
{ hostname, ... }@host:
{
${hostname} = gen host;
}
) variables.hosts
builtins.map (hostname: {
${hostname} = mkSystem hostname;
}) (builtins.attrNames (builtins.readDir ./config/hosts))
);
lib = (import ./lib/stdlib-extended.nix nixpkgs.lib).extend (
final: prev: {
inherit (inputs.home-manager.lib) hm;
inherit infuse;
haumea = inputs.haumea.lib;
}
);
infuse = (import inputs.infuse { inherit (nixpkgs) lib; }).v1.infuse;
in
{
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
packages = forAllSystems (
system:
lib.haumea.load {
src = ./pkgs;
loader = [
{
matches = str: builtins.match ".*\\.nix" str != null;
loader = _: path: nixpkgs.legacyPackages.${system}.callPackage path { };
}
];
transformer = lib.haumea.transformers.liftDefault;
}
);
# workaround for "treefmt warning"
formatter = forAllSystems (
system:
let
@@ -95,9 +113,9 @@
pkgs.writeShellApplication {
name = "nixfmt-wrapper";
runtimeInputs = [
pkgs.fd
pkgs.nixfmt-rfc-style
runtimeInputs = with pkgs; [
fd
nixfmt-rfc-style
];
text = ''
@@ -106,27 +124,17 @@
}
);
overlays = import ./overlays { inherit inputs; };
overlays = import ./overlays {
inherit inputs lib;
};
# Available through 'nixos-rebuild --flake .#{hostname}'
nixosConfigurations = forAllHosts (
{ hostname, system }:
hostname:
let
lib = import ./lib/stdlib-extended.nix (
nixpkgs.lib.extend (
final: prev: {
inherit (inputs.home-manager.lib) hm;
}
)
);
overlays = builtins.attrValues self.overlays ++ [
inputs.go-musicfox.overlays.default
inputs.omz.overlays.default
inputs.dwm.overlays.default
inputs.niri.overlays.niri
# inputs.neovim-nightly.overlays.default
inputs.fenix.overlays.default
inputs.nix-vscode-extensions.overlays.default
(final: prev: {
darkly-qt5 = inputs.darkly.packages.${final.system}.darkly-qt5;
darkly-qt6 = inputs.darkly.packages.${final.system}.darkly-qt6;
@@ -136,58 +144,24 @@
withJemalloc = true;
withQtSvg = true;
withWayland = true;
withPipewire = false;
withPipewire = true;
withPam = false;
withX11 = false;
withHyprland = false;
};
})
(final: prev: {
inherit lib;
})
];
pkgs = import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
specialArgs = {
inherit (variables)
username
userdesc
userfullname
useremail
;
inherit
inputs
outputs
nixos-wsl
system
hostname
;
sopsRoot = ./secrets;
};
in
lib.nixosSystem {
inherit specialArgs;
modules = [
./modules
./config/base.nix
./config/hosts/${hostname}
{
nixpkgs = {
inherit pkgs;
};
}
inputs.sops-nix.nixosModules.sops
inputs.impermanence.nixosModules.impermanence
inputs.home-manager.nixosModules.default
{
home = {
home-manager = {
sharedModules = [
inputs.sops-nix.homeManagerModules.sops
inputs.impermanence.nixosModules.home-manager.impermanence
inputs.stylix.homeManagerModules.stylix
inputs.niri.homeModules.niri
inputs.stylix.homeModules.stylix
inputs.zen.homeModules.beta
# workaround for annoying stylix
(
{ lib, ... }:
{
@@ -197,7 +171,43 @@
];
useGlobalPkgs = true;
};
}
};
pkgsConf.nixpkgs = {
inherit overlays;
config.allowUnfree = true;
flake.setNixPath = false;
};
in
lib.nixosSystem {
specialArgs = {
inherit
inputs
outputs
hostname
;
sopsRoot = ./secrets;
flake = ./.;
} // vars;
modules =
(lib.umport {
paths = [ ./modules ];
exclude = [
./modules/virt/types
./modules/desktop/wm/niri/waybar
];
recursive = true;
})
++ [
(lib.mkAliasOptionModule [ "my" "home" ] [ "home-manager" "users" vars.username ])
./config/base.nix
./config/hosts/${hostname}
inputs.chaotic.nixosModules.default
inputs.sops-nix.nixosModules.sops
inputs.impermanence.nixosModules.impermanence
inputs.home-manager.nixosModules.default
inputs.niri.nixosModules.niri
home
pkgsConf
];
}
);

View File

@@ -9,5 +9,6 @@ in
stdlib.extend (
self: super: {
my = mkMyLib { lib = self; };
umport = import ./umport.nix { lib = self; };
}
)

48
lib/umport.nix Normal file
View File

@@ -0,0 +1,48 @@
# This function is modified from:
# https://github.com/yunfachi/nypkgs/blob/master/lib/umport.nix
#
# !!! REMOVING THIS NOTICE VIOLATES THE MIT LICENSE OF THE UMPORT PROJECT !!!
# This notice must be retained in all copies of this function, including modified versions!
# The MIT License can be found here:
# https://github.com/yunfachi/nypkgs/blob/master/LICENSE
{ lib, ... }:
let
umport =
{
path ? null,
paths ? [ ],
include ? [ ],
exclude ? [ ],
recursive ? true,
}:
with lib;
with fileset;
let
excludedFiles = filter (path: pathIsRegularFile path) exclude;
excludedDirs = filter (path: pathIsDirectory path) exclude;
isExcluded =
path:
if elem path excludedFiles then
true
else
(filter (excludedDir: lib.path.hasPrefix excludedDir path) excludedDirs) != [ ];
in
unique (
(filter
(file: pathIsRegularFile file && hasSuffix ".nix" (builtins.toString file) && !isExcluded file)
(
concatMap (
_path:
if recursive then
toList _path
else
mapAttrsToList (
name: type: _path + (if type == "directory" then "/${name}/default.nix" else "/${name}")
) (builtins.readDir _path)
) (unique (if path == null then paths else [ path ] ++ paths))
)
)
++ (if recursive then concatMap (path: toList path) (unique include) else unique include)
);
in
umport

View File

@@ -3,15 +3,16 @@ lib.my.makeSwitch {
inherit config;
optionName = "all command line tools";
optionPath = [
"cmd"
"cli"
"all"
];
config' = {
my.cmd = {
my.cli = {
media.all.enable = true;
misc.enable = true;
monitor.all.enable = true;
shell.all.enable = true;
vcs.all.enable = true;
};
};
}

View File

@@ -3,12 +3,12 @@ lib.my.makeSwitch {
inherit config;
optionName = "all command line media tools";
optionPath = [
"cmd"
"cli"
"media"
"all"
];
config' = {
my.cmd.media = {
my.cli.media = {
cava.enable = true;
go-musicfox.enable = true;
mpd.enable = true;

View File

@@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig {
packageName = "cava";
packagePath = [ "cava" ];
optionPath = [
"cmd"
"cli"
"media"
"cava"
];

View File

@@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig {
packageName = "ffmpeg";
packagePath = [ "ffmpeg" ];
optionPath = [
"cmd"
"cli"
"media"
"ffmpeg"
];

View File

@@ -8,7 +8,7 @@ lib.my.makeSwitch {
inherit config;
optionName = "go-musicfox";
optionPath = [
"cmd"
"cli"
"media"
"go-musicfox"
];
@@ -22,7 +22,14 @@ lib.my.makeSwitch {
xdg.configFile."go-musicfox/go-musicfox.ini".source = ./go-musicfox.ini;
};
cmd.media.mpd.enable = true;
cli.media.mpd.enable = true;
persist.homeDirs = [
".config/go-musicfox/db"
];
persist.homeFiles = [
".config/go-musicfox/cookie"
];
};
};
}

View File

@@ -8,18 +8,21 @@ lib.my.makeSwitch {
inherit config;
optionName = "mpd";
optionPath = [
"cmd"
"cli"
"media"
"mpd"
];
config' = {
my.home = {
home.packages = with pkgs; [
home.packages = with pkgs.stable; [
mpd
mpc-cli
];
services.mpris-proxy.enable = true;
xdg.configFile."mpd/mpd.conf".source = ./mpd.conf;
};
my.persist.homeFiles = [
".config/mpd/mpd.db"
];
};
}

View File

@@ -2,6 +2,7 @@
config,
lib,
pkgs,
username,
userfullname,
useremail,
...
@@ -11,7 +12,7 @@ lib.my.makeSwitch {
default = true;
optionName = "misc command line tools";
optionPath = [
"cmd"
"cli"
"misc"
];
config' = {
@@ -43,21 +44,9 @@ lib.my.makeSwitch {
killall
];
programs.zsh.enable = true;
programs.dconf.enable = true;
my.home = {
programs.home-manager.enable = true;
programs.git = {
enable = true;
userName = "${userfullname}";
userEmail = "${useremail}";
extraConfig = {
pull.rebase = true;
push.autoSetupRemote = true;
};
};
home.packages = with pkgs; [
lsd
fd
@@ -68,20 +57,29 @@ lib.my.makeSwitch {
aria2
socat
nix-output-monitor
tmux
trash-cli
cht-sh
dooit
# translate-shell
];
xdg.configFile."tmux/tmux.conf".source = ./tmux.conf;
programs.tmux = {
enable = true;
extraConfig = "set-option -g mouse on";
plugins = [
(pkgs.tmuxPlugins.mkTmuxPlugin {
pluginName = "tokyo-night-tmux";
rtpFilePath = "tokyo-night.tmux";
version = "legacy";
src = pkgs.fetchFromGitHub {
owner = "janoamaral";
repo = "tokyo-night-tmux";
rev = "16469dfad86846138f594ceec780db27039c06cd";
hash = "sha256-EKCgYan0WayXnkSb2fDJxookdBLW0XBKi2hf/YISwJE=";
};
})
];
};
programs.tealdeer = {
enable = true;
enableAutoUpdates = true;
settings.updates.auto_update = true;
};
};
};
}

View File

@@ -3,12 +3,12 @@ lib.my.makeSwitch {
inherit config;
optionName = "all command line monitor tools";
optionPath = [
"cmd"
"cli"
"monitor"
"all"
];
config' = {
my.cmd.monitor = {
my.cli.monitor = {
btop.enable = true;
};
};

View File

@@ -9,7 +9,7 @@ lib.my.makeHomePackageConfig {
packageName = "btop";
packagePath = [ "btop" ];
optionPath = [
"cmd"
"cli"
"monitor"
"btop"
];

View File

@@ -3,12 +3,12 @@ lib.my.makeSwitch {
inherit config;
optionName = "all shells";
optionPath = [
"cmd"
"cli"
"shell"
"all"
];
config' = {
my.cmd.shell = {
my.cli.shell = {
zsh.enable = true;
};
};

View File

@@ -0,0 +1,190 @@
[aws]
symbol = " "
[buf]
symbol = " "
[bun]
symbol = " "
[c]
symbol = " "
[cpp]
symbol = " "
[cmake]
symbol = " "
[conda]
symbol = " "
[crystal]
symbol = " "
[dart]
symbol = " "
[deno]
symbol = " "
[directory]
read_only = " 󰌾"
[docker_context]
symbol = " "
[elixir]
symbol = " "
[elm]
symbol = " "
[fennel]
symbol = " "
[fossil_branch]
symbol = " "
[gcloud]
symbol = " "
[git_branch]
symbol = " "
[git_commit]
tag_symbol = '  '
[golang]
symbol = " "
[guix_shell]
symbol = " "
[haskell]
symbol = " "
[haxe]
symbol = " "
[hg_branch]
symbol = " "
[hostname]
ssh_symbol = " "
[java]
symbol = " "
[julia]
symbol = " "
[kotlin]
symbol = " "
[lua]
symbol = " "
[memory_usage]
symbol = "󰍛 "
[meson]
symbol = "󰔷 "
[nim]
symbol = "󰆥 "
[nix_shell]
symbol = " "
[nodejs]
symbol = " "
[ocaml]
symbol = " "
[os.symbols]
Alpaquita = " "
Alpine = " "
AlmaLinux = " "
Amazon = " "
Android = " "
Arch = " "
Artix = " "
CachyOS = " "
CentOS = " "
Debian = " "
DragonFly = " "
Emscripten = " "
EndeavourOS = " "
Fedora = " "
FreeBSD = " "
Garuda = "󰛓 "
Gentoo = " "
HardenedBSD = "󰞌 "
Illumos = "󰈸 "
Kali = " "
Linux = " "
Mabox = " "
Macos = " "
Manjaro = " "
Mariner = " "
MidnightBSD = " "
Mint = " "
NetBSD = " "
NixOS = " "
Nobara = " "
OpenBSD = "󰈺 "
openSUSE = " "
OracleLinux = "󰌷 "
Pop = " "
Raspbian = " "
Redhat = " "
RedHatEnterprise = " "
RockyLinux = " "
Redox = "󰀘 "
Solus = "󰠳 "
SUSE = " "
Ubuntu = " "
Unknown = " "
Void = " "
Windows = "󰍲 "
[package]
symbol = "󰏗 "
[perl]
symbol = " "
[php]
symbol = " "
[pijul_channel]
symbol = " "
[pixi]
symbol = "󰏗 "
[python]
symbol = " "
[rlang]
symbol = "󰟔 "
[ruby]
symbol = " "
[rust]
symbol = "󱘗 "
[scala]
symbol = " "
[swift]
symbol = " "
[zig]
symbol = " "
[gradle]
symbol = " "

127
modules/cli/shell/zsh.nix Normal file
View File

@@ -0,0 +1,127 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
default = true;
optionName = "default zsh settings";
optionPath = [
"cli"
"shell"
"zsh"
];
config' = {
my.persist.homeDirs = [ ".local/share/zoxide" ];
my.home =
let
stateHome = config.my.home.xdg.stateHome;
zsh-syntax-highlighting = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0.8.0";
hash = "sha256-iJdWopZwHpSyYl5/FQXEW7gl/SrKaYDEtTH9cGP7iPo=";
};
fzf-tab = pkgs.fetchFromGitHub {
owner = "Aloxaf";
repo = "fzf-tab";
rev = "v1.2.0";
hash = "sha256-q26XVS/LcyZPRqDNwKKA9exgBByE0muyuNb0Bbar2lY=";
};
in
{
home.packages = with pkgs; [
fzf
zoxide
];
programs.starship = {
enable = true;
settings = lib.recursiveUpdate (with builtins; fromTOML (readFile ./starship-preset.toml)) {
add_newline = false;
custom = {
jj = {
ignore_timeout = true;
description = "The current jj status";
when = "jj root";
symbol = " ";
command = ''
jj log --revisions @ --no-graph --ignore-working-copy --color always --limit 1 --template '
separate(" ",
change_id.shortest(4),
bookmarks,
"|",
concat(
if(conflict, "💥"),
if(divergent, "🚧"),
if(hidden, "👻"),
if(immutable, "🔒"),
),
raw_escape_sequence("\x1b[1;32m") ++ if(empty, "(empty)"),
raw_escape_sequence("\x1b[1;32m") ++ coalesce(
truncate_end(29, description.first_line(), ""),
"(no description set)",
) ++ raw_escape_sequence("\x1b[0m"),
)
'
'';
};
git_branch = {
when = true;
command = "jj root >/dev/null 2>&1 || starship module git_branch";
description = "Only show git_branch if we're not in a jj repo";
};
git_status = {
when = true;
command = "jj root >/dev/null 2>&1 || starship module git_status";
description = "Only show git_status if we're not in a jj repo";
};
};
git_state.disabled = true;
git_commit.disabled = true;
git_metrics.disabled = true;
git_branch.disabled = true;
git_status.disabled = true;
nix_shell.disabled = true;
};
};
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
history = {
path = "${stateHome}/zsh_history";
ignorePatterns = [
"la"
];
};
initContent = lib.mkAfter ''
source ${fzf-tab}/fzf-tab.plugin.zsh
eval "$(zoxide init zsh)"
source ${zsh-syntax-highlighting}/zsh-syntax-highlighting.plugin.zsh
source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh
'';
oh-my-zsh = {
enable = true;
theme = "gentoo";
plugins = [
"git"
"git-extras"
"extract"
"sudo"
"dotenv"
];
};
shellAliases = {
x = "extract";
ls = "lsd";
svim = "sudoedit";
nf = "neofetch";
tmux = "tmux -T RGB,focus,overline,mouse,clipboard,usstyle";
pastart = "pasuspender true";
};
};
};
};
}

16
modules/cli/vcs/all.nix Normal file
View File

@@ -0,0 +1,16 @@
{ config, lib, ... }:
lib.my.makeSwitch {
inherit config;
optionName = "all command line tools";
optionPath = [
"cli"
"vcs"
"all"
];
config' = {
my.cli.vcs = {
git.enable = true;
jj.enable = true;
};
};
}

42
modules/cli/vcs/git.nix Normal file
View File

@@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
username,
userfullname,
useremail,
...
}:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "git";
optionPath = [
"cli"
"vcs"
"git"
];
extraConfig = {
my.home = {
programs.git = {
userName = "${userfullname}";
userEmail = "${useremail}";
signing = {
format = "ssh";
signByDefault = true;
key = "/home/${username}/.ssh/id_ed25519";
};
extraConfig = {
push.autoSetupRemote = true;
gpg.ssh.allowedSignersFile =
(pkgs.writeText "allowed_signers" ''
imxyy1soope1@gmail.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEFLUkyeaK8ZPPZdVNEmtx8zvoxi7xqS2Z6oxRBuUPO imxyy@imxyy-nix
imxyy@imxyy.top ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEFLUkyeaK8ZPPZdVNEmtx8zvoxi7xqS2Z6oxRBuUPO imxyy@imxyy-nix
'').outPath;
};
};
programs.lazygit = {
enable = true;
};
};
};
}

45
modules/cli/vcs/jj.nix Normal file
View File

@@ -0,0 +1,45 @@
{
config,
lib,
pkgs,
username,
userfullname,
useremail,
...
}:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "jujutsu";
optionPath = [
"cli"
"vcs"
"jj"
];
extraConfig = {
my.home = {
programs.jujutsu = {
settings = {
user = {
name = "${userfullname}";
email = "${useremail}";
};
ui = {
graph.style = "square";
default-command = "status";
};
signing = {
backend = "ssh";
behavior = "own";
key = "/home/${username}/.ssh/id_ed25519";
backends.backends.ssh.allowed-signers =
(pkgs.writeText "allowed_signers" ''
imxyy1soope1@gmail.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEFLUkyeaK8ZPPZdVNEmtx8zvoxi7xqS2Z6oxRBuUPO imxyy@imxyy-nix
imxyy@imxyy.top ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEFLUkyeaK8ZPPZdVNEmtx8zvoxi7xqS2Z6oxRBuUPO imxyy@imxyy-nix
'').outPath;
};
};
};
home.packages = [ pkgs.lazyjj ];
};
};
}

View File

@@ -1,10 +0,0 @@
{ ... }:
{
imports = [
./all.nix
./media
./misc
./monitor
./shell
];
}

View File

@@ -1,10 +0,0 @@
{ ... }:
{
imports = [
./all.nix
./ffmpeg.nix
./mpd
./cava
./go-musicfox
];
}

View File

@@ -1,9 +0,0 @@
set-option -g mouse on
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin "janoamaral/tokyo-night-tmux#legacy"
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.config/tmux/plugins/tpm/tpm'

View File

@@ -1,7 +0,0 @@
{ ... }:
{
imports = [
./all.nix
./btop
];
}

View File

@@ -1,7 +0,0 @@
{ ... }:
{
imports = [
./all.nix
./zsh.nix
];
}

View File

@@ -1,49 +0,0 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
default = true;
optionName = "default zsh settings";
optionPath = [
"cmd"
"shell"
"zsh"
];
config' = {
my.home =
let
stateHome = config.my.home.xdg.stateHome;
in
{
home.packages = [ pkgs.omz ];
programs.zsh = {
enable = true;
dotDir = ".config/zsh";
history = {
path = "${stateHome}/zsh_history";
ignorePatterns = [
"la"
];
};
initExtra = ''
source ${pkgs.omz}/share/omz/omz.zsh
'';
sessionVariables = {
_ZL_DATA = "${stateHome}/zlua";
_FZF_HISTORY = "${stateHome}/fzf_history";
};
shellAliases = {
ls = "lsd";
svim = "sudoedit";
nf = "neofetch";
tmux = "tmux -T RGB,focus,overline,mouse,clipboard,usstyle";
pastart = "pasuspender true";
};
};
};
};
}

View File

@@ -1,9 +0,0 @@
{ ... }:
{
imports = [
./all.nix
./misc.nix
./langs
./editor
];
}

View File

@@ -11,6 +11,7 @@ lib.my.makeSwitch {
my.coding.editor = {
neovim.enable = true;
vscode.enable = true;
zed.enable = true;
};
};
}

View File

@@ -1,8 +0,0 @@
{ ... }:
{
imports = [
./all.nix
./neovim
./vscode
];
}

View File

@@ -20,9 +20,6 @@ lib.my.makeHomeProgramConfig {
recursive = true;
};
programs.neovim = {
package = pkgs.neovim-unwrapped.overrideAttrs {
treesitter-parsers = { };
};
enable = true;
defaultEditor = true;
viAlias = true;
@@ -39,7 +36,7 @@ lib.my.makeHomeProgramConfig {
rust-analyzer
pest-ide-tools
nil
nixd
gotools
gopls
@@ -57,5 +54,8 @@ lib.my.makeHomeProgramConfig {
];
};
};
my.persist.homeDirs = [
".local/share/nvim"
];
};
}

View File

@@ -6,4 +6,3 @@ require("langs.langs-setup")
require("plugins.plugins-setup")
require("core.autostart")

View File

@@ -36,7 +36,6 @@ function G.switch_input_method(req)
return input_status
end
function G.buf_kill(kill_command, bufnr, force)
kill_command = kill_command or "bd"
@@ -61,7 +60,8 @@ function G.buf_kill(kill_command, bufnr, force)
end)
elseif choice == 2 then
force = true
else return
else
return
end
elseif api.nvim_buf_get_option(bufnr, "buftype") == "terminal" then
choice = fn.confirm(fmt([[Close "%s"?]], bufname), "&Yes\n&No\n&Cancel")

View File

@@ -39,7 +39,9 @@ keymap.set("n", "<leader>ww", ":w<CR>", opt)
keymap.set("n", "<leader>so", ":so<CR>", opt)
keymap.set("n", "<leader>qq", ":q<CR>", opt)
keymap.set("n", "<leader>qa", ":qa<CR>", opt)
keymap.set("n", "<leader>c", function () buf_kill("bd", nil, false) end, opt)
keymap.set("n", "<leader>c", function()
buf_kill("bd", nil, false)
end, opt)
keymap.set("n", "<C-up>", ":resize +5<CR>", opt)
keymap.set("n", "<C-down>", ":resize -5<CR>", opt)
@@ -63,9 +65,8 @@ keymap.set("n", "<leader>wr", ":WorkspacesRemove<CR>", opt)
-- Neovide config
if vim.g.neovide then
keymap.set("v", "<C-C>", "\"+y", opt)
keymap.set("n", "<C-V>", "\"+P", opt)
keymap.set("i", "<C-V>", "<ESC>l\"+Pli", opt)
keymap.set("v", "<C-C>", '"+y', opt)
keymap.set("n", "<C-V>", '"+P', opt)
keymap.set("i", "<C-V>", '<ESC>l"+Pli', opt)
keymap.set("c", "<C-V>", "<C-R>+", opt)
end

View File

@@ -36,8 +36,8 @@ vim.g.autoread = true
vim.g.loaded_ruby_provider = 0
-- Hightlight on yank
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
vim.api.nvim_create_autocmd('TextYankPost', {
local highlight_group = vim.api.nvim_create_augroup("YankHighlight", { clear = true })
vim.api.nvim_create_autocmd("TextYankPost", {
callback = function()
vim.highlight.on_yank()
end,
@@ -62,7 +62,7 @@ vim.api.nvim_create_autocmd("InsertLeave", {
callback = function()
Last_input_method = require("core.globals").switch_input_method(1)
end,
group = "AutoInputMethod"
group = "AutoInputMethod",
})
vim.api.nvim_create_autocmd("CmdlineLeave", {
pattern = "*",
@@ -70,7 +70,7 @@ vim.api.nvim_create_autocmd("CmdlineLeave", {
callback = function()
require("core.globals").switch_input_method(1)
end,
group = "AutoInputMethod"
group = "AutoInputMethod",
})
vim.api.nvim_create_autocmd("InsertEnter", {
pattern = "*",
@@ -78,7 +78,7 @@ vim.api.nvim_create_autocmd("InsertEnter", {
callback = function()
require("core.globals").switch_input_method(Last_input_method)
end,
group = "AutoInputMethod"
group = "AutoInputMethod",
})
vim.api.nvim_create_autocmd("FileType", {
@@ -89,8 +89,8 @@ vim.api.nvim_create_autocmd("FileType", {
-- credit: https://github.com/sam4llis/nvim-lua-gf
vim.opt_local.include = [[\v<((do|load)file|require|reload)[^''"]*[''"]\zs[^''"]+]]
vim.opt_local.includeexpr = "substitute(v:fname,'\\.','/','g')"
vim.opt_local.suffixesadd:prepend ".lua"
vim.opt_local.suffixesadd:prepend "init.lua"
vim.opt_local.suffixesadd:prepend(".lua")
vim.opt_local.suffixesadd:prepend("init.lua")
for _, path in pairs(vim.api.nvim_list_runtime_paths()) do
vim.opt_local.path:append(path .. "/lua")
@@ -98,13 +98,6 @@ vim.api.nvim_create_autocmd("FileType", {
end,
})
-- fix https://github.com/neovim/neovim/issues/21856
vim.api.nvim_create_autocmd({ "VimLeave" }, {
callback = function()
vim.fn.jobstart("", { detach = true })
end,
})
-- MkDir
vim.api.nvim_create_user_command("MakeDirectory", function()
---@diagnostic disable-next-line: missing-parameter
@@ -116,25 +109,3 @@ vim.api.nvim_create_user_command("MakeDirectory", function()
vim.notify("Directory already exists", vim.log.levels.WARN, { title = "Nvim" })
end
end, { desc = "Create directory if it doesn't exist" })
-- Neovide config
if vim.g.neovide then
local global = vim.g
vim.o.guifont = "monospace:h14"
global.neovide_padding_top = 0
global.neovide_padding_bottom = 0
global.neovide_padding_right = 0
global.neovide_padding_left = 0
global.neovide_hide_mouse_when_typing = true
global.neovide_cursor_animation_length = 0.05
global.neovide_cursor_trail_size = 0.15
global.neovide_confirm_quit = true
end
vim.api.nvim_create_autocmd({ "VimEnter" }, {
callback = function()
-- A dumb way to clear annoying NeoVim startup screen
vim.cmd("normal ia")
vim.cmd("normal u")
end,
})

View File

@@ -10,4 +10,3 @@ vim.api.nvim_create_autocmd("BufWritePre", {
end,
group = "Go",
})

View File

@@ -32,4 +32,3 @@ vim.api.nvim_create_autocmd("BufLeave", {
end,
group = "Lua",
})

View File

@@ -32,4 +32,3 @@ vim.api.nvim_create_autocmd("BufLeave", {
end,
group = "Markdown",
})

View File

@@ -32,4 +32,3 @@ vim.api.nvim_create_autocmd("BufLeave", {
end,
group = "Nix",
})

View File

@@ -8,4 +8,3 @@ vim.api.nvim_create_autocmd("BufWritePost", {
end,
group = "Rust",
})

View File

@@ -5,14 +5,14 @@ M = {
javascript = { "string", "template_string" },
},
fast_wrap = {
map = '<M-e>',
chars = { '{', '[', '(', '"', "'" },
map = "<M-e>",
chars = { "{", "[", "(", '"', "'" },
pattern = [=[[%'%"%)%>%]%)%}%,]]=],
end_key = '$',
keys = 'qwertyuiopzxcvbnmasdfghjkl',
end_key = "$",
keys = "qwertyuiopzxcvbnmasdfghjkl",
check_comma = true,
highlight = 'Search',
highlight_grey='Comment'
highlight = "Search",
highlight_grey = "Comment",
},
}
@@ -23,4 +23,3 @@ if ok then
end
return M

View File

@@ -3,8 +3,8 @@ local buf_kill = require("core.globals").buf_kill
M = {
highlights = {
buffer_selected = {
bold = true
}
bold = true,
},
},
options = {
diagnostics = "nvim_lsp",
@@ -13,7 +13,7 @@ M = {
filetype = "NvimTree",
text = "File Explorer",
highlight = "Directory",
text_align = "center"
text_align = "center",
},
},
close_command = function(bufnr)
@@ -21,11 +21,10 @@ M = {
end,
right_mouse_command = function(bufnr)
buf_kill("bd", bufnr, true)
end
}
end,
},
}
vim.opt.termguicolors = true
return M

View File

@@ -3,21 +3,20 @@ local cmp = require("cmp")
M = {
window = {
completion = {
border = 'rounded',
scrollbar = '',
border = "rounded",
scrollbar = "",
},
documentation = {
border = 'rounded',
scrollbar = '',
border = "rounded",
scrollbar = "",
},
},
formatting = {
format = require('lspkind').cmp_format({
format = require("lspkind").cmp_format({
mode = "symbol",
maxwidth = 50,
ellipsis_char = '...',
symbol_map = { Codeium = "", }
})
ellipsis_char = "...",
}),
},
snippet = {
expand = function(args)
@@ -37,7 +36,7 @@ M = {
end
end, {
"i",
"s"
"s",
}),
["<Down>"] = cmp.mapping(function(fallback)
if cmp.visible() then
@@ -47,22 +46,19 @@ M = {
end
end, {
"i",
"s"
"s",
}),
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" },
{ name = "luasnip" },
-- { name = "codeium" },
{ name = "path" },
}, {
{ name = "buffer" },
})
}),
}
vim.o.wildmenu = true
vim.o.pumheight = 10
return M

View File

@@ -1,34 +1,30 @@
M = {
sources = {
friendly_snippets = true
friendly_snippets = true,
},
history = true,
updateevents = { "TextChanged", "TextChangedI" }
updateevents = { "TextChanged", "TextChangedI" },
}
-- vscode format
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load { paths = vim.g.vscode_snippets_path or "" }
require("luasnip.loaders.from_vscode").lazy_load({ paths = vim.g.vscode_snippets_path or "" })
-- snipmate format
require("luasnip.loaders.from_snipmate").load()
require("luasnip.loaders.from_snipmate").lazy_load { paths = vim.g.snipmate_snippets_path or "" }
require("luasnip.loaders.from_snipmate").lazy_load({ paths = vim.g.snipmate_snippets_path or "" })
-- lua format
require("luasnip.loaders.from_lua").load()
require("luasnip.loaders.from_lua").lazy_load { paths = vim.g.lua_snippets_path or "" }
require("luasnip.loaders.from_lua").lazy_load({ paths = vim.g.lua_snippets_path or "" })
local luasnip = require("luasnip")
vim.api.nvim_create_autocmd("InsertLeave", {
callback = function()
if
luasnip.session.current_nodes[vim.api.nvim_get_current_buf()]
and not luasnip.session.jump_active
then
if luasnip.session.current_nodes[vim.api.nvim_get_current_buf()] and not luasnip.session.jump_active then
luasnip.unlink_current()
end
end,
})
return M

View File

@@ -1,4 +0,0 @@
M = {}
return M

View File

@@ -1,19 +1,18 @@
M = {
signs = {
add = { text = '', color = "green" },
change = { text = '', color = "blue" },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
add = { text = "", color = "green" },
change = { text = "", color = "blue" },
delete = { text = "_" },
topdelete = { text = "" },
changedelete = { text = "~" },
},
current_line_blame = true,
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'eol',
virt_text_pos = "eol",
delay = 0,
ignore_whitespace = false,
},
}
return M

View File

@@ -1,15 +1,14 @@
M = {
enabled = true,
indent = {
tab_char = ""
tab_char = "",
},
scope = {
enabled = true,
show_start = false,
}
},
}
vim.opt.list = true
return M

View File

@@ -1,4 +1,3 @@
M = {}
return M

View File

@@ -7,7 +7,7 @@ local servers = {
"ts_ls",
"jsonls",
"cssls",
"nil_ls",
"nixd",
"html",
}
@@ -20,49 +20,53 @@ local extra_config = {
vim.api.nvim_get_runtime_file("", true),
"${3rd}/luv/library",
"${3rd}/luassert/library",
}
},
},
diagnostics = {
globals = {
"vim"
}
"vim",
},
},
completion = {
callSnippet = "Replace"
}
}
callSnippet = "Replace",
},
},
},
},
rust_analyzer = {
settings = {
rust_analyzer = {
check = {
command = "clippy"
command = "clippy",
},
diagnostics = {
experimental = true,
},
formatting = {
command = { "rustfmt" },
},
},
},
},
nixd = {
settings = {
nixd = {
nixpkgs = {
expr = "import <nixpkgs> { }",
},
options = {
nixos = {
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.imxyy-nix.options',
},
},
},
},
},
qmlls = {
cmd = {"qmlls", "-E"}
}
},
},
}
local on_attach = function(client, bufnr)
vim.api.nvim_create_autocmd("CursorHold", {
buffer = bufnr,
callback = function()
local opts = {
focusable = false,
close_events = { "BufLeave", "CursorMoved", "InsertEnter", "FocusLost" },
border = "rounded",
source = "always",
prefix = " ",
scope = "line",
}
vim.diagnostic.open_float(nil, opts)
end,
})
end
local capabilities = require("cmp_nvim_lsp").default_capabilities()
capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.foldingRange = {
@@ -73,16 +77,10 @@ local lspconfig = require("lspconfig")
for _, server in ipairs(servers) do
local extra = extra_config[server] or {}
local config = {
on_attach = on_attach,
capabilities = capabilities
capabilities = capabilities,
}
for k, v in pairs(extra) do
config[k] = v
end
lspconfig[server].setup(config)
end
vim.diagnostic.config({
virtual_lines = true
})

View File

@@ -1,7 +1,6 @@
M = {
-- ensure_installed = require("plugins.lsp.servers")
ensure_installed = {}
ensure_installed = {},
}
return M

View File

@@ -3,10 +3,9 @@ M = {
icons = {
package_installed = "",
package_pending = "",
package_uninstalled = ""
}
}
package_uninstalled = "",
},
},
}
return M

View File

@@ -4,26 +4,56 @@ local opt = require("core.globals").keymap_opt
vim.keymap.set("n", "K", vim.lsp.buf.hover, opt)
vim.keymap.set("n", "<leader>lR", vim.lsp.buf.rename, opt)
local icons = {}
local sev = vim.diagnostic.severity
local signs = {
[sev.ERROR] = "",
[sev.WARN] = "",
[sev.HINT] = "",
[sev.INFO] = "",
}
for type, icon in pairs(icons) do
local hl = vim.diagnostic.severity[type]
signs[hl] = icon
end
vim.diagnostic.config({
virtual_text = { spacing = 4, prefix = "" },
signs = true,
signs = {
text = signs,
},
underline = true,
update_in_insert = true,
severity_sort = true,
})
local signs = { Error = "", Warn = "", Hint = "", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "single",
})
--[[ vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = "single",
focusable = false,
relative = "cursor",
}) ]]
local diag_config1 = {
virtual_text = {
severity = {
max = vim.diagnostic.severity.WARN,
},
spacing = 4,
prefix = "",
},
virtual_lines = {
severity = {
min = vim.diagnostic.severity.ERROR,
},
},
}
local diag_config2 = {
virtual_text = { spacing = 4, prefix = "" },
virtual_lines = false,
}
vim.diagnostic.config(diag_config1)
local diag_config_basic = false
vim.keymap.set("n", "<leader>ll", function()
diag_config_basic = not diag_config_basic
if diag_config_basic then
vim.diagnostic.config(diag_config2)
else
vim.diagnostic.config(diag_config1)
end
end, { desc = "Toggle diagnostic virtual_lines" })

View File

@@ -1,6 +1,9 @@
M = {}
M = {
symbols = {
icon_source = "lspkind",
},
}
vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>",
{ desc = "Toggle Outline" })
vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>", { desc = "Toggle Outline" })
return M

View File

@@ -12,4 +12,3 @@ M = {
}
return M

View File

@@ -1,16 +1,19 @@
M = {
bind = true, -- This is mandatory, otherwise border config won't get registered.
handler_opts = {
border = "rounded"
border = "rounded",
},
hint_prefix = "^ ",
toggle_key = "<C-k>",
}
vim.keymap.set({ 'n' }, '<leader>k', require('lsp_signature').toggle_float_win,
{ silent = true, noremap = true, desc = 'toggle signature' })
vim.keymap.set(
{ "n" },
"<leader>k",
require("lsp_signature").toggle_float_win,
{ silent = true, noremap = true, desc = "toggle signature" }
)
vim.keymap.set({ 'n' }, 'K', vim.lsp.buf.signature_help,
{ silent = true, noremap = true, desc = 'toggle signature' })
vim.keymap.set({ "n" }, "K", vim.lsp.buf.signature_help, { silent = true, noremap = true, desc = "toggle signature" })
return M

View File

@@ -1,10 +1,12 @@
M = {
options = {
theme = "tokyonight"
theme = "tokyonight",
},
sections = {
lualine_y = {
'encoding', 'fileformat', 'filetype',
"encoding",
"fileformat",
"filetype",
},
lualine_x = {
{

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