Compare commits

..

115 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
258 changed files with 17553 additions and 2427 deletions

View File

@@ -1,6 +1,7 @@
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|conf)$
@@ -8,4 +9,5 @@ creation_rules:
- 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

View File

@@ -32,7 +32,7 @@ As for Flakes, refer to
| **Application Launcher** | wofi |
| **Notification Daemon** | SwayNotificationCenter |
| **Input method framework** | Fcitx5 |
| **Shell** | zsh & custom oh-my-zsh |
| **Shell** | Zsh |
| **Netease Cloudmusic Player** | go-musicfox |
| **Media Player** | mpv |
| **Text Editor** | Neovim |
@@ -52,28 +52,3 @@ And more...
- `vars.nix` - my variables
- `secrets/` - secrets managed by sops-nix. see [./secrets](./secrets) for details
- `flake.nix` - flake entry
<!--
## Deployment Guide
Since this repository is **heavily** based on my **own** daily use,
it includes, but not limit to, the tweaks listed below:
- auto login some specific TTYs (see [./modules/getty-autologin.nix](./modules/getty-autologin.nix) for details)
- `config.my` alias for custom modules and `config.my.home` alias for single user home-manger configuartion
- `lib.my` utilities to define custom modules conveniently
Therefore, if you want to deploy this setup locally, make sure that
you have **carefully** read **every single line** of code in this repository.
Then, you can follow the guide to deploy:
0. make sure that you have a very **reliable** networking environment (you know what I'm talking about)
1. boot into LiveCD
2. repartition your disk, it should be like this:
- `/dev/sda`
- `/dev/sda1`: boot partition (remember to set its type to `EFI System` in `cfdisk`, don't ask me why)
3. clone the repository (if you don't have `git` installed, `nix-shell -p git` will do the trick)
4. rename one of the folders in the `config/hosts` folder
5.
-->

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -22,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

@@ -18,13 +18,15 @@ in
];
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;

View File

@@ -1,40 +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 = {
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"
{
directory = ".ssh";
mode = "0700";
}
".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

@@ -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

@@ -23,7 +23,7 @@ in
verbose = false;
};
kernelPackages = lib.mkForce pkgs.linuxKernel.packages.linux_zen;
kernelPackages = lib.mkForce pkgs.linuxPackages_cachyos;
kernelModules = [ "kvm-amd" ];
tmp.useTmpfs = true;
@@ -36,6 +36,7 @@ in
"resume_offset=6444127"
];
};
services.scx.enable = true;
fileSystems."/" = {
device = btrfs;

View File

@@ -14,6 +14,7 @@
wpsoffice-cn
wps-office-fonts
ttf-wps-fonts
evince
anki
@@ -21,9 +22,9 @@
ayugram-desktop
telegram-desktop
signal-desktop
cinny-desktop
discord
qq
wechat
gnome-clocks
@@ -75,15 +76,6 @@
scale = 1.25;
};
};
spawn-at-startup = [
{
command = [
"sh"
"-c"
"sleep 3; echo 'Xft.dpi: 120' | ${lib.getExe pkgs.xorg.xrdb} -merge"
];
}
];
};
};
@@ -107,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;
@@ -162,54 +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"
];
};
};
}

View File

@@ -85,10 +85,6 @@
};
};
users.users.${username}.openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKAEH0EVp/DisV68ZtpN8APDc31ZgphVXfUQaYhkJuLP root@efl-nix"
];
sops.secrets.dae-imxyy-nix = {
sopsFile = sopsRoot + /dae-imxyy-nix.dae;
format = "binary";
@@ -117,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";
@@ -130,10 +126,5 @@
"network.target"
"sops-nix.service"
];
path = with pkgs; [
easytier
iproute2
bash
];
};
}

View File

@@ -132,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" ];
@@ -156,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" ];
};
@@ -194,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" ];

618
flake.lock generated

File diff suppressed because it is too large Load Diff

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,14 +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";
# OMZ
omz.url = "github:imxyy1soope1/omz/master";
omz.inputs.nixpkgs.follows = "nixpkgs";
# Niri
niri.url = "github:sodiboo/niri-flake";
niri.inputs.nixpkgs.follows = "nixpkgs";
@@ -56,8 +52,14 @@
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 =
@@ -78,17 +80,29 @@
}) (builtins.attrNames (builtins.readDir ./config/hosts))
);
lib = nixpkgs.lib.extend (
lib = (import ./lib/stdlib-extended.nix nixpkgs.lib).extend (
final: prev: {
inherit (inputs.home-manager.lib) hm;
inherit infuse;
my = import ./lib { lib = final; };
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 (
@@ -110,14 +124,15 @@
}
);
overlays = import ./overlays { inherit inputs infuse; };
overlays = import ./overlays {
inherit inputs lib;
};
nixosConfigurations = forAllHosts (
hostname:
let
overlays = builtins.attrValues self.overlays ++ [
inputs.go-musicfox.overlays.default
inputs.omz.overlays.default
inputs.niri.overlays.niri
inputs.fenix.overlays.default
(final: prev: {
@@ -129,7 +144,7 @@
withJemalloc = true;
withQtSvg = true;
withWayland = true;
withPipewire = false;
withPipewire = true;
withPam = false;
withX11 = false;
withHyprland = false;
@@ -144,7 +159,8 @@
sharedModules = [
inputs.sops-nix.homeManagerModules.sops
inputs.impermanence.nixosModules.home-manager.impermanence
inputs.stylix.homeManagerModules.stylix
inputs.stylix.homeModules.stylix
inputs.zen.homeModules.beta
# workaround for annoying stylix
(
{ lib, ... }:
@@ -157,7 +173,7 @@
};
};
pkgsConf.nixpkgs = {
overlays = lib.mkForce overlays;
inherit overlays;
config.allowUnfree = true;
flake.setNixPath = false;
};
@@ -169,20 +185,30 @@
outputs
hostname
;
sopsRoot = ./secrets;
flake = ./.;
} // vars;
modules = [
./modules
./config/base.nix
./config/hosts/${hostname}
inputs.sops-nix.nixosModules.sops
inputs.impermanence.nixosModules.impermanence
inputs.home-manager.nixosModules.default
inputs.niri.nixosModules.niri
home
pkgsConf
];
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

@@ -12,6 +12,7 @@ lib.my.makeSwitch {
misc.enable = true;
monitor.all.enable = true;
shell.all.enable = true;
vcs.all.enable = true;
};
};
}

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

@@ -23,6 +23,13 @@ lib.my.makeSwitch {
};
cli.media.mpd.enable = true;
persist.homeDirs = [
".config/go-musicfox/db"
];
persist.homeFiles = [
".config/go-musicfox/cookie"
];
};
};
}

View File

@@ -14,12 +14,15 @@ lib.my.makeSwitch {
];
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"
];
};
}

85
modules/cli/misc.nix Normal file
View File

@@ -0,0 +1,85 @@
{
config,
lib,
pkgs,
username,
userfullname,
useremail,
...
}:
lib.my.makeSwitch {
inherit config;
default = true;
optionName = "misc command line tools";
optionPath = [
"cli"
"misc"
];
config' = {
environment.systemPackages = with pkgs; [
vim
wget
git
file
gnused
gnutar
zip
unzip
xz
p7zip
unrar-free
pciutils
usbutils
lsof
nmap
traceroute
tcping-go
dnsutils
killall
];
programs.dconf.enable = true;
my.home = {
home.packages = with pkgs; [
lsd
fd
neofetch
fzf
bat
ripgrep
aria2
socat
];
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

@@ -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

@@ -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 = " "

View File

@@ -14,12 +14,78 @@ lib.my.makeSwitch {
"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 = [ pkgs.omz ];
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";
@@ -29,14 +95,26 @@ lib.my.makeSwitch {
"la"
];
};
initContent = ''
source ${pkgs.omz}/share/omz/omz.zsh
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
'';
sessionVariables = {
_ZL_DATA = "${stateHome}/zlua";
_FZF_HISTORY = "${stateHome}/fzf_history";
oh-my-zsh = {
enable = true;
theme = "gentoo";
plugins = [
"git"
"git-extras"
"extract"
"sudo"
"dotenv"
];
};
shellAliases = {
x = "extract";
ls = "lsd";
svim = "sudoedit";
nf = "neofetch";

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;
};
};
}

View File

@@ -7,50 +7,17 @@
useremail,
...
}:
lib.my.makeSwitch {
lib.my.makeHomeProgramConfig {
inherit config;
default = true;
optionName = "misc command line tools";
programName = "git";
optionPath = [
"cli"
"misc"
"vcs"
"git"
];
config' = {
environment.systemPackages = with pkgs; [
vim
wget
git
file
gnused
gnutar
zip
unzip
xz
p7zip
unrar-free
pciutils
usbutils
lsof
nmap
traceroute
tcping-go
dnsutils
killall
];
programs.zsh.enable = true;
programs.dconf.enable = true;
extraConfig = {
my.home = {
programs.home-manager.enable = true;
programs.git = {
enable = true;
userName = "${userfullname}";
userEmail = "${useremail}";
signing = {
@@ -59,7 +26,6 @@ lib.my.makeSwitch {
key = "/home/${username}/.ssh/id_ed25519";
};
extraConfig = {
pull.rebase = true;
push.autoSetupRemote = true;
gpg.ssh.allowedSignersFile =
(pkgs.writeText "allowed_signers" ''
@@ -71,31 +37,6 @@ lib.my.makeSwitch {
programs.lazygit = {
enable = true;
};
home.packages = with pkgs; [
lsd
fd
neofetch
fzf
bat
ripgrep
aria2
socat
nix-output-monitor
tmux
trash-cli
cht-sh
dooit
# translate-shell
];
xdg.configFile."tmux/tmux.conf".source = ./tmux.conf;
};
};
}

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,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;
@@ -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,77 +36,77 @@ function G.switch_input_method(req)
return input_status
end
function G.buf_kill(kill_command, bufnr, force)
kill_command = kill_command or "bd"
kill_command = kill_command or "bd"
local bo = vim.bo
local api = vim.api
local fmt = string.format
local fn = vim.fn
local bo = vim.bo
local api = vim.api
local fmt = string.format
local fn = vim.fn
if bufnr == 0 or bufnr == nil then
bufnr = api.nvim_get_current_buf()
end
if bufnr == 0 or bufnr == nil then
bufnr = api.nvim_get_current_buf()
end
local bufname = api.nvim_buf_get_name(bufnr)
local bufname = api.nvim_buf_get_name(bufnr)
if not force then
local choice
if bo[bufnr].modified then
choice = fn.confirm(fmt([[Save changes to "%s"?]], bufname), "&Yes\n&No\n&Cancel")
if choice == 1 then
vim.api.nvim_buf_call(bufnr, function()
vim.cmd("w")
end)
elseif choice == 2 then
force = true
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")
if choice == 1 then
force = true
else
return
end
end
end
if not force then
local choice
if bo[bufnr].modified then
choice = fn.confirm(fmt([[Save changes to "%s"?]], bufname), "&Yes\n&No\n&Cancel")
if choice == 1 then
vim.api.nvim_buf_call(bufnr, function()
vim.cmd("w")
end)
elseif choice == 2 then
force = true
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")
if choice == 1 then
force = true
else
return
end
end
end
-- Get list of windows IDs with the buffer to close
local windows = vim.tbl_filter(function(win)
return api.nvim_win_get_buf(win) == bufnr
end, api.nvim_list_wins())
-- Get list of windows IDs with the buffer to close
local windows = vim.tbl_filter(function(win)
return api.nvim_win_get_buf(win) == bufnr
end, api.nvim_list_wins())
if force then
kill_command = kill_command .. "!"
end
if force then
kill_command = kill_command .. "!"
end
-- Get list of active buffers
local buffers = vim.tbl_filter(function(buf)
return api.nvim_buf_is_valid(buf) and bo[buf].buflisted
end, api.nvim_list_bufs())
-- Get list of active buffers
local buffers = vim.tbl_filter(function(buf)
return api.nvim_buf_is_valid(buf) and bo[buf].buflisted
end, api.nvim_list_bufs())
-- If there is only one buffer (which has to be the current one), vim will
-- create a new buffer on :bd.
-- For more than one buffer, pick the previous buffer (wrapping around if necessary)
if #buffers > 1 and #windows > 0 then
for i, v in ipairs(buffers) do
if v == bufnr then
local prev_buf_idx = i == 1 and #buffers or (i - 1)
local prev_buffer = buffers[prev_buf_idx]
for _, win in ipairs(windows) do
api.nvim_win_set_buf(win, prev_buffer)
end
end
end
end
-- If there is only one buffer (which has to be the current one), vim will
-- create a new buffer on :bd.
-- For more than one buffer, pick the previous buffer (wrapping around if necessary)
if #buffers > 1 and #windows > 0 then
for i, v in ipairs(buffers) do
if v == bufnr then
local prev_buf_idx = i == 1 and #buffers or (i - 1)
local prev_buffer = buffers[prev_buf_idx]
for _, win in ipairs(windows) do
api.nvim_win_set_buf(win, prev_buffer)
end
end
end
end
-- Check if buffer still exists, to ensure the target buffer wasn't killed
-- due to options like bufhidden=wipe.
if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then
vim.cmd(string.format("%s %d", kill_command, bufnr))
end
-- Check if buffer still exists, to ensure the target buffer wasn't killed
-- due to options like bufhidden=wipe.
if api.nvim_buf_is_valid(bufnr) and bo[bufnr].buflisted then
vim.cmd(string.format("%s %d", kill_command, bufnr))
end
return true
end

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

@@ -1,31 +1,30 @@
local buf_kill = require("core.globals").buf_kill
M = {
highlights = {
buffer_selected = {
bold = true
}
},
options = {
diagnostics = "nvim_lsp",
offsets = {
highlights = {
buffer_selected = {
bold = true,
},
},
options = {
diagnostics = "nvim_lsp",
offsets = {
{
filetype = "NvimTree",
text = "File Explorer",
highlight = "Directory",
text_align = "center"
text_align = "center",
},
},
close_command = function (bufnr)
buf_kill("bd", bufnr, false)
end,
right_mouse_command = function (bufnr)
buf_kill("bd", bufnr, true)
end
}
close_command = function(bufnr)
buf_kill("bd", bufnr, false)
end,
right_mouse_command = function(bufnr)
buf_kill("bd", bufnr, true)
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)
@@ -29,7 +28,7 @@ M = {
["<C-f>"] = cmp.mapping.scroll_docs(4),
["<Escape>"] = cmp.mapping.abort(),
["<Tab>"] = cmp.mapping.confirm({ select = true }),
["<Up>"] = cmp.mapping(function (fallback)
["<Up>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
else
@@ -37,9 +36,9 @@ M = {
end
end, {
"i",
"s"
"s",
}),
["<Down>"] = cmp.mapping(function (fallback)
["<Down>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
else
@@ -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" },
})
{ name = "nvim_lsp" },
{ name = "luasnip" },
{ 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 = '~' },
},
signs = {
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

@@ -20,24 +20,24 @@ 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 = "cargo clippy"
command = "clippy",
},
diagnostics = {
experimental = true,
@@ -45,7 +45,7 @@ local extra_config = {
formatting = {
command = { "rustfmt" },
},
}
},
},
},
nixd = {
@@ -56,11 +56,14 @@ local extra_config = {
},
options = {
nixos = {
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.imxyy-nix.options',
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.imxyy-nix.options',
},
},
}
}
},
},
},
qmlls = {
cmd = {"qmlls", "-E"}
}
}
@@ -74,7 +77,7 @@ local lspconfig = require("lspconfig")
for _, server in ipairs(servers) do
local extra = extra_config[server] or {}
local config = {
capabilities = capabilities
capabilities = capabilities,
}
for k, v in pairs(extra) do
config[k] = v

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,22 +4,29 @@ 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 = { Error = "", Warn = "", Hint = "", Info = "" }
local signs = {}
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 = "DiagnosticSign" .. type
signs[hl] = { text = icon, texthl = hl, numhl = hl }
local hl = vim.diagnostic.severity[type]
signs[hl] = icon
end
vim.diagnostic.config({
virtual_text = { spacing = 4, prefix = "" },
signs = signs,
signs = {
text = signs,
},
underline = true,
update_in_insert = true,
severity_sort = true,
})
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = "single",
border = "single",
})
local diag_config1 = {
@@ -27,6 +34,8 @@ local diag_config1 = {
severity = {
max = vim.diagnostic.severity.WARN,
},
spacing = 4,
prefix = "",
},
virtual_lines = {
severity = {
@@ -35,7 +44,7 @@ local diag_config1 = {
},
}
local diag_config2 = {
virtual_text = true,
virtual_text = { spacing = 4, prefix = "" },
virtual_lines = false,
}
vim.diagnostic.config(diag_config1)

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 = {
{

View File

@@ -1,31 +0,0 @@
M = {}
vim.api.nvim_create_augroup("MarkdownPreviewAuto", {})
vim.api.nvim_create_user_command("MarkdownPreviewAutoEnable", function()
vim.api.nvim_create_autocmd("BufEnter", {
group = "MarkdownPreviewAuto",
pattern = { "*.md" },
desc = "Auto enable MarkdownPreview",
callback = function()
vim.cmd("MarkdownPreview")
end,
})
vim.api.nvim_create_autocmd("BufLeave", {
group = "MarkdownPreviewAuto",
pattern = { "*.md" },
desc = "Auto disable MarkdownPreview",
callback = function()
vim.cmd("MarkdownPreviewStop")
end,
})
end, { desc = "Auto enable MarkdownPreview" })
vim.api.nvim_create_user_command("MarkdownPreviewAutoDisable",
function()
vim.api.nvim_clear_autocmds({ group = "MarkdownPreviewAuto" })
end, {}
)
return M

View File

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

View File

@@ -3,11 +3,11 @@ M = {
diagnostics = {
enable = false,
debounce_delay = 50,
show_on_dirs = true
show_on_dirs = true,
},
filters = {
git_ignored = false
}
git_ignored = false,
},
}
vim.g.loaded_netrw = 1
@@ -18,4 +18,3 @@ vim.keymap.set("n", "<leader>e", ":NvimTreeToggle<CR>", opt)
vim.keymap.set("n", "<leader>te", ":NvimTreeFocus<CR>", opt)
return M

View File

@@ -5,7 +5,7 @@ if not vim.loop.fs_stat(lazypath) then
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
@@ -18,7 +18,7 @@ local plugins = {
priority = 1000,
config = function()
vim.cmd.colorscheme("tokyonight-storm")
end
end,
},
{
"nvim-lualine/lualine.nvim",
@@ -26,53 +26,50 @@ local plugins = {
dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } },
config = function()
require("lualine").setup(require("plugins.lualine"))
end
end,
},
{
"nvim-tree/nvim-tree.lua",
lazy = false,
dependencies = { { "nvim-tree/nvim-web-devicons", lazy = true } },
lazy = false,
config = function()
require("nvim-tree").setup(require("plugins.nvim-tree"))
end
end,
},
{
"nvim-treesitter/nvim-treesitter",
lazy = false,
event = "VeryLazy",
dependencies = {
"nvim-treesitter/nvim-treesitter-textobjects",
"nushell/tree-sitter-nu"
"nushell/tree-sitter-nu",
},
config = function()
require("nvim-treesitter.configs").setup(require("plugins.treesitter"))
end,
build = ":TSUpdate"
build = ":TSUpdate",
},
{
url = "https://gitlab.com/HiPhish/rainbow-delimiters.nvim",
lazy = false,
event = "VeryLazy",
config = function()
require("plugins.rainbow-delimiters")
end
end,
},
{
"lukas-reineke/indent-blankline.nvim",
lazy = false,
event = "VeryLazy",
config = function()
require("ibl").setup(require("plugins.indent-blankline"))
end
end,
},
{
"neovim/nvim-lspconfig",
dependencies = { "hrsh7th/cmp-nvim-lsp" },
lazy = false,
event = "VeryLazy",
config = function()
require("plugins.lsp.lspconfig")
require("plugins.lsp.others")
end
end,
},
{
"folke/trouble.nvim",
@@ -110,15 +107,13 @@ local plugins = {
desc = "Quickfix List (Trouble)",
},
},
opts = {}
opts = {},
},
{
"MysticalDevil/inlay-hints.nvim",
event = "LspAttach",
dependencies = { "neovim/nvim-lspconfig" },
config = function()
require("inlay-hints").setup()
end
opts = {}
},
{
"hedyhli/outline.nvim",
@@ -129,12 +124,12 @@ local plugins = {
},
{
"L3MON4D3/LuaSnip",
lazy = false,
event = "InsertEnter",
dependencies = { { "rafamadriz/friendly-snippets", lazy = true } },
build = "make install_jsregexp",
config = function()
require("luasnip").setup(require("plugins.cmp.luasnip"))
end
end,
},
{
"hrsh7th/nvim-cmp",
@@ -144,106 +139,78 @@ local plugins = {
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
"hrsh7th/cmp-path",
"onsails/lspkind.nvim"
"onsails/lspkind.nvim",
},
lazy = false,
event = "InsertEnter",
config = function()
require("cmp").setup(require("plugins.cmp.cmp"))
end
end,
},
{
"numToStr/Comment.nvim",
lazy = false,
event = "VeryLazy",
config = function()
require("Comment").setup(require("plugins.comment"))
end
opts = {}
},
{
"windwp/nvim-autopairs",
lazy = false,
event = "VeryLazy",
event = "InsertEnter",
dependencies = { "hrsh7th/nvim-cmp" },
config = function()
require("nvim-autopairs").setup(require("plugins.autopairs"))
end
end,
},
{
"akinsho/bufferline.nvim",
lazy = false,
config = function()
require("bufferline").setup(require("plugins.bufferline"))
end
end,
},
{
"lewis6991/gitsigns.nvim",
lazy = false,
event = "VeryLazy",
config = function()
require("gitsigns").setup(require("plugins.gitsigns"))
end
end,
},
{
"nvim-telescope/telescope.nvim",
tag = "0.1.2",
dependencies = { "nvim-lua/plenary.nvim", "BurntSushi/ripgrep" },
config = function()
require("telescope").setup(require("plugins.telescope"))
end,
},
{
"ggandor/leap.nvim",
dependencies = { "tpope/vim-repeat" },
config = function()
require("leap").set_default_mappings()
-- Exclude whitespace and the middle of alphabetic words from preview:
-- foobar[baaz] = quux
-- ^----^^^--^^-^-^--^
require('leap').opts.preview_filter = function(ch0, ch1, ch2)
return not (
ch1:match('%s') or
ch0:match('%a') and ch1:match('%a') and ch2:match('%a')
)
end
require('leap.user').set_repeat_keys('<enter>', '<backspace>')
end
},
{
"alexghergh/nvim-tmux-navigation",
lazy = false,
event = "VeryLazy",
config = function()
require("nvim-tmux-navigation").setup(require("plugins.tmuxnav"))
end
},
{
"natecraddock/sessions.nvim",
lazy = false,
event = "VeryLazy",
config = function()
require("sessions").setup(require("plugins.sessions"))
end
},
{
"natecraddock/workspaces.nvim",
lazy = false,
event = "VeryLazy",
dependencies = { "nvim-telescope/telescope.nvim", "natecraddock/sessions.nvim" },
config = function()
require("workspaces").setup(require("plugins.workspaces"))
require("telescope").load_extension("workspaces")
end
},
--[[ {
"iamcco/markdown-preview.nvim",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop", "MarkdownPreviewAutoEnable", "MarkdownPreviewAutoDisable" },
ft = { "markdown" },
build = function()
vim.fn["mkdp#util#install"]()
end,
config = function()
require("plugins.markdown-preview")
end
}, ]]
--[[ {
"dhruvasagar/vim-table-mode",
lazy = true,
event = "BufEnter *.md",
config = function()
require("plugins.table-mode")
end
}, ]]
},
{
"lukas-reineke/headlines.nvim",
dependencies = "nvim-treesitter/nvim-treesitter",
config = true, -- or `opts = {}`
"MeanderingProgrammer/render-markdown.nvim",
dependencies = { "nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons" },
event = "BufEnter *.md",
opts = {},
},
{
"folke/noice.nvim",
lazy = false,
event = "VeryLazy",
dependencies = {
"MunifTanjim/nui.nvim",
@@ -254,49 +221,41 @@ local plugins = {
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
["vim.lsp.util.stylize_markdown"] = true,
["cmp.entry.get_documentation"] = true,
}
}
},
},
},
{
"voldikss/vim-floaterm",
lazy = false,
event = "VeryLazy",
config = function()
require("plugins.floaterm")
end
end,
},
{
"folke/todo-comments.nvim",
lazy = false,
event = "VeryLazy",
opts = {},
},
{
"ojroques/nvim-osc52",
event = "BufEnter",
event = "VeryLazy",
config = function()
require("osc52").setup({
tmux_passthrough = true
tmux_passthrough = true,
})
local function copy()
if vim.v.event.operator == "y" and vim.v.event.regname == "+" then
require("osc52").copy_register("+")
end
end
vim.api.nvim_create_autocmd("TextYankPost", {callback = copy})
end
vim.api.nvim_create_autocmd("TextYankPost", { callback = copy })
end,
},
{
"pest-parser/pest.vim",
event = "VeryLazy",
opts = {}
}
ft = "pest",
opts = {},
},
}
local opts = {
rocks = {
enabled = false
}
}
require("lazy").setup(plugins, opts)
require("lazy").setup(plugins, {})

View File

@@ -1,21 +1,20 @@
local rainbow_delimiters = require("rainbow-delimiters")
vim.g.rainbow_delimiters = {
strategy = {
[''] = rainbow_delimiters.strategy['global'],
vim = rainbow_delimiters.strategy['local'],
[""] = rainbow_delimiters.strategy["global"],
vim = rainbow_delimiters.strategy["local"],
},
query = {
[''] = 'rainbow-delimiters',
lua = 'rainbow-blocks',
[""] = "rainbow-delimiters",
lua = "rainbow-blocks",
},
highlight = {
'RainbowDelimiterRed',
'RainbowDelimiterYellow',
'RainbowDelimiterBlue',
'RainbowDelimiterOrange',
'RainbowDelimiterGreen',
'RainbowDelimiterViolet',
'RainbowDelimiterCyan',
"RainbowDelimiterRed",
"RainbowDelimiterYellow",
"RainbowDelimiterBlue",
"RainbowDelimiterOrange",
"RainbowDelimiterGreen",
"RainbowDelimiterViolet",
"RainbowDelimiterCyan",
},
}

View File

@@ -1,10 +0,0 @@
M = {
events = { "VimLeavePre" },
indent = {
tab_char = ""
},
session_filepath = vim.fn.stdpath("data") .. "/session",
}
return M

View File

@@ -1,34 +0,0 @@
M = {}
vim.g.table_mode_corner = "|"
vim.api.nvim_create_augroup("TableModeAuto", {})
vim.api.nvim_create_user_command("TableModeAutoEnable", function()
vim.api.nvim_clear_autocmds({ group = "TableModeAuto" })
vim.api.nvim_create_autocmd("BufEnter", {
group = "TableModeAuto",
pattern = { "*.md" },
desc = "Auto enable TableMode",
callback = function()
vim.cmd("TableModeEnable")
end,
})
vim.api.nvim_create_autocmd("BufWrite", {
group = "TableModeAuto",
pattern = { "*.md" },
desc = "Auto enable TableMode",
callback = function()
vim.cmd("TableModeRealign")
end,
})
end, { desc = "Auto enable TableMode" })
vim.api.nvim_create_user_command("TableModeAutoDisable",
function()
vim.api.nvim_clear_autocmds({ group = "TableModeAuto" })
end, {}
)
return M

View File

@@ -3,13 +3,13 @@ M = {
winblend = 50,
path_display = {
"smart",
shorten = 3
}
shorten = 3,
},
},
pickers = {
lsp_definitions = {
theme = "cursor",
layout_config = { width = 0.6, height = 0.3},
layout_config = { width = 0.6, height = 0.3 },
},
lsp_references = {
theme = "cursor",
@@ -17,29 +17,28 @@ M = {
},
current_buffer_fuzzy_find = {
theme = "dropdown",
layout_config = { height = 0.7, width = 0.55, preview_cutoff = 0 ,prompt_position = "top" }
layout_config = { height = 0.7, width = 0.55, preview_cutoff = 0, prompt_position = "top" },
},
lsp_document_symbols = {
theme = "ivy",
layout_config = { height = 0.25 }
}
layout_config = { height = 0.25 },
},
},
}
local opt = require("core.globals").keymap_opt
local keymap = vim.keymap
local builtin = require('telescope.builtin')
local builtin = require("telescope.builtin")
keymap.set('n', '<leader>ff', builtin.find_files, opt)
keymap.set('n', '<leader>gf', builtin.git_files, opt)
keymap.set('n', '<leader>fg', builtin.live_grep, opt)
keymap.set('n', '<leader>fb', builtin.buffers, opt)
keymap.set('n', '<leader>fh', builtin.help_tags, opt)
keymap.set("n", "<leader>ff", builtin.find_files, opt)
keymap.set("n", "<leader>gf", builtin.git_files, opt)
keymap.set("n", "<leader>fg", builtin.live_grep, opt)
keymap.set("n", "<leader>fb", builtin.buffers, opt)
keymap.set("n", "<leader>fh", builtin.help_tags, opt)
-- keymap.set('n', '<leader>lD', builtin.diagnostics, opt)
keymap.set('n', '<leader>ld', builtin.lsp_definitions, opt)
keymap.set('n', '<leader>lr', builtin.lsp_references, opt)
keymap.set('n', '<leader>ls', builtin.lsp_document_symbols, opt)
keymap.set('n', '<leader>/', builtin.current_buffer_fuzzy_find, opt)
keymap.set("n", "<leader>ld", builtin.lsp_definitions, opt)
keymap.set("n", "<leader>lr", builtin.lsp_references, opt)
keymap.set("n", "<leader>ls", builtin.lsp_document_symbols, opt)
keymap.set("n", "<leader>/", builtin.current_buffer_fuzzy_find, opt)
return M

View File

@@ -11,4 +11,3 @@ keymap.set("n", "<C-\\>", tmuxnav.NvimTmuxNavigateLastActive)
keymap.set("n", "<C-Space>", tmuxnav.NvimTmuxNavigateNext)
return M

View File

@@ -6,15 +6,14 @@ M = {
ignore_install = {},
highlight = { enable = true },
indent = { enable = true }
indent = { enable = true },
}
vim.filetype.add({
pattern = {
[".*/hypr/.*%.conf"] = "hyprlang",
[".*%.hl"] = "hyprlang"
[".*%.hl"] = "hyprlang",
},
})
return M

View File

@@ -1,14 +0,0 @@
M = {
hooks = {
open = function ()
require("core.globals").close_empty_buffer()
vim.cmd("enew")
vim.cmd("bufdo bd")
require("sessions").load(nil, { silent = true })
vim.cmd("NvimTreeFocus")
end
},
}
return M

View File

@@ -0,0 +1,20 @@
{
config,
lib,
...
}:
lib.my.makeHomeProgramConfig {
inherit config;
programName = "zed-editor";
optionPath = [
"coding"
"editor"
"zed"
];
extraConfig = {
my.persist.homeDirs = [
".config/zed"
".local/share/zed"
];
};
}

View File

@@ -1,205 +0,0 @@
#compdef gh
# zsh completion for gh -*- shell-script -*-
__gh_debug()
{
local file="$BASH_COMP_DEBUG_FILE"
if [[ -n ${file} ]]; then
echo "$*" >> "${file}"
fi
}
_gh()
{
local shellCompDirectiveError=1
local shellCompDirectiveNoSpace=2
local shellCompDirectiveNoFileComp=4
local shellCompDirectiveFilterFileExt=8
local shellCompDirectiveFilterDirs=16
local lastParam lastChar flagPrefix requestComp out directive comp lastComp noSpace
local -a completions
__gh_debug "\n========= starting completion logic =========="
__gh_debug "CURRENT: ${CURRENT}, words[*]: ${words[*]}"
# The user could have moved the cursor backwards on the command-line.
# We need to trigger completion from the $CURRENT location, so we need
# to truncate the command-line ($words) up to the $CURRENT location.
# (We cannot use $CURSOR as its value does not work when a command is an alias.)
words=("${=words[1,CURRENT]}")
__gh_debug "Truncated words[*]: ${words[*]},"
lastParam=${words[-1]}
lastChar=${lastParam[-1]}
__gh_debug "lastParam: ${lastParam}, lastChar: ${lastChar}"
# For zsh, when completing a flag with an = (e.g., gh -n=<TAB>)
# completions must be prefixed with the flag
setopt local_options BASH_REMATCH
if [[ "${lastParam}" =~ '-.*=' ]]; then
# We are dealing with a flag with an =
flagPrefix="-P ${BASH_REMATCH}"
fi
# Prepare the command to obtain completions
requestComp="${words[1]} __complete ${words[2,-1]}"
if [ "${lastChar}" = "" ]; then
# If the last parameter is complete (there is a space following it)
# We add an extra empty parameter so we can indicate this to the go completion code.
__gh_debug "Adding extra empty parameter"
requestComp="${requestComp} \"\""
fi
__gh_debug "About to call: eval ${requestComp}"
# Use eval to handle any environment variables and such
out=$(eval ${requestComp} 2>/dev/null)
__gh_debug "completion output: ${out}"
# Extract the directive integer following a : from the last line
local lastLine
while IFS='\n' read -r line; do
lastLine=${line}
done < <(printf "%s\n" "${out[@]}")
__gh_debug "last line: ${lastLine}"
if [ "${lastLine[1]}" = : ]; then
directive=${lastLine[2,-1]}
# Remove the directive including the : and the newline
local suffix
(( suffix=${#lastLine}+2))
out=${out[1,-$suffix]}
else
# There is no directive specified. Leave $out as is.
__gh_debug "No directive found. Setting do default"
directive=0
fi
__gh_debug "directive: ${directive}"
__gh_debug "completions: ${out}"
__gh_debug "flagPrefix: ${flagPrefix}"
if [ $((directive & shellCompDirectiveError)) -ne 0 ]; then
__gh_debug "Completion received error. Ignoring completions."
return
fi
local activeHelpMarker="_activeHelp_ "
local endIndex=${#activeHelpMarker}
local startIndex=$((${#activeHelpMarker}+1))
local hasActiveHelp=0
while IFS='\n' read -r comp; do
# Check if this is an activeHelp statement (i.e., prefixed with $activeHelpMarker)
if [ "${comp[1,$endIndex]}" = "$activeHelpMarker" ];then
__gh_debug "ActiveHelp found: $comp"
comp="${comp[$startIndex,-1]}"
if [ -n "$comp" ]; then
compadd -x "${comp}"
__gh_debug "ActiveHelp will need delimiter"
hasActiveHelp=1
fi
continue
fi
if [ -n "$comp" ]; then
# If requested, completions are returned with a description.
# The description is preceded by a TAB character.
# For zsh's _describe, we need to use a : instead of a TAB.
# We first need to escape any : as part of the completion itself.
comp=${comp//:/\\:}
local tab="$(printf '\t')"
comp=${comp//$tab/:}
__gh_debug "Adding completion: ${comp}"
completions+=${comp}
lastComp=$comp
fi
done < <(printf "%s\n" "${out[@]}")
# Add a delimiter after the activeHelp statements, but only if:
# - there are completions following the activeHelp statements, or
# - file completion will be performed (so there will be choices after the activeHelp)
if [ $hasActiveHelp -eq 1 ]; then
if [ ${#completions} -ne 0 ] || [ $((directive & shellCompDirectiveNoFileComp)) -eq 0 ]; then
__gh_debug "Adding activeHelp delimiter"
compadd -x "--"
hasActiveHelp=0
fi
fi
if [ $((directive & shellCompDirectiveNoSpace)) -ne 0 ]; then
__gh_debug "Activating nospace."
noSpace="-S ''"
fi
if [ $((directive & shellCompDirectiveFilterFileExt)) -ne 0 ]; then
# File extension filtering
local filteringCmd
filteringCmd='_files'
for filter in ${completions[@]}; do
if [ ${filter[1]} != '*' ]; then
# zsh requires a glob pattern to do file filtering
filter="\*.$filter"
fi
filteringCmd+=" -g $filter"
done
filteringCmd+=" ${flagPrefix}"
__gh_debug "File filtering command: $filteringCmd"
_arguments '*:filename:'"$filteringCmd"
elif [ $((directive & shellCompDirectiveFilterDirs)) -ne 0 ]; then
# File completion for directories only
local subdir
subdir="${completions[1]}"
if [ -n "$subdir" ]; then
__gh_debug "Listing directories in $subdir"
pushd "${subdir}" >/dev/null 2>&1
else
__gh_debug "Listing directories in ."
fi
local result
_arguments '*:dirname:_files -/'" ${flagPrefix}"
result=$?
if [ -n "$subdir" ]; then
popd >/dev/null 2>&1
fi
return $result
else
__gh_debug "Calling _describe"
if eval _describe "completions" completions $flagPrefix $noSpace; then
__gh_debug "_describe found some completions"
# Return the success of having called _describe
return 0
else
__gh_debug "_describe did not find completions."
__gh_debug "Checking if we should do file completion."
if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
__gh_debug "deactivating file completion"
# We must return an error code here to let zsh know that there were no
# completions found by _describe; this is what will trigger other
# matching algorithms to attempt to find completions.
# For example zsh can match letters in the middle of words.
return 1
else
# Perform file completion
__gh_debug "Activating file completion"
# We must return the result of this command, so it must be the
# last command, or else we must store its result to return it.
_arguments '*:filename:_files'" ${flagPrefix}"
fi
fi
fi
}
# don't run the completion function when being source-ed or eval-ed
if [ "$funcstack[1]" = "_gh" ]; then
_gh
fi

View File

@@ -15,6 +15,7 @@ lib.my.makeSwitch {
python.enable = true;
rust.enable = true;
lua.enable = true;
qml.enable = true;
};
};
}

View File

@@ -1,12 +0,0 @@
{ ... }:
{
imports = [
./all.nix
./c.nix
./go.nix
./js.nix
./rust.nix
./python.nix
./lua.nix
];
}

View File

@@ -24,6 +24,9 @@ lib.my.makeSwitch {
prefix = ''${HOME}/.npm-global
registry = https://registry.npmmirror.com
'';
programs.zsh.initContent = lib.mkAfter ''
export PATH=$PATH:$HOME/.npm-global/bin
'';
};
my.persist.homeDirs = [
".npm"

View File

@@ -0,0 +1,20 @@
{
config,
lib,
pkgs,
...
}:
lib.my.makeSwitch {
inherit config;
optionName = "QML";
optionPath = [
"coding"
"langs"
"qml"
];
config' = {
my.home.home.packages = with pkgs; [
kdePackages.qtdeclarative
];
};
}

View File

@@ -17,9 +17,6 @@ lib.my.makeSwitch {
gnumake
github-cli # gh
];
programs.zsh.initContent = ''
source ${./github-cli-comp}
'';
programs.direnv.enable = true;
};
my.persist.homeDirs = [

View File

@@ -1,24 +0,0 @@
{
lib,
username,
...
}:
{
imports = [
./cli
./coding
./virt
./desktop
./i18n
./nix.nix
./sops.nix
./gpg.nix
./time.nix
./user.nix
./xdg.nix
./persist.nix
./getty-autologin.nix
(lib.mkAliasOptionModule [ "my" "home" ] [ "home-manager" "users" username ])
];
}

View File

@@ -17,6 +17,7 @@ lib.my.makeSwitch {
wm.all.enable = true;
style.enable = true;
quickshell.enable = true;
wine.enable = true;
};
};
}

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