From 3c86a6cacb4c4fd471b080eea596396386d41d99 Mon Sep 17 00:00:00 2001 From: NikSne Date: Fri, 19 Dec 2025 11:08:06 +0300 Subject: [PATCH] refactor!: use proper modules --- .gitignore | 1 + flake.nix | 6 +- home/profiles/default.nix | 16 - home/profiles/niksne/default.nix | 12 - home/profiles/niksne/hosts/konran/default.nix | 15 - home/profiles/niksne/hosts/nakama/default.nix | 15 - home/profiles/niksne/hosts/renga/default.nix | 5 - .../profiles/niksne/hosts/tobichi/default.nix | 5 - home/programs/browsers/default.nix | 5 - home/programs/browsers/vivaldi.nix | 26 - home/programs/browsers/zen.nix | 11 - home/programs/dconf.nix | 7 - home/programs/default.nix | 44 - home/programs/editors/default.nix | 6 - home/programs/editors/helix/default.nix | 62 -- .../programs/editors/helix/languages/bash.nix | 16 - home/programs/editors/helix/languages/c.nix | 20 - home/programs/editors/helix/languages/ci.nix | 16 - .../editors/helix/languages/default.nix | 61 -- .../editors/helix/languages/docker.nix | 20 - .../editors/helix/languages/elixir.nix | 16 - .../programs/editors/helix/languages/fish.nix | 16 - home/programs/editors/helix/languages/go.nix | 7 - .../programs/editors/helix/languages/helm.nix | 16 - .../programs/editors/helix/languages/just.nix | 16 - home/programs/editors/helix/languages/jvm.nix | 21 - .../editors/helix/languages/latex.nix | 16 - .../editors/helix/languages/markdown.nix | 16 - home/programs/editors/helix/languages/nix.nix | 26 - .../editors/helix/languages/protobuf.nix | 16 - .../editors/helix/languages/python.nix | 21 - home/programs/editors/helix/languages/qml.nix | 16 - .../programs/editors/helix/languages/rust.nix | 16 - .../editors/helix/languages/surql.nix | 32 - .../editors/helix/languages/systemd.nix | 16 - .../programs/editors/helix/languages/tofu.nix | 34 - .../programs/editors/helix/languages/toml.nix | 16 - home/programs/editors/helix/languages/web.nix | 113 --- .../programs/editors/helix/languages/yaml.nix | 8 - home/programs/editors/helix/languages/zig.nix | 7 - home/programs/editors/helix/runtime.nix | 135 ---- home/programs/editors/helix/themes.nix | 18 - home/programs/editors/jetbrains.nix | 40 - home/programs/editors/zed/default.nix | 43 - home/programs/games/default.nix | 5 - home/programs/games/minecraft.nix | 9 - home/programs/gtk.nix | 33 - home/programs/media/default.nix | 26 - home/programs/media/mpv.nix | 9 - home/programs/media/obs-studio.nix | 6 - home/programs/media/rnnoise.nix | 41 - home/programs/media/spicetify.nix | 55 -- home/programs/office/default.nix | 12 - home/programs/office/zathura.nix | 18 - home/programs/qt.nix | 7 - home/programs/social/default.nix | 12 - home/programs/social/discord.nix | 759 ------------------ home/programs/social/thunderbird.nix | 10 - home/programs/thunar.nix | 11 - home/programs/wayland/default.nix | 34 - home/programs/wayland/hyprlock.nix | 124 --- home/programs/wayland/niri/binds.nix | 605 -------------- home/programs/wayland/niri/default.nix | 63 -- home/programs/wayland/niri/input.nix | 18 - home/programs/wayland/niri/layout.nix | 55 -- home/programs/wayland/niri/rules.nix | 92 --- home/programs/wayland/rofi.nix | 239 ------ home/programs/wayland/wlogout.nix | 53 -- home/services/default.nix | 7 - home/services/media/playerctl.nix | 7 - home/services/system/default.nix | 7 - home/services/system/kdeconnect.nix | 6 - home/services/system/polkit-agent.nix | 19 - home/services/system/udiskie.nix | 3 - home/services/wayland/default.nix | 8 - home/services/wayland/hypridle.nix | 33 - home/services/wayland/hyprpaper.nix | 15 - home/services/wayland/swaync.nix | 52 -- home/services/wayland/waybar/default.nix | 391 --------- home/terminal/default.nix | 25 - home/terminal/emulators/rio.nix | 44 - home/terminal/emulators/wezterm.nix | 101 --- home/terminal/programs/atuin.nix | 18 - home/terminal/programs/bat.nix | 11 - home/terminal/programs/cargo.nix | 15 - home/terminal/programs/default.nix | 54 -- home/terminal/programs/eza.nix | 8 - home/terminal/programs/fetchers.nix | 213 ----- home/terminal/programs/git/default.nix | 40 - home/terminal/programs/git/delta.nix | 9 - home/terminal/programs/git/lazygit.nix | 9 - home/terminal/programs/lazydocker.nix | 16 - home/terminal/programs/skim.nix | 13 - home/terminal/programs/ssh.nix | 19 - home/terminal/programs/xdg.nix | 77 -- home/terminal/programs/zellij/binds.nix | 23 - home/terminal/programs/zellij/default.nix | 28 - .../programs/zellij/layouts/custom.nix | 14 - .../programs/zellij/layouts/default.nix | 5 - .../programs/zellij/plugins/default.nix | 33 - .../programs/zellij/plugins/zellij-forgot.nix | 6 - .../programs/zellij/plugins/zjstatus.nix | 69 -- home/terminal/programs/zellij/plugins/zsm.nix | 21 - home/terminal/programs/zoxide.nix | 8 - home/terminal/shell/default.nix | 18 - home/terminal/shell/fish/default.nix | 16 - .../shell/fish/functions/checkers.nix | 45 -- .../shell/fish/functions/clipboard.nix | 30 - .../terminal/shell/fish/functions/default.nix | 32 - .../shell/fish/functions/fetchers.nix | 73 -- .../shell/fish/functions/notifications.nix | 28 - .../terminal/shell/fish/functions/reloads.nix | 25 - .../shell/fish/functions/screenshot.nix | 19 - .../terminal/shell/fish/functions/toggles.nix | 73 -- home/terminal/shell/fish/plugins.nix | 8 - home/terminal/shell/starship.nix | 20 - homes/default.nix | 12 + homes/niksne/home.nix | 12 + homes/niksne/hosts/konran/home.nix | 15 + .../niksne/hosts/konran/niri.nix | 0 .../niksne/hosts/konran/programs.nix | 0 homes/niksne/hosts/nakama/home.nix | 15 + .../niksne/hosts/nakama/hypridle.nix | 0 .../niksne/hosts/nakama/niri.nix | 0 homes/niksne/hosts/renga/home.nix | 5 + homes/niksne/hosts/tobichi/home.nix | 5 + hosts/default.nix | 30 +- hosts/konran/default.nix | 30 - hosts/konran/disks/data.nix | 26 +- hosts/konran/disks/root.nix | 18 +- hosts/konran/host.nix | 46 ++ hosts/konran/modules/.gitkeep | 0 hosts/modules/programs/module.nix | 20 + hosts/nakama/default.nix | 43 - hosts/nakama/disks/default.nix | 18 +- hosts/nakama/host.nix | 59 ++ hosts/nakama/modules/.gitkeep | 0 hosts/renga/default.nix | 16 - hosts/renga/host.nix | 21 + hosts/renga/modules/.gitkeep | 0 hosts/tobichi/default.nix | 19 - hosts/tobichi/host.nix | 24 + hosts/tobichi/modules/.gitkeep | 0 keys.nix | 14 + lib/default.nix | 10 +- lib/helpers/default.nix | 12 + lib/helpers/hosts.nix | 76 ++ lib/helpers/keys.nix | 25 + lib/helpers/secrets.nix | 12 + lib/lib'/default.nix | 26 +- lib/lib'/discord.nix | 21 - lib/lib'/disks.nix | 29 - lib/lib'/fileset.nix | 21 + lib/lib'/fish.nix | 9 - lib/lib'/helix.nix | 83 -- lib/lib'/hosts.nix | 8 - lib/lib'/jetbrains.nix | 32 - lib/lib'/lists.nix | 7 + lib/lib'/niri.nix | 105 --- lib/lib'/numbers.nix | 5 - lib/lib'/options.nix | 9 + lib/lib'/rofi.nix | 52 -- lib/lib'/strings.nix | 7 - lib/lib'/tags.nix | 16 + lib/lib'/tmpfiles.nix | 18 + lib/lib'/users.nix | 20 + lib/lib'/zellij.nix | 26 - lib/niksos/default.nix | 8 - lib/niksos/homes.nix | 55 -- lib/niksos/hosts.nix | 70 -- modules/caches.nix | 41 - modules/default.nix | 13 - modules/{homes.nix => home/module.nix} | 0 modules/home/services/kdeconnect/module.nix | 21 + modules/home/services/playerctl/module.nix | 22 + modules/home/services/polkit/module.nix | 34 + modules/home/services/udiskie/module.nix | 18 + modules/home/services/waybar/module.nix | 401 +++++++++ .../home/services}/waybar/style.css | 0 modules/{theme.nix => home/theme/module.nix} | 0 modules/system/boot/module.nix | 64 ++ modules/system/core/module.nix | 15 + modules/system/fonts/module.nix | 36 + modules/system/hardware/backlight/module.nix | 17 + modules/system/hardware/bluetooth/module.nix | 24 + modules/system/hardware/cpu/amd.nix | 13 + modules/system/hardware/cpu/default.nix | 6 + modules/system/hardware/cpu/intel.nix | 13 + modules/system/hardware/gpu/amd.nix | 20 + modules/system/hardware/gpu/default.nix | 7 + modules/system/hardware/gpu/intel.nix | 101 +++ modules/system/hardware/gpu/nvidia.nix | 89 ++ modules/system/hardware/module.nix | 62 ++ modules/system/hardware/openrazer/module.nix | 21 + modules/system/hardware/printing/module.nix | 48 ++ modules/system/locale/module.nix | 24 + modules/system/networking/amnezia/module.nix | 26 + .../networking/networkmanager/module.nix | 16 + modules/system/nix/builders/lib.nix | 42 + modules/system/nix/builders/module.nix | 75 ++ modules/system/nix/builders/user.nix | 29 + modules/system/nix/caches.nix | 23 + .../system}/nix/documentation.nix | 0 {system => modules/system}/nix/index.nix | 0 modules/system/nix/lib.nix | 23 + .../system/nix/module.nix | 57 +- {system => modules/system}/nix/nh.nix | 1 + {system => modules/system}/nix/nixpkgs.nix | 0 .../system/programs/development/module.nix | 41 + modules/system/programs/fish/module.nix | 19 + modules/system/programs/gaming/module.nix | 66 ++ .../system/programs/home-manager/module.nix | 11 + modules/system/programs/module.nix | 35 + modules/system/programs/niri/module.nix | 27 + modules/system/programs/obs-studio/module.nix | 21 + modules/system/programs/qt/module.nix | 22 + modules/system/programs/starship/module.nix | 17 + modules/system/programs/xdg/module.nix | 31 + modules/system/secrets/agenix/lib.nix | 40 + modules/system/secrets/agenix/module.nix | 24 + .../system/security/module.nix | 0 .../system/services/gnome-services/module.nix | 27 + .../system}/services/kanata/main.kbd | 0 modules/system/services/kanata/module.nix | 27 + modules/system/services/location/module.nix | 19 + modules/system/services/module.nix | 24 + modules/system/services/ollama/module.nix | 20 + modules/system/services/openssh/module.nix | 8 + modules/system/services/pipewire/module.nix | 28 + modules/system/services/power/module.nix | 29 + modules/system/services/resolved/module.nix | 5 + modules/system/services/sddm/module.nix | 31 + .../system/services/xserver/xkb/layouts.nix | 35 + .../system/services/xserver/xkb/module.nix | 59 ++ .../services/xserver}/xkb/symbols/eng/rdvp | 0 modules/system/time/module.nix | 5 + modules/system/users/lib.nix | 26 + modules/system/users/module.nix | 24 + .../system/virtualisation/bottles/module.nix | 18 + .../system/virtualisation/libvirtd/module.nix | 19 + .../system/virtualisation/podman/module.nix | 29 + secrets/secrets.nix | 6 + system/core/boot.nix | 38 - system/core/default.nix | 33 - system/core/users.nix | 16 - system/core/xkb/default.nix | 17 - system/core/xkb/layouts.nix | 31 - system/default.nix | 28 - system/hardware/amd.nix | 4 - system/hardware/bluetooth.nix | 7 - system/hardware/default.nix | 6 - system/hardware/graphics.nix | 16 - system/hardware/intel.nix | 3 - system/hardware/nvidia-prime.nix | 7 - system/hardware/nvidia.nix | 27 - system/hardware/printing.nix | 18 - system/hardware/razer.nix | 3 - system/network/amnezia.nix | 15 - system/network/default.nix | 19 - system/nix/caches.nix | 11 - system/programs/default.nix | 25 - system/programs/development.nix | 26 - system/programs/fish.nix | 10 - system/programs/fonts.nix | 21 - system/programs/gaming.nix | 51 -- system/programs/home-manager.nix | 9 - system/programs/niri.nix | 14 - system/programs/obs-studio.nix | 6 - system/programs/qt.nix | 7 - system/programs/xdg.nix | 15 - system/services/backlight.nix | 3 - system/services/default.nix | 21 - system/services/gnome-services.nix | 12 - system/services/kanata/default.nix | 12 - system/services/location.nix | 5 - system/services/ollama.nix | 5 - system/services/pipewire.nix | 13 - system/services/power.nix | 13 - system/services/printer-sharing.nix | 15 - system/services/sddm.nix | 19 - system/services/thermald.nix | 3 - system/virtualisation/bottles.nix | 3 - system/virtualisation/default.nix | 7 - system/virtualisation/kubernetes.nix | 7 - system/virtualisation/podman.nix | 13 - system/virtualisation/virt-manager.nix | 4 - system/virtualisation/virtualbox.nix | 8 - 287 files changed, 2676 insertions(+), 6535 deletions(-) delete mode 100755 home/profiles/default.nix delete mode 100755 home/profiles/niksne/default.nix delete mode 100755 home/profiles/niksne/hosts/konran/default.nix delete mode 100755 home/profiles/niksne/hosts/nakama/default.nix delete mode 100755 home/profiles/niksne/hosts/renga/default.nix delete mode 100755 home/profiles/niksne/hosts/tobichi/default.nix delete mode 100755 home/programs/browsers/default.nix delete mode 100755 home/programs/browsers/vivaldi.nix delete mode 100755 home/programs/browsers/zen.nix delete mode 100644 home/programs/dconf.nix delete mode 100755 home/programs/default.nix delete mode 100755 home/programs/editors/default.nix delete mode 100755 home/programs/editors/helix/default.nix delete mode 100644 home/programs/editors/helix/languages/bash.nix delete mode 100644 home/programs/editors/helix/languages/c.nix delete mode 100644 home/programs/editors/helix/languages/ci.nix delete mode 100644 home/programs/editors/helix/languages/default.nix delete mode 100644 home/programs/editors/helix/languages/docker.nix delete mode 100644 home/programs/editors/helix/languages/elixir.nix delete mode 100644 home/programs/editors/helix/languages/fish.nix delete mode 100644 home/programs/editors/helix/languages/go.nix delete mode 100644 home/programs/editors/helix/languages/helm.nix delete mode 100644 home/programs/editors/helix/languages/just.nix delete mode 100644 home/programs/editors/helix/languages/jvm.nix delete mode 100644 home/programs/editors/helix/languages/latex.nix delete mode 100644 home/programs/editors/helix/languages/markdown.nix delete mode 100644 home/programs/editors/helix/languages/nix.nix delete mode 100644 home/programs/editors/helix/languages/protobuf.nix delete mode 100644 home/programs/editors/helix/languages/python.nix delete mode 100644 home/programs/editors/helix/languages/qml.nix delete mode 100644 home/programs/editors/helix/languages/rust.nix delete mode 100644 home/programs/editors/helix/languages/surql.nix delete mode 100644 home/programs/editors/helix/languages/systemd.nix delete mode 100644 home/programs/editors/helix/languages/tofu.nix delete mode 100644 home/programs/editors/helix/languages/toml.nix delete mode 100644 home/programs/editors/helix/languages/web.nix delete mode 100644 home/programs/editors/helix/languages/yaml.nix delete mode 100644 home/programs/editors/helix/languages/zig.nix delete mode 100644 home/programs/editors/helix/runtime.nix delete mode 100644 home/programs/editors/helix/themes.nix delete mode 100755 home/programs/editors/jetbrains.nix delete mode 100644 home/programs/editors/zed/default.nix delete mode 100755 home/programs/games/default.nix delete mode 100755 home/programs/games/minecraft.nix delete mode 100755 home/programs/gtk.nix delete mode 100755 home/programs/media/default.nix delete mode 100755 home/programs/media/mpv.nix delete mode 100755 home/programs/media/obs-studio.nix delete mode 100755 home/programs/media/rnnoise.nix delete mode 100755 home/programs/media/spicetify.nix delete mode 100755 home/programs/office/default.nix delete mode 100755 home/programs/office/zathura.nix delete mode 100755 home/programs/qt.nix delete mode 100755 home/programs/social/default.nix delete mode 100644 home/programs/social/discord.nix delete mode 100644 home/programs/social/thunderbird.nix delete mode 100644 home/programs/thunar.nix delete mode 100755 home/programs/wayland/default.nix delete mode 100755 home/programs/wayland/hyprlock.nix delete mode 100644 home/programs/wayland/niri/binds.nix delete mode 100644 home/programs/wayland/niri/default.nix delete mode 100644 home/programs/wayland/niri/input.nix delete mode 100644 home/programs/wayland/niri/layout.nix delete mode 100644 home/programs/wayland/niri/rules.nix delete mode 100755 home/programs/wayland/rofi.nix delete mode 100755 home/programs/wayland/wlogout.nix delete mode 100755 home/services/default.nix delete mode 100755 home/services/media/playerctl.nix delete mode 100755 home/services/system/default.nix delete mode 100755 home/services/system/kdeconnect.nix delete mode 100755 home/services/system/polkit-agent.nix delete mode 100755 home/services/system/udiskie.nix delete mode 100755 home/services/wayland/default.nix delete mode 100755 home/services/wayland/hypridle.nix delete mode 100755 home/services/wayland/hyprpaper.nix delete mode 100755 home/services/wayland/swaync.nix delete mode 100755 home/services/wayland/waybar/default.nix delete mode 100755 home/terminal/default.nix delete mode 100644 home/terminal/emulators/rio.nix delete mode 100755 home/terminal/emulators/wezterm.nix delete mode 100644 home/terminal/programs/atuin.nix delete mode 100755 home/terminal/programs/bat.nix delete mode 100644 home/terminal/programs/cargo.nix delete mode 100755 home/terminal/programs/default.nix delete mode 100644 home/terminal/programs/eza.nix delete mode 100755 home/terminal/programs/fetchers.nix delete mode 100755 home/terminal/programs/git/default.nix delete mode 100644 home/terminal/programs/git/delta.nix delete mode 100644 home/terminal/programs/git/lazygit.nix delete mode 100644 home/terminal/programs/lazydocker.nix delete mode 100755 home/terminal/programs/skim.nix delete mode 100644 home/terminal/programs/ssh.nix delete mode 100755 home/terminal/programs/xdg.nix delete mode 100644 home/terminal/programs/zellij/binds.nix delete mode 100644 home/terminal/programs/zellij/default.nix delete mode 100644 home/terminal/programs/zellij/layouts/custom.nix delete mode 100644 home/terminal/programs/zellij/layouts/default.nix delete mode 100644 home/terminal/programs/zellij/plugins/default.nix delete mode 100644 home/terminal/programs/zellij/plugins/zellij-forgot.nix delete mode 100644 home/terminal/programs/zellij/plugins/zjstatus.nix delete mode 100644 home/terminal/programs/zellij/plugins/zsm.nix delete mode 100644 home/terminal/programs/zoxide.nix delete mode 100644 home/terminal/shell/default.nix delete mode 100755 home/terminal/shell/fish/default.nix delete mode 100755 home/terminal/shell/fish/functions/checkers.nix delete mode 100755 home/terminal/shell/fish/functions/clipboard.nix delete mode 100755 home/terminal/shell/fish/functions/default.nix delete mode 100755 home/terminal/shell/fish/functions/fetchers.nix delete mode 100755 home/terminal/shell/fish/functions/notifications.nix delete mode 100755 home/terminal/shell/fish/functions/reloads.nix delete mode 100755 home/terminal/shell/fish/functions/screenshot.nix delete mode 100755 home/terminal/shell/fish/functions/toggles.nix delete mode 100644 home/terminal/shell/fish/plugins.nix delete mode 100755 home/terminal/shell/starship.nix create mode 100644 homes/default.nix create mode 100755 homes/niksne/home.nix create mode 100755 homes/niksne/hosts/konran/home.nix rename {home/profiles => homes}/niksne/hosts/konran/niri.nix (100%) rename {home/profiles => homes}/niksne/hosts/konran/programs.nix (100%) create mode 100755 homes/niksne/hosts/nakama/home.nix rename {home/profiles => homes}/niksne/hosts/nakama/hypridle.nix (100%) rename {home/profiles => homes}/niksne/hosts/nakama/niri.nix (100%) create mode 100755 homes/niksne/hosts/renga/home.nix create mode 100755 homes/niksne/hosts/tobichi/home.nix delete mode 100755 hosts/konran/default.nix create mode 100755 hosts/konran/host.nix create mode 100644 hosts/konran/modules/.gitkeep create mode 100644 hosts/modules/programs/module.nix delete mode 100755 hosts/nakama/default.nix create mode 100755 hosts/nakama/host.nix create mode 100644 hosts/nakama/modules/.gitkeep delete mode 100755 hosts/renga/default.nix create mode 100755 hosts/renga/host.nix create mode 100644 hosts/renga/modules/.gitkeep delete mode 100755 hosts/tobichi/default.nix create mode 100755 hosts/tobichi/host.nix create mode 100644 hosts/tobichi/modules/.gitkeep create mode 100644 keys.nix mode change 100755 => 100644 lib/default.nix create mode 100644 lib/helpers/default.nix create mode 100644 lib/helpers/hosts.nix create mode 100644 lib/helpers/keys.nix create mode 100644 lib/helpers/secrets.nix mode change 100755 => 100644 lib/lib'/default.nix delete mode 100755 lib/lib'/discord.nix delete mode 100755 lib/lib'/disks.nix create mode 100644 lib/lib'/fileset.nix delete mode 100755 lib/lib'/fish.nix delete mode 100644 lib/lib'/helix.nix delete mode 100644 lib/lib'/hosts.nix delete mode 100644 lib/lib'/jetbrains.nix create mode 100644 lib/lib'/lists.nix delete mode 100755 lib/lib'/niri.nix delete mode 100644 lib/lib'/numbers.nix create mode 100644 lib/lib'/options.nix delete mode 100755 lib/lib'/rofi.nix delete mode 100755 lib/lib'/strings.nix create mode 100644 lib/lib'/tags.nix create mode 100644 lib/lib'/tmpfiles.nix create mode 100644 lib/lib'/users.nix delete mode 100644 lib/lib'/zellij.nix delete mode 100755 lib/niksos/default.nix delete mode 100755 lib/niksos/homes.nix delete mode 100755 lib/niksos/hosts.nix delete mode 100755 modules/caches.nix delete mode 100755 modules/default.nix rename modules/{homes.nix => home/module.nix} (100%) mode change 100755 => 100644 create mode 100644 modules/home/services/kdeconnect/module.nix create mode 100644 modules/home/services/playerctl/module.nix create mode 100644 modules/home/services/polkit/module.nix create mode 100644 modules/home/services/udiskie/module.nix create mode 100755 modules/home/services/waybar/module.nix rename {home/services/wayland => modules/home/services}/waybar/style.css (100%) rename modules/{theme.nix => home/theme/module.nix} (100%) mode change 100755 => 100644 create mode 100755 modules/system/boot/module.nix create mode 100644 modules/system/core/module.nix create mode 100644 modules/system/fonts/module.nix create mode 100644 modules/system/hardware/backlight/module.nix create mode 100644 modules/system/hardware/bluetooth/module.nix create mode 100644 modules/system/hardware/cpu/amd.nix create mode 100644 modules/system/hardware/cpu/default.nix create mode 100644 modules/system/hardware/cpu/intel.nix create mode 100644 modules/system/hardware/gpu/amd.nix create mode 100644 modules/system/hardware/gpu/default.nix create mode 100644 modules/system/hardware/gpu/intel.nix create mode 100644 modules/system/hardware/gpu/nvidia.nix create mode 100644 modules/system/hardware/module.nix create mode 100644 modules/system/hardware/openrazer/module.nix create mode 100644 modules/system/hardware/printing/module.nix create mode 100644 modules/system/locale/module.nix create mode 100644 modules/system/networking/amnezia/module.nix create mode 100644 modules/system/networking/networkmanager/module.nix create mode 100644 modules/system/nix/builders/lib.nix create mode 100644 modules/system/nix/builders/module.nix create mode 100644 modules/system/nix/builders/user.nix create mode 100755 modules/system/nix/caches.nix rename {system => modules/system}/nix/documentation.nix (100%) rename {system => modules/system}/nix/index.nix (100%) create mode 100644 modules/system/nix/lib.nix rename system/nix/default.nix => modules/system/nix/module.nix (58%) mode change 100755 => 100644 rename {system => modules/system}/nix/nh.nix (82%) rename {system => modules/system}/nix/nixpkgs.nix (100%) create mode 100644 modules/system/programs/development/module.nix create mode 100644 modules/system/programs/fish/module.nix create mode 100644 modules/system/programs/gaming/module.nix create mode 100644 modules/system/programs/home-manager/module.nix create mode 100644 modules/system/programs/module.nix create mode 100644 modules/system/programs/niri/module.nix create mode 100644 modules/system/programs/obs-studio/module.nix create mode 100644 modules/system/programs/qt/module.nix create mode 100644 modules/system/programs/starship/module.nix create mode 100644 modules/system/programs/xdg/module.nix create mode 100644 modules/system/secrets/agenix/lib.nix create mode 100644 modules/system/secrets/agenix/module.nix rename system/core/security.nix => modules/system/security/module.nix (100%) mode change 100755 => 100644 create mode 100644 modules/system/services/gnome-services/module.nix rename {system => modules/system}/services/kanata/main.kbd (100%) create mode 100644 modules/system/services/kanata/module.nix create mode 100644 modules/system/services/location/module.nix create mode 100644 modules/system/services/module.nix create mode 100644 modules/system/services/ollama/module.nix create mode 100644 modules/system/services/openssh/module.nix create mode 100644 modules/system/services/pipewire/module.nix create mode 100644 modules/system/services/power/module.nix create mode 100644 modules/system/services/resolved/module.nix create mode 100644 modules/system/services/sddm/module.nix create mode 100644 modules/system/services/xserver/xkb/layouts.nix create mode 100644 modules/system/services/xserver/xkb/module.nix rename {system/core => modules/system/services/xserver}/xkb/symbols/eng/rdvp (100%) create mode 100644 modules/system/time/module.nix create mode 100644 modules/system/users/lib.nix create mode 100755 modules/system/users/module.nix create mode 100644 modules/system/virtualisation/bottles/module.nix create mode 100644 modules/system/virtualisation/libvirtd/module.nix create mode 100644 modules/system/virtualisation/podman/module.nix create mode 100644 secrets/secrets.nix delete mode 100755 system/core/boot.nix delete mode 100755 system/core/default.nix delete mode 100755 system/core/users.nix delete mode 100644 system/core/xkb/default.nix delete mode 100644 system/core/xkb/layouts.nix delete mode 100755 system/default.nix delete mode 100755 system/hardware/amd.nix delete mode 100755 system/hardware/bluetooth.nix delete mode 100755 system/hardware/default.nix delete mode 100755 system/hardware/graphics.nix delete mode 100644 system/hardware/intel.nix delete mode 100644 system/hardware/nvidia-prime.nix delete mode 100755 system/hardware/nvidia.nix delete mode 100755 system/hardware/printing.nix delete mode 100755 system/hardware/razer.nix delete mode 100755 system/network/amnezia.nix delete mode 100755 system/network/default.nix delete mode 100755 system/nix/caches.nix delete mode 100755 system/programs/default.nix delete mode 100755 system/programs/development.nix delete mode 100755 system/programs/fish.nix delete mode 100755 system/programs/fonts.nix delete mode 100755 system/programs/gaming.nix delete mode 100755 system/programs/home-manager.nix delete mode 100644 system/programs/niri.nix delete mode 100755 system/programs/obs-studio.nix delete mode 100755 system/programs/qt.nix delete mode 100755 system/programs/xdg.nix delete mode 100755 system/services/backlight.nix delete mode 100755 system/services/default.nix delete mode 100755 system/services/gnome-services.nix delete mode 100644 system/services/kanata/default.nix delete mode 100755 system/services/location.nix delete mode 100644 system/services/ollama.nix delete mode 100755 system/services/pipewire.nix delete mode 100755 system/services/power.nix delete mode 100755 system/services/printer-sharing.nix delete mode 100755 system/services/sddm.nix delete mode 100644 system/services/thermald.nix delete mode 100755 system/virtualisation/bottles.nix delete mode 100755 system/virtualisation/default.nix delete mode 100644 system/virtualisation/kubernetes.nix delete mode 100755 system/virtualisation/podman.nix delete mode 100644 system/virtualisation/virt-manager.nix delete mode 100755 system/virtualisation/virtualbox.nix diff --git a/.gitignore b/.gitignore index f9a759cb..f885b3ec 100755 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .direnv .pre-commit-config.yaml +old diff --git a/flake.nix b/flake.nix index 4d394b01..23f26566 100755 --- a/flake.nix +++ b/flake.nix @@ -6,10 +6,9 @@ systems = ["x86_64-linux"]; imports = [ - ./home/profiles + ./homes ./hosts ./lib - ./modules ./git-hooks.nix ]; @@ -24,9 +23,12 @@ DIRENV_LOG_FORMAT = ""; packages = [ + inputs.agenix.packages.${stdenv.hostPlatform.system}.default alejandra deadnix git + nh + just ]; shellHook = '' diff --git a/home/profiles/default.nix b/home/profiles/default.nix deleted file mode 100755 index 7582a9eb..00000000 --- a/home/profiles/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{niksos, ...}: let - inherit (niksos.homes) mkHomeImports mkHomes; - - users = { - konran = ["niksne"]; - nakama = ["niksne"]; - tobichi = ["niksne"]; - renga = ["niksne"]; - }; - - homeImports = mkHomeImports users; -in { - _module.args = {inherit homeImports;}; - - flake.homeConfigurations = mkHomes users; -} diff --git a/home/profiles/niksne/default.nix b/home/profiles/niksne/default.nix deleted file mode 100755 index fd64aeb7..00000000 --- a/home/profiles/niksne/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -mkHmModules: {inputs, ...}: { - imports = mkHmModules [ - "terminal" - ]; - - theme = { - flavor = "mocha"; - accent = "blue"; - - wallpaper = "${inputs.assets}/wallpapers/night_forest.png"; - }; -} diff --git a/home/profiles/niksne/hosts/konran/default.nix b/home/profiles/niksne/hosts/konran/default.nix deleted file mode 100755 index e454180c..00000000 --- a/home/profiles/niksne/hosts/konran/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -mkHmModules: { - imports = mkHmModules [ - "programs" - "programs/editors/jetbrains.nix" - "programs/games" - "programs/wayland/niri" - - "services" - - "terminal/emulators/wezterm.nix" - - ./niri.nix - ./programs.nix - ]; -} diff --git a/home/profiles/niksne/hosts/nakama/default.nix b/home/profiles/niksne/hosts/nakama/default.nix deleted file mode 100755 index b43b21c5..00000000 --- a/home/profiles/niksne/hosts/nakama/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -mkHmModules: { - imports = mkHmModules [ - "programs" - "programs/editors/jetbrains.nix" - "programs/games" - "programs/wayland/niri" - - "services" - - "terminal/emulators/wezterm.nix" - - ./hypridle.nix - ./niri.nix - ]; -} diff --git a/home/profiles/niksne/hosts/renga/default.nix b/home/profiles/niksne/hosts/renga/default.nix deleted file mode 100755 index 52c658a1..00000000 --- a/home/profiles/niksne/hosts/renga/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -mkHmModules: { - imports = mkHmModules [ - "programs/editors/helix" - ]; -} diff --git a/home/profiles/niksne/hosts/tobichi/default.nix b/home/profiles/niksne/hosts/tobichi/default.nix deleted file mode 100755 index 52c658a1..00000000 --- a/home/profiles/niksne/hosts/tobichi/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -mkHmModules: { - imports = mkHmModules [ - "programs/editors/helix" - ]; -} diff --git a/home/programs/browsers/default.nix b/home/programs/browsers/default.nix deleted file mode 100755 index 233ff28b..00000000 --- a/home/programs/browsers/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./zen.nix - ]; -} diff --git a/home/programs/browsers/vivaldi.nix b/home/programs/browsers/vivaldi.nix deleted file mode 100755 index e0382b13..00000000 --- a/home/programs/browsers/vivaldi.nix +++ /dev/null @@ -1,26 +0,0 @@ -{pkgs, ...}: { - programs.vivaldi = { - enable = true; - package = pkgs.vivaldi.override { - proprietaryCodecs = true; - enableWidevine = true; - }; - commandLineArgs = [ - "--enable-features=UseOzonePlatform" - "--ozone-platform=wayland" - ]; - extensions = [ - "cjpalhdlnbpafiamejdnhcphjbkeiagm" - "kjhdffcfinhkdfbbhjlfoadcdfgihmlp" - "eimadpbcbfnmbkopoojfekhnkhdbieeh" - "apmmpaebfobifelkijhaljbmpcgbjbdo" - "cbghhgpcnddeihccjmnadmkaejncjndb" - "mnjggcdmjocbbbhaepdhchncahnbgone" - "pljikjgdcelenhecaainhheabilopmcc" - ]; - }; - - home.packages = with pkgs; [ - vivaldi-ffmpeg-codecs - ]; -} diff --git a/home/programs/browsers/zen.nix b/home/programs/browsers/zen.nix deleted file mode 100755 index b7f516f6..00000000 --- a/home/programs/browsers/zen.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - inputs, - pkgs, - ... -}: { - home.packages = [ - (inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.beta.override { - iconsDir = "${inputs.assets}/icons/zen-browser"; - }) - ]; -} diff --git a/home/programs/dconf.nix b/home/programs/dconf.nix deleted file mode 100644 index 72e678e8..00000000 --- a/home/programs/dconf.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - dconf.settings = { - "org/nome/desktop/wm/preferences" = { - button-layout = ""; - }; - }; -} diff --git a/home/programs/default.nix b/home/programs/default.nix deleted file mode 100755 index d75b91a8..00000000 --- a/home/programs/default.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - pkgs, - inputs, - ... -}: { - imports = [ - ./browsers - ./editors - ./media - ./office - ./social - ./wayland - ./dconf.nix - ./gtk.nix - ./qt.nix - ./thunar.nix - ]; - - xdg.configFile."mimeapps.list".force = true; - - programs.java = { - enable = true; - package = pkgs.zulu21; - }; - - home.packages = with inputs.catppuccin.packages.${pkgs.stdenv.hostPlatform.system}; - [ - whiskers - catwalk - ] - ++ (with pkgs; [ - file-roller - - qbittorrent - blockbench - - surrealist - bruno - - mission-center - - custom.catppuccin - ]); -} diff --git a/home/programs/editors/default.nix b/home/programs/editors/default.nix deleted file mode 100755 index 248e7110..00000000 --- a/home/programs/editors/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - ./helix - ./zed - ]; -} diff --git a/home/programs/editors/helix/default.nix b/home/programs/editors/helix/default.nix deleted file mode 100755 index 1819429f..00000000 --- a/home/programs/editors/helix/default.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - config, - inputs, - pkgs, - ... -}: { - imports = [ - ./languages - ./themes.nix - ]; - - programs.helix = { - enable = true; - package = pkgs.symlinkJoin { - name = "helix-wrapped"; - paths = [inputs.helix.packages.${pkgs.stdenv.hostPlatform.system}.default]; - preferLocalBuild = true; - nativeBuildInputs = [pkgs.makeWrapper]; - postBuild = let - runtime = - pkgs.callPackage (import ./runtime.nix {inherit config inputs;}) {} |> toString; - in '' - wrapProgram $out/bin/hx \ - --suffix HELIX_RUNTIME : ${runtime} - ''; - }; - - defaultEditor = true; - settings = { - theme = "catppuccin_${config.theme.flavor}-transparent"; - editor = { - line-number = "relative"; - completion-trigger-len = 1; - completion-replace = true; - bufferline = "multiple"; - color-modes = true; - trim-trailing-whitespace = true; - rainbow-brackets = true; - lsp = { - display-progress-messages = true; - display-inlay-hints = true; - }; - cursor-shape = { - normal = "block"; - insert = "bar"; - select = "underline"; - }; - indent-guides = { - render = true; - character = "╎"; - }; - soft-wrap.enable = true; - inline-diagnostics = { - cursor-line = "hint"; - other-lines = "error"; - }; - }; - }; - }; - - catppuccin.helix.enable = false; -} diff --git a/home/programs/editors/helix/languages/bash.nix b/home/programs/editors/helix/languages/bash.nix deleted file mode 100644 index d33bfc8a..00000000 --- a/home/programs/editors/helix/languages/bash.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "bash"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - bash-language-server - ]; - }; -} diff --git a/home/programs/editors/helix/languages/c.nix b/home/programs/editors/helix/languages/c.nix deleted file mode 100644 index 7f0db68d..00000000 --- a/home/programs/editors/helix/languages/c.nix +++ /dev/null @@ -1,20 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "c"; - auto-format = true; - } - { - name = "cpp"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - llvmPackages_21.clang-tools - ]; - }; -} diff --git a/home/programs/editors/helix/languages/ci.nix b/home/programs/editors/helix/languages/ci.nix deleted file mode 100644 index b5d40998..00000000 --- a/home/programs/editors/helix/languages/ci.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "gitlab-ci"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - gitlab-ci-ls - ]; - }; -} diff --git a/home/programs/editors/helix/languages/default.nix b/home/programs/editors/helix/languages/default.nix deleted file mode 100644 index 44f1c999..00000000 --- a/home/programs/editors/helix/languages/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - inputs, - lib, - lib', - osConfig, - pkgs, - ... -}: let - notForHosts = lib'.notForHosts osConfig; - - headlessHosts = ["tobichi" "renga"]; - - commonLSPs = - { - wakatime-ls = { - command = "wakatime-ls"; - }; - } - // (notForHosts headlessHosts lib.optionalAttrs { - discord-rpc = { - command = "discord-rpc-lsp"; - }; - }); - - commonPackages = with pkgs; let - inherit (stdenv.hostPlatform) system; - in - [ - inputs.wakatime-ls.packages.${system}.wakatime-ls - ] - ++ ( - notForHosts headlessHosts lib.optional inputs.discord-rpc-lsp.packages.${system}.default - ); - - langfiles = [ - ./bash.nix - ./c.nix - ./ci.nix - ./docker.nix - ./elixir.nix - ./fish.nix - ./go.nix - ./helm.nix - ./just.nix - ./jvm.nix - ./latex.nix - ./nix.nix - ./protobuf.nix - ./python.nix - ./qml.nix - ./rust.nix - ./surql.nix - ./systemd.nix - ./tofu.nix - ./toml.nix - ./web.nix - ./yaml.nix - ./zig.nix - ]; -in - lib'.helix.mkHelixLangs pkgs langfiles commonLSPs commonPackages diff --git a/home/programs/editors/helix/languages/docker.nix b/home/programs/editors/helix/languages/docker.nix deleted file mode 100644 index 3ce6ed8a..00000000 --- a/home/programs/editors/helix/languages/docker.nix +++ /dev/null @@ -1,20 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "dockerfile"; - auto-format = true; - } - { - name = "docker-compose"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - docker-language-server - ]; - }; -} diff --git a/home/programs/editors/helix/languages/elixir.nix b/home/programs/editors/helix/languages/elixir.nix deleted file mode 100644 index 3db7540f..00000000 --- a/home/programs/editors/helix/languages/elixir.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "elixir"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - beamMinimal28Packages.elixir-ls - ]; - }; -} diff --git a/home/programs/editors/helix/languages/fish.nix b/home/programs/editors/helix/languages/fish.nix deleted file mode 100644 index 55dc427d..00000000 --- a/home/programs/editors/helix/languages/fish.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "fish"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - fish-lsp - ]; - }; -} diff --git a/home/programs/editors/helix/languages/go.nix b/home/programs/editors/helix/languages/go.nix deleted file mode 100644 index 82099b06..00000000 --- a/home/programs/editors/helix/languages/go.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - extraPackages = with pkgs; [ - gopls - ]; - }; -} diff --git a/home/programs/editors/helix/languages/helm.nix b/home/programs/editors/helix/languages/helm.nix deleted file mode 100644 index a60daa51..00000000 --- a/home/programs/editors/helix/languages/helm.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "helm"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - helm-ls - ]; - }; -} diff --git a/home/programs/editors/helix/languages/just.nix b/home/programs/editors/helix/languages/just.nix deleted file mode 100644 index d629bce7..00000000 --- a/home/programs/editors/helix/languages/just.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "just"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - just-lsp - ]; - }; -} diff --git a/home/programs/editors/helix/languages/jvm.nix b/home/programs/editors/helix/languages/jvm.nix deleted file mode 100644 index 2a2a4544..00000000 --- a/home/programs/editors/helix/languages/jvm.nix +++ /dev/null @@ -1,21 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "java"; - auto-format = true; - } - { - name = "kotlin"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - jdt-language-server - kotlin-language-server - ]; - }; -} diff --git a/home/programs/editors/helix/languages/latex.nix b/home/programs/editors/helix/languages/latex.nix deleted file mode 100644 index e4af4e62..00000000 --- a/home/programs/editors/helix/languages/latex.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "latex"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - texlab - ]; - }; -} diff --git a/home/programs/editors/helix/languages/markdown.nix b/home/programs/editors/helix/languages/markdown.nix deleted file mode 100644 index 89b7be49..00000000 --- a/home/programs/editors/helix/languages/markdown.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "markdown"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - marksman - ]; - }; -} diff --git a/home/programs/editors/helix/languages/nix.nix b/home/programs/editors/helix/languages/nix.nix deleted file mode 100644 index 5de027fc..00000000 --- a/home/programs/editors/helix/languages/nix.nix +++ /dev/null @@ -1,26 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "nix"; - auto-format = true; - } - ]; - - language-server.nil = { - config = { - nil.formatting.command = [ - "alejandra" - "-q" - ]; - }; - }; - }; - - extraPackages = with pkgs; [ - nil - alejandra - ]; - }; -} diff --git a/home/programs/editors/helix/languages/protobuf.nix b/home/programs/editors/helix/languages/protobuf.nix deleted file mode 100644 index 1519fa76..00000000 --- a/home/programs/editors/helix/languages/protobuf.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "protobuf"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - protols - ]; - }; -} diff --git a/home/programs/editors/helix/languages/python.nix b/home/programs/editors/helix/languages/python.nix deleted file mode 100644 index 6eaeb2b6..00000000 --- a/home/programs/editors/helix/languages/python.nix +++ /dev/null @@ -1,21 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "python"; - auto-format = true; - language-servers = [ - "basedpyright" - "ruff" - ]; - } - ]; - }; - - extraPackages = with pkgs; [ - basedpyright - ruff - ]; - }; -} diff --git a/home/programs/editors/helix/languages/qml.nix b/home/programs/editors/helix/languages/qml.nix deleted file mode 100644 index 880efd93..00000000 --- a/home/programs/editors/helix/languages/qml.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "qml"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - kdePackages.qtdeclarative - ]; - }; -} diff --git a/home/programs/editors/helix/languages/rust.nix b/home/programs/editors/helix/languages/rust.nix deleted file mode 100644 index 78f6933f..00000000 --- a/home/programs/editors/helix/languages/rust.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language-server.rust-analyzer = { - config = { - check.command = "clippy"; - diagnostics.styleLints.enable = true; - }; - }; - }; - - extraPackages = with pkgs; [ - rust-analyzer - ]; - }; -} diff --git a/home/programs/editors/helix/languages/surql.nix b/home/programs/editors/helix/languages/surql.nix deleted file mode 100644 index 1e0dd1d1..00000000 --- a/home/programs/editors/helix/languages/surql.nix +++ /dev/null @@ -1,32 +0,0 @@ -{...}: { - programs.helix = { - languages = { - language = [ - { - name = "surrealql"; - scope = "source.surrealql"; - file-types = ["surql"]; - comment-tokens = ["--" "//" "#"]; - block-comment-tokens = { - start = "/*"; - end = "*/"; - }; - indent = { - tab-width = 4; - unit = " "; - }; - injection-regex = "surql"; - } - ]; - grammar = [ - { - name = "surrealql"; - source = { - git = "https://github.com/Ce11an/tree-sitter-surrealql"; - rev = "8eda53c708592d32f0c705a7f8d13d4727502e2d"; - }; - } - ]; - }; - }; -} diff --git a/home/programs/editors/helix/languages/systemd.nix b/home/programs/editors/helix/languages/systemd.nix deleted file mode 100644 index 294a87af..00000000 --- a/home/programs/editors/helix/languages/systemd.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "systemd"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - systemd-lsp - ]; - }; -} diff --git a/home/programs/editors/helix/languages/tofu.nix b/home/programs/editors/helix/languages/tofu.nix deleted file mode 100644 index a69850fd..00000000 --- a/home/programs/editors/helix/languages/tofu.nix +++ /dev/null @@ -1,34 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "hcl"; - language-id = "opentofu"; - scope = "source.hcl"; - file-types = ["tf" "tofu" "tfvars"]; - auto-format = true; - comment-token = "#"; - block-comment-tokens = { - start = "/*"; - end = "*/"; - }; - indent = { - tab-width = 2; - unit = " "; - }; - language-servers = ["tofu-ls"]; - } - ]; - - language-server.tofu-ls = { - command = "tofu-ls"; - args = ["serve"]; - }; - }; - - extraPackages = with pkgs; [ - tofu-ls - ]; - }; -} diff --git a/home/programs/editors/helix/languages/toml.nix b/home/programs/editors/helix/languages/toml.nix deleted file mode 100644 index 36c9ab8b..00000000 --- a/home/programs/editors/helix/languages/toml.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "toml"; - auto-format = true; - } - ]; - }; - - extraPackages = with pkgs; [ - taplo - ]; - }; -} diff --git a/home/programs/editors/helix/languages/web.nix b/home/programs/editors/helix/languages/web.nix deleted file mode 100644 index 20af2ac8..00000000 --- a/home/programs/editors/helix/languages/web.nix +++ /dev/null @@ -1,113 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - languages = { - language = [ - { - name = "css"; - language-servers = [ - "vscode-css-language-server" - "tailwindcss-ls" - ]; - } - { - name = "html"; - language-servers = [ - "vscode-html-language-server" - "tailwindcss-ls" - "emmet" - ]; - } - { - name = "javascript"; - auto-format = true; - } - { - name = "jsx"; - auto-format = true; - language-servers = [ - "typescript-language-server" - "tailwindcss-ls" - "emmet" - ]; - } - { - name = "typescript"; - auto-format = true; - } - { - name = "tsx"; - auto-format = true; - language-servers = [ - "typescript-language-server" - "tailwindcss-ls" - "emmet" - ]; - } - { - name = "svelte"; - auto-format = true; - language-servers = [ - "svelteserver" - "tailwindcss-ls" - "emmet" - ]; - } - { - name = "vue"; - auto-format = true; - language-servers = [ - "vuels" - "tailwindcss-ls" - "emmet" - ]; - } - { - name = "astro"; - auto-format = true; - language-servers = [ - "astro-ls" - "tailwindcss-ls" - "emmet" - ]; - } - ]; - - language-server = { - typescript-language-server = { - config = { - typescript-language-server.source = { - addMissingImports.ts = true; - fixAll.ts = true; - organizeImports.ts = true; - removeUnusedImports.ts = true; - sortImports.ts = true; - }; - plugins = [ - { - name = "@vue/typescript-plugin"; - location = "${pkgs.vue-language-server}/lib/node_modules/@vue/language-server"; - languages = ["vue"]; - } - ]; - }; - }; - - emmet = { - command = "emmet-language-server"; - args = ["--stdio"]; - }; - }; - }; - - extraPackages = with pkgs; [ - vscode-langservers-extracted - tailwindcss-language-server - emmet-language-server - typescript-language-server - svelte-language-server - vue-language-server - astro-language-server - angular-language-server - ]; - }; -} diff --git a/home/programs/editors/helix/languages/yaml.nix b/home/programs/editors/helix/languages/yaml.nix deleted file mode 100644 index 1519eae1..00000000 --- a/home/programs/editors/helix/languages/yaml.nix +++ /dev/null @@ -1,8 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - extraPackages = with pkgs; [ - yaml-language-server - yamlfmt - ]; - }; -} diff --git a/home/programs/editors/helix/languages/zig.nix b/home/programs/editors/helix/languages/zig.nix deleted file mode 100644 index 23848c50..00000000 --- a/home/programs/editors/helix/languages/zig.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: { - programs.helix = { - extraPackages = with pkgs; [ - zls - ]; - }; -} diff --git a/home/programs/editors/helix/runtime.nix b/home/programs/editors/helix/runtime.nix deleted file mode 100644 index 4792415c..00000000 --- a/home/programs/editors/helix/runtime.nix +++ /dev/null @@ -1,135 +0,0 @@ -{ - config, - inputs, -}: { - stdenv, - lib, - symlinkJoin, - includeGrammarIf ? _: true, - grammarOverlays ? [], - ... -}: let - bundledLanguagesConfig = - builtins.fromTOML (builtins.readFile "${inputs.helix}/languages.toml"); - languagesConfig = config.programs.helix.languages; - isGitGrammar = grammar: - builtins.hasAttr "source" grammar - && builtins.hasAttr "git" grammar.source - && builtins.hasAttr "rev" grammar.source; - isGitHubGrammar = grammar: lib.hasPrefix "https://github.com" grammar.source.git; - toGitHubFetcher = url: let - match = builtins.match "https://github\.com/([^/]*)/([^/]*)/?" url; - in { - owner = builtins.elemAt match 0; - repo = builtins.elemAt match 1; - }; - # If `use-grammars.only` is set, use only those grammars. - # If `use-grammars.except` is set, use all other grammars. - # Otherwise use all grammars. - useGrammar = grammar: - if languagesConfig ? use-grammars.only - then builtins.elem grammar.name languagesConfig.use-grammars.only - else if languagesConfig ? use-grammars.except - then !(builtins.elem grammar.name languagesConfig.use-grammars.except) - else true; - - bundledGrammars = bundledLanguagesConfig.grammar |> map (grammar: grammar.name); - grammarsToUse = languagesConfig.grammar |> builtins.filter ({name, ...}: !(builtins.elem name bundledGrammars)) |> builtins.filter useGrammar; - gitGrammars = builtins.filter isGitGrammar grammarsToUse; - buildGrammar = grammar: let - gh = toGitHubFetcher grammar.source.git; - sourceGit = builtins.fetchTree { - type = "git"; - url = grammar.source.git; - rev = grammar.source.rev; - ref = grammar.source.ref or "HEAD"; - shallow = true; - }; - sourceGitHub = builtins.fetchTree { - type = "github"; - owner = gh.owner; - repo = gh.repo; - inherit (grammar.source) rev; - }; - source = - if isGitHubGrammar grammar - then sourceGitHub - else sourceGit; - in - stdenv.mkDerivation { - # see https://github.com/NixOS/nixpkgs/blob/fbdd1a7c0bc29af5325e0d7dd70e804a972eb465/pkgs/development/tools/parsing/tree-sitter/grammar.nix - - pname = "helix-tree-sitter-${grammar.name}"; - version = grammar.source.rev; - - src = source; - sourceRoot = - if builtins.hasAttr "subpath" grammar.source - then "source/${grammar.source.subpath}" - else "source"; - - dontConfigure = true; - - FLAGS = [ - "-Isrc" - "-g" - "-O3" - "-fPIC" - "-fno-exceptions" - "-Wl,-z,relro,-z,now" - ]; - - NAME = grammar.name; - - buildPhase = '' - runHook preBuild - - if [[ -e src/scanner.cc ]]; then - $CXX -c src/scanner.cc -o scanner.o $FLAGS - elif [[ -e src/scanner.c ]]; then - $CC -c src/scanner.c -o scanner.o $FLAGS - fi - - $CC -c src/parser.c -o parser.o $FLAGS - $CXX -shared -o $NAME.so *.o - - runHook postBuild - ''; - - installPhase = '' - runHook preInstall - mkdir -p $out/grammars - mv $NAME.so $out/grammars - if [[ -e queries ]]; then - mkdir -p $out/queries/$NAME - cp -r queries/* $out/queries/$NAME/ - find $out/queries/$NAME -type l -delete - fi - runHook postInstall - ''; - - # Strip failed on darwin: strip: error: symbols referenced by indirect symbol table entries that can't be stripped - fixupPhase = lib.optionalString stdenv.isLinux '' - runHook preFixup - $STRIP $out/grammars/$NAME.so - runHook postFixup - ''; - }; - grammarsToBuild = builtins.filter includeGrammarIf gitGrammars; - builtGrammars = - builtins.map (grammar: { - inherit (grammar) name; - value = buildGrammar grammar; - }) - grammarsToBuild; - extensibleGrammars = - lib.makeExtensible (_self: builtins.listToAttrs builtGrammars); - overlaidGrammars = - lib.pipe extensibleGrammars - (builtins.map (overlay: grammar: grammar.extend overlay) grammarOverlays); -in - symlinkJoin { - name = "helix-runtime"; - paths = overlaidGrammars |> lib.filterAttrs (_: v: lib.isDerivation v) |> builtins.attrValues; - preferLocalBuild = true; - } diff --git a/home/programs/editors/helix/themes.nix b/home/programs/editors/helix/themes.nix deleted file mode 100644 index 28d8e543..00000000 --- a/home/programs/editors/helix/themes.nix +++ /dev/null @@ -1,18 +0,0 @@ -{lib, ...}: let - inherit (lib) nameValuePair; -in { - programs.helix.themes = - map (flavor: "catppuccin_${flavor}") [ - "latte" - "frappe" - "macciato" - "mocha" - ] - |> map (theme: - nameValuePair "${theme}-transparent" { - inherits = theme; - - "ui.background" = {}; - }) - |> builtins.listToAttrs; -} diff --git a/home/programs/editors/jetbrains.nix b/home/programs/editors/jetbrains.nix deleted file mode 100755 index e2b32704..00000000 --- a/home/programs/editors/jetbrains.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ - lib', - pkgs, - ... -}: let - ides = [ - "idea-ultimate" - # "pycharm-professional" - # "webstorm" - "rust-rover" - # "goland" - # "phpstorm" - # "clion" - "datagrip" - ]; - - plugins = { - common = [ - "catppuccin-theme" - "catppuccin-icons" - "ideavim" - "nixidea" - "rainbow-brackets" - "-env-files" - "gitlab" - ]; - "idea-ultimate" = [ - "scala" - "minecraft-development" - ]; - }; - - ides' = lib'.jetbrains.mkIdes pkgs ides plugins; -in { - programs.jetbrains-remote = { - enable = true; - ides = ides'; - }; - home.packages = ides'; -} diff --git a/home/programs/editors/zed/default.nix b/home/programs/editors/zed/default.nix deleted file mode 100644 index 36877762..00000000 --- a/home/programs/editors/zed/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - programs.zed-editor = { - enable = true; - - installRemoteServer = true; - - userSettings = { - agent = { - always_allow_tool_actions = true; - play_sound_when_agent_done = true; - }; - audio."experimental.rodio_audio" = true; - auto_update = false; - buffer_font_family = "JetBrainsMono Nerd Font Mono"; - buffer_font_size = 15; - calls.mute_on_join = true; - diagnostics.inline.enabled = true; - git_panel.sort_by_path = true; - helix_mode = true; - inlay_hints.enabled = true; - languages = { - Rust = { - completions.lsp = false; - enable_language_server = false; - }; - }; - tabs = { - file_icons = true; - git_status = true; - }; - telemetry = { - diagnostics = false; - metrics = false; - }; - title_bar = { - show_branch_icon = true; - show_menus = true; - }; - ui_font_family = "JetBrainsMono Nerd Font Propo"; - ui_font_size = 16; - }; - }; -} diff --git a/home/programs/games/default.nix b/home/programs/games/default.nix deleted file mode 100755 index cc1175f8..00000000 --- a/home/programs/games/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./minecraft.nix - ]; -} diff --git a/home/programs/games/minecraft.nix b/home/programs/games/minecraft.nix deleted file mode 100755 index 8ee516a4..00000000 --- a/home/programs/games/minecraft.nix +++ /dev/null @@ -1,9 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - (prismlauncher.override { - jdk8 = zulu8; - jdk17 = zulu17; - jdk21 = zulu21; - }) - ]; -} diff --git a/home/programs/gtk.nix b/home/programs/gtk.nix deleted file mode 100755 index 49bd887d..00000000 --- a/home/programs/gtk.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - lib, - pkgs, - config, - ... -}: { - home = { - packages = with pkgs; [ - numix-icon-theme-circle - ]; - pointerCursor.size = 24; - }; - - gtk = { - enable = true; - - font = { - name = "JetBrainsMono Nerd Font Propo"; - package = pkgs.nerd-fonts.jetbrains-mono; - size = 10; - }; - - gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; - - iconTheme = { - name = lib.mkForce "Colloid-Teal-Dracula-Dark"; - package = pkgs.colloid-icon-theme.override { - schemeVariants = ["dracula"]; - colorVariants = ["teal"]; - }; - }; - }; -} diff --git a/home/programs/media/default.nix b/home/programs/media/default.nix deleted file mode 100755 index 02d9b0be..00000000 --- a/home/programs/media/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./mpv.nix - ./obs-studio.nix - ./rnnoise.nix - ./spicetify.nix - ]; - - home.packages = with pkgs; [ - # audio control - pavucontrol - pamixer - pulsemixer - - # audio - amberol - - # images - loupe - imagemagick - # gimp-with-plugins - - # videos - celluloid - ]; -} diff --git a/home/programs/media/mpv.nix b/home/programs/media/mpv.nix deleted file mode 100755 index 86f2064d..00000000 --- a/home/programs/media/mpv.nix +++ /dev/null @@ -1,9 +0,0 @@ -{pkgs, ...}: { - programs.mpv = { - enable = true; - defaultProfiles = ["gpu-hq"]; - scripts = [ - pkgs.mpvScripts.mpris - ]; - }; -} diff --git a/home/programs/media/obs-studio.nix b/home/programs/media/obs-studio.nix deleted file mode 100755 index 9f25870f..00000000 --- a/home/programs/media/obs-studio.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.obs-studio = { - enable = true; - plugins = []; - }; -} diff --git a/home/programs/media/rnnoise.nix b/home/programs/media/rnnoise.nix deleted file mode 100755 index eb07414d..00000000 --- a/home/programs/media/rnnoise.nix +++ /dev/null @@ -1,41 +0,0 @@ -{pkgs, ...}: let - json = pkgs.formats.json {}; - - pw_rnnoise_config = { - "context.modules" = [ - { - "name" = "libpipewire-module-filter-chain"; - "args" = { - "node.description" = "Noise Canceling source"; - "media.name" = "Noise Canceling source"; - "filter.graph" = { - "nodes" = [ - { - "type" = "ladspa"; - "name" = "rnnoise"; - "plugin" = "${pkgs.rnnoise-plugin}/lib/ladspa/librnnoise_ladspa.so"; - "label" = "noise_suppressor_stereo"; - "control" = { - "VAD Threshold (%)" = 50.0; - }; - } - ]; - }; - "audio.position" = ["FL" "FR"]; - "capture.props" = { - "node.name" = "effect_input.rnnoise"; - "node.passive" = true; - }; - "playback.props" = { - "node.name" = "effect_output.rnnoise"; - "media.class" = "Audio/Source"; - }; - }; - } - ]; - }; -in { - xdg.configFile."pipewire/pipewire.conf.d/99-input-denoising.conf" = { - source = json.generate "99-input-denoising.conf" pw_rnnoise_config; - }; -} diff --git a/home/programs/media/spicetify.nix b/home/programs/media/spicetify.nix deleted file mode 100755 index 5145f7b1..00000000 --- a/home/programs/media/spicetify.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - inputs, - pkgs, - config, - ... -}: { - # themable spotify - imports = [ - inputs.spicetify-nix.homeManagerModules.default - ]; - - programs.spicetify = let - spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.stdenv.hostPlatform.system}; - in { - enable = true; - - windowManagerPatch = true; - wayland = true; - - theme = spicePkgs.themes.catppuccin; - - colorScheme = config.theme.flavor; - - enabledExtensions = with spicePkgs.extensions; [ - autoSkipVideo - bookmark - keyboardShortcut - loopyLoop - popupLyrics - shuffle - trashbin - powerBar - seekSong - fullAlbumDate - goToSong - wikify - songStats - showQueueDuration - copyToClipboard - betterGenres - hidePodcasts - adblock - autoSkip - playNext - volumePercentage - copyLyrics - playingSource - beautifulLyrics - ]; - - enabledCustomApps = with spicePkgs.apps; [ - lyricsPlus - ]; - }; -} diff --git a/home/programs/office/default.nix b/home/programs/office/default.nix deleted file mode 100755 index 21a2e4f0..00000000 --- a/home/programs/office/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./zathura.nix - ]; - - home.packages = with pkgs; [ - affine - openscad - libreoffice - simple-scan - ]; -} diff --git a/home/programs/office/zathura.nix b/home/programs/office/zathura.nix deleted file mode 100755 index af856551..00000000 --- a/home/programs/office/zathura.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - programs.zathura = { - enable = true; - - options = { - font = "JetBrainsMono Nerd Font Mono 12"; - selection-notification = true; - - selection-clipboard = "clipboard"; - adjust-open = "best-fit"; - pages-per-row = "1"; - scroll-page-aware = "true"; - scroll-full-overlap = "0.01"; - scroll-step = "100"; - zoom-min = "10"; - }; - }; -} diff --git a/home/programs/qt.nix b/home/programs/qt.nix deleted file mode 100755 index e6f00256..00000000 --- a/home/programs/qt.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - qt = { - enable = true; - platformTheme.name = "kvantum"; - style.name = "kvantum"; - }; -} diff --git a/home/programs/social/default.nix b/home/programs/social/default.nix deleted file mode 100755 index b3d75542..00000000 --- a/home/programs/social/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./discord.nix - ./thunderbird.nix - ]; - - home.packages = with pkgs; [ - ayugram-desktop - - chatterino2 - ]; -} diff --git a/home/programs/social/discord.nix b/home/programs/social/discord.nix deleted file mode 100644 index 1efa3000..00000000 --- a/home/programs/social/discord.nix +++ /dev/null @@ -1,759 +0,0 @@ -{ - config, - lib', - pkgs, - ... -}: let - plugins = [ - { - name = "AccountPanelServerProfile"; - prioritizeServerProfile = true; - } - { - name = "AllCallTimers"; - format = "human"; - showRoleColor = true; - showSeconds = true; - showWithoutHover = false; - trackSelf = true; - watchLargeGuilds = false; - } - "AmITyping" - { - name = "Anammox"; - gift = false; - } - { - name = "AnonymiseFileNames"; - anonymiseByDefault = true; - consistent = "image"; - method = 0; - randomisedLength = 7; - } - { - name = "BetterActivities"; - allActivitiesStyle = "carousel"; - iconSize = 15; - memberList = true; - renderGifs = true; - showAppDescriptions = true; - specialFirst = true; - } - { - name = "BetterAudioPlayer"; - forceMoveBelow = true; - oscilloscope = true; - oscilloscopeColor = "255, 255, 255"; - oscilloscopeSolidColor = false; - spectrograph = true; - spectrographColor = "33, 150, 243"; - spectrographSolidColor = false; - } - "BetterBanReasons" - "BetterBlockedUsers" - "BetterCommands" - "BetterGifAltText" - "BetterGifPicker" - "BetterInvites" - { - name = "BetterNotesBox"; - hide = true; - noSpellCheck = false; - } - "BetterPlusReacts" - { - name = "BetterQuickReact"; - columns = 4; - compactMode = false; - frequentEmojis = true; - rows = 2; - scroll = true; - } - { - name = "BetterRoleContext"; - roleIconFileFormat = "png"; - } - { - name = "BetterRoleDot"; - bothStyles = false; - copyRoleColorInProfilePopout = false; - } - { - name = "BetterSessions"; - backgroundCheck = true; - checkInterval = 20; - } - "BetterUploadButton" - # "BetterUserArea" # TODO: uncomment when fixed - "BiggerStreamPreview" - { - name = "BlurNSFW"; - blurAmount = 10; - } - { - name = "CallTimer"; - format = "human"; - } - { - name = "CharacterCounter"; - colorEffects = true; - position = false; - } - "ChatInputButtonAPI" - "ClearURLs" - "ClipsEnhancements" - { - name = "CommandPalette"; - allowMouseControl = true; - hotkey = [ - "control" - "shift" - ]; - } - "CommandsAPI" - { - name = "ConsoleJanitor"; - disableLoggers = false; - disableSpotifyLogger = true; - whitelistedLoggers = "GatewaySocket; Routing/Utils"; - } - "ConsoleShortcuts" - "ContextMenuAPI" - { - name = "CopyEmojiMarkdown"; - copyUnicode = true; - } - "CopyFileContents" - "BetterCommands" - - "CopyUserMention" - "CopyUserURLs" - { - name = "CrashHandler"; - attemptToNavigateToHome = false; - attemptToPreventCrashes = true; - } - { - name = "CustomUserColors"; - colorInServers = true; - dmList = true; - } - "DeadMembers" - { - name = "Dearrow"; - dearrowByDefault = true; - hideButton = false; - replaceElements = 0; - } - { - name = "Decor"; - baseUrl = "https://decor.fieryflames.dev"; - } - "DisableCallIdle" - "DisableCameras" - "DontFilterMe" - "DontRoundMyTimestamps" - { - name = "Downloadify"; - defaultDirectory = "${config.home.homeDirectory}/Downloads/Equibop"; - } - "DynamicImageModalAPI" - "EmojiDumper" - "EmoteCloner" - "EquicordHelper" - { - name = "Experiments"; - toolbarDevMenu = true; - } - "ExportContacts" - "FakeNitro" - "FavoriteEmojiFirst" - { - name = "FindReply"; - hideButtonIfNoReply = true; - includeAuthor = true; - includePings = true; - } - "FixCodeblockGap" - "FixFileExtensions" - "FixImagesQuality" - { - name = "FixSpotifyEmbeds"; - volume = 10; - } - "FixYoutubeEmbeds" - { - name = "FontLoader"; - applyOnClodeBlocks = true; - selectedFont = "JetBrainsMono Nerd Font Propo"; - } - "ForceOwnerCrown" - "FrequentQuickSwitcher" - "FriendCodes" - "FriendInvites" - "FriendTags" - "FriendsSince" - "FriendshipRanks" - "FullSearchContext" - "FullUserInChatbox" - { - # TODO: uncomment when fixed - name = "GameActivityToggle"; - oldIcon = false; - } - "GifPaste" - "GitHubRepos" - { - name = "Glide"; - Accent = "313338"; - Brand = "ffffff"; - ColorPreset = 0; - Primary = "000000"; - Text = "ffffff"; - animationSpeed = "0.2"; - customFont = "JetBrainsMono Nerd Font Propo"; - memberListAnim = true; - pastelStatuses = true; - privacyBlur = false; - serverListAnim = false; - tooltips = false; - } - "GodMode" - { - name = "GoogleThat"; - defaultEngine = "DuckDuckGo"; - hyperlink = true; - } - { - name = "GreetStickerPicker"; - greetMode = "Greet"; - } - "GuildPickerDumper" - { - name = "HideServers"; - showIndicator = true; - } - "HolyNotes" - "HomeTyping" - "IRememberYou" - "ImageLink" - { - name = "ImagePreview"; - defaultMaxSize = "0"; - fileInformation = true; - fixedImage = false; - hoverDelay = 0.5; - messageAvatars = true; - messageImages = true; - messageLinks = true; - messageStickers = true; - mouseOnlyMode = false; - zoomFactor = 1.5; - } - "ImageZoom" - "ImgToGif" - { - name = "ImplicitRelationships"; - sortByAffinity = true; - } - "InRole" - "JumpToStart" - "KeepCurrentChannel" - { - name = "LimitMiddleClickPaste"; - limitTo = "active"; - reenableDelay = 500; - } - { - name = "LoadingQuotes"; - additionalQuotes = ""; - additionalQuotesDelimiter = "|"; - enableDiscordPresetQuotes = false; - enablePluginPresetQuotes = true; - replaceEvents = true; - } - "LoginWithQR" - { - name = "MediaDownloader"; - defaultGifQuality = 3; - showFfmpegWarning = true; - showProgress = true; - } - { - name = "MediaPlaybackSpeed"; - defaultAudioSpeed = 1; - defaultVideoSpeed = 1; - defaultVoiceMessageSpeed = 1; - } - { - name = "MemberCount"; - memberList = true; - toolTip = true; - } - "MemberListDecoratorsAPI" - { - name = "MentionAvatars"; - value = { - enabled = true; - showAtSymbol = true; - }; - } - "MessageAccessoriesAPI" - { - name = "MessageBurst"; - shouldMergeWithAttachment = false; - timePeriod = 3; - } - { - name = "MessageClickActions"; - enableDeleteOnClick = true; - enableDoubleClickToEdit = true; - enableDoubleClickToReply = true; - requireModifier = false; - } - "MessageDecorationsAPI" - "MessageEventsAPI" - { - name = "MessageLatency"; - detectDiscordKotlin = true; - latency = 2; - showMillis = true; - } - { - name = "MessageLinkTooltip"; - display = "auto"; - onForward = true; - onLink = true; - onReply = true; - } - { - name = "MessageLogger"; - collapseDeleted = false; - deleteStyle = "text"; - ignoreBots = false; - ignoreChannels = ""; - ignoreGuilds = ""; - ignoreSelf = false; - ignoreUsers = ""; - logDeletes = true; - logEdits = true; - } - { - name = "MessageLoggerEnhanced"; - ShowLogsButton = true; - alwaysLogCurrentChannel = true; - alwaysLogDirectMessages = true; - attachmentFileExtensions = "png,jpg,jpeg,gif,webp,mp4,webm,mp3,ogg,wav"; - attachmentSizeLimitInMegabytes = 12; - blacklistedIds = ""; - cacheLimit = 1000; - cacheMessagesFromServers = false; - hideMessageFromMessageLoggers = false; - hideMessageFromMessageLoggersDeletedMessage = "redacted eh"; - ignoreBots = false; - ignoreMutedCategories = false; - ignoreMutedChannels = false; - ignoreMutedGuilds = true; - ignoreSelf = false; - imageCacheDir = "${config.xdg.configHome}/equibop/MessageLoggerData/savedImages"; - logsDir = "${config.xdg.configHome}/equibop/MessageLoggerData"; - messageLimit = 200; - messagesToDisplayAtOnceInLogs = 100; - permanentlyRemoveLogByDefault = false; - saveImages = true; - saveMessages = true; - sortNewest = true; - whitelistedIds = ""; - } - "MessagePopoverAPI" - "MessageUpdaterAPI" - "ModalFade" - "MoreCommands" - "MoreKaomoji" - { - name = "Moyai"; - ignoreBlocked = true; - ignoreBots = true; - quality = "Normal"; - triggerWhenUnfocused = true; - volume = 0.5; - } - "MutualGroupDMs" - "NSFWGateBypass" - "NeverPausePreviews" - "NewPluginsManager" - "NoAppsAllowed" - "NoDevtoolsWarning" - "NoF1" - "NoMirroredCamera" - "NoModalAnimation" - "NoNitroUpsell" - "NoOnboardingDelay" - { - name = "NoTrack"; - disableAnalytics = true; - } - "NoUnblockToJump" - "NormalizeMessageLinks" - "NotificationTitle" - { - name = "NotificationVolume"; - notificationVolume = 100; - } - "PauseInvitesForever" - { - name = "PermissionFreeWill"; - lockout = true; - onboarding = true; - } - { - name = "PermissionsViewer"; - permissionsSortOrder = 0; - } - { - name = "PictureInPicture"; - loop = true; - } - "PinIcon" - { - name = "PlatformIndicators"; - ConsoleIcon = "equicord"; - badges = true; - colorMobileIndicator = true; - list = true; - messages = true; - showBots = true; - } - { - name = "PlatformSpoofer"; - platform = "desktop"; - } - "PreviewMessage" - "PurgeMessages" - "QuestFocused" - "" - "QuickMention" - { - name = "Quoter"; - userIdentifier = 0; - } - "ReactErrorDecoder" - "ReadAllNotificationsButton" - { - name = "RelationshipNotifier"; - friendRequestCancels = true; - friends = true; - groups = true; - notices = true; - offlineRemovals = true; - servers = true; - } - "RepeatMessage" - "ReplyTimestamp" - "RevealAllSpoilers" - "ReverseImageSearch" - { - name = "ReviewDB"; - hideBlockedUsers = true; - hideTimestamps = false; - notifyReviews = true; - showWarning = true; - } - { - name = "RoleColorEverywhere"; - chatMentions = true; - colorChatMessages = false; - memberList = true; - messageSaturation = 30; - pollResults = true; - reactorsList = true; - voiceUsers = true; - } - "ScreenRecorder" - "SearchFix" - { - name = "SecretRingToneEnabler"; - onlySnow = false; - } - { - name = "SendTimestamps"; - replaceMessageContents = true; - } - { - name = "ServerInfo"; - sorting = "displayname"; - } - "ServerListAPI" - { - name = "ServerListIndicators"; - mode = 2; - useCompact = true; - } - "ServerSearch" - { - name = "Settings"; - settingsLocation = "bottom"; - } - { - name = "ShikiCodeblocks"; - theme = "https://esm.sh/@catppuccin/vscode/themes/${config.theme.flavor}.json"; - useDevIcon = "GREYSCALE"; - } - { - name = "ShowBadgesInChat"; - DiscordNitroPosition = 0; - DiscordProfilePosition = 1; - EquicordContributorPosition = 3; - EquicordDonorPosition = 2; - VencordContributorPosition = 5; - VencordDonorPosition = 4; - showDiscordNitro = true; - showDiscordProfile = true; - showEquicordContributor = false; - showEquicordDonor = false; - showVencordContributor = false; - showVencordDonor = false; - } - { - name = "ShowConnections"; - iconSize = 32; - iconSpacing = 1; - } - { - name = "ShowHiddenChannels"; - channelStyle = 0; - defaultAllowedUsersAndRolesDropdownState = true; - showMode = 0; - } - { - name = "ShowHiddenThings"; - showInvitesPaused = true; - showModView = true; - showTimeouts = true; - } - { - name = "ShowMeYourName"; - displayNames = false; - inReplies = true; - mode = "nick-user"; - preferFriend = true; - } - { - name = "ShowTimeoutDuration"; - displayStyle = "ssalggnikool"; - } - "SidebarChat" - { - name = "SilentTyping"; - blockAllIsTyping = false; - blockAllTypingIndicators = false; - blockEverything = false; - contextMenu = true; - isEnabled = true; - showIcon = false; - } - { - name = "SortFriendRequests"; - showDates = true; - } - { - name = "SoundBoardLogger"; - FileType = ".ogg"; - IconLocation = "toolbar"; - soundVolume = 0.5; - } - "SplitLargeMessages" - { - name = "SpotifyControls"; - hoverControls = false; - previousButtonRestartsTrack = true; - useSpotifyUris = false; - } - { - name = "SpotifyCrack"; - keepSpotifyActivityOnIdle = false; - noSpotifyAutoPause = true; - } - "SpotifyLyrics" - "SpotifyShareCommands" - "StartupTimings" - "StatusPresets" - "StickerPaste" - "StreamerModeOn" - { - name = "SuperReactionTweaks"; - superReactByDefault = true; - superReactionPlayingLimit = 20; - unlimitedSuperReactionPlaying = false; - } - "SupportHelper" - "ThemeAttributes" - { - name = "Timezones"; - "24h Time" = true; - showMessageHeaderTime = true; - showProfileTime = true; - } - { - name = "Translate+"; - shavian = true; - sitelen = true; - target = "ru"; - toki = true; - } - { - name = "TypingIndicator"; - includeBlockedUsers = false; - includeCurrentChannel = true; - includeMutedChannels = false; - indicatorMode = 3; - } - { - name = "TypingTweaks"; - alternativeFormatting = true; - showAvatars = true; - showRoleColors = true; - } - { - name = "USRBG"; - nitroFirst = true; - voiceBackground = true; - } - "Unindent" - { - name = "UnlimitedAccounts"; - maxAccounts = 0; - } - { - name = "UnlockedAvatarZoom"; - zoomMultiplier = 4; - } - { - name = "UserMessagesPronouns"; - pronounsFormat = "LOWERCASE"; - showSelf = true; - } - { - name = "UserPFP"; - databaseToUse = "https://userpfp.github.io/UserPFP/source/data.json"; - preferNitro = true; - } - "UserSettingsAPI" - { - name = "UserVoiceShow"; - showInMemberList = true; - showInMessages = true; - showInUserProfileModal = true; - } - "ValidReply" - "ValidUser" - "VCPanelSettings" - "VCSupport" - { - name = "VideoSpeed"; - preservePitch = false; - } - { - name = "ViewIcons"; - format = "webp"; - imgSize = "1024"; - } - { - name = "ViewRaw"; - clickMethod = "Left"; - } - "ViewRawVariant" - "VoiceChatDoubleClick" - { - name = "VoiceChatUtilities"; - waitAfter = 5; - waitSeconds = 2; - } - "VoiceDownload" - { - name = "VoiceMessages"; - echoCancellation = true; - noiseSuppression = true; - } - { - name = "VolumeBooster"; - multiplier = 5; - } - { - name = "WebContextMenus"; - addBack = true; - } - "WebKeybinds" - "WebScreenShareFixes" - "WebpackTarball" - { - name = "WhoReacted"; - avatarClick = false; - } - { - name = "WhosWatching"; - showPanel = true; - } - "WriteUpperCase" - "YoutubeAdblock" - "YoutubeDescription" - "petpet" - ]; - - themes = [ - "https://catppuccin.github.io/discord/dist/catppuccin-${config.theme.flavor}-${config.theme.accent}.theme.css" - "https://raw.githubusercontent.com/NikSneMC/discord-css/main/jetbrainsmono-nerd-font.css" - "https://raw.githubusercontent.com/NikSneMC/discord-css/main/make-discord-ui-great-again.css" - ]; -in { - xdg.configFile = let - inherit (builtins) toJSON; - in { - "equibop/settings/settings.json".text = toJSON { - autoUpdate = false; - autoUpdateNotification = false; - disableMinSize = true; - eagerPatches = false; - enableReactDevtools = true; - enabledThemeLinks = themes; - enabledThemes = []; - frameless = false; - ignoreResetWarning = false; - notifications = { - logLimit = 50; - position = "bottom-right"; - timeout = 5000; - useNative = "not-focused"; - }; - plugins = lib'.discord.mkEnabledPluginsFromList plugins; - themeLinks = themes; - transparent = true; - updateRelaunch = false; - useQuickCss = true; - userCssVars = {}; - winCtrlQ = false; - winNativeTitleBar = false; - }; - "equibop/settings.json".text = toJSON { - discordBranch = "stable"; - tray = true; - minimizeToTray = true; - arRPC = true; - trayColor = config.theme.colors.accent; - trayMainOverride = false; - splashColor = "#${config.theme.colors.text}"; - splashBackground = "#${config.theme.colors.base}"; - trayColorType = "custom"; - trayAutoFill = "auto"; - disableMinSize = true; - splashAnimationPath = "${config.home.homeDirectory}/.face"; - }; - }; - - home.packages = with pkgs; [ - equibop - (master.discord.override { - withEquicord = true; - }) - ]; -} diff --git a/home/programs/social/thunderbird.nix b/home/programs/social/thunderbird.nix deleted file mode 100644 index bfa1c778..00000000 --- a/home/programs/social/thunderbird.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - programs.thunderbird = { - enable = true; - profiles.main = { - isDefault = true; - }; - }; - - catppuccin.thunderbird.profile = "main"; -} diff --git a/home/programs/thunar.nix b/home/programs/thunar.nix deleted file mode 100644 index 472a3076..00000000 --- a/home/programs/thunar.nix +++ /dev/null @@ -1,11 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs.xfce; [ - (thunar.override { - thunarPlugins = [ - thunar-archive-plugin - thunar-volman - thunar-media-tags-plugin - ]; - }) - ]; -} diff --git a/home/programs/wayland/default.nix b/home/programs/wayland/default.nix deleted file mode 100755 index 3840aff0..00000000 --- a/home/programs/wayland/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./hyprlock.nix - ./rofi.nix - ./wlogout.nix - ]; - - home.packages = with pkgs; [ - # screenshot - grim - slurp - - # utils - cliphist - wl-clipboard - wl-clip-persist - wtype - wl-screenrec - wlr-randr - nwg-displays - ]; - - # make stuff work on wayland - home.sessionVariables = { - GDK_BACKEND = "wayland"; - QT_QPA_PLATFORM = "wayland;xcb"; - SDL_VIDEODRIVER = "wayland"; - CLUTTER_BACKEND = "wayland"; - XDG_SESSION_TYPE = "wayland"; - QT_AUTO_SCREEN_SCALE_FACTOR = "1"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; - QT_QPA_PLATFORMTHEME = "kvantum"; - }; -} diff --git a/home/programs/wayland/hyprlock.nix b/home/programs/wayland/hyprlock.nix deleted file mode 100755 index 4c52337f..00000000 --- a/home/programs/wayland/hyprlock.nix +++ /dev/null @@ -1,124 +0,0 @@ -{config, ...}: let - font_family = "JetBrainsMono Nerd Font Propo"; -in { - programs.hyprlock = { - enable = true; - - settings = { - general = { - disable_loading_bar = true; - hide_cursor = true; - }; - - background = [ - { - monitor = ""; - path = config.theme.wallpaper; - blur_passes = 0; - color = "$base"; - } - ]; - - label = [ - { - monitor = ""; - text = "cmd[update:5000] fish -c fetch_battery"; - color = "$accent"; - font_size = 25; - inherit font_family; - position = "30, 30"; - halign = "left"; - valign = "bottom"; - } - { - monitor = ""; - text = "$TIME"; - color = "$text"; - font_size = 90; - inherit font_family; - position = "-30, 0"; - halign = "right"; - valign = "top"; - } - { - monitor = ""; - text = "cmd[update:43200000] date +\"%A, %d %B %Y\""; - color = "$text"; - font_size = 25; - inherit font_family; - position = "-30, -150"; - halign = "right"; - valign = "top"; - } - { - monitor = ""; - text = "$FPRINTPROMPT"; - color = "$text"; - font_size = 14; - inherit font_family; - position = "0, -107"; - halign = "center"; - valign = "center"; - } - { - monitor = ""; - text = "cmd[update:1000] fish -c fetch_music_player_data"; - color = "$text"; - font_size = 18; - inherit font_family; - position = "0, 40"; - halign = "center"; - valign = "bottom"; - } - { - monitor = ""; - text = "$LAYOUT[ENG,RUS]"; - text_align = "center"; - color = "$text"; - font_size = 18; - inherit font_family; - position = "30, -30"; - halign = "left"; - valign = "top"; - } - ]; - - image = [ - { - monitor = ""; - path = "${config.home.homeDirectory}/.face"; - size = 100; - border_color = "$accent"; - - position = "0, 75"; - halign = "center"; - valign = "center"; - } - ]; - - input-field = [ - { - monitor = ""; - size = "300, 60"; - outline_thickness = 4; - dots_size = 0.2; - dots_spacing = 0.2; - dots_center = true; - outer_color = "$accent"; - inner_color = "$surface0"; - font_color = "$text"; - fade_on_empty = false; - placeholder_text = "󰌾 Logged in as $USER"; - check_color = "$accent"; - fail_color = "$red"; - fail_text = "$FAIL ($ATTEMPTS)"; - capslock_color = "$yellow"; - position = "0, -50"; - halign = "center"; - valign = "center"; - } - ]; - }; - }; - catppuccin.hyprlock.useDefaultConfig = false; -} diff --git a/home/programs/wayland/niri/binds.nix b/home/programs/wayland/niri/binds.nix deleted file mode 100644 index 890bf148..00000000 --- a/home/programs/wayland/niri/binds.nix +++ /dev/null @@ -1,605 +0,0 @@ -{ - config, - inputs, - lib, - lib', - pkgs, - ... -}: { - programs.niri.settings.binds = with config.lib.niri.actions; let - inherit (lib'.niri) mkBinds mkWorkspacesBinds mkColumnsBinds; - - fish = spawn "fish" "-c"; - rofi = menu: fish "pkill -9 bin/rofi || rofi -show ${menu}"; - packages = builtins.mapAttrs (_: lib.getExe) { - activate-niksos = inputs.activate-niksos.packages.${pkgs.stdenv.hostPlatform.system}.default; - inherit (pkgs) ani-cli brightnessctl; - }; - in - mkBinds ( - (mkWorkspacesBinds config) - ++ (mkColumnsBinds 10) - ++ [ - { - bind = "Mod+Ctrl+K"; - desc = "Enter the `kill mode`"; - action = fish "pkill -9 -P $(niri msg -j pick-window | jaq .pid)"; - } - { - bind = "Mod+Ctrl+Alt+Shift+E"; - desc = "Exit niri"; - action = quit; - } - { - bind = "Mod+Shift+Q"; - desc = "Close the focused window"; - action = close-window; - } - ] - ++ [ - { - bind = "Mod+M"; - desc = "Toggle the maximized state of the focused column"; - action = maximize-column; - } - { - bind = "Mod+U"; - desc = "Switch between preset column widths backwards"; - action = switch-preset-column-width-back; - } - { - bind = "Mod+P"; - desc = "Switch between preset column widths"; - action = switch-preset-column-width; - } - ] - ++ [ - { - bind = "F11"; - desc = "Toggle fullscreen on the focused window"; - action = fullscreen-window; - } - { - bind = "Mod+F"; - desc = "Move the focused window between the floating and the tiling layout"; - action = toggle-window-floating; - } - { - bind = "Mod+Ctrl+F"; - desc = "Toggles the focus between the floating and the tiling layout"; - action = switch-focus-between-floating-and-tiling; - } - ] - ++ [ - { - bind = "Mod+Ctrl+Alt+B"; - desc = "Reload bar"; - action = fish "reload_bar"; - } - { - bind = "Mod+Ctrl+Alt+N"; - desc = "Reload notifications"; - action = fish "reload_notifications"; - } - ] - ++ [ - { - bind = "Mod+A"; - desc = "Launch app menu"; - action = rofi "drun"; - } - { - bind = "Mod+B"; - desc = "Launch browser"; - action = spawn "zen"; - } - { - bind = "Mod+D"; - desc = "Launch Discord"; - action = spawn "equibop"; - } - { - bind = "Mod+E"; - desc = "Launch file manager"; - action = spawn "thunar"; - } - { - bind = "Mod+N"; - desc = "Open notification center"; - action = spawn "swaync-client" "-t"; - } - { - bind = "Mod+R"; - desc = "Execute command"; - action = rofi "run"; - } - { - bind = "Mod+T"; - desc = "Launch terminal"; - action = spawn "wezterm"; - } - { - bind = "Mod+V"; - desc = "Open clipboard history"; - action = fish "clipboard_log"; - } - { - bind = "Mod+X"; - desc = "Delete an item from the clipboard history"; - action = fish "clipboard_delete_item"; - } - { - bind = "Mod+Tab"; - desc = "Toggle overview"; - action = toggle-overview; - } - { - bind = "Mod+Escape"; - desc = "Open logout menu"; - action = spawn "wlogout"; - } - { - bind = "Mod+Semicolon"; - desc = "Open emoju menu"; - action = fish "clipboard_emoji"; - } - ] - ++ [ - { - bind = "Mod+Shift+A"; - desc = "Open 2fa menu"; - action = rofi "2fa"; - } - { - bind = "Mod+Shift+C"; - desc = "Launch color picker"; - action = fish "select_color"; - } - { - bind = "Mod+Shift+F"; - desc = "Open file browser menu"; - action = rofi "filebrowser"; - } - { - bind = "Mod+Shift+G"; - desc = "Lock session"; - action = spawn "hyprlock"; - } - { - bind = "Mod+Shift+M"; - desc = "Launch mail client"; - action = spawn "thunderbird"; - } - { - bind = "Mod+Shift+N"; - desc = "Mute notifications"; - action = spawn "swaync-client" "-d"; - } - { - bind = "Mod+Shift+T"; - desc = "Launch Telegram"; - action = spawn "AyuGram"; - } - { - bind = "Mod+Shift+W"; - desc = "Launch ani-cli"; - action = spawn "${packages.ani-cli}"; - } - { - bind = "Mod+Shift+X"; - desc = "Clear clipboard"; - action = fish "clipboard_clear"; - } - ] - ++ [ - { - bind = "Mod+Shift+S"; - desc = "Take screenshot"; - action = fish "take_screenshot"; - } - { - bind = "Mod+Shift+Ctrl+S"; - desc = "Take screenshot (window)"; - action = fish "take_screenshot_window"; - } - { - bind = "Mod+Shift+Alt+S"; - desc = "Take screenshot (screen)"; - action = fish "take_screenshot_screen"; - } - ] - ++ ( - let - toggle_scratchpad = selector: command: fish "niri msg action close-window --id $(niri msg -j windows | jaq -c '.[] | select(${selector}) | .id') || ${command}"; - in [ - { - bind = "Mod+Ctrl+A"; - desc = "Toggle anti RKN software"; - action = toggle_scratchpad ".title == \"AmneziaVPN\"" "AmneziaVPN"; - } - - { - bind = "Mod+Ctrl+E"; - desc = "Toggle easter egg"; - action = fish "pkill -9 activate-niksos || ${packages.activate-niksos}"; - } - { - bind = "Mod+Ctrl+N"; - desc = "Toggle night mode"; - action = fish "toggle_night_mode"; - } - { - bind = "Mod+Ctrl+P"; - desc = "Toggle airplane mode"; - action = fish "toggle_airplane_mode"; - } - { - bind = "Mod+Ctrl+V"; - desc = "Toggle volume menu"; - action = toggle_scratchpad ".app_id == \"org.pulseaudio.pavucontrol\"" "pavucontrol"; - } - { - bind = "Mod+Ctrl+W"; - desc = "Toggle wi-fi"; - action = fish "toggle_wifi"; - } - ] - ) - ++ [ - { - bind = "Mod+K"; - desc = "Focus the window above"; - action = focus-window-up; - } - { - bind = "Mod+J"; - desc = "Focus the window below"; - action = focus-window-down; - } - { - bind = "Mod+H"; - desc = "Focus the column to the left"; - action = focus-column-left; - } - { - bind = "Mod+L"; - desc = "Focus the column to the right"; - action = focus-column-right; - } - { - bind = "Mod+Shift+K"; - desc = "Move the focused window up in a column"; - action = move-window-up; - } - { - bind = "Mod+Shift+J"; - desc = "Move the focused window down in a column"; - action = move-window-down; - } - { - bind = "Mod+Shift+H"; - desc = "Move the focused column to the left"; - action = move-column-left; - } - { - bind = "Mod+Shift+L"; - desc = "Move the focused column to the right"; - action = move-column-right; - } - ] - ++ [ - { - bind = "Mod+Alt+T"; - desc = "Toggle the focused column between normal and tabbed display"; - action = toggle-column-tabbed-display; - } - { - bind = "Mod+Slash"; - desc = "Consume or expel the focused window left"; - action = consume-or-expel-window-left; - } - { - bind = "Mod+At"; - desc = "Consume or expel the focused window right"; - action = consume-or-expel-window-right; - } - ] - ++ [ - { - bind = "Mod+Home"; - desc = "Focus the first column"; - action = focus-column-first; - } - { - bind = "Mod+End"; - desc = "Focus the last column"; - action = focus-column-last; - } - { - bind = "Mod+Shift+Home"; - desc = "Move the focused column to the start of the workspace"; - action = move-column-to-first; - } - { - bind = "Mod+Shift+End"; - desc = "Move the focused column to the end of the workspace"; - action = move-column-to-last; - } - ] - ++ [ - { - bind = "Mod+Exclam"; - desc = "Decrease the width of the focused window"; - action = set-window-width "-5%"; - repeat = true; - } - { - bind = "Mod+Numbersign"; - desc = "Increase the width of the focused window"; - action = set-window-width "+5%"; - repeat = true; - } - { - bind = "Mod+Shift+Exclam"; - desc = "Decrease the height of the focused window"; - action = set-window-height "-5%"; - repeat = true; - } - { - bind = "Mod+Shift+Numbersign"; - desc = "Increase the height of the focused window"; - action = set-window-height "+5%"; - repeat = true; - } - ] - ++ [ - { - bind = "Mod+WheelScrollDown"; - desc = "Focus the workspace below"; - action = focus-workspace-down; - cooldown-ms = 150; - } - { - bind = "Mod+WheelScrollUp"; - desc = "Focus the workspace above"; - action = focus-workspace-up; - cooldown-ms = 150; - } - { - bind = "Mod+Shift+WheelScrollDown"; - desc = "Move the focused workspace down"; - action = move-workspace-down; - cooldown-ms = 150; - } - { - bind = "Mod+Shift+WheelScrollUp"; - desc = "Move the focused workspace up"; - action = move-workspace-up; - cooldown-ms = 150; - } - ] - ++ [ - { - bind = "Mod+Ctrl+WheelScrollDown"; - desc = "Focus the column to the left"; - action = focus-column-left; - cooldown-ms = 150; - } - { - bind = "Mod+Ctrl+WheelScrollUp"; - desc = "Focus the column to the right"; - action = focus-column-right; - cooldown-ms = 150; - } - { - bind = "Mod+Ctrl+Shift+WheelScrollDown"; - desc = "Move the focused column to the left"; - action = move-column-left; - cooldown-ms = 150; - } - { - bind = "Mod+Ctrl+Shift+WheelScrollUp"; - desc = "Move the focused column to the right"; - action = move-column-right; - cooldown-ms = 150; - } - ] - ++ [ - { - bind = "Mod+Page_Down"; - desc = "Focus the workspace below"; - action = focus-workspace-down; - } - { - bind = "Mod+Page_Up"; - desc = "Focus the workspace above"; - action = focus-workspace-up; - } - { - bind = "Mod+Shift+Page_Down"; - desc = "Move the focused workspace down"; - action = move-workspace-down; - } - { - bind = "Mod+Shift+Page_Up"; - desc = "Move the focused workspace up"; - action = move-workspace-up; - } - ] - ++ [ - { - bind = "Mod+Alt+K"; - desc = "Focus the monitor above"; - action = focus-monitor-up; - } - { - bind = "Mod+Alt+J"; - desc = "Focus the monitor below"; - action = focus-monitor-down; - } - { - bind = "Mod+Alt+H"; - desc = "Focus the monitor to the left"; - action = focus-monitor-left; - } - { - bind = "Mod+Alt+L"; - desc = "Focus the monitor to the right"; - action = focus-monitor-right; - } - ] - ++ [ - { - bind = "Mod+Alt+Shift+K"; - desc = "Move the focused window to the monitor above"; - action = move-window-to-monitor-up; - } - { - bind = "Mod+Alt+Shift+J"; - desc = "Move the focused window to the monitor below"; - action = move-window-to-monitor-down; - } - { - bind = "Mod+Alt+Shift+H"; - desc = "Move the focused window to the monitor to the left"; - action = move-window-to-monitor-left; - } - { - bind = "Mod+Alt+Shift+L"; - desc = "Move the focused window to the monitor to the right"; - action = move-window-to-monitor-right; - } - ] - ++ [ - { - bind = "Mod+Alt+Ctrl+K"; - desc = "Move the focused column to the monitor above"; - action = move-column-to-monitor-up; - } - { - bind = "Mod+Alt+Ctrl+J"; - desc = "Move the focused column to the monitor below"; - action = move-column-to-monitor-down; - } - { - bind = "Mod+Alt+Ctrl+H"; - desc = "Move the focused column to the monitor to the left"; - action = move-column-to-monitor-left; - } - { - bind = "Mod+Alt+Ctrl+L"; - desc = "Move the focused column to the monitor to the right"; - action = move-column-to-monitor-right; - } - ] - ++ [ - { - bind = "Mod+Alt+Ctrl+Shift+K"; - desc = "Move the focused workspace to the monitor above"; - action = move-workspace-to-monitor-up; - } - { - bind = "Mod+Alt+Ctrl+Shift+J"; - desc = "Move the focused workspace to the monitor below"; - action = move-workspace-to-monitor-down; - } - { - bind = "Mod+Alt+Ctrl+Shift+H"; - desc = "Move the focused workspace to the monitor to the left"; - action = move-workspace-to-monitor-left; - } - { - bind = "Mod+Alt+Ctrl+Shift+L"; - desc = "Move the focused workspace to the monitor to the right"; - action = move-workspace-to-monitor-right; - } - ] - ++ [ - { - bind = "XF86MonBrightnessUp"; - desc = "Increase brightness by 10%"; - action = spawn packages.brightnessctl "--class=backlight" "set" "+10%"; - allow-when-locked = true; - repeat = true; - } - { - bind = "XF86MonBrightnessDown"; - desc = "Decrease brightness by 10%"; - action = spawn packages.brightnessctl "--class=backlight" "set" "10%-"; - allow-when-locked = true; - repeat = true; - } - ] - ++ [ - { - bind = "XF86AudioRaiseVolume"; - desc = "Increase volume by 5%"; - action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05+"; - allow-when-locked = true; - repeat = true; - } - { - bind = "XF86AudioLowerVolume"; - desc = "Decrease volume by 5%"; - action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.05-"; - allow-when-locked = true; - repeat = true; - } - { - bind = "Ctrl+XF86AudioRaiseVolume"; - desc = "Increase volume by 1%"; - action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.01+"; - allow-when-locked = true; - repeat = true; - } - { - bind = "Ctrl+XF86AudioLowerVolume"; - desc = "Decrease volume by 1%"; - action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.01-"; - allow-when-locked = true; - repeat = true; - } - ] - ++ [ - { - bind = "XF86AudioMute"; - desc = "Mute audio"; - action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; - allow-when-locked = true; - } - { - bind = "XF86AudioMicMute"; - desc = "Mute microphone"; - action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; - allow-when-locked = true; - } - ] - ++ [ - { - bind = "XF86AudioPlay"; - desc = "Toggle media play/pause"; - action = spawn "playerctl" "play-pause"; - allow-when-locked = true; - } - { - bind = "XF86AudioPrev"; - desc = "Move to the previous track"; - action = spawn "playerctl" "previous"; - allow-when-locked = true; - } - { - bind = "XF86AudioNext"; - desc = "Move to the next track"; - action = spawn "playerctl" "next"; - allow-when-locked = true; - } - ] - ++ [ - { - bind = "Mod+Ctrl+D"; - desc = "Power off all monitors via DPMS"; - action = power-off-monitors; - } - ] - ); -} diff --git a/home/programs/wayland/niri/default.nix b/home/programs/wayland/niri/default.nix deleted file mode 100644 index 1e49c935..00000000 --- a/home/programs/wayland/niri/default.nix +++ /dev/null @@ -1,63 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: { - imports = [ - ./binds.nix - ./input.nix - ./layout.nix - ./rules.nix - ]; - - programs.niri.settings = { - environment = { - _JAVA_AWT_WM_NONREPARENTING = "1"; - }; - - spawn-at-startup = let - inherit (lib) getExe; - in - [ - ["${getExe pkgs.wl-gammarelay-rs}" "run"] - ["waybar"] - ["fish" "-c" "wl-paste --type text --watch cliphist store"] - ["fish" "-c" "wl-paste --type image --watch cliphist store"] - ["equibop"] - ["AyuGram"] - ["thunderbird"] - ] - |> map (command: {inherit command;}); - - workspaces = { - "1".name = "development"; - "2".name = "misc"; - "3".name = "education"; - "4".name = "social"; - "5".name = "gaming"; - "6".name = "recording/streaming"; - }; - - screenshot-path = "~/Pictures/Screenshots/screenshot-%d-%m-%Y_%H_%M_%S.png"; - prefer-no-csd = true; - - hotkey-overlay = { - hide-not-bound = true; - skip-at-startup = true; - }; - - overview = { - backdrop-color = config.theme.colors.base; - workspace-shadow.enable = false; - }; - - gestures.hot-corners.enable = false; - - xwayland-satellite = { - enable = true; - path = lib.getExe inputs.niri-flake.packages.${pkgs.stdenv.hostPlatform.system}.xwayland-satellite-unstable; - }; - }; -} diff --git a/home/programs/wayland/niri/input.nix b/home/programs/wayland/niri/input.nix deleted file mode 100644 index f9c60fd4..00000000 --- a/home/programs/wayland/niri/input.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - programs.niri.settings.input = { - focus-follows-mouse.enable = false; - - keyboard = { - numlock = true; - track-layout = "window"; - }; - - mod-key = "Super"; - mod-key-nested = "Alt"; - - warp-mouse-to-focus = { - enable = true; - mode = "center-xy"; - }; - }; -} diff --git a/home/programs/wayland/niri/layout.nix b/home/programs/wayland/niri/layout.nix deleted file mode 100644 index e35d49cd..00000000 --- a/home/programs/wayland/niri/layout.nix +++ /dev/null @@ -1,55 +0,0 @@ -{config, ...}: let - inherit (config.theme) colors; - - proportion = proportion: {inherit proportion;}; -in { - programs.niri.settings.layout = { - border = { - enable = true; - width = 4; - active.color = "#${colors.accent}"; - inactive.color = "#${colors.surface1}"; - urgent.color = "#${colors.peach}"; - }; - - focus-ring.enable = false; - - shadow = { - enable = false; - color = "#${colors.accent}"; - inactive-color = "#${colors.base}"; - }; - - insert-hint = { - enable = true; - display.color = "#${colors.accent}99"; - }; - - background-color = "transparent"; - - default-column-width = proportion 1.; - preset-column-widths = - [ - (1. / 3) - (1. / 2) - (2. / 3) - 1. - ] - |> map proportion; - preset-window-heights = []; - - always-center-single-column = true; - - tab-indicator = { - enable = true; - gap = 3; - gaps-between-tabs = 3; - width = 3; - active.color = "#${colors.accent}"; - inactive.color = "#${colors.surface1}"; - urgent.color = "#${colors.peach}"; - }; - - gaps = 10; - }; -} diff --git a/home/programs/wayland/niri/rules.nix b/home/programs/wayland/niri/rules.nix deleted file mode 100644 index b8b9fc02..00000000 --- a/home/programs/wayland/niri/rules.nix +++ /dev/null @@ -1,92 +0,0 @@ -{ - programs.niri.settings = { - window-rules = [ - { - geometry-corner-radius = let - radius = 10.0; - in { - bottom-left = radius; - bottom-right = radius; - top-left = radius; - top-right = radius; - }; - clip-to-geometry = true; - open-maximized = true; - } - { - matches = [ - {is-focused = true;} - ]; - opacity = 0.99; - } - { - matches = [ - {is-focused = false;} - ]; - opacity = 0.95; - } - { - matches = [ - {app-id = "dev.zed.*";} - {app-id = "jetbrains-.*";} - ]; - open-on-workspace = "development"; - } - { - matches = [ - {app-id = "zen";} - {app-id = "spotify";} - ]; - open-on-workspace = "misc"; - } - { - matches = [ - {app-id = "equibop";} - {app-id = "vesktop";} - {app-id = "discord";} - {app-id = "com.ayugram";} - {app-id = "thunderbird";} - ]; - open-on-workspace = "social"; - } - { - matches = [ - {app-id = "org.prismlauncher.PrismLauncher";} - {app-id = "com.mojang.*";} - {app-id = "Minecraft.*";} - {app-id = "steam.*";} - {app-id = "factorio";} - {app-id = "mono";} - {app-id = "Terraria.bin.x86_64";} - ]; - open-on-workspace = "gaming"; - } - { - matches = [ - {app-id = "com.obsproject.Studio";} - ]; - open-on-workspace = "recording/streaming"; - } - { - matches = [ - {title = "AmneziaVPN";} - {app-id = "org.pulseaudio.pavucontrol";} - {app-id = ".blueman-manager-wrapped";} - { - app-id = "com.ayugram.desktop"; - title = "Mini App: .*"; - } - ]; - open-floating = true; - } - ]; - layer-rules = [ - { - matches = [ - {namespace = "hyprpaper";} - ]; - place-within-backdrop = true; - } - ]; - }; -} diff --git a/home/programs/wayland/rofi.nix b/home/programs/wayland/rofi.nix deleted file mode 100755 index 0d87de63..00000000 --- a/home/programs/wayland/rofi.nix +++ /dev/null @@ -1,239 +0,0 @@ -{ - config, - lib, - lib', - pkgs, - ... -}: let - inherit (config.lib.formats.rasi) mkLiteral; - script-2fa = - pkgs.writeScript "rofi-script-2fa" - # py - '' - #!/usr/bin/env python - from sys import argv - from json import load - from subprocess import check_output - - - if len(argv) not in {1, 2}: - raise Exception - - def parse_account(entry: dict) -> tuple[str, str]: - return f"{entry['name']}@{entry['issuer']}".lower(), entry["info"]["secret"] - - with open(file="${config.home.homeDirectory}/.2fa.json", mode="r", encoding="utf-8") as f: - accounts: dict[str, str] = dict(map(parse_account, load(f)["db"]["entries"])) - - if len(argv) == 1: - for account in accounts.keys(): - print(account) - else: - if argv[1] in accounts.keys(): - check_output(["notify-send", f"Copied token for {argv[1]}!"]) - check_output(["wl-copy", check_output(["${lib.getExe pkgs.oath-toolkit}", "--totp", "-b", accounts[argv[1]]])]) - else: - check_output(["notify-send", f"No 2FA secret found for {argv[1]}"]) - - ''; - script-clipboard = - pkgs.writeScript "rofi-script-clipboard.sh" - # sh - '' - #!/usr/bin/env bash - - tmp_dir="/tmp/cliphist" - rm -rf "$tmp_dir" - - if [[ -n "$1" ]]; then - cliphist decode <<<"$1" | wl-copy - exit - fi - - mkdir -p "$tmp_dir" - - read -r -d "" prog <$tmp_dir/"grp[1]"."grp[3]) - print \$0"\0icon\x1f$tmp_dir/"grp[1]"."grp[3] - next - } - 1 - EOF - cliphist list | gawk "$prog" - ''; - common-config = { - icon-theme = "Numix-Circle"; - show-icons = true; - drun-display-format = "{icon} {name}"; - disable-history = false; - hide-scrollbar = true; - sidebar-mode = true; - }; - rofi-theme = { - "*" = with config.theme.colors; { - bg-col = mkLiteral "#${base}"; - bg-col-light = mkLiteral "#${base}"; - border-col = mkLiteral "#${accent}"; - selected-col = mkLiteral "#${base}"; - accent = mkLiteral "#${accent}"; - fg-col = mkLiteral "#${text}"; - fg-col2 = mkLiteral "#${red}"; - grey = mkLiteral "#${overlay0}"; - - width = 600; - font = "JetBrainsMono Nerd Font Propo 10"; - }; - - "element-text, element-icon, mode-switcher" = { - background-color = mkLiteral "inherit"; - text-color = mkLiteral "inherit"; - }; - - window = { - height = mkLiteral "100%"; - width = mkLiteral "20%"; - margin = mkLiteral "10px"; - border = mkLiteral "3px"; - border-radius = mkLiteral "10px"; - border-color = mkLiteral "@border-col"; - background-color = mkLiteral "@bg-col"; - }; - - mainbox = { - background-color = mkLiteral "@bg-col"; - }; - - inputbar = { - children = mkLiteral "[prompt, entry]"; - background-color = mkLiteral "@bg-col"; - border-radius = mkLiteral "5px"; - padding = mkLiteral "2px"; - }; - - prompt = { - background-color = mkLiteral "@accent"; - padding = mkLiteral "6px"; - text-color = mkLiteral "@bg-col"; - border-radius = mkLiteral "3px"; - margin = mkLiteral "20px 0 0 20px"; - }; - - textbox-prompt-colon = { - expand = false; - str = " ="; - }; - - entry = { - padding = mkLiteral "6px"; - margin = mkLiteral "20px 0 0 10px"; - text-color = mkLiteral "@fg-col"; - background-color = mkLiteral "@bg-col"; - }; - - listview = { - border = mkLiteral "0"; - padding = mkLiteral "6px 0 0"; - margin = mkLiteral "10px 0 0 20px"; - columns = 1; - lines = 5; - background-color = mkLiteral "@bg-col"; - }; - - element = { - padding = mkLiteral "5px"; - background-color = mkLiteral "@bg-col"; - text-color = mkLiteral "@fg-col"; - }; - - element-icon = { - size = mkLiteral "25px"; - }; - - "element selected" = { - background-color = mkLiteral "@selected-col"; - text-color = mkLiteral "@fg-col2"; - }; - - mode-switcher = { - spacing = 0; - }; - - button = { - padding = mkLiteral "10px"; - background-color = mkLiteral "@bg-col-light"; - text-color = mkLiteral "@grey"; - vertical-align = mkLiteral "0.5"; - horizontal-align = mkLiteral "0.5"; - }; - - "button selected" = { - background-color = mkLiteral "@bg-col"; - text-color = mkLiteral "@accent"; - }; - - message = { - background-color = mkLiteral "@bg-col-light"; - margin = mkLiteral "2px"; - padding = mkLiteral "2px"; - border-radius = mkLiteral "5px"; - }; - - textbox = { - padding = mkLiteral "6px"; - margin = mkLiteral "20px 0 0 20px"; - text-color = mkLiteral "@accent"; - background-color = mkLiteral "@bg-col-light"; - }; - }; -in { - programs.rofi = { - enable = true; - package = pkgs.rofi; - location = "right"; - terminal = "wezterm"; - extraConfig = - common-config - // { - modes = "run,drun,filebrowser,2fa:${script-2fa}"; - display-run = "  "; - display-drun = " 󰵆 "; - display-filebrowser = " 󰥨 "; - display-2fa = " 󰦯 "; - "// bad way to do this" = - config.lib.formats.rasi.mkLiteral - # rasi - '' - - filebrowser { - directory: "~"; - sorting-method: "name"; - directories-first: true; - } - // I'll fix it later''; - }; - theme = rofi-theme; - }; - - xdg.configFile."rofimoji.rc".text = '' - action = copy - files = [emoji, arrows, block_elements, box_drawing, currency_symbols, gitmoji, hiragana, katakana, math, mathematical_operators] - skin-tone = neutral - max-recent = 0 - use-icons = true - ''; - - xdg.configFile."rofi/clipboard.rasi".text = lib'.toRasi { - configuration = - common-config - // { - location = 4; - terminal = "wezterm"; - modes = "log:${script-clipboard},emoji:${lib.getExe pkgs.rofimoji}"; - display-emoji = " 󰞅 "; - display-log = " 󱃔 "; - }; - "@theme" = "custom"; - }; -} diff --git a/home/programs/wayland/wlogout.nix b/home/programs/wayland/wlogout.nix deleted file mode 100755 index b3bc1f68..00000000 --- a/home/programs/wayland/wlogout.nix +++ /dev/null @@ -1,53 +0,0 @@ -{config, ...}: { - programs.wlogout = { - enable = true; - - layout = [ - { - label = "lock"; - action = "hyprlock"; - text = "Lock"; - keybind = "l"; - } - { - label = "hibernate"; - action = "hyprlock & sleep 1 && niri msg action power-off-monitors"; - text = "Lock & screen off"; - keybind = "d"; - } - { - label = "logout"; - action = "loginctl terminate-user $USER"; - text = "Logout"; - keybind = "e"; - } - { - label = "shutdown"; - action = "systemctl poweroff"; - text = "Shutdown"; - keybind = "s"; - } - { - label = "suspend"; - action = "fish -c suspend"; - text = "Suspend"; - keybind = "u"; - } - { - label = "reboot"; - action = "systemctl reboot"; - text = "Reboot"; - keybind = "r"; - } - ]; - }; - catppuccin.wlogout.extraStyle = - # css - '' - @define-color surface0 #${config.theme.colors.surface0}; - - button { - background-color: alpha(@surface0, 0.9); - } - ''; -} diff --git a/home/services/default.nix b/home/services/default.nix deleted file mode 100755 index c864af75..00000000 --- a/home/services/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = [ - ./media/playerctl.nix - ./system - ./wayland - ]; -} diff --git a/home/services/media/playerctl.nix b/home/services/media/playerctl.nix deleted file mode 100755 index 6175651d..00000000 --- a/home/services/media/playerctl.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - playerctl - ]; - - services.playerctld.enable = true; -} diff --git a/home/services/system/default.nix b/home/services/system/default.nix deleted file mode 100755 index 2d4b2b9c..00000000 --- a/home/services/system/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = [ - ./kdeconnect.nix - ./polkit-agent.nix - ./udiskie.nix - ]; -} diff --git a/home/services/system/kdeconnect.nix b/home/services/system/kdeconnect.nix deleted file mode 100755 index 544c162b..00000000 --- a/home/services/system/kdeconnect.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - services.kdeconnect = { - enable = true; - indicator = true; - }; -} diff --git a/home/services/system/polkit-agent.nix b/home/services/system/polkit-agent.nix deleted file mode 100755 index dd55fd16..00000000 --- a/home/services/system/polkit-agent.nix +++ /dev/null @@ -1,19 +0,0 @@ -{pkgs, ...}: { - systemd.user.services.polkit-gnome-authentication-agent-1 = { - Unit.Description = "polkit-gnome-authentication-agent-1"; - - Install = { - WantedBy = ["graphical-session.target"]; - Wants = ["graphical-session.target"]; - After = ["graphical-session.target"]; - }; - - Service = { - Type = "simple"; - ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; - }; -} diff --git a/home/services/system/udiskie.nix b/home/services/system/udiskie.nix deleted file mode 100755 index f3ea3b85..00000000 --- a/home/services/system/udiskie.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - services.udiskie.enable = true; -} diff --git a/home/services/wayland/default.nix b/home/services/wayland/default.nix deleted file mode 100755 index e21bfa60..00000000 --- a/home/services/wayland/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - imports = [ - ./waybar - ./hypridle.nix - ./hyprpaper.nix - ./swaync.nix - ]; -} diff --git a/home/services/wayland/hypridle.nix b/home/services/wayland/hypridle.nix deleted file mode 100755 index 386769a1..00000000 --- a/home/services/wayland/hypridle.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - lib, - config, - ... -}: { - services.hypridle = { - enable = true; - - settings = { - general = let - hyprlock = lib.getExe config.programs.hyprlock.package; - in { - before_sleep_cmd = "loginctl lock-session"; - after_sleep_cmd = "niri msg action power-on-monitors"; - lock_cmd = "pidof ${hyprlock} || ${hyprlock}"; - }; - - listener = let - inherit (config.services.hypridle.settings) general; - in [ - { - timeout = 150; - on-timeout = general.lock_cmd; - } - { - timeout = 300; - on-timeout = "niri msg action power-off-monitors"; - on-resume = general.after_sleep_cmd; - } - ]; - }; - }; -} diff --git a/home/services/wayland/hyprpaper.nix b/home/services/wayland/hyprpaper.nix deleted file mode 100755 index 2670123b..00000000 --- a/home/services/wayland/hyprpaper.nix +++ /dev/null @@ -1,15 +0,0 @@ -{config, ...}: { - services.hyprpaper = { - enable = true; - - settings = { - ipc = false; - preload = [ - config.theme.wallpaper - ]; - wallpaper = [ - ", ${config.theme.wallpaper}" - ]; - }; - }; -} diff --git a/home/services/wayland/swaync.nix b/home/services/wayland/swaync.nix deleted file mode 100755 index 98785192..00000000 --- a/home/services/wayland/swaync.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - services.swaync = { - enable = true; - settings = { - "$schema" = "https://raw.githubusercontent.com/ErikReider/SwayNotificationCenter/main/src/configSchema.json"; - positionX = "right"; - positionY = "top"; - notification-icon-size = 48; - notification-body-image-height = 160; - notification-body-image-width = 90; - timeout = 6; - timeout-low = 4; - timeout-critical = 0; - fit-to-screen = true; - notification-window-width = 350; - keyboard-shortcuts = true; - image-visibility = "when-available"; - transition-time = 100; - hide-on-clear = false; - hide-on-action = true; - script-fail-notify = true; - scripts = {}; - notification-visibility = { - example-name = { - state = "muted"; - urgency = "Low"; - app-name = "Spotify"; - }; - }; - widgets = [ - "title" - "dnd" - "notifications" - "mpris" - ]; - widget-config = { - title = { - text = "Notifications"; - clear-all-button = true; - button-text = "Clear"; - }; - dnd.text = "Do Not Disturb"; - mpris = { - image-size = 96; - image-radius = 6; - blur = false; - }; - }; - }; - }; - catppuccin.swaync.font = "JetBrainsMono Nerd Font Propo"; -} diff --git a/home/services/wayland/waybar/default.nix b/home/services/wayland/waybar/default.nix deleted file mode 100755 index 82b345e2..00000000 --- a/home/services/wayland/waybar/default.nix +++ /dev/null @@ -1,391 +0,0 @@ -{ - config, - lib, - lib', - osConfig, - ... -}: let - inherit (config.theme) colors; - - attrsForHost = host: lib'.forHosts osConfig [host] lib.optionalAttrs; -in { - programs.waybar = { - enable = true; - settings = [ - { - name = "left-bar"; - layer = "top"; - position = "left"; - width = 60; - margin-top = 9; - margin-bottom = 9; - modules-left = [ - "niri/workspaces" - ]; - modules-center = [ - "cpu" - "memory" - "disk" - "temperature" - "clock#time" - "clock#calendar" - "battery" - "backlight" - "pulseaudio#output" - "pulseaudio#input" - ]; - modules-right = [ - "group/misc" - "tray" - "custom/media" - "network" - "niri/language" - ]; - - "niri/workspaces" = { - format = "{icon}"; - format-icons = let - icons = [ - "" - "" - "󱛉" - "󰭻" - "󰊗" - "" - ]; - named = - config.programs.niri.settings.workspaces - |> builtins.attrValues - |> map (ws: ws.name) - |> lib.zipLists icons - |> map ({ - fst, - snd, - }: - lib.nameValuePair snd fst) - |> builtins.listToAttrs; - in - named - // { - default = ""; - }; - }; - - cpu = { - interval = 1; - format = "󰻠{usage}%"; - states = { - high = 90; - upper-medium = 70; - medium = 50; - lower-medium = 30; - low = 10; - }; - on-click = "mission-center"; - }; - memory = { - interval = 1; - format = "{percentage}%"; - tooltip-format = '' Main: ({used} GiB/{total} GiB)({percentage}%,) available {avail} GiB - Swap: ({swapUsed} GiB/{swapTotal} GiB)({swapPercentage}%), available {swapAvail} GiB''; - states = { - high = 90; - upper-medium = 70; - medium = 50; - lower-medium = 30; - low = 10; - }; - on-click = "mission-center"; - }; - disk = { - format = "󰋊{percentage_used}%"; - tooltip-format = "({used}/{total})({percentage_used}%) in '{path}', available {free}({percentage_free}%)"; - states = { - high = 90; - upper-medium = 70; - medium = 50; - lower-medium = 30; - low = 10; - }; - on-click = "mission-center"; - }; - temperature = - { - interval = 1; - tooltip = false; - critical-threshold = 90; - format = "{icon}{temperatureC}󰔄"; - # "format-critical" = "🔥{icon} {temperatureC}󰔄"; - format-icons = [ - "" - "" - "" - "" - "" - ]; - } - // (attrsForHost "nakama" { - hwmon-path = "/sys/devices/platform/coretemp.0/hwmon/hwmon6/temp1_input"; - }); - "clock#time" = { - interval = 1; - format = "{:%H:%M}"; - tooltip-format = "{:%H:%M:%S}"; - }; - "clock#calendar" = { - format = "{:%d-%m}"; - tooltip-format = "{calendar}"; - actions = { - on-click-right = "mode"; - on-scroll-up = "shift_up"; - on-scroll-down = "shift_down"; - }; - calendar = { - mode = "month"; - mode-mon-col = 3; - weeks-pos = "right"; - on-scroll = 1; - on-click-right = "mode"; - format = with colors; { - months = "{}"; - days = "{}"; - weeks = "W{}"; - weekdays = "{}"; - today = "{}"; - }; - }; - }; - battery = { - interval = 1; - states = { - high = 90; - upper-medium = 70; - medium = 50; - lower-medium = 30; - low = 10; - }; - format = "{icon}{capacity}%"; - format-charging = "󰂄{capacity}%"; - format-plugged = "󰚥{capacity}%"; - format-time = "{H} h {M} min"; - format-icons = [ - "󱃍" - "󰁺" - "󰁻" - "󰁼" - "󰁽" - "󰁾" - "󰁿" - "󰂀" - "󰂁" - "󰂂" - "󰁹" - ]; - tooltip-format = "{timeTo}"; - }; - backlight = { - reverse-scrolling = true; - format = "{icon}{percent}%"; - format-icons = [ - "󰌶" - "󱩎" - "󱩏" - "󱩐" - "󱩑" - "󱩒" - "󱩓" - "󱩔" - "󱩕" - "󱩖" - "󰛨" - ]; - tooltip = false; - states = { - high = 90; - upper-medium = 70; - medium = 50; - lower-medium = 30; - low = 10; - }; - }; - "pulseaudio#output" = { - states = { - high = 90; - upper-medium = 70; - medium = 50; - lower-medium = 30; - low = 10; - }; - tooltip-format = "{desc}"; - format = "{icon}{volume}%"; - format-bluetooth = "󰂱{icon}{volume}%"; - format-bluetooth-muted = "󰂱󰝟{volume}%"; - format-muted = "󰝟{volume}%"; - format-icons = { - headphone = "󰋋"; - hands-free = ""; - headset = "󰋎"; - phone = "󰄜"; - portable = "󰦧"; - car = "󰄋"; - speaker = "󰓃"; - hdmi = "󰡁"; - hifi = "󰋌"; - default = [ - "󰕿" - "󰖀" - "󰕾" - ]; - }; - on-click = "pamixer -t"; - on-click-right = "pavucontrol"; - on-scroll-up = "pamixer -i 5"; - on-scroll-down = "pamixer -d 5"; - reverse-scrolling = true; - scroll-step = 1; - }; - "pulseaudio#input" = { - states = { - high = 90; - upper-medium = 70; - medium = 50; - lower-medium = 30; - low = 10; - }; - tooltip-format = "{desc}"; - format = "{format_source}"; - format-source = "󰍬{volume}%"; - format-source-muted = "󰍭{volume}%"; - on-click = "pamixer --default-source -t"; - on-click-right = "pavucontrol"; - on-scroll-up = "pamixer --default-source -i 1"; - on-scroll-down = "pamixer --default-source -d 1"; - reverse-scrolling = true; - scroll-step = 1; - }; - "group/misc" = { - orientation = "vertical"; - modules = [ - "pulseaudio#microphone_indicator" - "custom/recording" - # "custom/github"; - "custom/notifications" - "custom/night_mode" - "custom/airplane_mode" - "idle_inhibitor" - ]; - }; - "pulseaudio#microphone_indicator" = { - format = "{format_source}"; - format-source = "󰍬"; - format-source-muted = ""; - tooltip-format = "microphone on"; - }; - "custom/recording" = { - interval = 1; - exec-if = "pgrep wf-recorder"; - exec = "fish -c check_recording"; - return-type = "json"; - }; - "custom/notifications" = { - return-type = "json"; - exec = "fish -c notifications"; - on-click = "swaync-client -t"; - on-click-middle = "swaync-client -C"; - on-click-right = "swaync-client -d"; - restart-interval = 1; - }; - "custom/night_mode" = { - return-type = "json"; - interval = 1; - exec = "fish -c check_night_mode"; - on-click = "fish -c toggle_night_mode"; - }; - "custom/airplane_mode" = { - return-type = "json"; - interval = 1; - exec = "fish -c check_airplane_mode"; - on-click = "fish -c toggle_airplane_mode"; - }; - "idle_inhibitor" = { - format = "{icon}"; - format-icons = { - activated = "󰛐"; - deactivated = "󰛑"; - }; - tooltip-format-activated = "idle-inhibitor on"; - tooltip-format-deactivated = "idle-inhibitor off"; - start-activated = true; - }; - tray = { - icon-size = 20; - spacing = 2; - }; - "custom/media" = { - format = "{icon}"; - restart-interval = 2; - return-type = "json"; - format-icons = { - "Playing" = ""; - "Paused" = ""; - }; - max-length = 40; - exec = "fish -c \"fetch_music_player_data -w\""; - on-click = "playerctl play-pause"; - on-click-right = "playerctl next"; - on-click-middle = "playerctl previous"; - on-scroll-up = "playerctl volume 0.05+"; - on-scroll-down = "playerctl volume 0.05-"; - smooth-scrolling-threshold = "0.1"; - reverse-scrolling = true; - }; - network = { - interval = 1; - format = "󰤭"; - format-wifi = "{icon}"; - format-icons = [ - "󰤯" - "󰤟" - "󰤢" - "󰤥" - "󰤨" - ]; - format-disconnected = "󰤫"; - tooltip-format = "wifi off"; - tooltip-format-wifi = with colors; '' - SSID = {essid}({signalStrength}%), {frequency} MHz - Interface = {ifname} - IP = {ipaddr} - GW = {gwaddr} - - {bandwidthUpBits}\t{bandwidthDownBits}\t󰹹{bandwidthTotalBits} - ''; - tooltip-format-disconnected = "disconnected"; - format-ethernet = "󰈀"; - format-linked = "󰈀!"; - tooltip-format-ethernet = with colors; '' Interface = {ifname} - IP = {ipaddr} - GW = {gwaddr} - Netmask = {netmask} - CIDR = {cidr} - - {bandwidthUpBits} {bandwidthDownBits} 󰹹{bandwidthTotalBits}''; - max-length = 35; - on-click = "fish -c toggle_wifi"; - on-click-right = "nm-connection-editor"; - }; - "niri/language" = { - format- = "ENG"; - format-ru = "RUS"; - }; - } - ]; - style = - # css - '' - @define-color accent @${config.theme.accent}; - - ${builtins.readFile ./style.css} - ''; - }; -} diff --git a/home/terminal/default.nix b/home/terminal/default.nix deleted file mode 100755 index 166157b3..00000000 --- a/home/terminal/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{config, ...}: let - data = config.xdg.dataHome; - conf = config.xdg.configHome; - cache = config.xdg.cacheHome; -in { - imports = [ - ./programs - ./shell - ]; - - # add environment variables - home.sessionVariables = { - # clean up ~ - LESSHISTFILE = "${cache}/less/history"; - LESSKEY = "${conf}/less/lesskey"; - - WINEPREFIX = "${data}/wine"; - XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority"; - - DIRENV_LOG_FORMAT = ""; - - # auto-run programs using nix-index-database - NIX_AUTO_RUN = "1"; - }; -} diff --git a/home/terminal/emulators/rio.nix b/home/terminal/emulators/rio.nix deleted file mode 100644 index 8360448f..00000000 --- a/home/terminal/emulators/rio.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ - config, - lib, - ... -}: { - programs.rio = { - enable = true; - settings = { - colors = with config.theme.colors; { - bar = "#${mantle}"; - tabs-active = lib.mkForce "#${accent}"; - tabs-active-highlight = lib.mkForce "#${accent}"; - }; - confirm-before-quit = false; - fonts = { - family = "JetBrainsMono Nerd Font Mono"; - size = 15; - extras = [{family = "Noto Sans Mono CJK JP";}]; - emojis = [{family = "Noto Color Emoji";}]; - }; - navigation.mode = "toptab"; - padding-x = 5; - padding-y = [7 3]; - renderer.performance = "high"; - scroll = { - multiplier = 10.0; - divider = 0.5; - }; - window.opacity = 0.9; - bindings.keys = [ - { - key = "pageup"; - "with" = "control | shift"; - action = "MoveCurrentTabToPrev"; - } - { - key = "pagedown"; - "with" = "control | shift"; - action = "MoveCurrentTabToNext"; - } - ]; - }; - }; -} diff --git a/home/terminal/emulators/wezterm.nix b/home/terminal/emulators/wezterm.nix deleted file mode 100755 index 54b11e71..00000000 --- a/home/terminal/emulators/wezterm.nix +++ /dev/null @@ -1,101 +0,0 @@ -{config, ...}: let - font = "JetBrainsMono Nerd Font Mono"; - - mkTabColorFg = bg: fg: - # lua - '' - { - bg_color = "#${config.theme.colors.${bg}}", - fg_color = "#${config.theme.colors.${fg}}" - } - ''; - mkTabColor = bg: mkTabColorFg bg "text"; -in { - programs.wezterm = { - enable = true; - - extraConfig = - # lua - '' - config.window_close_confirmation = "NeverPrompt" - - config.enable_tab_bar = true - config.hide_tab_bar_if_only_one_tab = true - - config.font = wezterm.font_with_fallback { "${font}", "JetBrainsMono Nerd Font Mono" } - config.window_frame = { - font = wezterm.font { family = "${font}", weight = "Bold" }, - font_size = 10, - active_titlebar_bg = "#${config.theme.colors.crust}", - } - config.colors = { - tab_bar = { - active_tab = ${mkTabColorFg "${config.theme.accent}" "crust"}, - inactive_tab = ${mkTabColor "mantle"}, - inactive_tab_hover = ${mkTabColor "base"}, - new_tab = ${mkTabColor "surface0"}, - new_tab_hover = ${mkTabColor "surface1"} - } - } - config.window_background_opacity = 0.95 - - config.keys = { - { - key = "h", - mods = "CTRL", - action = wezterm.action.ActivateTabRelative(-1), - }, - { - key = "l", - mods = "CTRL", - action = wezterm.action.ActivateTabRelative(1), - }, - { - key = "H", - mods = "CTRL|SHIFT", - action = wezterm.action.MoveTabRelative(-1), - }, - { - key = "L", - mods = "CTRL|SHIFT", - action = wezterm.action.MoveTabRelative(1), - }, - } - - disabled_keys = { - { - key = "PageUp", - mods = "CTRL|SHIFT", - }, - { - key = "PageDown", - mods = "CTRL|SHIFT", - }, - { - key = "Tab", - mods = "CTRL|SHIFT", - }, - { - key = "Tab", - mods = "CTRL", - }, - { - key = "<", - mods = "ALT|SHIFT", - }, - { - key = ">", - mods = "ALT|SHIFT", - }, - } - - for _, bind in ipairs(disabled_keys) do - bind["action"] = wezterm.action.DisableDefaultAssignment - table.insert(config.keys, bind) - end - - return config - ''; - }; - catppuccin.wezterm.apply = true; -} diff --git a/home/terminal/programs/atuin.nix b/home/terminal/programs/atuin.nix deleted file mode 100644 index 1a598b5e..00000000 --- a/home/terminal/programs/atuin.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - programs.atuin = { - enable = true; - - daemon.enable = true; - - flags = [ - "--disable-up-arrow" - ]; - - settings = { - dialect = "uk"; - update_check = false; - keymap_mode = "vim-insert"; - dotfiles.enabled = true; - }; - }; -} diff --git a/home/terminal/programs/bat.nix b/home/terminal/programs/bat.nix deleted file mode 100755 index 94cf0b20..00000000 --- a/home/terminal/programs/bat.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - programs.bat = { - enable = true; - config.pager = "less -FR"; - }; - - home.sessionVariables = { - MANPAGER = "sh -c 'col -bx | bat -l man -p'"; - MANROFFOPT = "-c"; - }; -} diff --git a/home/terminal/programs/cargo.nix b/home/terminal/programs/cargo.nix deleted file mode 100644 index 40dd5850..00000000 --- a/home/terminal/programs/cargo.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - lib, - pkgs, - ... -}: { - programs.cargo = { - enable = true; - settings = { - build = { - build-dir = "{cargo-cache-home}"; - rustc-wrapper = "${lib.getExe pkgs.sccache}"; - }; - }; - }; -} diff --git a/home/terminal/programs/default.nix b/home/terminal/programs/default.nix deleted file mode 100755 index 2fa33b35..00000000 --- a/home/terminal/programs/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - inputs, - pkgs, - ... -}: { - imports = [ - ./git - ./zellij - ./atuin.nix - ./bat.nix - ./cargo.nix - ./eza.nix - ./fetchers.nix - ./lazydocker.nix - ./skim.nix - ./ssh.nix - ./xdg.nix - ./zoxide.nix - ]; - - home.packages = with pkgs; [ - # archives - zip - unzip - unrar - libwebp - - libnotify - - cmatrix - pipes-rs - - dust - uutils-coreutils - duf - fd - file - jaq - ripgrep - nix-prefetch-github - nix-output-monitor - wf-recorder - tree - - packwiz - inputs.git-helper.packages.${stdenv.hostPlatform.system}.git-helper - ]; - - programs = { - btop.enable = true; - cava.enable = true; - yazi.enable = true; - }; -} diff --git a/home/terminal/programs/eza.nix b/home/terminal/programs/eza.nix deleted file mode 100644 index bfa4d296..00000000 --- a/home/terminal/programs/eza.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs.eza = { - enable = true; - colors = "always"; - git = true; - icons = "always"; - }; -} diff --git a/home/terminal/programs/fetchers.nix b/home/terminal/programs/fetchers.nix deleted file mode 100755 index 207fbef3..00000000 --- a/home/terminal/programs/fetchers.nix +++ /dev/null @@ -1,213 +0,0 @@ -{ - inputs, - pkgs, - ... -}: { - home.packages = with pkgs; [ - onefetch - cpufetch - ]; - - programs.fastfetch = { - enable = true; - settings = { - "$schema" = "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json"; - logo = { - type = "kitty"; - source = "${inputs.assets}/niksos/niksos2048.png"; - width = 35; - }; - display = { - separator = " │ "; - }; - modules = [ - "title" - { - type = "separator"; - string = "─"; - } - { - format = "{3} {12}"; - key = "╭─ OS "; - keyColor = "red"; - type = "os"; - } - { - key = "├─󰌢 Host "; - keyColor = "green"; - type = "host"; - } - { - key = "├─ Kernel "; - keyColor = "yellow"; - type = "kernel"; - } - { - key = "├─↑ Uptime "; - keyColor = "blue"; - type = "uptime"; - } - { - format = "{6} {4}"; - key = "├─ Shell "; - keyColor = "magenta"; - type = "shell"; - } - { - key = "├─ Packages "; - keyColor = "cyan"; - type = "packages"; - } - { - key = "├─ Locale "; - keyColor = "white"; - type = "locale"; - } - { - key = "├─󰨇 DE "; - keyColor = "red"; - type = "de"; - } - { - key = "├─ Terminal "; - keyColor = "green"; - type = "terminal"; - } - { - key = "├─ Terminal Font"; - keyColor = "yellow"; - type = "terminalfont"; - } - { - key = "├─ WM "; - keyColor = "blue"; - type = "wm"; - } - { - key = "├─󰭠 WM Theme "; - keyColor = "magenta"; - type = "wmtheme"; - } - { - key = "├─󱕕 Theme "; - keyColor = "cyan"; - type = "theme"; - } - { - key = "├─󱁹 Icons "; - keyColor = "white"; - type = "icons"; - } - { - key = "├─ Font "; - keyColor = "red"; - type = "font"; - } - { - key = "╰─󰇀 Cursor "; - keyColor = "yellow"; - type = "cursor"; - } - { - key = "╭─ CPU "; - keyColor = "red"; - temp = true; - type = "cpu"; - } - { - format = "{2} {1} ({3})"; - key = "├─󰚗 Board "; - keyColor = "green"; - type = "board"; - } - { - format = "{3} {5} {2} ({1})"; - key = "├─ BIOS "; - keyColor = "blue"; - type = "bios"; - } - { - key = "├─ Memory "; - keyColor = "magenta"; - percent = { - green = 50; - yellow = 80; - }; - type = "memory"; - } - { - format = "{2} - {1} [{3}, {4}, {7}] {10}"; - key = "├─󰋊 Drive "; - keyColor = "cyan"; - temp = { - green = 45; - yellow = 60; - }; - type = "physicaldisk"; - } - { - format = "{10} - {1} / {2} ({3})"; - key = "├─󰋊 Disk "; - keyColor = "white"; - percent = { - green = 60; - yellow = 85; - }; - type = "disk"; - } - { - key = "├─󰂀 Battery "; - keyColor = "red"; - percent = { - green = 60; - yellow = 20; - }; - temp = { - green = 40; - yellow = 60; - }; - type = "battery"; - } - { - format = "{1} {2} [{6}] ({3})"; - key = "├─ GPU "; - keyColor = "green"; - temp = { - green = 40; - yellow = 60; - }; - type = "gpu"; - } - { - format = "{6} - {1}x{2}@{3}Hz (as {4}x{5})"; - key = "├─ Display "; - keyColor = "yellow"; - order = "desc"; - preciseRefreshRate = false; - type = "display"; - } - { - format = "{1} - {3} ({4})"; - key = "├─ Bluetooth "; - keyColor = "blue"; - percent = { - green = 50; - yellow = 80; - }; - type = "bluetooth"; - } - { - key = "╰─ Swap "; - keyColor = "magenta"; - percent = { - green = 50; - yellow = 80; - }; - type = "swap"; - } - "break" - "colors" - ]; - }; - }; -} diff --git a/home/terminal/programs/git/default.nix b/home/terminal/programs/git/default.nix deleted file mode 100755 index 6cb7dc6e..00000000 --- a/home/terminal/programs/git/default.nix +++ /dev/null @@ -1,40 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./delta.nix - ./lazygit.nix - ]; - - home.packages = with pkgs; [ - gh - ]; - - programs.git = { - enable = true; - package = pkgs.gitFull; - - settings = { - diff.colorMoved = "default"; - merge.conflictstyle = "diff3"; - pull.rebase = false; - }; - - settings.safe.directory = ["*"]; - - ignores = [ - "*~" - "*.swp" - "*result*" - "kls_database.db" - "**/.project" - "**/.settings" - "**/.classpath" - "**/.factorypath" - "**/bin" - ]; - - settings.credential.helper = "store"; - - signing.signByDefault = true; - settings.gpg.format = "ssh"; - }; -} diff --git a/home/terminal/programs/git/delta.nix b/home/terminal/programs/git/delta.nix deleted file mode 100644 index a5ba30d2..00000000 --- a/home/terminal/programs/git/delta.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - programs.delta = { - enable = true; - enableGitIntegration = true; - }; - - # enable scrolling in git diff - home.sessionVariables.DELTA_PAGER = "less -R"; -} diff --git a/home/terminal/programs/git/lazygit.nix b/home/terminal/programs/git/lazygit.nix deleted file mode 100644 index 0ecc62eb..00000000 --- a/home/terminal/programs/git/lazygit.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - programs.lazygit = { - enable = true; - - settings = { - gui.showRandomTip = false; - }; - }; -} diff --git a/home/terminal/programs/lazydocker.nix b/home/terminal/programs/lazydocker.nix deleted file mode 100644 index d09a8045..00000000 --- a/home/terminal/programs/lazydocker.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - programs.lazydocker = { - enable = true; - - package = pkgs.symlinkJoin { - name = "lazydocker-wrapped"; - paths = [pkgs.lazydocker]; - preferLocalBuild = true; - nativeBuildInputs = [pkgs.makeWrapper]; - postBuild = '' - wrapProgram $out/bin/lazydocker \ - --suffix DOCKER_HOST : unix:///run/user/1000/podman/podman.sock - ''; - }; - }; -} diff --git a/home/terminal/programs/skim.nix b/home/terminal/programs/skim.nix deleted file mode 100755 index 100b4557..00000000 --- a/home/terminal/programs/skim.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - programs.skim = { - enable = true; - enableFishIntegration = true; - - defaultCommand = "rg --files --hidden"; - - changeDirWidgetOptions = [ - "--preview 'eza --icons --git --color always -T -L 3 {} | head -200'" - "--exact" - ]; - }; -} diff --git a/home/terminal/programs/ssh.nix b/home/terminal/programs/ssh.nix deleted file mode 100644 index 518d28b1..00000000 --- a/home/terminal/programs/ssh.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - programs.ssh = { - enable = true; - - enableDefaultConfig = false; - matchBlocks."*" = { - forwardAgent = false; - addKeysToAgent = "no"; - compression = false; - serverAliveInterval = 0; - serverAliveCountMax = 3; - hashKnownHosts = false; - userKnownHostsFile = "~/.ssh/known_hosts"; - controlMaster = "no"; - controlPath = "~/.ssh/master-%r@%n:%p"; - controlPersist = "no"; - }; - }; -} diff --git a/home/terminal/programs/xdg.nix b/home/terminal/programs/xdg.nix deleted file mode 100755 index dada74ee..00000000 --- a/home/terminal/programs/xdg.nix +++ /dev/null @@ -1,77 +0,0 @@ -{ - config, - pkgs, - ... -}: let - browser = ["zen"]; - imageViewer = ["org.gnome.Loupe"]; - videoPlayer = ["io.github.celluloid_player.Celluloid"]; - audioPlayer = ["io.bassi.Amberol"]; - - xdgAssociations = type: program: list: - list - |> map (e: { - name = "${type}/${e}"; - value = program; - }) - |> builtins.listToAttrs; - - image = xdgAssociations "image" imageViewer ["png" "svg" "jpeg" "gif"]; - video = xdgAssociations "video" videoPlayer ["mp4" "avi" "mkv"]; - audio = xdgAssociations "audio" audioPlayer ["mp3" "flac" "wav" "aac"]; - browserTypes = - (xdgAssociations "application" browser [ - "json" - "x-extension-htm" - "x-extension-html" - "x-extension-shtml" - "x-extension-xht" - "x-extension-xhtml" - ]) - // (xdgAssociations "x-scheme-handler" browser [ - "about" - "ftp" - "http" - "https" - "unknown" - ]); - - # XDG MIME types - associations = builtins.mapAttrs (_: v: (map (e: "${e}.desktop") v)) ({ - "application/pdf" = ["org.pwmt.zathura-pdf-mupdf"]; - "text/html" = browser; - "text/plain" = ["vi"]; - "x-scheme-handler/chrome" = browser; - "inode/directory" = ["thunar"]; - } - // image - // video - // audio - // browserTypes); -in { - xdg = { - enable = true; - cacheHome = config.home.homeDirectory + "/.local/cache"; - - mimeApps = { - enable = true; - defaultApplications = associations; - }; - - userDirs = { - enable = true; - createDirectories = true; - extraConfig = { - XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; - }; - }; - }; - - home.packages = [ - # used by `gio open` and xdp-gtk - (pkgs.writeShellScriptBin "xdg-terminal-exec" '' - wezterm -e "$@" - '') - pkgs.xdg-utils - ]; -} diff --git a/home/terminal/programs/zellij/binds.nix b/home/terminal/programs/zellij/binds.nix deleted file mode 100644 index b5737f31..00000000 --- a/home/terminal/programs/zellij/binds.nix +++ /dev/null @@ -1,23 +0,0 @@ -{...}: -# kdl -'' - keybinds { - session { - bind "b" { - LaunchOrFocusPlugin "zellij-forgot" { - "LOAD_ZELLIJ_BINDINGS" "true" - floating true - } - SwitchToMode "Normal" - } - - bind "w" { - LaunchOrFocusPlugin "zsm" { - floating true - move_to_focused_tab true - } - SwitchToMode "Normal" - } - } - } -'' diff --git a/home/terminal/programs/zellij/default.nix b/home/terminal/programs/zellij/default.nix deleted file mode 100644 index efbad754..00000000 --- a/home/terminal/programs/zellij/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -args: { - imports = [ - ./layouts - ]; - - programs.zellij = { - enable = true; - - enableFishIntegration = true; - exitShellOnExit = true; - - settings = { - default_layout = "custom"; - mirror_session = true; - show_startup_tips = false; - show_release_notes = false; - ui.pane_frames.rounded_corners = true; - }; - - extraConfig = - [ - ./plugins - ./binds.nix - ] - |> map (file: import file args) - |> builtins.concatStringsSep "\n"; - }; -} diff --git a/home/terminal/programs/zellij/layouts/custom.nix b/home/terminal/programs/zellij/layouts/custom.nix deleted file mode 100644 index 12c20879..00000000 --- a/home/terminal/programs/zellij/layouts/custom.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - xdg.configFile."zellij/layouts/custom.kdl".text = - # kdl - '' - layout { - default_tab_template { - pane size=1 borderless=true { - plugin location="zjstatus" - } - children - } - } - ''; -} diff --git a/home/terminal/programs/zellij/layouts/default.nix b/home/terminal/programs/zellij/layouts/default.nix deleted file mode 100644 index 322581dc..00000000 --- a/home/terminal/programs/zellij/layouts/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./custom.nix - ]; -} diff --git a/home/terminal/programs/zellij/plugins/default.nix b/home/terminal/programs/zellij/plugins/default.nix deleted file mode 100644 index 489cac2e..00000000 --- a/home/terminal/programs/zellij/plugins/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{...} @ args: -[ - ./zellij-forgot.nix - ./zjstatus.nix - ./zsm.nix -] -|> map (file: import file args) -|> ( - plugins: let - joinLines = builtins.concatStringsSep "\n"; - - configs = - plugins - |> map (plugin: plugin.config) - |> joinLines; - - toLoad = - plugins - |> builtins.filter (plugin: plugin.load) - |> map (plugin: plugin.name) - |> joinLines; - in - # kdl - '' - plugins { - ${configs} - } - - load_plugins { - ${toLoad} - } - '' -) diff --git a/home/terminal/programs/zellij/plugins/zellij-forgot.nix b/home/terminal/programs/zellij/plugins/zellij-forgot.nix deleted file mode 100644 index 1e39f9ae..00000000 --- a/home/terminal/programs/zellij/plugins/zellij-forgot.nix +++ /dev/null @@ -1,6 +0,0 @@ -{lib', ...}: -lib'.zellij.zellijPlugin { - name = "zellij-forgot"; - url = "https://github.com/karimould/zellij-forgot/releases/download/0.4.2/zellij_forgot.wasm"; - sha256 = "1ns9wjn1ncjapqpp9nn9kyhqydvl0fbnyiavd0lc3gcxa52l269i"; -} diff --git a/home/terminal/programs/zellij/plugins/zjstatus.nix b/home/terminal/programs/zellij/plugins/zjstatus.nix deleted file mode 100644 index 960b55a9..00000000 --- a/home/terminal/programs/zellij/plugins/zjstatus.nix +++ /dev/null @@ -1,69 +0,0 @@ -{ - config, - lib', - ... -}: let - inherit (config.theme) colors; -in - lib'.zellij.zellijPlugin { - name = "zjstatus"; - url = "https://github.com/dj95/zjstatus/releases/download/v0.21.1/zjstatus.wasm"; - sha256 = "06mfcijmsmvb2gdzsql6w8axpaxizdc190b93s3nczy212i846fw"; - config = - # kdl - '' - format_left "{mode}#[bg=#${colors.base}] {tabs}" - format_center "" - format_right "#[bg=#${colors.base},fg=#${colors.blue}]#[bg=#${colors.blue},fg=#${colors.mantle},bold] #[bg=#${colors.surface0},fg=#${colors.text},bold] {session} #[bg=#${colors.surface1},fg=#${colors.text},bold]" - format_space "" - format_hide_on_overlength "true" - format_precedence "crl" - - border_enabled "false" - border_char "─" - border_format "#[fg=#6C7086]{char}" - border_position "top" - - mode_normal "#[bg=#${colors.green},fg=#${colors.surface0},bold] NORMAL#[bg=#${colors.surface1},fg=#${colors.green}]█" - mode_locked "#[bg=#${colors.surface2},fg=#${colors.surface0},bold] LOCKED #[bg=#${colors.surface1},fg=#${colors.surface2}]█" - mode_resize "#[bg=#${colors.red},fg=#${colors.surface0},bold] RESIZE#[bg=#${colors.surface1},fg=#${colors.red}]█" - mode_pane "#[bg=#${colors.blue},fg=#${colors.surface0},bold] PANE#[bg=#${colors.surface1},fg=#${colors.blue}]█" - mode_tab "#[bg=#${colors.lavender},fg=#${colors.surface0},bold] TAB#[bg=#${colors.surface1},fg=#${colors.lavender}]█" - mode_scroll "#[bg=#${colors.yellow},fg=#${colors.surface0},bold] SCROLL#[bg=#${colors.surface1},fg=#${colors.yellow}]█" - mode_enter_search "#[bg=#${colors.blue},fg=#${colors.surface0},bold] ENT-SEARCH#[bg=#${colors.surface1},fg=#${colors.blue}]█" - mode_search "#[bg=#${colors.blue},fg=#${colors.surface0},bold] SEARCHARCH#[bg=#${colors.surface1},fg=#${colors.blue}]█" - mode_rename_tab "#[bg=#${colors.lavender},fg=#${colors.surface0},bold] RENAME-TAB#[bg=#${colors.surface1},fg=#${colors.lavender}]█" - mode_rename_pane "#[bg=#${colors.blue},fg=#${colors.surface0},bold] RENAME-PANE#[bg=#${colors.surface1},fg=#${colors.blue}]█" - mode_session "#[bg=#${colors.mauve},fg=#${colors.surface0},bold] SESSION#[bg=#${colors.surface1},fg=#${colors.mauve}]█" - mode_move "#[bg=#${colors.flamingo},fg=#${colors.surface0},bold] MOVE#[bg=#${colors.surface1},fg=#${colors.flamingo}]█" - mode_prompt "#[bg=#${colors.blue},fg=#${colors.surface0},bold] PROMPT#[bg=#${colors.surface1},fg=#${colors.blue}]█" - mode_tmux "#[bg=#${colors.peach},fg=#${colors.surface0},bold] TMUX#[bg=#${colors.surface1},fg=#${colors.peach}]█" - - // formatting for inactive tabs - tab_normal "#[bg=#${colors.surface1},fg=#${colors.blue}]█#[bg=#${colors.blue},fg=#${colors.surface0},bold]{index} #[bg=#${colors.surface0},fg=#${colors.text},bold] {name}{floating_indicator}#[bg=#${colors.surface1},fg=#${colors.surface0},bold]█" - tab_normal_fullscreen "#[bg=#${colors.surface1},fg=#${colors.blue}]█#[bg=#${colors.blue},fg=#${colors.surface0},bold]{index} #[bg=#${colors.surface0},fg=#${colors.text},bold] {name}{fullscreen_indicator}#[bg=#${colors.surface1},fg=#${colors.surface0},bold]█" - tab_normal_sync "#[bg=#${colors.surface1},fg=#${colors.blue}]█#[bg=#${colors.blue},fg=#${colors.surface0},bold]{index} #[bg=#${colors.surface0},fg=#${colors.text},bold] {name}{sync_indicator}#[bg=#${colors.surface1},fg=#${colors.surface0},bold]█" - - // formatting for the current active tab - tab_active "#[bg=#${colors.surface1},fg=#${colors.peach}]█#[bg=#${colors.peach},fg=#${colors.surface0},bold]{index} #[bg=#${colors.surface0},fg=#${colors.text},bold] {name}{floating_indicator}#[bg=#${colors.surface1},fg=#${colors.surface0},bold]█" - tab_active_fullscreen "#[bg=#${colors.surface1},fg=#${colors.peach}]█#[bg=#${colors.peach},fg=#${colors.surface0},bold]{index} #[bg=#${colors.surface0},fg=#${colors.text},bold] {name}{fullscreen_indicator}#[bg=#${colors.surface1},fg=#${colors.surface0},bold]█" - tab_active_sync "#[bg=#${colors.surface1},fg=#${colors.peach}]█#[bg=#${colors.peach},fg=#${colors.surface0},bold]{index} #[bg=#${colors.surface0},fg=#${colors.text},bold] {name}{sync_indicator}#[bg=#${colors.surface1},fg=#${colors.surface0},bold]█" - - // separator between the tabs - tab_separator "#[bg=#${colors.base}] " - - // indicators - tab_sync_indicator " " - tab_fullscreen_indicator " 󰊓" - tab_floating_indicator " 󰹙" - - command_git_branch_command "git rev-parse --abbrev-ref HEAD" - command_git_branch_format "#[fg=blue] {stdout} " - command_git_branch_interval "10" - command_git_branch_rendermode "static" - - datetime "#[fg=#6C7086,bold] {format} " - datetime_format "%A, %d %b %Y %H:%M" - datetime_timezone "Europe/Moscow" - ''; - } diff --git a/home/terminal/programs/zellij/plugins/zsm.nix b/home/terminal/programs/zellij/plugins/zsm.nix deleted file mode 100644 index 780fdeff..00000000 --- a/home/terminal/programs/zellij/plugins/zsm.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - config, - lib', - ... -}: -lib'.zellij.zellijPlugin { - name = "zsm"; - url = "https://github.com/liam-mackie/zsm/releases/download/v0.4.0/zsm.wasm"; - sha256 = "1s3pnfn0ppqwqmxympk0rrixzzw92671p4vpbn1x05knaf54mlxn"; - config = - # kdl - '' - default_layout "custom" - - session_separator "_" - - show_resurrectable_sessions true - - base_paths "${config.home.homeDirectory}/Projects" - ''; -} diff --git a/home/terminal/programs/zoxide.nix b/home/terminal/programs/zoxide.nix deleted file mode 100644 index f51d0a47..00000000 --- a/home/terminal/programs/zoxide.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs.zoxide = { - enable = true; - options = [ - "--cmd cd" - ]; - }; -} diff --git a/home/terminal/shell/default.nix b/home/terminal/shell/default.nix deleted file mode 100644 index 3dc46a24..00000000 --- a/home/terminal/shell/default.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - imports = [ - ./fish - ./starship.nix - ]; - - home = { - shell = { - enableBashIntegration = true; - enableFishIntegration = true; - }; - shellAliases = { - jq = "jaq"; - fetch = "fastfetch"; - lazypodman = "lazydocker"; - }; - }; -} diff --git a/home/terminal/shell/fish/default.nix b/home/terminal/shell/fish/default.nix deleted file mode 100755 index b747adf0..00000000 --- a/home/terminal/shell/fish/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ - imports = [ - ./functions - ./plugins.nix - ]; - - programs.fish = { - enable = true; - shellInit = - # fish - '' - fish_vi_key_bindings - ''; - functions.fish_greeting.body = ''''; - }; -} diff --git a/home/terminal/shell/fish/functions/checkers.nix b/home/terminal/shell/fish/functions/checkers.nix deleted file mode 100755 index ae77dcc1..00000000 --- a/home/terminal/shell/fish/functions/checkers.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ - config, - lib', - ... -}: { - programs.fish.functions = let - mkTooltips = lib'.fish.mkTooltips config.theme.colors; - in { - check_airplane_mode.body = let - tooltip = mkTooltips "󰀝" "󰀞" "airplane-mode"; - in - # fish - '' - set backup_file ~/.cache/airplane_backup - - if test -e $backup_file - echo ${tooltip.on} - else - echo ${tooltip.off} - end - ''; - check_night_mode.body = let - tooltip = mkTooltips "󱩌" "󱩍" "night-mode"; - in - # fish - '' - set backup_file ~/.cache/night_backup - - if test -e $backup_file - echo ${tooltip.on} - else - echo ${tooltip.off} - end - ''; - check_recording.body = - # fish - '' - set target_process "wf-recorder" - - if pgrep $target_process > /dev/null - echo "{\"text\":\"\", \"tooltip\":\"Recording\", \"alt\":\"Recording\"}" - end - ''; - }; -} diff --git a/home/terminal/shell/fish/functions/clipboard.nix b/home/terminal/shell/fish/functions/clipboard.nix deleted file mode 100755 index 5d7a0960..00000000 --- a/home/terminal/shell/fish/functions/clipboard.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - programs.fish.functions = { - clipboard_clear.body = - # fish - '' - rm "$HOME/.local/cache/cliphist/db" - cb clr -a - notify-send "Clipboard" "Cleared" -t 2000 - ''; - clipboard_delete_item.body = - # fish - '' - set clip $(cliphist list | rofi -dmenu -p 'clipboard delete item') - if not [ -z $clip ] - echo $clip | cliphist delete - notify-send "Clipboard" "Clip '$clip' was deleted" -t 2000 - end - ''; - clipboard_emoji.body = - # fish - '' - rofi -show emoji -config ~/.config/rofi/clipboard.rasi - ''; - clipboard_log.body = - # fish - '' - rofi -show log -config ~/.config/rofi/clipboard.rasi - ''; - }; -} diff --git a/home/terminal/shell/fish/functions/default.nix b/home/terminal/shell/fish/functions/default.nix deleted file mode 100755 index f69de9fe..00000000 --- a/home/terminal/shell/fish/functions/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - lib, - pkgs, - ... -}: { - imports = [ - ./checkers.nix - ./clipboard.nix - ./fetchers.nix - ./notifications.nix - ./reloads.nix - ./screenshot.nix - ./toggles.nix - ]; - - programs.fish.functions = { - select_color.body = - # fish - '' - set COLOR (${lib.getExe pkgs.hyprpicker} -a -r) - if [ $COLOR != "" ] - notify-send hyprpicker "copied selected color to the clipboard!" - end - ''; - suspend.body = - # fish - '' - hyprlock & \ - systemctl suspend - ''; - }; -} diff --git a/home/terminal/shell/fish/functions/fetchers.nix b/home/terminal/shell/fish/functions/fetchers.nix deleted file mode 100755 index 3f0f24c7..00000000 --- a/home/terminal/shell/fish/functions/fetchers.nix +++ /dev/null @@ -1,73 +0,0 @@ -{config, ...}: { - programs.fish.functions = { - fetch_battery.body = - # fish - '' - set enable_battery false - set battery_charging false - - for battery in /sys/class/power_supply/*BAT* - if test -f $battery/uevent - set enable_battery true - if test (cat $battery/status) = "Charging" - set battery_charging true - end - break - end - end - - if test $enable_battery = true - set percentage (math (cat $battery/capacity)) - if test $percentage -gt 100 - set percentage 100 - end - if test $battery_charging = true - if test $percentage -eq 100 - echo -n "󰚥" - else - echo -n "󰂄" - end - else - switch $percentage - case 100 - echo -n "󰁹" - case (seq 90 99) - echo -n "󰂂" - case (seq 80 89) - echo -n "󰂁" - case (seq 70 79) - echo -n "󰂀" - case (seq 60 69) - echo -n "󰁿" - case (seq 50 59) - echo -n "󰁾" - case (seq 40 49) - echo -n "󰁽" - case (seq 30 39) - echo -n "󰁼" - case (seq 20 29) - echo -n "󰁻" - case (seq 10 19) - echo -n "󰁺" - case (seq 0 9) - echo -n "󰂃" - end - end - echo -n " $percentage%" - end - echo "" - ''; - fetch_music_player_data.body = with config.theme.colors; - # fish - '' - set STATUS (playerctl status 2>&1) - if [ $STATUS != Paused -a $STATUS != Stopped -a $STATUS != "No players found" ] - if test "$(count $argv)" -eq 0 - playerctl -a metadata --format "Now playing: {{artist}} - {{markup_escape(title)}}" - else - playerctl -a metadata --format "{\"text\": \"{{artist}} - {{markup_escape(title)}}\", \"tooltip\": \"{{playerName}}\n{{markup_escape(title)}}\nby {{artist}}\non {{album}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}" -F - end - end - ''; - }; -} diff --git a/home/terminal/shell/fish/functions/notifications.nix b/home/terminal/shell/fish/functions/notifications.nix deleted file mode 100755 index 1999cb4d..00000000 --- a/home/terminal/shell/fish/functions/notifications.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - config, - lib', - ... -}: { - programs.fish.functions = { - notifications.body = let - tooltip = lib'.fish.mkTooltips config.theme.colors "󰂜" "󰪑" "notifications"; - in - # fish - '' - set COUNT (swaync-client -c) - set ENABLED ${tooltip.on} - set DISABLED ${tooltip.off} - - if [ $COUNT != 0 ] - set ENABLED "{ \"text\": \"󰂚$COUNT\", \"tooltip\": \"$COUNT notifications\", \"class\": \"on\" }" - set DISABLED "{ \"text\": \"󰂛$COUNT\", \"tooltip\": \"(silent) $COUNT notifications\", \"class\": \"off\" }" - end - - if swaync-client -D | rg -q "false" - echo $ENABLED - else - echo $DISABLED - end - ''; - }; -} diff --git a/home/terminal/shell/fish/functions/reloads.nix b/home/terminal/shell/fish/functions/reloads.nix deleted file mode 100755 index 14245966..00000000 --- a/home/terminal/shell/fish/functions/reloads.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ - programs.fish.functions = { - reload_bar.body = - # fish - '' - pkill -12 waybar - notify-send waybar "Configuration reloaded!" - ''; - reload_notifications.body = - # fish - '' - swaync -R - swaync -rs - notify-send swaync "Configuration reloaded!" - ''; - reload_pyprland.body = - # fish - '' - pkill -9 pypr - rm /run/user/1000/hypr/*/.pyprland.sock - hyprctl dispatch exec "pypr" - notify-send pyprland "Configuration reloaded!" - ''; - }; -} diff --git a/home/terminal/shell/fish/functions/screenshot.nix b/home/terminal/shell/fish/functions/screenshot.nix deleted file mode 100755 index 902af0cf..00000000 --- a/home/terminal/shell/fish/functions/screenshot.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - programs.fish.functions = let - niri = action: - # fish - '' - set screenshot_filename (echo "$HOME/Pictures/Screenshots/screenshot-$(date +"%d-%m-%Y_%H:%M:%S").png") - niri msg action ${action} - - if [ -e $screenshot_filename ] - cat $screenshot_filename | wl-copy --type image/png - notify-send -i $screenshot_filename -r (cd ~/Pictures/Screenshots/ && ls -1 | wc -l) "Screenshots" "Screenshot was taken" -t 2000 - end - ''; - in { - take_screenshot.body = niri "screenshot"; - take_screenshot_window.body = niri "screenshot-window"; - take_screenshot_screen.body = niri "screenshot-screen"; - }; -} diff --git a/home/terminal/shell/fish/functions/toggles.nix b/home/terminal/shell/fish/functions/toggles.nix deleted file mode 100755 index aa72ea30..00000000 --- a/home/terminal/shell/fish/functions/toggles.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ - programs.fish.functions = { - toggle_airplane_mode.body = - # fish - '' - set backup_file ~/.cache/airplane_backup - - if test -e $backup_file - set -l wifi_status (cat $backup_file | grep -o 'wifi:\(on\|off\)$' | cut -d':' -f2) - set -l bluetooth_status (cat $backup_file | grep -o 'bluetooth:\(on\|off\)$' | cut -d':' -f2) - - if test "$wifi_status" = "on" - nmcli radio wifi on - end - - if test "$bluetooth_status" = "on" - rfkill unblock bluetooth - end - - rm $backup_file - else - echo "wifi:$(rfkill list wifi | grep -q "Soft blocked: no" && echo "on" || echo "off")" > $backup_file - echo "bluetooth:$(rfkill list bluetooth | grep -qi "Soft blocked: no" && echo "on" || echo "off")" >> $backup_file - - nmcli radio wifi off - rfkill block bluetooth - end - ''; - toggle_bluetooth.body = - # fish - '' - set bluetooth_status (rfkill list bluetooth | grep -i -o "Soft blocked: yes") - set backup_file ~/.cache/airplane_backup - - if [ -z "$bluetooth_status" ] - rfkill block bluetooth - else - rfkill unblock bluetooth - if test -e $backup_file - rm $backup_file - end - end - ''; - toggle_night_mode = - # fish - '' - set backup_file ~/.cache/night_backup - - if test -e $backup_file - rm $backup_file - busctl --user -- call rs.wl-gammarelay / rs.wl.gammarelay UpdateTemperature n +2500 - else - touch $backup_file - busctl --user -- call rs.wl-gammarelay / rs.wl.gammarelay UpdateTemperature n -2500 - end - ''; - toggle_wifi.body = - # fish - '' - set wifi_status (nmcli radio wifi) - set backup_file ~/.cache/airplane_backup - - if [ "$wifi_status" = enabled ] - nmcli radio wifi off - else - nmcli radio wifi on - if test -e $backup_file - rm $backup_file - end - end - ''; - }; -} diff --git a/home/terminal/shell/fish/plugins.nix b/home/terminal/shell/fish/plugins.nix deleted file mode 100644 index 09dd54de..00000000 --- a/home/terminal/shell/fish/plugins.nix +++ /dev/null @@ -1,8 +0,0 @@ -{pkgs, ...}: { - programs.fish.plugins = [ - { - name = "wakatime"; - inherit (pkgs.fishPlugins.wakatime-fish) src; - } - ]; -} diff --git a/home/terminal/shell/starship.nix b/home/terminal/shell/starship.nix deleted file mode 100755 index a98b79f6..00000000 --- a/home/terminal/shell/starship.nix +++ /dev/null @@ -1,20 +0,0 @@ -{config, ...}: { - home.sessionVariables.STARSHIP_CACHE = "${config.xdg.cacheHome}/starship"; - - programs.starship = { - enable = true; - - settings = { - character = { - success_symbol = "[❯](teal)"; - error_symbol = "[❯](red)"; - vimcmd_symbol = "[❮](green)"; - }; - - directory = { - truncation_length = 4; - style = "bold lavender"; - }; - }; - }; -} diff --git a/homes/default.nix b/homes/default.nix new file mode 100644 index 00000000..0f9f773b --- /dev/null +++ b/homes/default.nix @@ -0,0 +1,12 @@ +{helpers, ...}: { + flake.homeConfigurations = helpers.mkHomes { + niksne = { + hosts = [ + "konran" + "nakama" + "tobichi" + "renga" + ]; + }; + }; +} diff --git a/homes/niksne/home.nix b/homes/niksne/home.nix new file mode 100755 index 00000000..30289e56 --- /dev/null +++ b/homes/niksne/home.nix @@ -0,0 +1,12 @@ +{...}: { + # imports = [ + # "terminal" + # ]; + + # theme = { + # flavor = "mocha"; + # accent = "blue"; + + # wallpaper = "${inputs.assets}/wallpapers/night_forest.png"; + # }; +} diff --git a/homes/niksne/hosts/konran/home.nix b/homes/niksne/hosts/konran/home.nix new file mode 100755 index 00000000..20fcd998 --- /dev/null +++ b/homes/niksne/hosts/konran/home.nix @@ -0,0 +1,15 @@ +{...}: { + # imports = [ + # "programs" + # "programs/editors/jetbrains.nix" + # "programs/games" + # "programs/wayland/niri" + + # "services" + + # "terminal/emulators/wezterm.nix" + + # ./niri.nix + # ./programs.nix + # ]; +} diff --git a/home/profiles/niksne/hosts/konran/niri.nix b/homes/niksne/hosts/konran/niri.nix similarity index 100% rename from home/profiles/niksne/hosts/konran/niri.nix rename to homes/niksne/hosts/konran/niri.nix diff --git a/home/profiles/niksne/hosts/konran/programs.nix b/homes/niksne/hosts/konran/programs.nix similarity index 100% rename from home/profiles/niksne/hosts/konran/programs.nix rename to homes/niksne/hosts/konran/programs.nix diff --git a/homes/niksne/hosts/nakama/home.nix b/homes/niksne/hosts/nakama/home.nix new file mode 100755 index 00000000..fad89da0 --- /dev/null +++ b/homes/niksne/hosts/nakama/home.nix @@ -0,0 +1,15 @@ +{...}: { + # imports = [ + # "programs" + # "programs/editors/jetbrains.nix" + # "programs/games" + # "programs/wayland/niri" + + # "services" + + # "terminal/emulators/wezterm.nix" + + # ./hypridle.nix + # ./niri.nix + # ]; +} diff --git a/home/profiles/niksne/hosts/nakama/hypridle.nix b/homes/niksne/hosts/nakama/hypridle.nix similarity index 100% rename from home/profiles/niksne/hosts/nakama/hypridle.nix rename to homes/niksne/hosts/nakama/hypridle.nix diff --git a/home/profiles/niksne/hosts/nakama/niri.nix b/homes/niksne/hosts/nakama/niri.nix similarity index 100% rename from home/profiles/niksne/hosts/nakama/niri.nix rename to homes/niksne/hosts/nakama/niri.nix diff --git a/homes/niksne/hosts/renga/home.nix b/homes/niksne/hosts/renga/home.nix new file mode 100755 index 00000000..e1461232 --- /dev/null +++ b/homes/niksne/hosts/renga/home.nix @@ -0,0 +1,5 @@ +{...}: { + # imports = [ + # "programs/editors/helix" + # ]; +} diff --git a/homes/niksne/hosts/tobichi/home.nix b/homes/niksne/hosts/tobichi/home.nix new file mode 100755 index 00000000..e1461232 --- /dev/null +++ b/homes/niksne/hosts/tobichi/home.nix @@ -0,0 +1,5 @@ +{...}: { + # imports = [ + # "programs/editors/helix" + # ]; +} diff --git a/hosts/default.nix b/hosts/default.nix index 26b0503e..02e9c104 100755 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,11 +1,23 @@ -{niksos, ...}: { - flake.nixosConfigurations = let - inherit (niksos.hosts) mkHosts systemProfiles; - in - mkHosts { - konran = systemProfiles.desktop; - nakama = systemProfiles.laptop; - tobichi = systemProfiles.minimal; - renga = systemProfiles.minimal; +{helpers, ...}: { + flake.nixosConfigurations = helpers.mkHosts { + konran = { + tags = ["desktop"]; + users = ["niksne"]; }; + + nakama = { + tags = ["laptop"]; + users = ["niksnes"]; + }; + + tobichi = { + tags = ["wsl"]; + users = ["niksne"]; + }; + + renga = { + tags = ["avf"]; + users = ["niksne"]; + }; + }; } diff --git a/hosts/konran/default.nix b/hosts/konran/default.nix deleted file mode 100755 index 1da1a751..00000000 --- a/hosts/konran/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -mkNixosModules: { - imports = mkNixosModules [ - # "hardware/nvidia.nix" - "hardware/amd.nix" - "hardware/razer.nix" - "programs/niri.nix" - "services/ollama.nix" - ]; - - boot.loader = { - grub = { - efiSupport = true; - device = "nodev"; - }; - efi.canTouchEfiVariables = true; - }; - - catppuccin = { - enable = true; - flavor = "mocha"; - accent = "sky"; - }; - - services = { - displayManager.defaultSession = "niri"; - fstrim.enable = true; - }; - - hardware.openrazer.users = ["niksne"]; -} diff --git a/hosts/konran/disks/data.nix b/hosts/konran/disks/data.nix index 7fa623c0..10aa85fd 100755 --- a/hosts/konran/disks/data.nix +++ b/hosts/konran/disks/data.nix @@ -1,5 +1,29 @@ let - inherit (import "${../../../lib}/lib'/disks.nix" {}) mkUserSubvolumes; + mkSubvolumes = subvolumes: + subvolumes + |> map ( + subvolume: + if builtins.isString subvolume + then { + name = subvolume; + value = { + mountpoint = subvolume; + }; + } + else { + name = subvolume.mountpoint; + value = subvolume; + } + ) + |> builtins.listToAttrs; + + mkUserSubvolumes = user: folders: + folders + |> map (folder: { + mountpoint = "/home/${user}/${folder}"; + mountOptions = ["compress=zstd"]; + }) + |> mkSubvolumes; in { disko.devices.disk.sda = { type = "disk"; diff --git a/hosts/konran/disks/root.nix b/hosts/konran/disks/root.nix index bde3f10b..0921984d 100755 --- a/hosts/konran/disks/root.nix +++ b/hosts/konran/disks/root.nix @@ -1,5 +1,21 @@ let - inherit (import "${../../../lib}/lib'/disks.nix" {}) mkSubvolumes; + mkSubvolumes = subvolumes: + subvolumes + |> map ( + subvolume: + if builtins.isString subvolume + then { + name = subvolume; + value = { + mountpoint = subvolume; + }; + } + else { + name = subvolume.mountpoint; + value = subvolume; + } + ) + |> builtins.listToAttrs; in { disko.devices.disk.nvme0n1 = { type = "disk"; diff --git a/hosts/konran/host.nix b/hosts/konran/host.nix new file mode 100755 index 00000000..a51e8d37 --- /dev/null +++ b/hosts/konran/host.nix @@ -0,0 +1,46 @@ +{...}: { + # imports = [ + # # "hardware/nvidia.nix" + # "hardware/amd.nix" + # "hardware/razer.nix" + # "programs/niri.nix" + # "services/ollama.nix" + # ]; + + # boot.loader = { + # grub = { + # efiSupport = true; + # device = "nodev"; + # }; + # efi.canTouchEfiVariables = true; + # }; + + # catppuccin = { + # enable = true; + # flavor = "mocha"; + # accent = "sky"; + # }; + + # services = { + # displayManager.defaultSession = "niri"; + # fstrim.enable = true; + # }; + + # hardware.openrazer.users = ["niksne"]; + + modules = { + programs = { + enable = true; + }; + # services = { + # enable = true; + # }; + + secrets.agenix.enable = true; + # nix.builders.enable = true; + }; + + # don't touch this + nixpkgs.hostPlatform = "x86_64-linux"; + system.stateVersion = "24.11"; +} diff --git a/hosts/konran/modules/.gitkeep b/hosts/konran/modules/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/hosts/modules/programs/module.nix b/hosts/modules/programs/module.nix new file mode 100644 index 00000000..f94e04f1 --- /dev/null +++ b/hosts/modules/programs/module.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.programs; +in { + options.modules.programs = { + enable = mkEnableOption "default program configs"; + }; + + config = mkIf cfg.enable { + modules.programs = { + fish.enable = true; + starship.enable = true; + }; + }; +} diff --git a/hosts/nakama/default.nix b/hosts/nakama/default.nix deleted file mode 100755 index 7c0dc6f0..00000000 --- a/hosts/nakama/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -mkNixosModules: { - imports = mkNixosModules [ - # "hardware/intel.nix" - "hardware/nvidia-prime.nix" - "hardware/nvidia.nix" - "programs/niri.nix" - "programs/obs-studio.nix" - "hardware/razer.nix" - "services/thermald.nix" - # "services/ollama.nix" - "virtualisation/virt-manager.nix" - ]; - - boot.loader = { - grub = { - efiSupport = true; - device = "nodev"; - }; - efi.canTouchEfiVariables = true; - }; - - catppuccin = { - enable = true; - flavor = "mocha"; - accent = "blue"; - }; - - services = { - displayManager.defaultSession = "niri"; - fstrim.enable = true; - }; - - hardware = { - nvidia.prime = { - nvidiaBusId = "PCI:1:0:0"; - intelBusId = "PCI:0:2:0"; - }; - - openrazer.users = ["niksne"]; - }; - - users.users.niksne.extraGroups = ["libvirtd"]; -} diff --git a/hosts/nakama/disks/default.nix b/hosts/nakama/disks/default.nix index 44928ae1..8d92b6e9 100755 --- a/hosts/nakama/disks/default.nix +++ b/hosts/nakama/disks/default.nix @@ -1,5 +1,21 @@ let - inherit (import "${../../../lib}/lib'/disks.nix" {}) mkSubvolumes; + mkSubvolumes = subvolumes: + subvolumes + |> map ( + subvolume: + if builtins.isString subvolume + then { + name = subvolume; + value = { + mountpoint = subvolume; + }; + } + else { + name = subvolume.mountpoint; + value = subvolume; + } + ) + |> builtins.listToAttrs; in { disko.devices.disk.nvme0n1 = { type = "disk"; diff --git a/hosts/nakama/host.nix b/hosts/nakama/host.nix new file mode 100755 index 00000000..e00fc2b5 --- /dev/null +++ b/hosts/nakama/host.nix @@ -0,0 +1,59 @@ +{...}: { + # imports = [ + # # "hardware/intel.nix" + # "hardware/nvidia-prime.nix" + # "hardware/nvidia.nix" + # "programs/niri.nix" + # "programs/obs-studio.nix" + # "hardware/razer.nix" + # "services/thermald.nix" + # # "services/ollama.nix" + # "virtualisation/virt-manager.nix" + # ]; + + # boot.loader = { + # grub = { + # efiSupport = true; + # device = "nodev"; + # }; + # efi.canTouchEfiVariables = true; + # }; + + # catppuccin = { + # enable = true; + # flavor = "mocha"; + # accent = "blue"; + # }; + + # services = { + # displayManager.defaultSession = "niri"; + # fstrim.enable = true; + # }; + + # hardware = { + # nvidia.prime = { + # nvidiaBusId = "PCI:1:0:0"; + # intelBusId = "PCI:0:2:0"; + # }; + + # openrazer.users = ["niksne"]; + # }; + + # users.users.niksne.extraGroups = ["libvirtd"]; + + modules = { + programs = { + enable = true; + }; + # services = { + # enable = true; + # }; + + secrets.agenix.enable = true; + # nix.builders.enable = true; + }; + + # don't touch this + nixpkgs.hostPlatform = "x86_64-linux"; + system.stateVersion = "24.11"; +} diff --git a/hosts/nakama/modules/.gitkeep b/hosts/nakama/modules/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/hosts/renga/default.nix b/hosts/renga/default.nix deleted file mode 100755 index a9765bc2..00000000 --- a/hosts/renga/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -mkNixosModules: { - inputs, - lib, - ... -}: { - imports = mkNixosModules [ - inputs.nixos-avf.nixosModules.avf - ]; - - avf = { - defaultUser = "niksne"; - }; - - nixpkgs.hostPlatform = "aarch64-linux"; - system.stateVersion = lib.mkDefault "26.05"; -} diff --git a/hosts/renga/host.nix b/hosts/renga/host.nix new file mode 100755 index 00000000..07f16a3c --- /dev/null +++ b/hosts/renga/host.nix @@ -0,0 +1,21 @@ +{...}: { + # imports = [ + # ]; + + modules = { + programs = { + enable = true; + }; + + secrets.agenix.enable = true; + # nix.builders.enable = true; + }; + + # avf = { + # defaultUser = "niksne"; + # }; + + # don't touch this + nixpkgs.hostPlatform = "aarch64-linux"; + system.stateVersion = "26.05"; +} diff --git a/hosts/renga/modules/.gitkeep b/hosts/renga/modules/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/hosts/tobichi/default.nix b/hosts/tobichi/default.nix deleted file mode 100755 index b5b685a6..00000000 --- a/hosts/tobichi/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -mkNixosModules: { - inputs, - lib, - ... -}: { - imports = mkNixosModules [ - inputs.nixos-wsl.nixosModules.default - "programs/development.nix" - "virtualisation/podman.nix" - ]; - - wsl = { - enable = true; - defaultUser = "niksne"; - }; - - nixpkgs.hostPlatform = "x86_64-linux"; - system.stateVersion = lib.mkDefault "24.11"; -} diff --git a/hosts/tobichi/host.nix b/hosts/tobichi/host.nix new file mode 100755 index 00000000..d7582cd7 --- /dev/null +++ b/hosts/tobichi/host.nix @@ -0,0 +1,24 @@ +{...}: { + imports = [ + # "programs/development.nix" + # "virtualisation/podman.nix" + ]; + + # wsl.defaultUser = "niksne"; + + modules = { + programs = { + enable = true; + }; + # services = { + # enable = true; + # }; + + secrets.agenix.enable = true; + # nix.builders.enable = true; + }; + + # don't touch this + nixpkgs.hostPlatform = "x86_64-linux"; + system.stateVersion = "24.11"; +} diff --git a/hosts/tobichi/modules/.gitkeep b/hosts/tobichi/modules/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/keys.nix b/keys.nix new file mode 100644 index 00000000..09b4ed17 --- /dev/null +++ b/keys.nix @@ -0,0 +1,14 @@ +let + inherit (import ./lib/helpers/keys.nix) mkKeys; +in + mkKeys { + users = { + niksne = { + nakama = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINdhtDO3Z1MrC/uICq7qSW6yMPfPW5WgvavrFHXIUpcP"; + }; + }; + + hosts = { + nakama = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHxsrqXzsiLa0mlMD1t0YggugeSKBh3FrU7D1+31na1H"; + }; + } diff --git a/lib/default.nix b/lib/default.nix old mode 100755 new mode 100644 index fa452c74..8eab208d --- a/lib/default.nix +++ b/lib/default.nix @@ -1,15 +1,17 @@ { - homeImports, inputs, lib, pkgs, - self, ... }: { _module.args = let - args = {inherit homeImports inputs lib pkgs self;}; + flakeRoot = ../.; + keys = import "${flakeRoot}/keys.nix"; + + args = {inherit flakeRoot inputs keys lib pkgs;}; in rec { lib' = import "${./.}/lib'" args; - niksos = import ./niksos (args // {inherit lib';}); + helpers = import ./helpers (args // {inherit lib';}); + inherit flakeRoot keys; }; } diff --git a/lib/helpers/default.nix b/lib/helpers/default.nix new file mode 100644 index 00000000..0411127c --- /dev/null +++ b/lib/helpers/default.nix @@ -0,0 +1,12 @@ +args: let + hosts = import ./hosts.nix args; + keys = import ./keys.nix args; +in { + inherit hosts keys; + + inherit (hosts) mkHosts; + inherit (keys) mkKeys; + + # TODO: implement proper homes helper; + mkHomes = _: {}; +} diff --git a/lib/helpers/hosts.nix b/lib/helpers/hosts.nix new file mode 100644 index 00000000..f76e0721 --- /dev/null +++ b/lib/helpers/hosts.nix @@ -0,0 +1,76 @@ +{ + flakeRoot, + inputs, + keys, + lib, + lib', + ... +}: let + inherit (builtins) mapAttrs attrValues; + inherit (lib) nixosSystem optionals filterAttrs; + inherit (lib') filesNamed; + tagsHelpers = lib'.tags; + + mkHosts = hosts: + hosts + |> mapAttrs (hostName: {tags, ...}: let + hasTags = tagsHelpers.hasTags tags; + withoutTags = tagsHelpers.withoutTags tags; + in + nixosSystem { + specialArgs = { + modulesPath = "${inputs.nixpkgs}/nixos/modules"; + + inherit inputs keys lib' flakeRoot; + }; + + modules = let + hostPath = flakeRoot + "/hosts/${hostName}"; + in + (filesNamed "module.nix" (flakeRoot + "/modules/system")) + ++ (filesNamed "module.nix" (flakeRoot + "/hosts/modules")) + ++ (filesNamed "module.nix" (hostPath + "/modules")) + ++ (optionals (withoutTags ["wsl" "avf"]) [ + inputs.disko.nixosModules.disko + "${hostPath}/disks/default.nix" + + "${hostPath}/hardware-configuration.nix" + ]) + ++ (optionals (hasTags ["wsl"]) [ + inputs.nixos-wsl.nixosModules.default + { + wsl.enable = true; + } + ]) + ++ (optionals (hasTags ["avf"]) [ + inputs.nixos-avf.nixosModules.avf + ]) + ++ [ + inputs.catppuccin.nixosModules.catppuccin + "${hostPath}/host.nix" + { + networking = {inherit hostName;}; + } + { + modules = { + core = { + inherit tags; + }; + + nix.builders.builders = + hosts + |> filterAttrs (_: _: hasTags ["builder"]) + |> mapAttrs ( + hostName: {extras, ...}: { + inherit hostName; + builderType = extras.builderType or (throw ''builder hosts should have 'extras.builderType' set!''); + } + ) + |> attrValues; + }; + } + ]; + }); +in { + inherit mkHosts; +} diff --git a/lib/helpers/keys.nix b/lib/helpers/keys.nix new file mode 100644 index 00000000..d480eb11 --- /dev/null +++ b/lib/helpers/keys.nix @@ -0,0 +1,25 @@ +let + mkPublicKeys = keys: keys // {publicKeys = builtins.attrValues keys;}; + + mkUsers = users: + (users: + users + // { + publicKeys = builtins.concatLists (map (userSet: userSet.publicKeys) (builtins.attrValues users)); + }) (builtins.mapAttrs (_: userSet: mkPublicKeys userSet) users); + + mkKeys = { + users, + hosts, + }: let + keys = { + users = mkUsers users; + hosts = mkPublicKeys hosts; + }; + in { + inherit (keys) users hosts; + publicKeys = keys.users.publicKeys ++ keys.hosts.publicKeys; + }; +in { + inherit mkKeys; +} diff --git a/lib/helpers/secrets.nix b/lib/helpers/secrets.nix new file mode 100644 index 00000000..0b3cfc2c --- /dev/null +++ b/lib/helpers/secrets.nix @@ -0,0 +1,12 @@ +let + inherit (builtins) listToAttrs; + + mkEnv = hosts: users: nameFn: groups: type: + listToAttrs (map (name: { + name = nameFn type name; + value.publicKeys = [hosts.${type}] ++ users.publicKeys; + }) + groups); +in { + inherit mkEnv; +} diff --git a/lib/lib'/default.nix b/lib/lib'/default.nix old mode 100755 new mode 100644 index c6606e72..ebe51e1e --- a/lib/lib'/default.nix +++ b/lib/lib'/default.nix @@ -1,17 +1,15 @@ args: let - discord = import ./discord.nix args; - disks = import ./disks.nix args; - fish = import ./fish.nix args; - helix = import ./helix.nix args; - hosts = import ./hosts.nix args; - jetbrains = import ./jetbrains.nix args; - niri = import ./niri.nix (args // {inherit numbers;}); - numbers = import ./numbers.nix args; - rofi = import ./rofi.nix args; - strings = import ./strings.nix args; - zellij = import ./zellij.nix args; + fileset = import ./fileset.nix args; + lists = import ./lists.nix args; + options = import ./options.nix args; + tags = import ./tags.nix args; + tmpfiles = import ./tmpfiles.nix args; + users = import ./users.nix args; in { - inherit discord disks fish helix hosts jetbrains niri numbers rofi strings zellij; - inherit (hosts) forHosts notForHosts; - inherit (rofi) toRasi; + inherit fileset lists options tags tmpfiles users; + + inherit (fileset) filesNamed listFilesExcluding; + inherit (lists) range0; + inherit (tmpfiles) mkTmpfiles; + inherit (users) mkUsers; } diff --git a/lib/lib'/discord.nix b/lib/lib'/discord.nix deleted file mode 100755 index 2c2c0e5c..00000000 --- a/lib/lib'/discord.nix +++ /dev/null @@ -1,21 +0,0 @@ -_: let - mkEnabledPluginsFromList = plugins: - plugins - |> map ( - plugin: let - value = {enabled = true;}; - in - if builtins.isString plugin - then { - name = plugin; - inherit value; - } - else { - inherit (plugin) name; - value = (builtins.removeAttrs plugin ["name"]) // value; - } - ) - |> builtins.listToAttrs; -in { - inherit mkEnabledPluginsFromList; -} diff --git a/lib/lib'/disks.nix b/lib/lib'/disks.nix deleted file mode 100755 index 8fcf8074..00000000 --- a/lib/lib'/disks.nix +++ /dev/null @@ -1,29 +0,0 @@ -_: let - mkSubvolumes = subvolumes: - subvolumes - |> map ( - subvolume: - if builtins.isString subvolume - then { - name = subvolume; - value = { - mountpoint = subvolume; - }; - } - else { - name = subvolume.mountpoint; - value = subvolume; - } - ) - |> builtins.listToAttrs; - - mkUserSubvolumes = user: folders: - folders - |> map (folder: { - mountpoint = "/home/${user}/${folder}"; - mountOptions = ["compress=zstd"]; - }) - |> mkSubvolumes; -in { - inherit mkSubvolumes mkUserSubvolumes; -} diff --git a/lib/lib'/fileset.nix b/lib/lib'/fileset.nix new file mode 100644 index 00000000..5a3929fa --- /dev/null +++ b/lib/lib'/fileset.nix @@ -0,0 +1,21 @@ +{lib, ...}: let + inherit (builtins) readDir elem attrNames; + inherit (lib) filterAttrs; + inherit (lib.fileset) fileFilter toList; + + filesNamed = filename: path: + path + |> fileFilter (file: file.name == filename) + |> toList; + + listFilesExcluding = filenames: path: + readDir path + |> filterAttrs ( + name: type: + type == "regular" && !(elem name filenames) + ) + |> attrNames + |> map (filename: "${path}/${filename}"); +in { + inherit filesNamed listFilesExcluding; +} diff --git a/lib/lib'/fish.nix b/lib/lib'/fish.nix deleted file mode 100755 index fbe435c2..00000000 --- a/lib/lib'/fish.nix +++ /dev/null @@ -1,9 +0,0 @@ -_: let - mkTooltip = icon: tooltip: color: class: ''"{ \"text\":\"${icon}\", \"tooltip\": \"${tooltip} ${class}\", \"class\": \"${class}\" }"''; - mkTooltips = colors: enabled: disabled: tooltip: { - on = mkTooltip enabled tooltip colors.green "on"; - off = mkTooltip disabled tooltip colors.maroon "off"; - }; -in { - inherit mkTooltip mkTooltips; -} diff --git a/lib/lib'/helix.nix b/lib/lib'/helix.nix deleted file mode 100644 index 4047b561..00000000 --- a/lib/lib'/helix.nix +++ /dev/null @@ -1,83 +0,0 @@ -{ - inputs, - lib, - ... -}: let - mkHelixLangs = pkgs: langfiles: commonLSPs: commonPackages: let - defaultLanguageConfig = "${inputs.helix}/languages.toml" |> builtins.readFile |> builtins.fromTOML; - - customLanguagesConfig = - langfiles - |> map (langfile: import langfile {inherit inputs pkgs;}) - |> map (contents: contents.programs.helix) - |> lib.zipAttrs; - - customLanguageConfig' = customLanguagesConfig.languages; - - customLanguageConfig = { - language = - customLanguageConfig' - |> map ( - {language ? [], ...}: - language - ) - |> builtins.concatLists; - - language-server = - customLanguageConfig' - |> map ( - {language-server ? {}, ...}: - language-server - ) - |> lib.mergeAttrsList; - - grammar = - customLanguageConfig' - |> map ( - {grammar ? [], ...}: - grammar - ) - |> builtins.concatLists; - - use-grammars = - customLanguageConfig' - |> map ( - {use-grammars ? {}, ...}: - use-grammars - ) - |> lib.mergeAttrsList; - }; - - combineLists = list: - list - |> builtins.groupBy (obj: obj.name) - |> builtins.attrValues - |> map lib.mergeAttrsList; - - commonLSPNames = builtins.attrNames commonLSPs; - - customLanguagePackages = builtins.concatLists customLanguagesConfig.extraPackages; - in { - programs.helix = { - languages = { - language = - defaultLanguageConfig.language - ++ customLanguageConfig.language - |> combineLists - |> map ( - {language-servers ? [], ...} @ lang: - lang // {language-servers = language-servers ++ commonLSPNames;} - ); - language-server = - lib.recursiveUpdate defaultLanguageConfig.language-server customLanguageConfig.language-server - |> lib.recursiveUpdate commonLSPs; - grammar = defaultLanguageConfig.grammar ++ customLanguageConfig.grammar |> combineLists; - use-grammars = lib.recursiveUpdate defaultLanguageConfig.use-grammars customLanguageConfig.use-grammars; - }; - - extraPackages = customLanguagePackages ++ commonPackages; - }; - }; -in { - inherit mkHelixLangs; -} diff --git a/lib/lib'/hosts.nix b/lib/lib'/hosts.nix deleted file mode 100644 index 4396cd12..00000000 --- a/lib/lib'/hosts.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: let - hostIn = config: hostlist: builtins.elem config.networking.hostName hostlist; - - forHosts = config: hostlist: fn: hostIn config hostlist |> fn; - notForHosts = config: hostlist: fn: !(hostIn config hostlist) |> fn; -in { - inherit forHosts notForHosts; -} diff --git a/lib/lib'/jetbrains.nix b/lib/lib'/jetbrains.nix deleted file mode 100644 index abb35371..00000000 --- a/lib/lib'/jetbrains.nix +++ /dev/null @@ -1,32 +0,0 @@ -_: let - mkIdes = pkgs: ides: plugins: - ides - |> map ( - ide: - { - package = pkgs.jetbrains.${ide}.override { - vmopts = '' - -Dnosplash=true - --add-opens=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED - --add-opens=java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED - - -javaagent:${pkgs.custom.ja-netfilter}/ja-netfilter.jar=jetbrains - ''; - }; - } - // ( - if plugins ? ide - then {plugins' = plugins.${ide};} - else {} - ) - ) - |> map ( - { - package, - plugins' ? [], - }: - pkgs.jetbrains.plugins.addPlugins package (plugins.common ++ plugins') - ); -in { - inherit mkIdes; -} diff --git a/lib/lib'/lists.nix b/lib/lib'/lists.nix new file mode 100644 index 00000000..3897e5fc --- /dev/null +++ b/lib/lib'/lists.nix @@ -0,0 +1,7 @@ +{lib, ...}: let + inherit (lib) range; + + range0 = n: range 0 (n - 1); +in { + inherit range0; +} diff --git a/lib/lib'/niri.nix b/lib/lib'/niri.nix deleted file mode 100755 index 5306f650..00000000 --- a/lib/lib'/niri.nix +++ /dev/null @@ -1,105 +0,0 @@ -{ - lib, - numbers, - ... -}: let - inherit (lib) nameValuePair take; - inherit (lib.lists) findFirstIndex; - inherit (numbers) mod; - - rebinds = { - "1" = "Ampersand"; - "2" = "Plus"; - "3" = "Bracketleft"; - "4" = "BraceLeft"; - "5" = "ParenLeft"; - "6" = "Equal"; - "7" = "Asterisk"; - "8" = "ParenRight"; - "9" = "BraceRight"; - "0" = "BracketRight"; - }; - - mkBinds = binds: - binds - |> map ( - { - bind, - desc, - action, - allow-when-locked ? false, - repeat ? false, - cooldown-ms ? null, - }: - nameValuePair bind { - hotkey-overlay.title = desc; - inherit action allow-when-locked repeat cooldown-ms; - } - ) - |> builtins.listToAttrs; - - mkWorkspacesBinds = config: let - workspaces = - config.programs.niri.settings.workspaces - |> builtins.attrValues - |> map (ws: ws.name) - |> take 10; - in - workspaces - |> map ( - name: let - nameIndex = findFirstIndex (w: w == name) null workspaces; - wsIndex = mod (nameIndex + 1) 10; - ws_ru = toString wsIndex; - ws_en = rebinds.${ws_ru}; - in - [ws_ru ws_en] - |> map (ws: [ - { - bind = "Mod+${ws}"; - desc = "Focus the `${name}` workspace"; - action.focus-workspace = name; - } - { - bind = "Mod+Shift+${ws}"; - desc = "Move the focused window to the `${name}` workspace"; - action.move-window-to-workspace = name; - } - { - bind = "Mod+Shift+Ctrl+Alt+${ws}"; - desc = "Move the focused column to the `${name}` workspace"; - action.move-column-to-workspace = name; - } - ]) - |> builtins.concatLists - ) - |> builtins.concatLists; - - mkColumnsBinds = n: - n - |> builtins.genList ( - x: let - m = x + 1; - ws_ru = toString (mod m 10); - ws_en = rebinds.${ws_ru}; - mStr = toString m; - in - [ws_ru ws_en] - |> map (ws: [ - { - bind = "Mod+Alt+${ws}"; - desc = "Focus a column at index ${mStr}"; - action.focus-column = m; - } - { - bind = "Mod+Alt+Shift+${ws}"; - desc = "Move column to the index ${mStr}"; - action.move-column-to-index = m; - } - ]) - |> builtins.concatLists - ) - |> builtins.concatLists; -in { - inherit mkBinds mkWorkspacesBinds mkColumnsBinds; -} diff --git a/lib/lib'/numbers.nix b/lib/lib'/numbers.nix deleted file mode 100644 index f32b0db6..00000000 --- a/lib/lib'/numbers.nix +++ /dev/null @@ -1,5 +0,0 @@ -_: let - mod = a: b: a - a / b * b; -in { - inherit mod; -} diff --git a/lib/lib'/options.nix b/lib/lib'/options.nix new file mode 100644 index 00000000..e7cb1d5e --- /dev/null +++ b/lib/lib'/options.nix @@ -0,0 +1,9 @@ +{...}: let + override = option: attrs: option // attrs; + overrideWith = attrs: option: override option attrs; + + overrideDefaultWith = default: overrideWith {inherit default;}; + overrideDefault = option: default: overrideDefaultWith default option; +in { + inherit override overrideWith overrideDefault overrideDefaultWith; +} diff --git a/lib/lib'/rofi.nix b/lib/lib'/rofi.nix deleted file mode 100755 index 99304cd2..00000000 --- a/lib/lib'/rofi.nix +++ /dev/null @@ -1,52 +0,0 @@ -{lib, ...}: let - mkValueString = value: - if lib.isBool value - then - if value - then "true" - else "false" - else if lib.isInt value - then toString value - else if (value._type or "") == "literal" - then value.value - else if lib.isString value - then ''"${value}"'' - else if lib.isList value - then "[ ${lib.strings.concatStringsSep "," (map mkValueString value)} ]" - else abort "Unhandled value type ${builtins.typeOf value}"; - - mkKeyValue = { - sep ? ": ", - end ? ";", - }: name: value: "${name}${sep}${mkValueString value}${end}"; - - mkRasiSection = name: value: - if lib.isAttrs value - then let - toRasiKeyValue = lib.generators.toKeyValue {mkKeyValue = mkKeyValue {};}; - # Remove null values so the resulting config does not have empty lines - configStr = toRasiKeyValue (lib.filterAttrs (_: v: v != null) value); - in '' - ${name} { - ${configStr}} - '' - else - (mkKeyValue { - sep = " "; - end = ""; - } - name - value) - + "\n"; - - toRasi = attrs: - [ - (lib.filterAttrs (n: _: n == "@theme") attrs) - (lib.filterAttrs (n: _: n == "@import") attrs) - (removeAttrs attrs ["@theme" "@import"]) - ] - |> lib.concatMap (lib.mapAttrsToList mkRasiSection) - |> lib.concatStringsSep "\n"; -in { - inherit mkValueString mkKeyValue mkRasiSection toRasi; -} diff --git a/lib/lib'/strings.nix b/lib/lib'/strings.nix deleted file mode 100755 index 6711de36..00000000 --- a/lib/lib'/strings.nix +++ /dev/null @@ -1,7 +0,0 @@ -{lib, ...}: let - mkUpper = str: - with builtins; - (lib.toUpper (substring 0 1 str)) + (substring 1 (stringLength str) str); -in { - inherit mkUpper; -} diff --git a/lib/lib'/tags.nix b/lib/lib'/tags.nix new file mode 100644 index 00000000..c32ecae2 --- /dev/null +++ b/lib/lib'/tags.nix @@ -0,0 +1,16 @@ +{lib, ...}: let + inherit (lib) allUnique; + + withoutTags = tagged: denied: tagged ++ denied |> allUnique; + + hasTags = tagged: needed: !(withoutTags tagged needed); + + stateful = config: let + inherit (config.modules.core) tags; + in { + hasTags = hasTags tags; + withoutTags = withoutTags tags; + }; +in { + inherit hasTags withoutTags stateful; +} diff --git a/lib/lib'/tmpfiles.nix b/lib/lib'/tmpfiles.nix new file mode 100644 index 00000000..304bd954 --- /dev/null +++ b/lib/lib'/tmpfiles.nix @@ -0,0 +1,18 @@ +{...}: let + mkTmpfiles = { + source, + target, + user, + group, + }: { + ${target}."C+" = { + argument = source; + }; + + ${dirOf target}.d = { + inherit user group; + }; + }; +in { + inherit mkTmpfiles; +} diff --git a/lib/lib'/users.nix b/lib/lib'/users.nix new file mode 100644 index 00000000..817cf454 --- /dev/null +++ b/lib/lib'/users.nix @@ -0,0 +1,20 @@ +{ + keys, + lib, + ... +}: let + mkUsers = hashedPasswords: + keys.users + |> lib.filterAttrs (_: value: builtins.isAttrs value) + |> builtins.mapAttrs (username: {publicKeys ? [], ...}: { + isNormalUser = true; + extraGroups = [ + "input" + "wheel" + ]; + inherit (hashedPasswords.${username}) hashedPassword; + openssh.authorizedKeys.keys = publicKeys; + }); +in { + inherit mkUsers; +} diff --git a/lib/lib'/zellij.nix b/lib/lib'/zellij.nix deleted file mode 100644 index 4e4a1cb6..00000000 --- a/lib/lib'/zellij.nix +++ /dev/null @@ -1,26 +0,0 @@ -{...}: let - zellijPlugin = { - url, - name, - sha256, - config ? "", - load ? false, - }: let - package = builtins.fetchurl { - inherit url sha256; - name = "zellij-plugin-${name}"; - }; - in { - inherit name load; - - config = - # kdl - '' - ${name} location="file://${package}" { - ${config} - } - ''; - }; -in { - inherit zellijPlugin; -} diff --git a/lib/niksos/default.nix b/lib/niksos/default.nix deleted file mode 100755 index ec446b22..00000000 --- a/lib/niksos/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -args: let - homes = import ./homes.nix args; - hosts = import ./hosts.nix args; -in { - inherit homes hosts; - inherit (homes) mkHomes; - inherit (hosts) mkHosts; -} diff --git a/lib/niksos/homes.nix b/lib/niksos/homes.nix deleted file mode 100755 index f6898380..00000000 --- a/lib/niksos/homes.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - inputs, - lib, - pkgs, - self, - ... -}: let - rawMk = nameValueFunction: hosts: - hosts - |> lib.mapAttrsToList ( - host: map (user: nameValueFunction host user) - ) - |> builtins.concatLists - |> builtins.listToAttrs; - - mkHmModules = map ( - import: - if (builtins.isString import) - then "${self}/home/${import}" - else import - ); - - mkHomeImports = users: - ( - rawMk ( - host: user: - lib.nameValuePair "${user}@${host}" - [ - inputs.catppuccin.homeModules.catppuccin - self.homeManagerModules.homes - self.homeManagerModules.theme - (inputs.private.modulesFor "hm" host) - (import "${self}/home/profiles/${user}" mkHmModules) - (import "${self}/home/profiles/${user}/hosts/${host}" mkHmModules) - {home = {inherit user;};} - ] - ) - users - ) - // {raw = users;}; - - mkHomes = homeImports: - rawMk (host: user: - lib.nameValuePair "${user}_${host}" ( - inputs.hm.lib.homeManagerConfiguration { - modules = homeImports."${user}@${host}"; - extraSpecialArgs = { - inherit inputs self; - }; - inherit pkgs; - } - )); -in { - inherit rawMk mkHomeImports mkHomes; -} diff --git a/lib/niksos/hosts.nix b/lib/niksos/hosts.nix deleted file mode 100755 index 31f50472..00000000 --- a/lib/niksos/hosts.nix +++ /dev/null @@ -1,70 +0,0 @@ -{ - homeImports, - inputs, - lib, - lib', - self, - ... -}: let - systemProfiles = import "${self}/system"; - - mkPkgsOverlays = lib.mapAttrsToList (name: input: _: _: { - ${name} = import input { - system = "x86_64-linux"; - config.allowUnfree = true; - }; - }); - - mkNixosModules = map ( - import: - if (builtins.isString import) - then "${self}/system/${import}" - else import - ); - - mkHosts = builtins.mapAttrs (host: type: - inputs.nixpkgs.lib.nixosSystem rec { - specialArgs = { - inherit inputs self lib'; - }; - modules = - type - ++ [ - inputs.disko.nixosModules.disko - inputs.agenix.nixosModules.age - inputs.catppuccin.nixosModules.catppuccin - self.niksosModules.all - (inputs.private.modulesFor "nixos" host) - (import "${self}/hosts/${host}" mkNixosModules) - ( - if type != systemProfiles.minimal - then "${self}/hosts/${host}/disks" - else {} - ) - ( - if type != systemProfiles.minimal - then "${self}/hosts/${host}/hardware-configuration.nix" - else {} - ) - ({...}: { - networking.hostName = host; - home-manager = { - users = - homeImports.raw.${host} - |> map ( - user: lib.nameValuePair user {imports = homeImports."${user}@${host}";} - ) - |> builtins.listToAttrs; - extraSpecialArgs = specialArgs; - }; - nixpkgs.overlays = mkPkgsOverlays (with inputs; { - inherit master unstable stable; - custom = nikspkgs; - }); - catppuccin.cache.enable = true; - }) - ]; - }); -in { - inherit systemProfiles mkPkgsOverlays mkHosts; -} diff --git a/modules/caches.nix b/modules/caches.nix deleted file mode 100755 index a98b0e88..00000000 --- a/modules/caches.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - config, - lib, - ... -}: let - inherit (lib) types mkOption mkIf; - - cfg = config.niksos.caches; -in { - options.niksos.caches = mkOption { - type = types.attrsOf types.str; - default = {}; - example = { - "cache.nixos.org?priority=10" = "6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="; - - "nix-community.cachix.org" = "mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="; - "wezterm.cachix.org" = "kAbhjYUC9qvblTE+s7S+kl5XM1zVa4skO+E/1IDWdH0="; - }; - description = '' - Shorthand for {option}`nix.settings.substituters` and {option}`nix.settings.trusted-public-keys`. - ''; - }; - config = mkIf (cfg - != {}) { - nix.settings = { - substituters = - cfg - |> builtins.attrNames - |> map (s: "https://${s}"); - trusted-public-keys = - cfg - |> builtins.mapAttrs (s_: k: let - s = - s_ - |> builtins.split "\\?" - |> builtins.head; - in "${s}${k}") - |> builtins.attrValues; - }; - }; -} diff --git a/modules/default.nix b/modules/default.nix deleted file mode 100755 index c01ef070..00000000 --- a/modules/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - flake = { - niksosModules = rec { - all = caches; - caches = import ./caches.nix; - }; - homeManagerModules = rec { - all = homes // theme; - homes = import ./homes.nix; - theme = import ./theme.nix; - }; - }; -} diff --git a/modules/homes.nix b/modules/home/module.nix old mode 100755 new mode 100644 similarity index 100% rename from modules/homes.nix rename to modules/home/module.nix diff --git a/modules/home/services/kdeconnect/module.nix b/modules/home/services/kdeconnect/module.nix new file mode 100644 index 00000000..8f6a7a25 --- /dev/null +++ b/modules/home/services/kdeconnect/module.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + options, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.services.kdeconnect; +in { + options.modules.services.kdeconnect = { + enable = options.services.kdeconnect.enable; + }; + + config = mkIf cfg.enable { + services.kdeconnect = { + enable = true; + indicator = true; + }; + }; +} diff --git a/modules/home/services/playerctl/module.nix b/modules/home/services/playerctl/module.nix new file mode 100644 index 00000000..a0a570a8 --- /dev/null +++ b/modules/home/services/playerctl/module.nix @@ -0,0 +1,22 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.services.playerctl; +in { + options.modules.services.playerctl = { + enable = mkEnableOption "playerctl service module"; + }; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + playerctl + ]; + + services.playerctld.enable = true; + }; +} diff --git a/modules/home/services/polkit/module.nix b/modules/home/services/polkit/module.nix new file mode 100644 index 00000000..ece65a20 --- /dev/null +++ b/modules/home/services/polkit/module.nix @@ -0,0 +1,34 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.services.polkit; +in { + options.modules.services.polkit = { + enable = mkEnableOption "polkit service module"; + }; + + config = mkIf cfg.enable { + systemd.user.services.polkit-gnome-authentication-agent-1 = { + Unit.Description = "polkit-gnome-authentication-agent-1"; + + Install = { + WantedBy = ["graphical-session.target"]; + Wants = ["graphical-session.target"]; + After = ["graphical-session.target"]; + }; + + Service = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + }; +} diff --git a/modules/home/services/udiskie/module.nix b/modules/home/services/udiskie/module.nix new file mode 100644 index 00000000..2d0e4321 --- /dev/null +++ b/modules/home/services/udiskie/module.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + options, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.services.udiskie; +in { + options.modules.services.udiskie = { + enable = options.services.udiskie.enable; + }; + + config = mkIf cfg.enable { + services.udiskie.enable = true; + }; +} diff --git a/modules/home/services/waybar/module.nix b/modules/home/services/waybar/module.nix new file mode 100755 index 00000000..e021b755 --- /dev/null +++ b/modules/home/services/waybar/module.nix @@ -0,0 +1,401 @@ +{ + config, + lib, + lib', + options, + osConfig, + ... +}: let + inherit (lib) mkIf; + inherit (config.theme) colors; + + cfg = config.modules.services.waybar; + + attrsForHost = host: lib'.forHosts osConfig [host] lib.optionalAttrs; +in { + options.modules.services.waybar = { + enable = options.services.waybar.enable; + }; + + config = mkIf cfg.enable { + programs.waybar = { + enable = true; + settings = [ + { + name = "left-bar"; + layer = "top"; + position = "left"; + width = 60; + margin-top = 9; + margin-bottom = 9; + modules-left = [ + "niri/workspaces" + ]; + modules-center = [ + "cpu" + "memory" + "disk" + "temperature" + "clock#time" + "clock#calendar" + "battery" + "backlight" + "pulseaudio#output" + "pulseaudio#input" + ]; + modules-right = [ + "group/misc" + "tray" + "custom/media" + "network" + "niri/language" + ]; + + "niri/workspaces" = { + format = "{icon}"; + format-icons = let + icons = [ + "" + "" + "󱛉" + "󰭻" + "󰊗" + "" + ]; + named = + config.programs.niri.settings.workspaces + |> builtins.attrValues + |> map (ws: ws.name) + |> lib.zipLists icons + |> map ({ + fst, + snd, + }: + lib.nameValuePair snd fst) + |> builtins.listToAttrs; + in + named + // { + default = ""; + }; + }; + + cpu = { + interval = 1; + format = "󰻠{usage}%"; + states = { + high = 90; + upper-medium = 70; + medium = 50; + lower-medium = 30; + low = 10; + }; + on-click = "mission-center"; + }; + memory = { + interval = 1; + format = "{percentage}%"; + tooltip-format = '' Main: ({used} GiB/{total} GiB)({percentage}%,) available {avail} GiB + Swap: ({swapUsed} GiB/{swapTotal} GiB)({swapPercentage}%), available {swapAvail} GiB''; + states = { + high = 90; + upper-medium = 70; + medium = 50; + lower-medium = 30; + low = 10; + }; + on-click = "mission-center"; + }; + disk = { + format = "󰋊{percentage_used}%"; + tooltip-format = "({used}/{total})({percentage_used}%) in '{path}', available {free}({percentage_free}%)"; + states = { + high = 90; + upper-medium = 70; + medium = 50; + lower-medium = 30; + low = 10; + }; + on-click = "mission-center"; + }; + temperature = + { + interval = 1; + tooltip = false; + critical-threshold = 90; + format = "{icon}{temperatureC}󰔄"; + # "format-critical" = "🔥{icon} {temperatureC}󰔄"; + format-icons = [ + "" + "" + "" + "" + "" + ]; + } + // (attrsForHost "nakama" { + hwmon-path = "/sys/devices/platform/coretemp.0/hwmon/hwmon6/temp1_input"; + }); + "clock#time" = { + interval = 1; + format = "{:%H:%M}"; + tooltip-format = "{:%H:%M:%S}"; + }; + "clock#calendar" = { + format = "{:%d-%m}"; + tooltip-format = "{calendar}"; + actions = { + on-click-right = "mode"; + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + }; + calendar = { + mode = "month"; + mode-mon-col = 3; + weeks-pos = "right"; + on-scroll = 1; + on-click-right = "mode"; + format = with colors; { + months = "{}"; + days = "{}"; + weeks = "W{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + }; + battery = { + interval = 1; + states = { + high = 90; + upper-medium = 70; + medium = 50; + lower-medium = 30; + low = 10; + }; + format = "{icon}{capacity}%"; + format-charging = "󰂄{capacity}%"; + format-plugged = "󰚥{capacity}%"; + format-time = "{H} h {M} min"; + format-icons = [ + "󱃍" + "󰁺" + "󰁻" + "󰁼" + "󰁽" + "󰁾" + "󰁿" + "󰂀" + "󰂁" + "󰂂" + "󰁹" + ]; + tooltip-format = "{timeTo}"; + }; + backlight = { + reverse-scrolling = true; + format = "{icon}{percent}%"; + format-icons = [ + "󰌶" + "󱩎" + "󱩏" + "󱩐" + "󱩑" + "󱩒" + "󱩓" + "󱩔" + "󱩕" + "󱩖" + "󰛨" + ]; + tooltip = false; + states = { + high = 90; + upper-medium = 70; + medium = 50; + lower-medium = 30; + low = 10; + }; + }; + "pulseaudio#output" = { + states = { + high = 90; + upper-medium = 70; + medium = 50; + lower-medium = 30; + low = 10; + }; + tooltip-format = "{desc}"; + format = "{icon}{volume}%"; + format-bluetooth = "󰂱{icon}{volume}%"; + format-bluetooth-muted = "󰂱󰝟{volume}%"; + format-muted = "󰝟{volume}%"; + format-icons = { + headphone = "󰋋"; + hands-free = ""; + headset = "󰋎"; + phone = "󰄜"; + portable = "󰦧"; + car = "󰄋"; + speaker = "󰓃"; + hdmi = "󰡁"; + hifi = "󰋌"; + default = [ + "󰕿" + "󰖀" + "󰕾" + ]; + }; + on-click = "pamixer -t"; + on-click-right = "pavucontrol"; + on-scroll-up = "pamixer -i 5"; + on-scroll-down = "pamixer -d 5"; + reverse-scrolling = true; + scroll-step = 1; + }; + "pulseaudio#input" = { + states = { + high = 90; + upper-medium = 70; + medium = 50; + lower-medium = 30; + low = 10; + }; + tooltip-format = "{desc}"; + format = "{format_source}"; + format-source = "󰍬{volume}%"; + format-source-muted = "󰍭{volume}%"; + on-click = "pamixer --default-source -t"; + on-click-right = "pavucontrol"; + on-scroll-up = "pamixer --default-source -i 1"; + on-scroll-down = "pamixer --default-source -d 1"; + reverse-scrolling = true; + scroll-step = 1; + }; + "group/misc" = { + orientation = "vertical"; + modules = [ + "pulseaudio#microphone_indicator" + "custom/recording" + # "custom/github"; + "custom/notifications" + "custom/night_mode" + "custom/airplane_mode" + "idle_inhibitor" + ]; + }; + "pulseaudio#microphone_indicator" = { + format = "{format_source}"; + format-source = "󰍬"; + format-source-muted = ""; + tooltip-format = "microphone on"; + }; + "custom/recording" = { + interval = 1; + exec-if = "pgrep wf-recorder"; + exec = "fish -c check_recording"; + return-type = "json"; + }; + "custom/notifications" = { + return-type = "json"; + exec = "fish -c notifications"; + on-click = "swaync-client -t"; + on-click-middle = "swaync-client -C"; + on-click-right = "swaync-client -d"; + restart-interval = 1; + }; + "custom/night_mode" = { + return-type = "json"; + interval = 1; + exec = "fish -c check_night_mode"; + on-click = "fish -c toggle_night_mode"; + }; + "custom/airplane_mode" = { + return-type = "json"; + interval = 1; + exec = "fish -c check_airplane_mode"; + on-click = "fish -c toggle_airplane_mode"; + }; + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = "󰛐"; + deactivated = "󰛑"; + }; + tooltip-format-activated = "idle-inhibitor on"; + tooltip-format-deactivated = "idle-inhibitor off"; + start-activated = true; + }; + tray = { + icon-size = 20; + spacing = 2; + }; + "custom/media" = { + format = "{icon}"; + restart-interval = 2; + return-type = "json"; + format-icons = { + "Playing" = ""; + "Paused" = ""; + }; + max-length = 40; + exec = "fish -c \"fetch_music_player_data -w\""; + on-click = "playerctl play-pause"; + on-click-right = "playerctl next"; + on-click-middle = "playerctl previous"; + on-scroll-up = "playerctl volume 0.05+"; + on-scroll-down = "playerctl volume 0.05-"; + smooth-scrolling-threshold = "0.1"; + reverse-scrolling = true; + }; + network = { + interval = 1; + format = "󰤭"; + format-wifi = "{icon}"; + format-icons = [ + "󰤯" + "󰤟" + "󰤢" + "󰤥" + "󰤨" + ]; + format-disconnected = "󰤫"; + tooltip-format = "wifi off"; + tooltip-format-wifi = with colors; '' + SSID = {essid}({signalStrength}%), {frequency} MHz + Interface = {ifname} + IP = {ipaddr} + GW = {gwaddr} + + {bandwidthUpBits}\t{bandwidthDownBits}\t󰹹{bandwidthTotalBits} + ''; + tooltip-format-disconnected = "disconnected"; + format-ethernet = "󰈀"; + format-linked = "󰈀!"; + tooltip-format-ethernet = with colors; '' Interface = {ifname} + IP = {ipaddr} + GW = {gwaddr} + Netmask = {netmask} + CIDR = {cidr} + + {bandwidthUpBits} {bandwidthDownBits} 󰹹{bandwidthTotalBits}''; + max-length = 35; + on-click = "fish -c toggle_wifi"; + on-click-right = "nm-connection-editor"; + }; + "niri/language" = { + format- = "ENG"; + format-ru = "RUS"; + }; + } + ]; + style = + # css + '' + @define-color accent @${config.theme.accent}; + + ${builtins.readFile ./style.css} + ''; + }; + }; +} diff --git a/home/services/wayland/waybar/style.css b/modules/home/services/waybar/style.css similarity index 100% rename from home/services/wayland/waybar/style.css rename to modules/home/services/waybar/style.css diff --git a/modules/theme.nix b/modules/home/theme/module.nix old mode 100755 new mode 100644 similarity index 100% rename from modules/theme.nix rename to modules/home/theme/module.nix diff --git a/modules/system/boot/module.nix b/modules/system/boot/module.nix new file mode 100755 index 00000000..125b4e66 --- /dev/null +++ b/modules/system/boot/module.nix @@ -0,0 +1,64 @@ +{ + config, + inputs, + lib, + lib', + options, + pkgs, + ... +}: let + inherit (lib) mkIf mkDefault mkForce; + inherit (lib'.tags.stateful config) withoutTags; + + cfg = config.modules.boot; + niksos-logo = "${inputs.assets}/niksos/niksos100.png"; +in { + options.modules.boot = let + inherit (lib'.options) overrideDefault; + in { + loader = { + efiSupport = overrideDefault options.boot.loader.grub.efiSupport true; + }; + plymouth = { + enable = overrideDefault options.boot.plymouth.enable true; + }; + }; + + config = mkIf (withoutTags ["wsl" "avf"]) { + boot = { + initrd = { + systemd.enable = true; + supportedFilesystems = ["fat32" "ext4" "btrfs" "ntfs"]; + }; + + kernelPackages = mkDefault pkgs.linuxPackages_latest; + consoleLogLevel = 3; + kernelParams = [ + # "quiet" + "systemd.show_status=auto" + "rd.udev.log_level=3" + ]; + + loader = + { + grub = { + inherit (cfg.loader) efiSupport; + enable = true; + useOSProber = true; + extraFiles."theme/logo.png" = mkForce niksos-logo; + configurationLimit = 25; + }; + timeout = 3; + } + // (mkIf cfg.loader.efiSupport { + efi.canTouchEfiVariables = true; + grub.device = "nodev"; + }); + + plymouth = { + inherit (cfg.plymouth) enable; + logo = niksos-logo; + }; + }; + }; +} diff --git a/modules/system/core/module.nix b/modules/system/core/module.nix new file mode 100644 index 00000000..74606448 --- /dev/null +++ b/modules/system/core/module.nix @@ -0,0 +1,15 @@ +{lib, ...}: let + inherit (lib) mkOption types; +in { + options.modules.core = { + tags = mkOption { + type = types.listOf (types.enum [ + "desktop" + "laptop" + "wsl" + "avf" + "builder" + ]); + }; + }; +} diff --git a/modules/system/fonts/module.nix b/modules/system/fonts/module.nix new file mode 100644 index 00000000..5af13615 --- /dev/null +++ b/modules/system/fonts/module.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.fonts; +in { + options.modules.fonts = { + enable = mkEnableOption "fonts config"; + }; + + config = mkIf cfg.enable { + fonts = { + packages = with pkgs; [ + corefonts + noto-fonts + noto-fonts-cjk-sans + noto-fonts-color-emoji + nerd-fonts.jetbrains-mono + nerd-fonts.noto + ]; + + enableDefaultPackages = false; + + fontconfig.defaultFonts = { + serif = ["Noto Serif"]; + sansSerif = ["Noto Sans"]; + monospace = ["JetBrainsMono Nerd Font Mono"]; + emoji = []; + }; + }; + }; +} diff --git a/modules/system/hardware/backlight/module.nix b/modules/system/hardware/backlight/module.nix new file mode 100644 index 00000000..fed73213 --- /dev/null +++ b/modules/system/hardware/backlight/module.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.hardware.backlight; +in { + options.modules.hardware.backlight = { + enable = mkEnableOption "backlight module"; + }; + + config = mkIf cfg.enable { + hardware.brillo.enable = true; + }; +} diff --git a/modules/system/hardware/bluetooth/module.nix b/modules/system/hardware/bluetooth/module.nix new file mode 100644 index 00000000..7d0bdfcf --- /dev/null +++ b/modules/system/hardware/bluetooth/module.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + lib', + ... +}: let + inherit (lib) mkIf mkEnableOption; + inherit (lib'.options) overrideDefaultWith; + inherit (lib'.tags.stateful config) hasTags; + + cfg = config.modules.hardware.bluetooth; +in { + options.modules.hardware.bluetooth = { + enable = mkEnableOption "bluetooth module" |> overrideDefaultWith (hasTags ["laptop"]); + }; + + config = mkIf cfg.enable { + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + services.blueman.enable = true; + }; +} diff --git a/modules/system/hardware/cpu/amd.nix b/modules/system/hardware/cpu/amd.nix new file mode 100644 index 00000000..fd38d4a9 --- /dev/null +++ b/modules/system/hardware/cpu/amd.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.hardware; +in { + config = mkIf (cfg.cpu == "amd") { + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} diff --git a/modules/system/hardware/cpu/default.nix b/modules/system/hardware/cpu/default.nix new file mode 100644 index 00000000..b0acb523 --- /dev/null +++ b/modules/system/hardware/cpu/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./amd.nix + ./intel.nix + ]; +} diff --git a/modules/system/hardware/cpu/intel.nix b/modules/system/hardware/cpu/intel.nix new file mode 100644 index 00000000..ecedf004 --- /dev/null +++ b/modules/system/hardware/cpu/intel.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.hardware; +in { + config = mkIf (cfg.cpu == "intel") { + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} diff --git a/modules/system/hardware/gpu/amd.nix b/modules/system/hardware/gpu/amd.nix new file mode 100644 index 00000000..99f8da67 --- /dev/null +++ b/modules/system/hardware/gpu/amd.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.hardware; +in { + config = mkIf (cfg.gpu == "amd") { + services.xserver.videoDrivers = lib.mkDefault ["modesetting"]; + + hardware.graphics = { + enable = lib.mkDefault true; + enable32Bit = lib.mkDefault true; + }; + + hardware.amdgpu.initrd.enable = lib.mkDefault true; + }; +} diff --git a/modules/system/hardware/gpu/default.nix b/modules/system/hardware/gpu/default.nix new file mode 100644 index 00000000..83df5d02 --- /dev/null +++ b/modules/system/hardware/gpu/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./amd.nix + ./intel.nix + ./nvidia.nix + ]; +} diff --git a/modules/system/hardware/gpu/intel.nix b/modules/system/hardware/gpu/intel.nix new file mode 100644 index 00000000..974c9a61 --- /dev/null +++ b/modules/system/hardware/gpu/intel.nix @@ -0,0 +1,101 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.hardware; +in { + options.hardware.intelgpu = { + driver = lib.mkOption { + description = "Intel GPU driver to use"; + type = lib.types.enum [ + "i915" + "xe" + ]; + default = "i915"; + }; + + loadInInitrd = + lib.mkEnableOption "Load the Intel GPU kernel module at stage 1 boot. (Added to `boot.initrd.kernelModules`)" + // { + default = true; + }; + + computeRuntime = lib.mkOption { + description = "intel-compute-runtime variant to use"; + type = lib.types.enum [ + "default" + "legacy" + ]; + default = "default"; + }; + + vaapiDriver = lib.mkOption { + description = "Intel VAAPI driver to use (use null to use both)"; + type = lib.types.nullOr ( + lib.types.enum [ + "intel-vaapi-driver" + "intel-media-driver" + ] + ); + default = null; # Use both drivers when we don't know which one to use + }; + + enableHybridCodec = lib.mkEnableOption "hybrid codec support for Intel GPUs"; + }; + + config = mkIf (cfg.gpu == "intel") (let + cfg = config.hardware.intelgpu; + + useIntelVaapiDriver = cfg.vaapiDriver == "intel-vaapi-driver" || cfg.vaapiDriver == null; + intel-vaapi-driver = (pkgs.intel-vaapi-driver or pkgs.vaapiIntel).override { + enableHybridCodec = cfg.enableHybridCodec; + }; + intel-vaapi-driver-32 = + (pkgs.driversi686Linux.intel-vaapi-driver or pkgs.driversi686Linux.vaapiIntel).override + { + enableHybridCodec = cfg.enableHybridCodec; + }; + + useIntelOcl = + useIntelVaapiDriver + && (config.hardware.enableAllFirmware or config.nixpkgs.config.allowUnfree or false); + intel-ocl = pkgs.intel-ocl; + + useIntelMediaDriver = cfg.vaapiDriver == "intel-media-driver" || cfg.vaapiDriver == null; + intel-media-driver = pkgs.intel-media-driver; + intel-media-driver-32 = pkgs.driversi686Linux.intel-media-driver; + intel-compute-runtime = + if cfg.computeRuntime == "legacy" + then pkgs.intel-compute-runtime-legacy1 + else pkgs.intel-compute-runtime; + vpl-gpu-rt = pkgs.vpl-gpu-rt or pkgs.onevpl-intel-gpu; + in { + boot.initrd.kernelModules = lib.optionals cfg.loadInInitrd [cfg.driver]; + + hardware.graphics.extraPackages = + lib.optionals useIntelVaapiDriver [intel-vaapi-driver] + ++ lib.optionals useIntelOcl [intel-ocl] + ++ lib.optionals useIntelMediaDriver [ + intel-media-driver + intel-compute-runtime + vpl-gpu-rt + ]; + + hardware.graphics.extraPackages32 = + lib.optionals useIntelVaapiDriver [intel-vaapi-driver-32] + ++ lib.optionals useIntelMediaDriver [intel-media-driver-32]; + + assertions = [ + { + assertion = ( + cfg.driver != "xe" || lib.versionAtLeast config.boot.kernelPackages.kernel.version "6.8" + ); + message = "Intel Xe GPU driver is not supported on kernels earlier than 6.8. Update or use the i915 driver."; + } + ]; + }); +} diff --git a/modules/system/hardware/gpu/nvidia.nix b/modules/system/hardware/gpu/nvidia.nix new file mode 100644 index 00000000..0dfdeb87 --- /dev/null +++ b/modules/system/hardware/gpu/nvidia.nix @@ -0,0 +1,89 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.hardware; +in { + config = mkIf (cfg.gpu == "nvidia") ({ + services.xserver.videoDrivers = lib.mkDefault ["nvidia"]; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement = { + enable = false; + finegrained = false; + }; + open = false; + nvidiaSettings = true; + package = let + inherit (cfg.nvidiaPackage) type version sha256; + + pkg = config.boot.kernelPackages.nvidiaPackages.${type}; + in + if version == null + then pkg + else + pkg.overrideAttrs { + src = pkgs.fetchurl { + url = "https://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}.run"; + inherit sha256; + }; + }; + }; + } + // ( + mkIf cfg.nvidiaPrime.enable { + hardware.nvidia.prime = { + offload = { + enable = lib.mkOverride 990 true; + enableOffloadCmd = lib.mkIf config.hardware.nvidia.prime.offload.enable true; + }; + }; + + specialisation = { + battery-saver.configuration = { + system.nixos.tags = ["battery-saver"]; + imports = [ + { + boot.extraModprobeConfig = '' + blacklist nouveau + options nouveau modeset=0 + ''; + + services.udev.extraRules = '' + # Remove NVIDIA USB xHCI Host Controller devices, if present + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1" + + # Remove NVIDIA USB Type-C UCSI devices, if present + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1" + + # Remove NVIDIA Audio devices, if present + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1" + + # Remove NVIDIA VGA/3D controller devices + ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1" + ''; + boot.blacklistedKernelModules = [ + "nouveau" + "nvidia" + "nvidia_drm" + "nvidia_modeset" + ]; + } + ]; + hardware.nvidia = { + prime.offload.enable = lib.mkForce false; + powerManagement = { + enable = lib.mkForce false; + finegrained = lib.mkForce false; + }; + }; + }; + }; + } + )); +} diff --git a/modules/system/hardware/module.nix b/modules/system/hardware/module.nix new file mode 100644 index 00000000..d2b86d0d --- /dev/null +++ b/modules/system/hardware/module.nix @@ -0,0 +1,62 @@ +{ + config, + lib, + lib', + pkgs, + ... +}: let + inherit (lib) mkOption types mkIf fakeSha256 mkEnableOption; + inherit (lib') overrideDefaultWith; + inherit (lib'.tags.stateful config) hasTags; + + cfg = config.modules.hardware; +in { + imports = [ + ./gpu + ./cpu + ]; + + options.modules.hardware = { + cpu = mkOption { + type = types.either types.unspecified (types.enum ["intel" "amd"]); + default = null; + }; + gpu = mkOption { + type = types.either types.unspecified (types.enum ["intel" "amd" "nvidia"]); + default = null; + }; + + nvidiaPackage = mkIf (cfg.gpu == "nvidia") { + type = mkOption { + type = types.enum ["beta" "stable"]; + default = "beta"; + }; + version = mkOption { + type = types.either types.unspecified types.nonEmptyStr; + default = null; + }; + sha256 = mkOption { + type = types.str; + default = fakeSha256; + }; + }; + + nvidiaPrime = { + enable = mkEnableOption "nvidia prime with profiles" |> overrideDefaultWith (hasTags ["laptop"]); + }; + }; + + config = mkIf (cfg.gpu != null) { + hardware.graphics = { + extraPackages = with pkgs; [ + libva + libva-vdpau-driver + libvdpau-va-gl + ]; + extraPackages32 = with pkgs.pkgsi686Linux; [ + libva-vdpau-driver + libvdpau-va-gl + ]; + }; + }; +} diff --git a/modules/system/hardware/openrazer/module.nix b/modules/system/hardware/openrazer/module.nix new file mode 100644 index 00000000..1bf9bf33 --- /dev/null +++ b/modules/system/hardware/openrazer/module.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + ... +}: let + inherit (builtins) attrNames; + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.hardware.openrazer; +in { + options.modules.hardware.openrazer = { + enable = mkEnableOption "openrazar hardware support module"; + }; + + config = mkIf cfg.enable { + hardware.openrazer = { + enable = true; + users = config.users.users |> attrNames; + }; + }; +} diff --git a/modules/system/hardware/printing/module.nix b/modules/system/hardware/printing/module.nix new file mode 100644 index 00000000..aad9bb90 --- /dev/null +++ b/modules/system/hardware/printing/module.nix @@ -0,0 +1,48 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf recursiveUpdate; + + cfg = config.modules.hardware.printing; +in { + options.modules.hardware.printing = { + enable = mkEnableOption "printing module"; + share = mkEnableOption "printer sharing module"; + }; + + config = mkIf cfg.enable { + hardware.sane.enable = true; + services = + { + printing = { + enable = true; + drivers = with pkgs; [ + hplipWithPlugin + samsung-unified-linux-driver + epson-escpr + ]; + }; + avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + } + |> recursiveUpdate (mkIf cfg.share { + avahi.publish = { + enable = true; + userServices = true; + }; + printing = { + listenAddresses = ["*:631"]; + allowFrom = ["all"]; + browsing = true; + defaultShared = true; + openFirewall = true; + }; + }); + }; +} diff --git a/modules/system/locale/module.nix b/modules/system/locale/module.nix new file mode 100644 index 00000000..59c71fd8 --- /dev/null +++ b/modules/system/locale/module.nix @@ -0,0 +1,24 @@ +{ + config = { + i18n = { + supportedLocales = [ + "en_US.UTF-8/UTF-8" + "ru_RU.UTF-8/UTF-8" + "en_GB.UTF-8/UTF-8" + "ja_JP.UTF-8/UTF-8" + ]; + defaultLocale = "en_US.UTF-8"; + extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + }; + }; +} diff --git a/modules/system/networking/amnezia/module.nix b/modules/system/networking/amnezia/module.nix new file mode 100644 index 00000000..be781ac7 --- /dev/null +++ b/modules/system/networking/amnezia/module.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkIf mkEnableOption; + + cfg = config.modules.networking.amnezia; +in { + options.modules.networking.amnezia = { + enable = mkEnableOption "amvezia module"; + }; + + config = mkIf cfg.enable { + boot.extraModulePackages = with config.boot.kernelPackages; [ + amneziawg + ]; + + environment.systemPackages = with pkgs; [ + amneziawg-tools + ]; + + programs.amnezia-vpn.enable = true; + }; +} diff --git a/modules/system/networking/networkmanager/module.nix b/modules/system/networking/networkmanager/module.nix new file mode 100644 index 00000000..0e9b269f --- /dev/null +++ b/modules/system/networking/networkmanager/module.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + lib', + ... +}: let + inherit (lib) mkIf; + inherit (lib'.tags.stateful config) withoutTags; +in { + config = mkIf (withoutTags ["wsl" "avf"]) { + networking.networkmanager = { + enable = true; + dns = "systemd-resolved"; + }; + }; +} diff --git a/modules/system/nix/builders/lib.nix b/modules/system/nix/builders/lib.nix new file mode 100644 index 00000000..9f9e5a96 --- /dev/null +++ b/modules/system/nix/builders/lib.nix @@ -0,0 +1,42 @@ +{ + config, + builderTypes, + keys, + lib, + lib', + ... +}: let + inherit (builtins) filter; + inherit (lib) recursiveUpdate; + inherit (lib'.tags.stateful config) hasTags; + + isBuilder = hasTags ["builder"]; + + mkBuilder = { + builderType, + hostName, + ... + }: + recursiveUpdate builderTypes.${builderType} { + hostName = "${hostName}.${config.networking.domain}"; + }; + + mkBuildersConfig = { + distributedBuilds = + isBuilder + |> (pred: !pred); + + buildMachines = + config.modules.nix.builders.builders + |> map mkBuilder + |> filter (builder: builder.hostName != config.networking.hostName); + }; + + mkKnownBuilderHosts = + config.modules.nix.builders.builders + |> map ({hostName, ...}: + lib.nameValuePair "${hostName}.${config.networking.domain}" {publicKey = keys.hosts.${hostName};}) + |> builtins.listToAttrs; +in { + inherit isBuilder mkBuilder mkBuildersConfig mkKnownBuilderHosts; +} diff --git a/modules/system/nix/builders/module.nix b/modules/system/nix/builders/module.nix new file mode 100644 index 00000000..eb6cb1fe --- /dev/null +++ b/modules/system/nix/builders/module.nix @@ -0,0 +1,75 @@ +{ + config, + keys, + lib, + lib', + ... +}: let + inherit (builtins) attrNames; + inherit (lib) recursiveUpdate mkEnableOption mkOption types mkIf; + + buildersLib = import ./lib.nix { + inherit config builderTypes keys lib lib'; + }; + # TODO: finish builders + # inherit (buildersLib) isBuilder; + inherit (buildersLib.stateful config) mkBuildersConfig mkKnownBuilderHosts; + + builderTypes = rec { + regular = { + systems = ["x86_64-linux"]; + speedFactor = 4; + maxJobs = 4; + supportedFeatures = ["benchmark" "nixos-test"]; + protocol = "ssh-ng"; + sshUser = "builder"; + sshKey = "/etc/ssh/ssh_host_ed25519_key"; + }; + + big = recursiveUpdate regular { + systems = regular.systems ++ ["aarch64-linux" "i686-linux"]; + maxJobs = 16; + speedFactor = 16; + supportedFeatures = regular.supportedFeatures ++ ["kvm" "big-parallel"]; + }; + }; + + cfg = config.modules.nix.builders; +in { + options.modules.nix.builders = { + enable = mkEnableOption "remote buliders"; + + builders = mkOption { + type = types.listOf (types.submodule { + options = { + hostName = mkOption { + type = types.str; + }; + + builderType = mkOption { + type = types.nullOr (types.enum (attrNames builderTypes)); + }; + }; + }); + }; + }; + + imports = [ + (import ./user.nix builderTypes) + ]; + + config = mkIf cfg.enable { + nix = { + inherit (mkBuildersConfig config) distributedBuilds buildMachines; + + # TODO: complete konran and use it as a builder + # settings.max-jobs = + # if isBuilder + # then "auto" + # else 0; + settings.max-jobs = "auto"; + }; + + programs.ssh.knownHosts = mkKnownBuilderHosts config; + }; +} diff --git a/modules/system/nix/builders/user.nix b/modules/system/nix/builders/user.nix new file mode 100644 index 00000000..afd0742f --- /dev/null +++ b/modules/system/nix/builders/user.nix @@ -0,0 +1,29 @@ +builderTypes: { + config, + keys, + lib, + lib', + pkgs, + ... +}: let + inherit (lib) mkIf; + inherit (import ./lib.nix {inherit config builderTypes keys lib lib';}) isBuilder; + + sshOpts = ''command="nix-daemon --stdio",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding''; +in { + config = mkIf isBuilder { + users = { + groups.builder = {}; + users.builder = { + shell = pkgs.bash; + isSystemUser = true; + createHome = true; + group = "builder"; + home = "/var/empty"; + openssh.authorizedKeys.keys = + keys.publicKeys + |> map (key: ''${sshOpts} ${key}''); + }; + }; + }; +} diff --git a/modules/system/nix/caches.nix b/modules/system/nix/caches.nix new file mode 100755 index 00000000..c423cb11 --- /dev/null +++ b/modules/system/nix/caches.nix @@ -0,0 +1,23 @@ +{ + nix.settings = { + substituters = [ + "https://cache.nixos.org?priority=10" + + "https://niri.cachix.org" + "https://nix-community.cachix.org" + "https://wezterm.cachix.org" + "https://cache.garnix.io" + "https://helix.cachix.org" + ]; + + trusted-public-keys = [ + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + + "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "wezterm.cachix.org-1:kAbhjYUC9qvblTE+s7S+kl5XM1zVa4skO+E/1IDWdH0=" + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" + ]; + }; +} diff --git a/system/nix/documentation.nix b/modules/system/nix/documentation.nix similarity index 100% rename from system/nix/documentation.nix rename to modules/system/nix/documentation.nix diff --git a/system/nix/index.nix b/modules/system/nix/index.nix similarity index 100% rename from system/nix/index.nix rename to modules/system/nix/index.nix diff --git a/modules/system/nix/lib.nix b/modules/system/nix/lib.nix new file mode 100644 index 00000000..4151436d --- /dev/null +++ b/modules/system/nix/lib.nix @@ -0,0 +1,23 @@ +{lib, ...}: let + inherit (builtins) elem mapAttrs; + inherit (lib) filterAttrs mapAttrs' mapAttrsToList; + + registryPathsFor = config: names: + config.nix.registry + |> (filterAttrs (name: _: (elem name names))) + |> (mapAttrs' (name: value: { + name = "nix/path/${name}"; + value.source = value.flake; + })); + + mappedRegistryFrom = inputs: + inputs + |> (filterAttrs (_: lib.isType "flake")) + |> (mapAttrs (_: flake: {inherit flake;})) + |> (flakes: flakes // {nixpkgs.flake = inputs.nixpkgs;}) + |> (mappedRegistry: mappedRegistry // {default-flake = mappedRegistry.nixpkgs;}); + + mkNixPath = config: mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; +in { + inherit registryPathsFor mappedRegistryFrom mkNixPath; +} diff --git a/system/nix/default.nix b/modules/system/nix/module.nix old mode 100755 new mode 100644 similarity index 58% rename from system/nix/default.nix rename to modules/system/nix/module.nix index e7318770..0434951e --- a/system/nix/default.nix +++ b/modules/system/nix/module.nix @@ -4,10 +4,13 @@ lib, pkgs, ... -}: { +}: let + inherit (builtins) toJSON; + inherit (import ./lib.nix {inherit lib;}) registryPathsFor mappedRegistryFrom mkNixPath; +in { imports = [ - ./documentation.nix ./caches.nix + ./documentation.nix ./index.nix ./nh.nix ./nixpkgs.nix @@ -21,26 +24,12 @@ }) ]; - environment.etc = let - commonPaths = ["home-manager" "nixpkgs"]; - in - config.nix.registry - |> (lib.filterAttrs (name: _: (builtins.elem name commonPaths))) - |> (lib.mapAttrs' (name: value: { - name = "nix/path/${name}"; - value.source = value.flake; - })); - - nix = let - mappedRegistry = - inputs - |> (lib.filterAttrs (_: lib.isType "flake")) - |> (lib.mapAttrs (_: flake: {inherit flake;})) - |> (flakes: flakes // {nixpkgs.flake = inputs.nixpkgs;}); - in { - registry = mappedRegistry // {default-flake = mappedRegistry.nixpkgs;}; - - nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry; + environment.etc = registryPathsFor config ["home-manager" "nixpkgs"]; + + nix = { + registry = mappedRegistryFrom inputs; + + nixPath = mkNixPath config; package = pkgs.lixPackageSets.stable.lix; @@ -48,11 +37,16 @@ daemonIOSchedClass = "idle"; daemonIOSchedPriority = 7; + optimise = { + automatic = true; + dates = ["04:00"]; + }; + settings = { use-xdg-base-directories = true; use-registries = true; - flake-registry = pkgs.writeText "flakes-empty.json" (builtins.toJSON { + flake-registry = pkgs.writeText "flakes-empty.json" (toJSON { flakes = []; version = 2; }); @@ -72,20 +66,23 @@ keep-derivations = true; keep-outputs = true; - trusted-users = [ - "root" - "@wheel" - ]; + allowed-users = ["root" "@wheel" "builder"]; - max-jobs = "auto"; + trusted-users = ["root" "@wheel" "builder"]; sandbox = true; sandbox-fallback = false; system-features = ["nixos-test" "kvm" "recursive-nix" "big-parallel"]; + extra-platforms = config.boot.binfmt.emulatedSystems; + keep-going = true; + connect-timeout = 5; + + stalled-download-timeout = 20; + log-lines = 30; pure-eval = false; @@ -97,8 +94,4 @@ use-cgroups = pkgs.stdenv.isLinux; }; }; - - systemd.services.nix-gc = { - unitConfig.ConditionACPower = true; - }; } diff --git a/system/nix/nh.nix b/modules/system/nix/nh.nix similarity index 82% rename from system/nix/nh.nix rename to modules/system/nix/nh.nix index 30b9bb45..b07c49bf 100755 --- a/system/nix/nh.nix +++ b/modules/system/nix/nh.nix @@ -4,6 +4,7 @@ flake = "/etc/nixos"; clean = { enable = true; + dates = "Sat *-*-* 03:00"; extraArgs = "--keep-since 4d --keep 3"; }; }; diff --git a/system/nix/nixpkgs.nix b/modules/system/nix/nixpkgs.nix similarity index 100% rename from system/nix/nixpkgs.nix rename to modules/system/nix/nixpkgs.nix diff --git a/modules/system/programs/development/module.nix b/modules/system/programs/development/module.nix new file mode 100644 index 00000000..1af6b290 --- /dev/null +++ b/modules/system/programs/development/module.nix @@ -0,0 +1,41 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.programs.development; +in { + options.modules.programs.development = { + enable = mkEnableOption "development programs module"; + }; + + config = mkIf cfg.enable { + programs = { + java = { + enable = true; + package = pkgs.zulu21; + }; + direnv = { + enable = true; + silent = true; + nix-direnv.enable = true; + settings = { + global = { + load_dotenv = true; + }; + }; + }; + }; + + environment = { + systemPackages = with pkgs; [ + python313 + ]; + + variables.JAVA_HOME = "${pkgs.zulu21}/"; + }; + }; +} diff --git a/modules/system/programs/fish/module.nix b/modules/system/programs/fish/module.nix new file mode 100644 index 00000000..e8659121 --- /dev/null +++ b/modules/system/programs/fish/module.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.programs.fish; +in { + options.modules.programs.fish = { + enable = mkEnableOption "fish shell"; + }; + + config = mkIf cfg.enable { + programs.fish.enable = true; + + environment.pathsToLink = ["/share/fish"]; + }; +} diff --git a/modules/system/programs/gaming/module.nix b/modules/system/programs/gaming/module.nix new file mode 100644 index 00000000..381892b9 --- /dev/null +++ b/modules/system/programs/gaming/module.nix @@ -0,0 +1,66 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.programs.gaming; +in { + options.modules.programs.gaming = { + enable = mkEnableOption "gaming programs module"; + }; + + config = mkIf cfg.enable { + programs = { + gamemode = { + enable = true; + settings = { + general = { + renice = 10; + }; + gpu = { + apply_gpu_optimisations = "accept-responsibility"; + gpu_device = 0; + amd_performance_level = "high"; + }; + custom = { + start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'"; + end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'"; + }; + }; + }; + gamescope = { + enable = true; + args = [ + "--rt" + "--prefer-vk-device 8086:9bc4" + ]; + }; + + steam = { + enable = true; + package = pkgs.steam.override { + extraPkgs = p: + with p; [ + SDL2 + openal + libglvnd + gtk3 + mono + ]; + }; + protontricks.enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; + }; + + environment.systemPackages = with pkgs; [ + libGL + glfw3-minecraft + ]; + }; +} diff --git a/modules/system/programs/home-manager/module.nix b/modules/system/programs/home-manager/module.nix new file mode 100644 index 00000000..3f644e56 --- /dev/null +++ b/modules/system/programs/home-manager/module.nix @@ -0,0 +1,11 @@ +{inputs, ...}: { + imports = [inputs.hm.nixosModules.default]; + + config = { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + }; + }; +} diff --git a/modules/system/programs/module.nix b/modules/system/programs/module.nix new file mode 100644 index 00000000..54dfba45 --- /dev/null +++ b/modules/system/programs/module.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.programs'; +in { + options.modules.programs' = { + enable = mkEnableOption "programs' module"; + }; + + config = mkIf cfg.enable { + programs = { + dconf.enable = true; + kdeconnect.enable = true; + seahorse.enable = true; + nix-ld.enable = true; + gdk-pixbuf.modulePackages = [pkgs.librsvg]; + }; + + modules.programs = { + development.enable = true; + gaming.enable = true; + qt.enable = true; + xdg.enable = true; + }; + + environment.systemPackages = with pkgs; [ + ffmpeg-full + ]; + }; +} diff --git a/modules/system/programs/niri/module.nix b/modules/system/programs/niri/module.nix new file mode 100644 index 00000000..3f578554 --- /dev/null +++ b/modules/system/programs/niri/module.nix @@ -0,0 +1,27 @@ +{ + config, + inputs, + lib, + options, + pkgs, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.programs.niri; +in { + imports = [inputs.niri-flake.nixosModules.niri]; + + options.modules.programs.niri = { + enable = options.programs.niri.enable; + }; + + config = mkIf cfg.enable { + programs.niri = { + enable = true; + package = inputs.niri-flake.packages.${pkgs.stdenv.hostPlatform.system}.niri-unstable; + }; + + xdg.portal.config.niri.default = ["gtk" "gnome"]; + }; +} diff --git a/modules/system/programs/obs-studio/module.nix b/modules/system/programs/obs-studio/module.nix new file mode 100644 index 00000000..0c894ae7 --- /dev/null +++ b/modules/system/programs/obs-studio/module.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + options, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.programs.obs-studio; +in { + options.modules.programs.obs-studio = { + enable = options.programs.obs-studio.enable; + }; + + config = mkIf cfg.enable { + programs.obs-studio = { + enable = true; + enableVirtualCamera = true; + }; + }; +} diff --git a/modules/system/programs/qt/module.nix b/modules/system/programs/qt/module.nix new file mode 100644 index 00000000..c40e85e5 --- /dev/null +++ b/modules/system/programs/qt/module.nix @@ -0,0 +1,22 @@ +{ + config, + lib, + options, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.programs.qt; +in { + options.modules.programs.qt = { + enable = options.qt.enable; + }; + + config = mkIf cfg.enable { + qt = { + enable = true; + platformTheme = "gtk2"; + style = "gtk2"; + }; + }; +} diff --git a/modules/system/programs/starship/module.nix b/modules/system/programs/starship/module.nix new file mode 100644 index 00000000..c8ff8da1 --- /dev/null +++ b/modules/system/programs/starship/module.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.programs.starship; +in { + options.modules.programs.starship = { + enable = mkEnableOption "starship"; + }; + + config = mkIf cfg.enable { + programs.starship.enable = true; + }; +} diff --git a/modules/system/programs/xdg/module.nix b/modules/system/programs/xdg/module.nix new file mode 100644 index 00000000..93e1993d --- /dev/null +++ b/modules/system/programs/xdg/module.nix @@ -0,0 +1,31 @@ +{ + config, + lib, + options, + pkgs, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.programs.xdg; +in { + options.modules.programs.xdg = { + enable = options.xdg.portal.enable; + }; + + config = mkIf cfg.enable { + xdg.portal = { + enable = true; + wlr.enable = true; + xdgOpenUsePortal = true; + + config.common.default = ["gtk"]; + + extraPortals = with pkgs; [ + # xdg-desktop-portal-wlr + xdg-desktop-portal-gtk + # xdg-desktop-portal-gnome + ]; + }; + }; +} diff --git a/modules/system/secrets/agenix/lib.nix b/modules/system/secrets/agenix/lib.nix new file mode 100644 index 00000000..07665428 --- /dev/null +++ b/modules/system/secrets/agenix/lib.nix @@ -0,0 +1,40 @@ +{ + flakeRoot, + keys, + lib, + ... +}: let + inherit (builtins) mapAttrs elem attrNames split filter isString concatStringsSep listToAttrs; + inherit (lib) filterAttrs dropEnd nameValuePair reverseList; + + secretsPath = "${flakeRoot}/secrets"; + + mkSecrets = config: + import "${secretsPath}/secrets.nix" + |> mapAttrs (_: {publicKeys, ...}: publicKeys) + |> filterAttrs (_: elem keys.hosts.${config.networking.hostName}) + |> attrNames + |> map ( + secret: + secret + |> split "\\." + |> filter isString + |> dropEnd 1 + ) + |> map ( + parts: + nameValuePair ( + parts + |> reverseList + |> concatStringsSep "-" + ) { + file = + parts + |> concatStringsSep "." + |> (secret: "${secretsPath}/${secret}.age"); + } + ) + |> listToAttrs; +in { + inherit mkSecrets; +} diff --git a/modules/system/secrets/agenix/module.nix b/modules/system/secrets/agenix/module.nix new file mode 100644 index 00000000..7082718a --- /dev/null +++ b/modules/system/secrets/agenix/module.nix @@ -0,0 +1,24 @@ +{ + config, + flakeRoot, + inputs, + keys, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + inherit (import ./lib.nix {inherit flakeRoot keys lib;}) mkSecrets; + + cfg = config.modules.secrets.agenix; +in { + options.modules.secrets.agenix = { + enable = mkEnableOption "agenix"; + }; + + imports = [inputs.agenix.nixosModules.default]; + + config = mkIf cfg.enable { + age.secrets = mkSecrets config; + }; +} diff --git a/system/core/security.nix b/modules/system/security/module.nix old mode 100755 new mode 100644 similarity index 100% rename from system/core/security.nix rename to modules/system/security/module.nix diff --git a/modules/system/services/gnome-services/module.nix b/modules/system/services/gnome-services/module.nix new file mode 100644 index 00000000..629dd96f --- /dev/null +++ b/modules/system/services/gnome-services/module.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.services.gnome-services; +in { + options.modules.services.gnome-services = { + enable = mkEnableOption "gnome services module"; + }; + + config = mkIf cfg.enable { + services = { + dbus.packages = with pkgs; [ + gcr + gnome-settings-daemon + ]; + + gnome.gnome-keyring.enable = true; + + gvfs.enable = true; + }; + }; +} diff --git a/system/services/kanata/main.kbd b/modules/system/services/kanata/main.kbd similarity index 100% rename from system/services/kanata/main.kbd rename to modules/system/services/kanata/main.kbd diff --git a/modules/system/services/kanata/module.nix b/modules/system/services/kanata/module.nix new file mode 100644 index 00000000..c8d79a76 --- /dev/null +++ b/modules/system/services/kanata/module.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + options, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.services.kanata; +in { + options.modules.services.kanata = { + enable = options.services.kanata.enable; + }; + + config = mkIf cfg.enable { + services.kanata = { + enable = true; + + keyboards.default = { + extraDefCfg = '' + process-unmapped-keys yes + ''; + config = builtins.readFile (./. + "/main.kbd"); + }; + }; + }; +} diff --git a/modules/system/services/location/module.nix b/modules/system/services/location/module.nix new file mode 100644 index 00000000..891c93de --- /dev/null +++ b/modules/system/services/location/module.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.services.location; +in { + options.modules.services.location = { + enable = mkEnableOption "location services module"; + }; + + config = mkIf cfg.enable { + location.provider = "geoclue2"; + + services.geoclue2.enable = true; + }; +} diff --git a/modules/system/services/module.nix b/modules/system/services/module.nix new file mode 100644 index 00000000..c0e3e500 --- /dev/null +++ b/modules/system/services/module.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.services; +in { + options.modules.services = { + enable = mkEnableOption "services module"; + }; + + config = mkIf cfg.enable { + services = { + dbus.implementation = "broker"; + + psd = { + enable = true; + resyncTimer = "10m"; + }; + }; + }; +} diff --git a/modules/system/services/ollama/module.nix b/modules/system/services/ollama/module.nix new file mode 100644 index 00000000..22f2009b --- /dev/null +++ b/modules/system/services/ollama/module.nix @@ -0,0 +1,20 @@ +{ + config, + lib, + options, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.services.ollama; +in { + options.modules.services.ollama = { + enable = options.services.ollama.enable; + }; + + config = mkIf cfg.enable { + services.ollama = { + enable = true; + }; + }; +} diff --git a/modules/system/services/openssh/module.nix b/modules/system/services/openssh/module.nix new file mode 100644 index 00000000..90579e85 --- /dev/null +++ b/modules/system/services/openssh/module.nix @@ -0,0 +1,8 @@ +{...}: { + config = { + services.openssh = { + enable = true; + settings.PasswordAuthentication = true; + }; + }; +} diff --git a/modules/system/services/pipewire/module.nix b/modules/system/services/pipewire/module.nix new file mode 100644 index 00000000..4019aa3b --- /dev/null +++ b/modules/system/services/pipewire/module.nix @@ -0,0 +1,28 @@ +{ + config, + lib, + options, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.services.pipewire; +in { + options.modules.services.pipewire = { + enable = options.services.pipewire.enable; + }; + + config = mkIf cfg.enable { + services.pipewire = { + enable = true; + alsa = { + enable = true; + support32Bit = true; + }; + jack.enable = true; + pulse.enable = true; + }; + + services.pulseaudio.enable = lib.mkForce false; + }; +} diff --git a/modules/system/services/power/module.nix b/modules/system/services/power/module.nix new file mode 100644 index 00000000..672291b3 --- /dev/null +++ b/modules/system/services/power/module.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.services.power; +in { + options.modules.services.power = { + enable = mkEnableOption "power services module"; + }; + + config = mkIf cfg.enable { + services = { + logind.settings.Login.HandlePowerKey = "suspend"; + + power-profiles-daemon.enable = true; + + # battery info + upower.enable = true; + + # fix pipewire #2669 and #4115 + pipewire.wireplumber.extraConfig."wireplumber.profiles".main."monitor.libcamera" = "disabled"; + + thermald.enable = true; + }; + }; +} diff --git a/modules/system/services/resolved/module.nix b/modules/system/services/resolved/module.nix new file mode 100644 index 00000000..ab5f0379 --- /dev/null +++ b/modules/system/services/resolved/module.nix @@ -0,0 +1,5 @@ +{...}: { + config = { + services.resolved.enable = true; + }; +} diff --git a/modules/system/services/sddm/module.nix b/modules/system/services/sddm/module.nix new file mode 100644 index 00000000..2b36846e --- /dev/null +++ b/modules/system/services/sddm/module.nix @@ -0,0 +1,31 @@ +{ + config, + inputs, + lib, + options, + pkgs, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.services.sddm; +in { + options.modules.services.sddm = { + enable = options.services.displayManager.sddm.enable; + }; + + config = mkIf cfg.enable { + services.displayManager.sddm = { + enable = true; + package = lib.mkForce pkgs.kdePackages.sddm; + wayland.enable = true; + }; + + catppuccin.sddm = { + font = "Jetbrains Mono Nerd Font"; + fontSize = "10"; + background = "${inputs.assets}/wallpapers/night_forest.png"; + loginBackground = false; + }; + }; +} diff --git a/modules/system/services/xserver/xkb/layouts.nix b/modules/system/services/xserver/xkb/layouts.nix new file mode 100644 index 00000000..51261ab7 --- /dev/null +++ b/modules/system/services/xserver/xkb/layouts.nix @@ -0,0 +1,35 @@ +cfg: { + lib, + pkgs, + ... +}: let + inherit (lib) mkIf; +in { + config = mkIf cfg.enable { + services.xserver.xkb.extraLayouts = let + inherit (builtins) readDir attrNames readFile mapAttrs attrValues concatLists listToAttrs; + inherit (lib) filterAttrs nameValuePair; + + listLangSymbols = lang: _: + "${./symbols}/${lang}" + |> readDir + |> filterAttrs (_: type: type == "regular") + |> attrNames; + + mkLanfgLayouts = lang: + map (symbolsFileName: + nameValuePair symbolsFileName { + languages = [lang]; + description = "${symbolsFileName} (${lang})"; + symbolsFile = readFile "${./symbols}/${lang}/${symbolsFileName}" |> pkgs.writeText "xkb-layout-${symbolsFileName}"; + }); + in + readDir ./symbols + |> filterAttrs (_: type: type == "directory") + |> mapAttrs listLangSymbols + |> mapAttrs mkLanfgLayouts + |> attrValues + |> concatLists + |> listToAttrs; + }; +} diff --git a/modules/system/services/xserver/xkb/module.nix b/modules/system/services/xserver/xkb/module.nix new file mode 100644 index 00000000..af48224f --- /dev/null +++ b/modules/system/services/xserver/xkb/module.nix @@ -0,0 +1,59 @@ +{ + config, + lib, + lib', + ... +}: let + inherit (builtins) attrValues concatStringsSep; + inherit (lib) mkIf mkEnableOption mkOption types; + + cfg = config.modules.services.xserver.xkb; +in { + imports = [ + (import ./layouts.nix cfg) + ]; + + options.modules.services.xserver.xkb = let + inherit (lib'.options) overrideDefaultWith; + in { + enable = mkEnableOption "xkb module" |> overrideDefaultWith true; + + layouts = mkOption { + type = types.attrsOf types.str; + default = { + en = "rdvp"; + ru = "ru"; + }; + }; + + options = mkOption { + type = types.listOf types.str; + default = [ + "grp:win_space_toggle" + "compose:ralt" + ]; + }; + }; + + config = mkIf cfg.enable { + console.useXkbConfig = true; + + services.xserver.xkb = { + layout = + cfg.layouts + |> attrValues + |> concatStringsSep ", "; + + options = + cfg.options + |> concatStringsSep ", "; + }; + + environment.variables = let + inherit (config.services.xserver.xkb) layout variant; + in { + XKB_DEFAULT_LAYOUT = layout; + XKB_DEFAULT_VARIANT = variant; + }; + }; +} diff --git a/system/core/xkb/symbols/eng/rdvp b/modules/system/services/xserver/xkb/symbols/eng/rdvp similarity index 100% rename from system/core/xkb/symbols/eng/rdvp rename to modules/system/services/xserver/xkb/symbols/eng/rdvp diff --git a/modules/system/time/module.nix b/modules/system/time/module.nix new file mode 100644 index 00000000..ef388c7c --- /dev/null +++ b/modules/system/time/module.nix @@ -0,0 +1,5 @@ +{lib, ...}: { + config = { + time.timeZone = lib.mkDefault "Europe/Moscow"; + }; +} diff --git a/modules/system/users/lib.nix b/modules/system/users/lib.nix new file mode 100644 index 00000000..dd4a4491 --- /dev/null +++ b/modules/system/users/lib.nix @@ -0,0 +1,26 @@ +{ + keys, + lib, + ... +}: let + inherit (lib) recursiveUpdate; + + mkUsers = configOverrides: + keys.users + |> lib.filterAttrs (_: value: builtins.isAttrs value) + |> builtins.mapAttrs ( + _username: {publicKeys ? [], ...}: { + isNormalUser = true; + extraGroups = [ + "input" + "networkmanager" + "video" + "wheel" + ]; + openssh.authorizedKeys.keys = publicKeys; + } + ) + |> recursiveUpdate configOverrides; +in { + inherit mkUsers; +} diff --git a/modules/system/users/module.nix b/modules/system/users/module.nix new file mode 100755 index 00000000..f716215c --- /dev/null +++ b/modules/system/users/module.nix @@ -0,0 +1,24 @@ +{ + keys, + lib, + pkgs, + ... +}: let + inherit (import ./lib.nix {inherit keys lib;}) mkUsers; +in { + config = { + users = { + mutableUsers = false; + allowNoPasswordLogin = false; + enforceIdUniqueness = true; + + users = mkUsers { + niksne = { + initialHashedPassword = "$y$j9T$l4DeIv1F4IavM4cZ662Um1$TLzF2xx.thPu5otqumFf9vpMZKX87.uEol5O0wqHWk5"; + shell = pkgs.fish; + }; + root.hashedPassword = "*"; + }; + }; + }; +} diff --git a/modules/system/virtualisation/bottles/module.nix b/modules/system/virtualisation/bottles/module.nix new file mode 100644 index 00000000..fea204b2 --- /dev/null +++ b/modules/system/virtualisation/bottles/module.nix @@ -0,0 +1,18 @@ +{ + config, + pkgs, + lib, + ... +}: let + inherit (lib) mkEnableOption mkIf; + + cfg = config.modules.virtualisation.bottles; +in { + options.modules.virtualisation.bottles = { + enable = mkEnableOption "bottles module"; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [bottles]; + }; +} diff --git a/modules/system/virtualisation/libvirtd/module.nix b/modules/system/virtualisation/libvirtd/module.nix new file mode 100644 index 00000000..0faea380 --- /dev/null +++ b/modules/system/virtualisation/libvirtd/module.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + options, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.virtualisation.libvirtd; +in { + options.modules.virtualisation.libvirtd = { + enable = options.virtualisation.libvirtd.enable; + }; + + config = mkIf cfg.enable { + virtualisation.libvirtd.enable = true; + programs.virt-manager.enable = true; + }; +} diff --git a/modules/system/virtualisation/podman/module.nix b/modules/system/virtualisation/podman/module.nix new file mode 100644 index 00000000..f60b99a7 --- /dev/null +++ b/modules/system/virtualisation/podman/module.nix @@ -0,0 +1,29 @@ +{ + config, + lib, + options, + pkgs, + ... +}: let + inherit (lib) mkIf; + + cfg = config.modules.virtualisation.podman; +in { + options.modules.virtualisation.podman = { + enable = options.virtualisation.podman.enable; + }; + + config = mkIf cfg.enable { + virtualisation.podman = { + enable = true; + autoPrune.enable = true; + dockerCompat = true; + dockerSocket.enable = true; + }; + + environment.systemPackages = with pkgs; [ + podman-compose + podman-desktop + ]; + }; +} diff --git a/secrets/secrets.nix b/secrets/secrets.nix new file mode 100644 index 00000000..8bccfc81 --- /dev/null +++ b/secrets/secrets.nix @@ -0,0 +1,6 @@ +# let +# secrets = {inherit (import ../lib/helpers/secrets.nix) mkEnv;};;s +# inherit (import ../keys.nix) hosts users; +# in +{ +} diff --git a/system/core/boot.nix b/system/core/boot.nix deleted file mode 100755 index e6d3ec19..00000000 --- a/system/core/boot.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - inputs, - lib, - pkgs, - ... -}: let - niksos-logo = "${inputs.assets}/niksos/niksos100.png"; -in { - boot = { - initrd = { - systemd.enable = true; - supportedFilesystems = ["fat32" "ext4" "btrfs" "ntfs"]; - }; - - kernelPackages = pkgs.linuxPackages_latest; - consoleLogLevel = 3; - kernelParams = [ - # "quiet" - "systemd.show_status=auto" - "rd.udev.log_level=3" - ]; - - loader = { - grub = { - enable = true; - useOSProber = true; - extraFiles."theme/logo.png" = lib.mkForce niksos-logo; - configurationLimit = 25; - }; - timeout = 3; - }; - - plymouth = { - enable = true; - logo = niksos-logo; - }; - }; -} diff --git a/system/core/default.nix b/system/core/default.nix deleted file mode 100755 index e45c3b91..00000000 --- a/system/core/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{lib, ...}: { - imports = [ - ./xkb - ./boot.nix - ./security.nix - ]; - - i18n = { - supportedLocales = [ - "en_US.UTF-8/UTF-8" - "ru_RU.UTF-8/UTF-8" - "en_GB.UTF-8/UTF-8" - "ja_JP.UTF-8/UTF-8" - ]; - defaultLocale = "en_US.UTF-8"; - extraLocaleSettings = { - LC_ADDRESS = "en_GB.UTF-8"; - LC_IDENTIFICATION = "en_GB.UTF-8"; - LC_MEASUREMENT = "en_GB.UTF-8"; - LC_MONETARY = "en_GB.UTF-8"; - LC_NAME = "en_GB.UTF-8"; - LC_NUMERIC = "en_GB.UTF-8"; - LC_PAPER = "en_GB.UTF-8"; - LC_TELEPHONE = "en_GB.UTF-8"; - LC_TIME = "en_GB.UTF-8"; - }; - }; - - # don't touch this - system.stateVersion = lib.mkDefault "24.11"; - - time.timeZone = lib.mkDefault "Europe/Moscow"; -} diff --git a/system/core/users.nix b/system/core/users.nix deleted file mode 100755 index 7eccc0cd..00000000 --- a/system/core/users.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - users.users = { - niksne = { - isNormalUser = true; - initialHashedPassword = "$y$j9T$l4DeIv1F4IavM4cZ662Um1$TLzF2xx.thPu5otqumFf9vpMZKX87.uEol5O0wqHWk5"; - description = "NikSne"; - shell = pkgs.fish; - extraGroups = [ - "input" - "networkmanager" - "video" - "wheel" - ]; - }; - }; -} diff --git a/system/core/xkb/default.nix b/system/core/xkb/default.nix deleted file mode 100644 index d417394d..00000000 --- a/system/core/xkb/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{config, ...}: { - imports = [ - ./layouts.nix - ]; - - console.useXkbConfig = true; - - services.xserver.xkb = { - layout = "rdvp, ru"; - options = "grp:win_space_toggle, compose:ralt"; - }; - - environment.variables = { - XKB_DEFAULT_LAYOUT = config.services.xserver.xkb.layout; - XKB_DEFAULT_VARIANT = config.services.xserver.xkb.variant; - }; -} diff --git a/system/core/xkb/layouts.nix b/system/core/xkb/layouts.nix deleted file mode 100644 index 4699e5f0..00000000 --- a/system/core/xkb/layouts.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - lib, - pkgs, - ... -}: { - services.xserver.xkb.extraLayouts = let - inherit (builtins) readDir attrNames readFile mapAttrs attrValues concatLists listToAttrs; - inherit (lib) filterAttrs nameValuePair; - - listLangSymbols = lang: _: - "${./symbols}/${lang}" - |> readDir - |> filterAttrs (_: type: type == "regular") - |> attrNames; - - mkLanfgLayouts = lang: - map (symbolsFileName: - nameValuePair symbolsFileName { - languages = [lang]; - description = "${symbolsFileName} (${lang})"; - symbolsFile = readFile "${./symbols}/${lang}/${symbolsFileName}" |> pkgs.writeText "xkb-layout-${symbolsFileName}"; - }); - in - readDir ./symbols - |> filterAttrs (_: type: type == "directory") - |> mapAttrs listLangSymbols - |> mapAttrs mkLanfgLayouts - |> attrValues - |> concatLists - |> listToAttrs; -} diff --git a/system/default.nix b/system/default.nix deleted file mode 100755 index 55936efd..00000000 --- a/system/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -let - minimal = [ - ./core/users.nix - ./nix - ./programs/fish.nix - ./programs/home-manager.nix - ]; - - desktop = - minimal - ++ [ - ./core - ./hardware - ./network - ./programs - ./services - ./virtualisation - ]; - - laptop = - desktop - ++ [ - ./hardware/bluetooth.nix - ./services/power.nix - ]; -in { - inherit minimal desktop laptop; -} diff --git a/system/hardware/amd.nix b/system/hardware/amd.nix deleted file mode 100755 index a4cd7732..00000000 --- a/system/hardware/amd.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - boot.initrd.kernelModules = ["amdgpu"]; - services.xserver.videoDrivers = ["amdgpu"]; -} diff --git a/system/hardware/bluetooth.nix b/system/hardware/bluetooth.nix deleted file mode 100755 index f42f4f4e..00000000 --- a/system/hardware/bluetooth.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - services.blueman.enable = true; -} diff --git a/system/hardware/default.nix b/system/hardware/default.nix deleted file mode 100755 index 02e6dde3..00000000 --- a/system/hardware/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - imports = [ - ./graphics.nix - ./printing.nix - ]; -} diff --git a/system/hardware/graphics.nix b/system/hardware/graphics.nix deleted file mode 100755 index 91a95129..00000000 --- a/system/hardware/graphics.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...}: { - hardware.graphics = { - enable = true; - enable32Bit = true; - - extraPackages = with pkgs; [ - libva - libva-vdpau-driver - libvdpau-va-gl - ]; - extraPackages32 = with pkgs.pkgsi686Linux; [ - libva-vdpau-driver - libvdpau-va-gl - ]; - }; -} diff --git a/system/hardware/intel.nix b/system/hardware/intel.nix deleted file mode 100644 index 1ae7e347..00000000 --- a/system/hardware/intel.nix +++ /dev/null @@ -1,3 +0,0 @@ -{pkgs, ...}: { - hardware.graphics.extraPackages = with pkgs; [vaapiIntel intel-media-driver]; -} diff --git a/system/hardware/nvidia-prime.nix b/system/hardware/nvidia-prime.nix deleted file mode 100644 index 10d03862..00000000 --- a/system/hardware/nvidia-prime.nix +++ /dev/null @@ -1,7 +0,0 @@ -{inputs, ...}: { - imports = [ - "${inputs.nixos-hardware}/common/gpu/nvidia/prime.nix" - ]; - - hardware.nvidia.primeBatterySaverSpecialisation = true; -} diff --git a/system/hardware/nvidia.nix b/system/hardware/nvidia.nix deleted file mode 100755 index 4ef3a700..00000000 --- a/system/hardware/nvidia.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - config, - # pkgs, - ... -}: { - services.xserver.videoDrivers = ["nvidia"]; - hardware.nvidia = { - modesetting.enable = true; - powerManagement = { - enable = false; - finegrained = false; - }; - open = false; - nvidiaSettings = true; - package = config.boot.kernelPackages.nvidiaPackages.beta; - # - # If you want specifix version: - # package = let - # version = "560.35.03"; - # in (config.boot.kernelPackages.nvidiaPackages.stable.overrideAttrs { - # src = pkgs.fetchurl { - # url = "https://download.nvidia.com/XFree86/Linux-x86_64/${version}/NVIDIA-Linux-x86_64-${version}.run"; - # sha256 = "${pkgs.lib.fakeSha256}"; - # }; - # }); - }; -} diff --git a/system/hardware/printing.nix b/system/hardware/printing.nix deleted file mode 100755 index cfabbe80..00000000 --- a/system/hardware/printing.nix +++ /dev/null @@ -1,18 +0,0 @@ -{pkgs, ...}: { - hardware.sane.enable = true; - services = { - printing = { - enable = true; - drivers = with pkgs; [ - hplipWithPlugin - samsung-unified-linux-driver - epson-escpr - ]; - }; - avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; - }; -} diff --git a/system/hardware/razer.nix b/system/hardware/razer.nix deleted file mode 100755 index a41b5670..00000000 --- a/system/hardware/razer.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - hardware.openrazer.enable = true; -} diff --git a/system/network/amnezia.nix b/system/network/amnezia.nix deleted file mode 100755 index 151ec3a8..00000000 --- a/system/network/amnezia.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - config, - pkgs, - ... -}: { - boot.extraModulePackages = with config.boot.kernelPackages; [ - amneziawg - ]; - - environment.systemPackages = with pkgs; [ - amneziawg-tools - ]; - - programs.amnezia-vpn.enable = true; -} diff --git a/system/network/default.nix b/system/network/default.nix deleted file mode 100755 index dd7e2759..00000000 --- a/system/network/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - imports = [ - ./amnezia.nix - ]; - - networking.networkmanager = { - enable = true; - dns = "systemd-resolved"; - }; - - services = { - openssh = { - enable = true; - settings.PasswordAuthentication = true; - }; - - resolved.enable = true; - }; -} diff --git a/system/nix/caches.nix b/system/nix/caches.nix deleted file mode 100755 index ed03062a..00000000 --- a/system/nix/caches.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - niksos.caches = { - "cache.nixos.org?priority=10" = "-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="; - - "niri.cachix.org" = "-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="; - "nix-community.cachix.org" = "-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="; - "wezterm.cachix.org" = "-1:kAbhjYUC9qvblTE+s7S+kl5XM1zVa4skO+E/1IDWdH0="; - "cache.garnix.io" = ":CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="; - "helix.cachix.org" = "-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs="; - }; -} diff --git a/system/programs/default.nix b/system/programs/default.nix deleted file mode 100755 index d2a86f9c..00000000 --- a/system/programs/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./development.nix - ./fonts.nix - ./gaming.nix - ./qt.nix - ./xdg.nix - ]; - - programs = { - dconf.enable = true; - - kdeconnect.enable = true; - - seahorse.enable = true; - - nix-ld.enable = true; - - gdk-pixbuf.modulePackages = [pkgs.librsvg]; - }; - - environment.systemPackages = with pkgs; [ - ffmpeg-full - ]; -} diff --git a/system/programs/development.nix b/system/programs/development.nix deleted file mode 100755 index 051707c0..00000000 --- a/system/programs/development.nix +++ /dev/null @@ -1,26 +0,0 @@ -{pkgs, ...}: { - programs = { - java = { - enable = true; - package = pkgs.zulu21; - }; - direnv = { - enable = true; - silent = true; - nix-direnv.enable = true; - settings = { - global = { - load_dotenv = true; - }; - }; - }; - }; - - environment = { - systemPackages = with pkgs; [ - python313 - ]; - - variables.JAVA_HOME = "${pkgs.zulu21}/"; - }; -} diff --git a/system/programs/fish.nix b/system/programs/fish.nix deleted file mode 100755 index 3931394d..00000000 --- a/system/programs/fish.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, ...}: { - environment.pathsToLink = ["/share/fish"]; - - programs = { - less.enable = true; - - fish.enable = true; - }; - users.defaultUserShell = pkgs.fish; -} diff --git a/system/programs/fonts.nix b/system/programs/fonts.nix deleted file mode 100755 index 889d818f..00000000 --- a/system/programs/fonts.nix +++ /dev/null @@ -1,21 +0,0 @@ -{pkgs, ...}: { - fonts = { - packages = with pkgs; [ - corefonts - noto-fonts - noto-fonts-cjk-sans - noto-fonts-color-emoji - nerd-fonts.jetbrains-mono - nerd-fonts.noto - ]; - - enableDefaultPackages = false; - - fontconfig.defaultFonts = { - serif = ["Noto Serif"]; - sansSerif = ["Noto Sans"]; - monospace = ["JetBrainsMono Nerd Font Mono"]; - emoji = []; - }; - }; -} diff --git a/system/programs/gaming.nix b/system/programs/gaming.nix deleted file mode 100755 index 3bd916a7..00000000 --- a/system/programs/gaming.nix +++ /dev/null @@ -1,51 +0,0 @@ -{pkgs, ...}: { - programs = { - gamemode = { - enable = true; - settings = { - general = { - renice = 10; - }; - gpu = { - apply_gpu_optimisations = "accept-responsibility"; - gpu_device = 0; - amd_performance_level = "high"; - }; - custom = { - start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'"; - end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'"; - }; - }; - }; - gamescope = { - enable = true; - args = [ - "--rt" - "--prefer-vk-device 8086:9bc4" - ]; - }; - - steam = { - enable = true; - package = pkgs.steam.override { - extraPkgs = p: - with p; [ - SDL2 - openal - libglvnd - gtk3 - mono - ]; - }; - protontricks.enable = true; - remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play - dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server - localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers - }; - }; - - environment.systemPackages = with pkgs; [ - libGL - glfw3-minecraft - ]; -} diff --git a/system/programs/home-manager.nix b/system/programs/home-manager.nix deleted file mode 100755 index 0016b002..00000000 --- a/system/programs/home-manager.nix +++ /dev/null @@ -1,9 +0,0 @@ -{inputs, ...}: { - imports = [inputs.hm.nixosModules.default]; - - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; - backupFileExtension = "backup"; - }; -} diff --git a/system/programs/niri.nix b/system/programs/niri.nix deleted file mode 100644 index ba3accab..00000000 --- a/system/programs/niri.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ - inputs, - pkgs, - ... -}: { - imports = [inputs.niri-flake.nixosModules.niri]; - - programs.niri = { - enable = true; - package = inputs.niri-flake.packages.${pkgs.stdenv.hostPlatform.system}.niri-unstable; - }; - - xdg.portal.config.niri.default = ["gtk" "gnome"]; -} diff --git a/system/programs/obs-studio.nix b/system/programs/obs-studio.nix deleted file mode 100755 index a61a6b8e..00000000 --- a/system/programs/obs-studio.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.obs-studio = { - enable = true; - enableVirtualCamera = true; - }; -} diff --git a/system/programs/qt.nix b/system/programs/qt.nix deleted file mode 100755 index c7d98b31..00000000 --- a/system/programs/qt.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - qt = { - enable = true; - platformTheme = "gtk2"; - style = "gtk2"; - }; -} diff --git a/system/programs/xdg.nix b/system/programs/xdg.nix deleted file mode 100755 index 616decc9..00000000 --- a/system/programs/xdg.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs, ...}: { - xdg.portal = { - enable = true; - wlr.enable = true; - xdgOpenUsePortal = true; - - config.common.default = ["gtk"]; - - extraPortals = with pkgs; [ - # xdg-desktop-portal-wlr - xdg-desktop-portal-gtk - # xdg-desktop-portal-gnome - ]; - }; -} diff --git a/system/services/backlight.nix b/system/services/backlight.nix deleted file mode 100755 index 4cbef77d..00000000 --- a/system/services/backlight.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - hardware.brillo.enable = true; -} diff --git a/system/services/default.nix b/system/services/default.nix deleted file mode 100755 index 967758af..00000000 --- a/system/services/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - imports = [ - ./kanata - ./backlight.nix - ./gnome-services.nix - ./location.nix - ./pipewire.nix - ./sddm.nix - ]; - - services = { - dbus.implementation = "broker"; - - printing.enable = true; - - psd = { - enable = true; - resyncTimer = "10m"; - }; - }; -} diff --git a/system/services/gnome-services.nix b/system/services/gnome-services.nix deleted file mode 100755 index aacc6aa7..00000000 --- a/system/services/gnome-services.nix +++ /dev/null @@ -1,12 +0,0 @@ -{pkgs, ...}: { - services = { - dbus.packages = with pkgs; [ - gcr - gnome-settings-daemon - ]; - - gnome.gnome-keyring.enable = true; - - gvfs.enable = true; - }; -} diff --git a/system/services/kanata/default.nix b/system/services/kanata/default.nix deleted file mode 100644 index 3b26d802..00000000 --- a/system/services/kanata/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ - services.kanata = { - enable = true; - - keyboards.default = { - extraDefCfg = '' - process-unmapped-keys yes - ''; - config = builtins.readFile (./. + "/main.kbd"); - }; - }; -} diff --git a/system/services/location.nix b/system/services/location.nix deleted file mode 100755 index fccfa218..00000000 --- a/system/services/location.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - location.provider = "geoclue2"; - - services.geoclue2.enable = true; -} diff --git a/system/services/ollama.nix b/system/services/ollama.nix deleted file mode 100644 index 19087deb..00000000 --- a/system/services/ollama.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - services.ollama = { - enable = true; - }; -} diff --git a/system/services/pipewire.nix b/system/services/pipewire.nix deleted file mode 100755 index 7b0f36d3..00000000 --- a/system/services/pipewire.nix +++ /dev/null @@ -1,13 +0,0 @@ -{lib, ...}: { - services.pipewire = { - enable = true; - alsa = { - enable = true; - support32Bit = true; - }; - jack.enable = true; - pulse.enable = true; - }; - - services.pulseaudio.enable = lib.mkForce false; -} diff --git a/system/services/power.nix b/system/services/power.nix deleted file mode 100755 index 6eba2c11..00000000 --- a/system/services/power.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - services = { - logind.settings.Login.HandlePowerKey = "suspend"; - - power-profiles-daemon.enable = true; - - # battery info - upower.enable = true; - - # fix pipewire #2669 and #4115 - pipewire.wireplumber.extraConfig."wireplumber.profiles".main."monitor.libcamera" = "disabled"; - }; -} diff --git a/system/services/printer-sharing.nix b/system/services/printer-sharing.nix deleted file mode 100755 index 00f096ff..00000000 --- a/system/services/printer-sharing.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - services = { - avahi.publish = { - enable = true; - userServices = true; - }; - printing = { - listenAddresses = ["*:631"]; - allowFrom = ["all"]; - browsing = true; - defaultShared = true; - openFirewall = true; - }; - }; -} diff --git a/system/services/sddm.nix b/system/services/sddm.nix deleted file mode 100755 index e395e3ac..00000000 --- a/system/services/sddm.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - inputs, - lib, - pkgs, - ... -}: { - services.displayManager.sddm = { - enable = true; - package = lib.mkForce pkgs.kdePackages.sddm; - wayland.enable = true; - }; - - catppuccin.sddm = { - font = "Jetbrains Mono Nerd Font"; - fontSize = "10"; - background = "${inputs.assets}/wallpapers/night_forest.png"; - loginBackground = false; - }; -} diff --git a/system/services/thermald.nix b/system/services/thermald.nix deleted file mode 100644 index 7e804ec4..00000000 --- a/system/services/thermald.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - services.thermald.enable = true; -} diff --git a/system/virtualisation/bottles.nix b/system/virtualisation/bottles.nix deleted file mode 100755 index de03e204..00000000 --- a/system/virtualisation/bottles.nix +++ /dev/null @@ -1,3 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [bottles]; -} diff --git a/system/virtualisation/default.nix b/system/virtualisation/default.nix deleted file mode 100755 index 0451c3f8..00000000 --- a/system/virtualisation/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = [ - ./bottles.nix - ./kubernetes.nix - ./podman.nix - ]; -} diff --git a/system/virtualisation/kubernetes.nix b/system/virtualisation/kubernetes.nix deleted file mode 100644 index 0e5bdf5c..00000000 --- a/system/virtualisation/kubernetes.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: { - environment.systemPackages = with pkgs; [ - kubectl - kind - kubernetes-helm - ]; -} diff --git a/system/virtualisation/podman.nix b/system/virtualisation/podman.nix deleted file mode 100755 index 57783360..00000000 --- a/system/virtualisation/podman.nix +++ /dev/null @@ -1,13 +0,0 @@ -{pkgs, ...}: { - virtualisation.podman = { - enable = true; - autoPrune.enable = true; - dockerCompat = true; - dockerSocket.enable = true; - }; - - environment.systemPackages = with pkgs; [ - podman-compose - podman-desktop - ]; -} diff --git a/system/virtualisation/virt-manager.nix b/system/virtualisation/virt-manager.nix deleted file mode 100644 index d923a088..00000000 --- a/system/virtualisation/virt-manager.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - virtualisation.libvirtd.enable = true; - programs.virt-manager.enable = true; -} diff --git a/system/virtualisation/virtualbox.nix b/system/virtualisation/virtualbox.nix deleted file mode 100755 index c797f948..00000000 --- a/system/virtualisation/virtualbox.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - virtualisation.virtualbox.host = { - enable = true; - enableExtensionPack = true; - }; - - users.extraGroups.vboxusers.members = ["niksne"]; -}