Compare commits

..

84 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
245 changed files with 17351 additions and 2279 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 --json |& nom
@nh os switch .
boot:
@echo "Rebuilding NixOS..."
@nixos-rebuild boot --flake . --use-remote-sudo --json |& nom
@nh os boot .
test:
@echo "Rebuilding NixOS..."
@nh os test .
vm:
@echo "Building NixOS VM..."
@nixos-rebuild build-vm --flake . --json |& nom
@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,8 +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

@@ -21,5 +21,7 @@
./note.nix
./matrix.nix
./minio.nix
./build.nix
./immich.nix
];
}

View File

@@ -18,13 +18,15 @@ in
];
boot.initrd.kernelModules = [ "amdgpu" ];
boot.kernelModules = [ "kvm-amd" ];
boot.kernelPackages = lib.mkForce pkgs.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

@@ -12,20 +12,11 @@
"workspace"
"Virt"
{
directory = ".ssh";
mode = "0700";
}
".local/state"
".local/share"
".local/share/nvim"
".cache"
".ollama"
];
nixosDirs = [
"/etc/ssh"
];
};
};
}

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

@@ -392,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";
@@ -415,84 +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;
@@ -505,7 +445,6 @@
client_secret = "";
expiry = 0;
extra_params.domain_hint = "imxyy.top";
strip_email_domain = true;
};
};
};
@@ -531,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";
@@ -544,11 +483,6 @@
"network.target"
"sops-nix.service"
];
path = with pkgs; [
easytier
iproute2
bash
];
};
virtualisation.oci-containers = {

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

@@ -26,9 +26,8 @@
];
users = {
users.nas = {
isNormalUser = true;
home = "/var/empty";
description = "nas user";
isSystemUser = true;
description = "NAS user";
group = "nextcloud";
};
};

View File

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

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

@@ -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,24 +76,6 @@
scale = 1.25;
};
};
spawn-at-startup = [
{
command = [
"sh"
"-c"
"sleep 3; echo 'Xft.dpi: 120' | ${lib.getExe pkgs.xorg.xrdb} -merge"
];
}
{
command = [
"sh"
"-c"
"sleep 3; ${lib.getExe pkgs.xsettingsd} -c ${pkgs.writeText "xsettingsd.conf" ''
Xft/DPI 122880
''}"
];
}
];
};
};
@@ -123,7 +106,7 @@
{
"inode/directory" = [ "nemo.desktop" ];
"application/pdf" = [ "evince.desktop" ];
"application/pdf" = [ "org.gnome.Evince.desktop" ];
"text/*" = editor;
"application/json" = editor;
@@ -171,53 +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/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

@@ -113,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";
@@ -126,10 +126,5 @@
"network.target"
"sops-nix.service"
];
path = with pkgs; [
easytier
iproute2
bash
];
};
}

View File

@@ -160,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" ];
};
@@ -198,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" ];

533
flake.lock generated
View File

@@ -81,7 +81,7 @@
"go-musicfox",
"devenv"
],
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1728672398,
@@ -98,6 +98,29 @@
"type": "github"
}
},
"chaotic": {
"inputs": {
"flake-schemas": "flake-schemas",
"home-manager": "home-manager",
"jovian": "jovian",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1752141190,
"narHash": "sha256-RHNq77Z84BtLTwyRtrBffm5V9006Dqw4vh3vrvULlxM=",
"owner": "chaotic-cx",
"repo": "nyx",
"rev": "ef0794b8e94eea166407141f7e92da75f6df925a",
"type": "github"
},
"original": {
"owner": "chaotic-cx",
"ref": "nyxpkgs-unstable",
"repo": "nyx",
"type": "github"
}
},
"darkly": {
"inputs": {
"nixpkgs": [
@@ -105,11 +128,11 @@
]
},
"locked": {
"lastModified": 1749134809,
"narHash": "sha256-1WErpDYTlMW/889Efe3OUM3uwt5w+EttjOGoBolBZvE=",
"lastModified": 1750940343,
"narHash": "sha256-qmc/jreM09MOwQ8dOa/+yyh99rU7TowSqo8L33VHfto=",
"owner": "Bali10050",
"repo": "Darkly",
"rev": "c26d5e6a00c053850befd6c6af550797a5758dac",
"rev": "77770c8d3c35f7ad39da2c57122c360096df0aac",
"type": "github"
},
"original": {
@@ -124,7 +147,7 @@
"flake-compat": "flake-compat",
"git-hooks": "git-hooks",
"nix": "nix",
"nixpkgs": "nixpkgs_3"
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1738772960,
@@ -148,11 +171,11 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1749192146,
"narHash": "sha256-ZEpmRS5m692wzUhRSdBgSojaWR0EU0lqT9x0Bsb+2xY=",
"lastModified": 1752129689,
"narHash": "sha256-0Xq5tZbvgZvxbbxv6kRHFuZE4Tq2za016NXh32nX0+Q=",
"owner": "nix-community",
"repo": "fenix",
"rev": "167c053888748278d52fba3c4bf3b8abaee72929",
"rev": "70bb04a7de606a75ba0a2ee9d47b99802780b35d",
"type": "github"
},
"original": {
@@ -195,21 +218,6 @@
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"locked": {
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
@@ -293,11 +301,11 @@
]
},
"locked": {
"lastModified": 1743550720,
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
"lastModified": 1751413152,
"narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
"rev": "77826244401ea9de6e3bac47c2db46005e1f30b5",
"type": "github"
},
"original": {
@@ -321,6 +329,20 @@
"type": "github"
}
},
"flake-schemas": {
"locked": {
"lastModified": 1721999734,
"narHash": "sha256-G5CxYeJVm4lcEtaO87LKzOsVnWeTcHGKbKxNamNWgOw=",
"rev": "0a5c42297d870156d9c57d8f99e476b738dcd982",
"revCount": 75,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/DeterminateSystems/flake-schemas/0.1.5/0190ef2f-61e0-794b-ba14-e82f225e55e6/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/DeterminateSystems/flake-schemas/%3D0.1.5.tar.gz"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@@ -339,24 +361,6 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"fromYaml": {
"flake": false,
"locked": {
@@ -400,32 +404,6 @@
"type": "github"
}
},
"git-hooks_2": {
"inputs": {
"flake-compat": [
"stylix",
"flake-compat"
],
"gitignore": "gitignore_2",
"nixpkgs": [
"stylix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1747372754,
"narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
@@ -449,41 +427,19 @@
"type": "github"
}
},
"gitignore_2": {
"inputs": {
"nixpkgs": [
"stylix",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"gnome-shell": {
"flake": false,
"locked": {
"lastModified": 1744584021,
"narHash": "sha256-0RJ4mJzf+klKF4Fuoc8VN8dpQQtZnKksFmR2jhWE1Ew=",
"lastModified": 1748186689,
"narHash": "sha256-UaD7Y9f8iuLBMGHXeJlRu6U1Ggw5B9JnkFs3enZlap0=",
"owner": "GNOME",
"repo": "gnome-shell",
"rev": "52c517c8f6c199a1d6f5118fae500ef69ea845ae",
"rev": "8c88f917db0f1f0d80fa55206c863d3746fa18d0",
"type": "github"
},
"original": {
"owner": "GNOME",
"ref": "48.1",
"ref": "48.2",
"repo": "gnome-shell",
"type": "github"
}
@@ -515,23 +471,44 @@
"type": "github"
}
},
"home-manager": {
"haumea": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1749243446,
"narHash": "sha256-P1gumhZN5N9q+39ndePHYrtwOwY1cGx+VoXGl+vTm7A=",
"lastModified": 1685133229,
"narHash": "sha256-FePm/Gi9PBSNwiDFq3N+DWdfxFq0UKsVVTJS3cQPn94=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2d7d65f65b61fdfce23278e59ca266ddd0ef0a36",
"repo": "haumea",
"rev": "34dd58385092a23018748b50f9b23de6266dffc2",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "v0.2.2",
"repo": "haumea",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"chaotic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1751824240,
"narHash": "sha256-aDDC0CHTlL7QDKWWhdbEgVPK6KwWt+ca0QkmHYZxMzI=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "fd9e55f5fac45a26f6169310afca64d56b681935",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
@@ -539,20 +516,20 @@
"home-manager_2": {
"inputs": {
"nixpkgs": [
"stylix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1748737919,
"narHash": "sha256-5kvBbLYdp+n7Ftanjcs6Nv+UO6sBhelp6MIGJ9nWmjQ=",
"lastModified": 1752202894,
"narHash": "sha256-knafgng4gCjZIUMyAEWjxxdols6n/swkYnbWr+oF+1w=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "5675a9686851d9626560052a032c4e14e533c1fa",
"rev": "fab659b346c0d4252208434c3c4b3983a4b38fec",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "master",
"repo": "home-manager",
"type": "github"
}
@@ -609,6 +586,28 @@
"url": "https://codeberg.org/amjoseph/infuse.nix"
}
},
"jovian": {
"inputs": {
"nix-github-actions": "nix-github-actions",
"nixpkgs": [
"chaotic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1751529406,
"narHash": "sha256-jwKDHyUycp678zDYa5Hyfq3msO73YMXdZPxp96dU7po=",
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"rev": "b2e5ce654e4f5bf8905c2e07a96dcf4966e6277d",
"type": "github"
},
"original": {
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"type": "github"
}
},
"libgit2": {
"flake": false,
"locked": {
@@ -669,11 +668,11 @@
"xwayland-satellite-unstable": "xwayland-satellite-unstable"
},
"locked": {
"lastModified": 1749242294,
"narHash": "sha256-kRoYNsL0fwNVXFAr5dl/7esQK8vtJUJYnU+P5/w+ZJQ=",
"lastModified": 1752078530,
"narHash": "sha256-TrRmlYdhWcadWvBpDjB9Xlry4uT4ZUIO46d+o5tjtCQ=",
"owner": "sodiboo",
"repo": "niri-flake",
"rev": "2b3bd97df72f2d0b021afcb7a6077e7f71fc2f8d",
"rev": "d231d92313192d4d0c78d6ef04167fed9dee87cf",
"type": "github"
},
"original": {
@@ -685,16 +684,16 @@
"niri-stable": {
"flake": false,
"locked": {
"lastModified": 1740117926,
"narHash": "sha256-mTTHA0RAaQcdYe+9A3Jx77cmmyLFHmRoZdd8RpWa+m8=",
"lastModified": 1748151941,
"narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "b94a5db8790339cf9134873d8b490be69e02ac71",
"rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7",
"type": "github"
},
"original": {
"owner": "YaLTeR",
"ref": "v25.02",
"ref": "v25.05.1",
"repo": "niri",
"type": "github"
}
@@ -702,11 +701,11 @@
"niri-unstable": {
"flake": false,
"locked": {
"lastModified": 1749112952,
"narHash": "sha256-ajI1cXa2AgdZSELvlVaQZd0XMi4eM8H3Ys0Ek8a/roI=",
"lastModified": 1750791124,
"narHash": "sha256-F5iVU/hjoSHSSe0gllxm0PcAaseEtGNanYK5Ha3k2Tg=",
"owner": "YaLTeR",
"repo": "niri",
"rev": "242ebf294514cc22f4f9d83c0566c8ffe1cb8d8a",
"rev": "37458d94b288945f6cfbd3c5c233f634d59f246c",
"type": "github"
},
"original": {
@@ -723,7 +722,7 @@
],
"flake-parts": "flake-parts",
"libgit2": "libgit2",
"nixpkgs": "nixpkgs_2",
"nixpkgs": "nixpkgs_3",
"nixpkgs-23-11": [
"go-musicfox",
"devenv"
@@ -752,6 +751,29 @@
"type": "github"
}
},
"nix-github-actions": {
"inputs": {
"nixpkgs": [
"chaotic",
"jovian",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729697500,
"narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=",
"owner": "zhaofengli",
"repo": "nix-github-actions",
"rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"ref": "matrix-name",
"repo": "nix-github-actions",
"type": "github"
}
},
"nix2container": {
"inputs": {
"flake-utils": "flake-utils",
@@ -782,11 +804,11 @@
]
},
"locked": {
"lastModified": 1746453552,
"narHash": "sha256-r66UGha+7KVHkI7ksrcMjnw/mm9Sg4l5bQlylxHwdGU=",
"lastModified": 1752199438,
"narHash": "sha256-xSBMmGtq8K4Qv80TMqREmESCAsRLJRHAbFH2T/2Bf1Y=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "be618645aa0adf461f778500172b6896d5ab2d01",
"rev": "d34d9412556d3a896e294534ccd25f53b6822e80",
"type": "github"
},
"original": {
@@ -797,11 +819,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1730531603,
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
"lastModified": 1751984180,
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
"type": "github"
},
"original": {
@@ -825,11 +847,11 @@
},
"nixpkgs-master": {
"locked": {
"lastModified": 1749263255,
"narHash": "sha256-N57WqGFUUDJ7QVR4YPRttp4YuTA4oN/KdXHY4OEXGFk=",
"lastModified": 1752206449,
"narHash": "sha256-NVAbC/s4CupABWGXF8M9mDiVw/n0YCftxwc1KatVjDk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "067a39e41a125985e061199452c900b0305f4c42",
"rev": "1bd4d0d4a678d48b63eb18f457d74df2fcee6c69",
"type": "github"
},
"original": {
@@ -841,27 +863,27 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1749246182,
"narHash": "sha256-0q80SLtfhrtZAzLGpwAQjqaTE+HAwmOjoX4Q3M5mB/s=",
"lastModified": 1752203688,
"narHash": "sha256-uJ054F5PVGPu5SvLPMevhdY/EfK0X5DUyRtXhQYNUyo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "5908ad2494520214a309e74d5c3f33623a593ecd",
"rev": "a70a12c75e13aa546c20ce0fe515de634d52c39e",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-24.11",
"ref": "release-25.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1749201760,
"narHash": "sha256-LEZbj+VD/AR/dWL5ns1gMwzMvp4mLlv4WalxmZTKy5Y=",
"lastModified": 1752124863,
"narHash": "sha256-5rWuf6RAlMDp/CAEuyYEz7ryxzgjxOCgUDhWEef864c=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ebd3748a6b97de45844aa62701b81df35c5c1269",
"rev": "40de82b434526744da778ed53c742c1282d9e75e",
"type": "github"
},
"original": {
@@ -872,6 +894,22 @@
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1730531603,
"narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1717432640,
"narHash": "sha256-+f9c4/ZX5MWDOuB1rKoWj+lBNm0z0rs4CK47HBLxy1o=",
@@ -887,7 +925,7 @@
"type": "github"
}
},
"nixpkgs_3": {
"nixpkgs_4": {
"locked": {
"lastModified": 1716977621,
"narHash": "sha256-Q1UQzYcMJH4RscmpTkjlgqQDX5yi1tZL0O345Ri6vXQ=",
@@ -903,13 +941,13 @@
"type": "github"
}
},
"nixpkgs_4": {
"nixpkgs_5": {
"locked": {
"lastModified": 1749143949,
"narHash": "sha256-QuUtALJpVrPnPeozlUG/y+oIMSLdptHxb3GK6cpSVhA=",
"lastModified": 1751984180,
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d3d2d80a2191a73d1e86456a751b83aa13085d7d",
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
"type": "github"
},
"original": {
@@ -922,15 +960,14 @@
"nur": {
"inputs": {
"flake-parts": "flake-parts_3",
"nixpkgs": "nixpkgs_4",
"treefmt-nix": "treefmt-nix"
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1749268187,
"narHash": "sha256-vvyoGq0DMwmNwJ4hNDkXdlMPjT7ZaJoaYcx/JTxENxI=",
"lastModified": 1752207112,
"narHash": "sha256-dnVoQSGQqEGJQzS6iHAG95c0oFrezzBinwu1bDLj9J4=",
"owner": "nix-community",
"repo": "NUR",
"rev": "6e40eba6340c0787c694800c443e3f70c7c2dd60",
"rev": "f166dc14862dfec043f9545e8291cc4402f8b866",
"type": "github"
},
"original": {
@@ -948,42 +985,19 @@
"nixpkgs": [
"stylix",
"nixpkgs"
],
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1748730660,
"narHash": "sha256-5LKmRYKdPuhm8j5GFe3AfrJL8dd8o57BQ34AGjJl1R0=",
"owner": "nix-community",
"repo": "NUR",
"rev": "2c0bc52fe14681e9ef60e3553888c4f086e46ecb",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"omz": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1704103295,
"narHash": "sha256-BAwAKajpAUC78z0IMJt6LXGV8dLdUMYXe6CxbGA0JP0=",
"owner": "imxyy1soope1",
"repo": "omz",
"rev": "e581a6d0d47291a3ddd7da5046bea59b29631a3f",
"lastModified": 1751906969,
"narHash": "sha256-BSQAOdPnzdpOuCdAGSJmefSDlqmStFNScEnrWzSqKPw=",
"owner": "nix-community",
"repo": "NUR",
"rev": "ddb679f4131e819efe3bbc6457ba19d7ad116f25",
"type": "github"
},
"original": {
"owner": "imxyy1soope1",
"ref": "master",
"repo": "omz",
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
@@ -994,11 +1008,11 @@
]
},
"locked": {
"lastModified": 1748598934,
"narHash": "sha256-c8o4KJPda4HNj/jWwjrWip7QZmfnuOQxKiAadzu/Ibs=",
"lastModified": 1752146885,
"narHash": "sha256-ZJK989GL+bTCQSxbG8v8/7tHMCEl/FPovkeDBNyClQE=",
"ref": "refs/heads/master",
"rev": "aa547bad843439615bc0a7f97a55d81058b2e9c8",
"revCount": 565,
"rev": "d7079b75241c6e2b67f2429996fa7679ffc052e2",
"revCount": 616,
"type": "git",
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
},
@@ -1009,10 +1023,12 @@
},
"root": {
"inputs": {
"chaotic": "chaotic",
"darkly": "darkly",
"fenix": "fenix",
"go-musicfox": "go-musicfox",
"home-manager": "home-manager",
"haumea": "haumea",
"home-manager": "home-manager_2",
"impermanence": "impermanence",
"infuse": "infuse",
"niri": "niri",
@@ -1024,7 +1040,6 @@
"nixpkgs-stable": "nixpkgs-stable",
"nixpkgs-unstable": "nixpkgs-unstable",
"nur": "nur",
"omz": "omz",
"quickshell": "quickshell",
"sops-nix": "sops-nix",
"stylix": "stylix",
@@ -1034,11 +1049,11 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1749133384,
"narHash": "sha256-nKbHae8x2v2IMg1Rd3e5OrRPk5lxAqcvPkIM3fYtB90=",
"lastModified": 1752086493,
"narHash": "sha256-USpVUdiWXDfPoh+agbvoBQaBhg3ZdKZgHXo/HikMfVo=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "d5665e5ca79135a753f853b5a0e2f33f8f263a0b",
"rev": "6e3abe164b9036048dce1a3aa65a7e7e5200c0d3",
"type": "github"
},
"original": {
@@ -1048,6 +1063,27 @@
"type": "github"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"chaotic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1751856221,
"narHash": "sha256-/QE1eV0ckFvgRMcKjZqgdJDoXFNwSMepwRoBjaw2MCk=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "34cae4b56929c5b340e1c5b10d9a98a425b2a51e",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
@@ -1055,11 +1091,11 @@
]
},
"locked": {
"lastModified": 1747603214,
"narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=",
"lastModified": 1751606940,
"narHash": "sha256-KrDPXobG7DFKTOteqdSVeL1bMVitDcy7otpVZWDE6MA=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd",
"rev": "3633fc4acf03f43b260244d94c71e9e14a2f6e0d",
"type": "github"
},
"original": {
@@ -1075,16 +1111,13 @@
"base16-helix": "base16-helix",
"base16-vim": "base16-vim",
"firefox-gnome-theme": "firefox-gnome-theme",
"flake-compat": "flake-compat_3",
"flake-parts": "flake-parts_4",
"git-hooks": "git-hooks_2",
"gnome-shell": "gnome-shell",
"home-manager": "home-manager_2",
"nixpkgs": [
"nixpkgs"
],
"nur": "nur_2",
"systems": "systems_3",
"systems": "systems_2",
"tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes",
@@ -1092,11 +1125,11 @@
"tinted-zed": "tinted-zed"
},
"locked": {
"lastModified": 1749236315,
"narHash": "sha256-Ndtdvwz8D4WOYHl5mj9d5F5iC8WPH6uPNF7RcU3QzmE=",
"lastModified": 1752201883,
"narHash": "sha256-SZVbQ4YThvYU50cJ4W4GNMy7/rVOJI8qmXqbEcRNsug=",
"owner": "danth",
"repo": "stylix",
"rev": "29d006198ee05143cca8b4b89f37025823da1bcc",
"rev": "d395780b9c5c36f191b990b2021c71af180a1982",
"type": "github"
},
"original": {
@@ -1135,21 +1168,6 @@
"type": "github"
}
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"tinted-foot": {
"flake": false,
"locked": {
@@ -1186,11 +1204,11 @@
"tinted-schemes": {
"flake": false,
"locked": {
"lastModified": 1748180480,
"narHash": "sha256-7n0XiZiEHl2zRhDwZd/g+p38xwEoWtT0/aESwTMXWG4=",
"lastModified": 1750770351,
"narHash": "sha256-LI+BnRoFNRa2ffbe3dcuIRYAUcGklBx0+EcFxlHj0SY=",
"owner": "tinted-theming",
"repo": "schemes",
"rev": "87d652edd26f5c0c99deda5ae13dfb8ece2ffe31",
"rev": "5a775c6ffd6e6125947b393872cde95867d85a2a",
"type": "github"
},
"original": {
@@ -1202,11 +1220,11 @@
"tinted-tmux": {
"flake": false,
"locked": {
"lastModified": 1748740859,
"narHash": "sha256-OEM12bg7F4N5WjZOcV7FHJbqRI6jtCqL6u8FtPrlZz4=",
"lastModified": 1751159871,
"narHash": "sha256-UOHBN1fgHIEzvPmdNMHaDvdRMgLmEJh2hNmDrp3d3LE=",
"owner": "tinted-theming",
"repo": "tinted-tmux",
"rev": "57d5f9683ff9a3b590643beeaf0364da819aedda",
"rev": "bded5e24407cec9d01bd47a317d15b9223a1546c",
"type": "github"
},
"original": {
@@ -1218,11 +1236,11 @@
"tinted-zed": {
"flake": false,
"locked": {
"lastModified": 1725758778,
"narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=",
"lastModified": 1751158968,
"narHash": "sha256-ksOyv7D3SRRtebpXxgpG4TK8gZSKFc4TIZpR+C98jX8=",
"owner": "tinted-theming",
"repo": "base16-zed",
"rev": "122c9e5c0e6f27211361a04fae92df97940eccf9",
"rev": "86a470d94204f7652b906ab0d378e4231a5b3384",
"type": "github"
},
"original": {
@@ -1231,67 +1249,7 @@
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733222881,
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"treefmt-nix_2": {
"inputs": {
"nixpkgs": [
"stylix",
"nur",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733222881,
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"xwayland-satellite-stable": {
"flake": false,
"locked": {
"lastModified": 1739246919,
"narHash": "sha256-/hBM43/Gd0/tW+egrhlWgOIISeJxEs2uAOIYVpfDKeU=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "44590a416d4a3e8220e19e29e0b6efe64a80315d",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"ref": "v0.5.1",
"repo": "xwayland-satellite",
"type": "github"
}
},
"xwayland-satellite-unstable": {
"flake": false,
"locked": {
"lastModified": 1748488455,
@@ -1301,6 +1259,23 @@
"rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"ref": "v0.6",
"repo": "xwayland-satellite",
"type": "github"
}
},
"xwayland-satellite-unstable": {
"flake": false,
"locked": {
"lastModified": 1751228685,
"narHash": "sha256-MENtauGBhJ+kDeFaawvWGXaFG3Il6qQzjaP0RmtfM0k=",
"owner": "Supreeeme",
"repo": "xwayland-satellite",
"rev": "557ebeb616e03d5e4a8049862bbbd1f02c6f020b",
"type": "github"
},
"original": {
"owner": "Supreeeme",
"repo": "xwayland-satellite",
@@ -1315,11 +1290,11 @@
]
},
"locked": {
"lastModified": 1749227189,
"narHash": "sha256-bToj/0wPCkay4LCDKKRNup9oyt9IwiFyEaCG0ljvlb8=",
"lastModified": 1752164817,
"narHash": "sha256-LJFIx27IOUowLsJn5wci9mHZ4CesJsiAivQWDjnZPCc=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "37608b352c9def5aafad3a819fe02ef120c1cb08",
"rev": "9193992c4c2c4349b4280ec2b49648cae208fe63",
"type": "github"
},
"original": {

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,10 +27,6 @@
# NUR
nur.url = "github:nix-community/NUR";
# OMZ
omz.url = "github:imxyy1soope1/omz/master";
omz.inputs.nixpkgs.follows = "nixpkgs";
# Niri
niri.url = "github:sodiboo/niri-flake";
niri.inputs.nixpkgs.follows = "nixpkgs";
@@ -57,6 +57,9 @@
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 =
@@ -77,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 (
@@ -109,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: {
@@ -128,7 +144,7 @@
withJemalloc = true;
withQtSvg = true;
withWayland = true;
withPipewire = false;
withPipewire = true;
withPam = false;
withX11 = false;
withHyprland = false;
@@ -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,9 +0,0 @@
{
imports = [
./all.nix
./media
./misc
./monitor
./shell
];
}

View File

@@ -1,9 +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,6 +0,0 @@
{
imports = [
./all.nix
./btop
];
}

View File

@@ -1,6 +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 = {
@@ -70,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,8 +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,7 +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 = "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,7 +1,7 @@
M = {
symbols = {
icon_source = "lspkind"
}
icon_source = "lspkind",
},
}
vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>", { desc = "Toggle Outline" })

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,11 +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;
};
};
}

View File

@@ -1,9 +0,0 @@
{
imports = [
./all.nix
./firefox.nix
./librewolf.nix
./chromium.nix
./zen.nix
];
}

View File

@@ -1,14 +0,0 @@
{
imports = [
./all.nix
./browser
./gaming
./media
./notify
./screencast
./terminal
./wm
./style
./quickshell
];
}

View File

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

View File

@@ -23,5 +23,8 @@ lib.my.makeSwitch {
".minecraft"
".local/share/hmcl"
];
my.persist.homeFiles = [
".hmcl.json"
];
};
}

View File

@@ -20,5 +20,8 @@ lib.my.makeSwitch {
gamescope
];
};
my.persist.homeDirs = [
".local/share/Steam"
];
};
}

View File

@@ -1,11 +0,0 @@
{
imports = [
./all.nix
./mpv.nix
./shotwell.nix
./thunderbird.nix
./vlc.nix
./spotify.nix
./spotube.nix
];
}

View File

@@ -13,4 +13,9 @@ lib.my.makeHomePackageConfig {
"media"
"spotube"
];
extraConfig = {
my.persist.homeDirs = [
".local/share/oss.krtirtho.spotube"
];
};
}

View File

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

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