From de6052693e8692ad4b6aeb28e8fde86f9c46e311 Mon Sep 17 00:00:00 2001 From: Anthony Rodriguez Date: Wed, 15 Jan 2025 22:57:01 +0100 Subject: [PATCH] treewide: huge refactor, move everything into modules As my configuration was getting more and more complex, I thought it was time to switch to a completely modular approach. A local module system has been created, containing profiles (some will be added later, as I went with as generic as I could, but I would like to make them more specialized). NixOS and home-manager modules have also been separated, which I don't like too much, and will switch to a cleaner implementation of home management systems. commit 09a07b15dae18bdb455d7b08c92bfacf9e51c8e9 Author: Anthony Rodriguez Date: Wed Jan 15 22:56:32 2025 +0100 treewide: config/home-manager -> modules/hm Moved every remaining home-manager piece of configuration to its own hm module. commit d7356d3fdef0d4f6236a3c5a9e668bc291be9655 Author: Anthony Rodriguez Date: Wed Jan 15 14:55:03 2025 +0100 modules/nix/services: add keyd commit c846cc95ae8f786766649a5e9c4d12d15087b0c4 Author: Anthony Rodriguez Date: Tue Jan 14 21:41:13 2025 +0100 flake: update inputs commit 94d59b47b3ca03563dbe5e0e9dd208a74db137be Author: Anthony Rodriguez Date: Tue Jan 14 21:41:09 2025 +0100 modules/nix/services: remove kanata commit 4429b604dd931ce1b585a59416a154b84ec079b4 Author: Anthony Rodriguez Date: Tue Jan 14 21:41:01 2025 +0100 config/home-manager: remove services/udiskie.nix commit 376024d4a50cdd91563263f656390c6b2237ab1c Author: Anthony Rodriguez Date: Tue Jan 14 20:06:31 2025 +0100 treewide: config/home-manager/services -> modules/hm/services commit b808281674d6c09cea216d17caa690bda341dcb0 Author: Anthony Rodriguez Date: Tue Jan 14 19:33:31 2025 +0100 treewide: config/home-manager -> modules/hm Started moving HM config to the new local modules system. Conditionally toggling based on profiles and modules. commit 2b77ac239e7a8f7cf5ed0384a1e8b49aadf0a008 Author: Anthony Rodriguez Date: Tue Jan 14 15:10:49 2025 +0100 treewide: config/nixos/services -> modules/nix/services Moved every service in their own module, and conditionally enable them based on profiles. commit 7aadc0c8feade16770870dcc5563012588794beb Author: Anthony Rodriguez Date: Tue Jan 14 14:44:38 2025 +0100 modules/nix/programs/hyprland: make chromium/electron apps run on Wayland commit ec285bcc523d30639bac9e6d55ce6b3ab0000e28 Author: Anthony Rodriguez Date: Tue Jan 14 13:58:52 2025 +0100 treewide: config/nixos/programs -> modules/nix/programs Here, we also use the option we just added, `local.modules.hyprland.enable` to toggle Hyprland, as well as the profiles. Also removed other unused configuration, such as KDE/Gnome. commit 76a2caa9c7edc14e8dece31ac70777df0fe9bac7 Author: Anthony Rodriguez Date: Tue Jan 14 14:07:41 2025 +0100 options/modules: add options for Hyprland commit 9f3d6ae768466330808a7ba9716ad73ad8c1c471 Author: Anthony Rodriguez Date: Tue Jan 14 13:56:56 2025 +0100 config/nix/programs: cleanup unused files commit f3c08b843199b64cc232dcbf508d6640a89ce671 Author: Anthony Rodriguez Date: Tue Jan 14 13:55:17 2025 +0100 treewide: config/nixos/programs/fonts -> modules/nix/core/fonts commit c37f00205b7bab05d4c6fd565d7d5cce71aab3af Author: Anthony Rodriguez Date: Tue Jan 14 13:49:29 2025 +0100 treewide: config/nixos/nix -> modules/nix/core/nix.nix commit a734372732c62383e7f950b4f8dd9b755d9b29f9 Author: Anthony Rodriguez Date: Tue Jan 14 13:43:23 2025 +0100 treewide: config/nixos/network -> modules/nix/core/networking commit 07a9c5f510886f730808c2bd892d11692e6ebc73 Author: Anthony Rodriguez Date: Tue Jan 14 12:34:01 2025 +0100 treewide: move hardware into modules commit 7d1baf7eb5bb5d2d1623414bd8a5ddb0f75e39f4 Author: Anthony Rodriguez Date: Tue Jan 14 12:33:21 2025 +0100 options: use mkIf for assertions commit 9b01b402530df484d4c4dd0f235206dd43f1942b Author: Anthony Rodriguez Date: Tue Jan 14 12:33:00 2025 +0100 hosts: set profiles We set profiles before moving the config so nothing breaks and we keep a working commit history :) commit 65ea8beba00be7539a3a76bb50286f50ec26e51d Author: Anthony Rodriguez Date: Tue Jan 14 12:22:06 2025 +0100 options: remove isServer since we have server profile commit 7906864ae17143db11576a3cbae4e372441b437a Author: Anthony Rodriguez Date: Tue Jan 14 12:21:49 2025 +0100 options/profiles: add laptop profile commit 99b6b41de3337aa11629de14308b678c833dfc97 Author: Anthony Rodriguez Date: Tue Jan 14 12:01:33 2025 +0100 treewide: migrate config/system/core to modules Moved everything from core into modules. I want to get all the NixOS stuff moved first, and do home-manager after. I used the different profiles to disable configuration that might break my server, as it has its own configuration already. This will need to be refactored later, as I want to ultimately only use the local module system. commit b89a42ef13c094b5a16aa5c59c027f1b57c412a2 Author: Anthony Rodriguez Date: Tue Jan 14 11:59:59 2025 +0100 modules/options: add profiles The next step in the refactoring is to add different profiles, so that we may toggle them easily in our hosts. Here's the profiles I went for: - desktop: enables everything a desktop computer needs (graphics, productivity apps, base apps such as browsers...) - gaming: enables gaming configurations (steam, gamescope...) - server: enables server configurations (website hosting, git forge...) I made sure the server profile can not be enabled if desktop/gaming are enabled, as it would not make sense to have desktop applications and configurations on a server. commit 851024052d34a3697e0da65069a87b73fe27a651 Author: Anthony Rodriguez Date: Tue Jan 14 11:02:13 2025 +0100 modules: move style to nix/style This is temporary, as we're going to get rid of that awkward style module that was meant to be shared, but ended up being too specific to my use-case. We just put it in a nix directory for now, as we will with everything else. This will be refactored later to be mixed with the relevant program's configuration. commit bb55875491c4d3bc4da4c4039072ab6052d5c552 Author: Anthony Rodriguez Date: Tue Jan 14 10:56:34 2025 +0100 treewide: move shared/nixosModules to modules The idea of this refactor is, as the configuration is getting bigger and more complex, to move everything into a local modules system. The idea is to simplify hosts declaration and add a new layer of abstraction to avoid the long and redundant imports in hosts/default.nix, that I am currently using. First, we're going to move everything to the modules directory, and split options from the proper configuration. That allows us to have an easier time understanding how the options are structured, as they will follow the directory structure and won't be mixed with the module configuration. --- config/home-manager/default.nix | 7 - .../programs/browsers/default.nix | 4 - .../programs/browsers/firefox.nix | 172 ------------ config/home-manager/programs/default.nix | 45 ---- .../home-manager/programs/editors/helix.nix | 61 ----- .../home-manager/programs/editors/neovim.nix | 244 ----------------- .../home-manager/programs/games/default.nix | 10 - .../home-manager/programs/gnome/default.nix | 10 - config/home-manager/programs/hypr/idle.nix | 55 ---- .../home-manager/programs/hypr/land/binds.nix | 79 ------ .../programs/hypr/land/default.nix | 109 -------- config/home-manager/programs/hypr/lock.nix | 10 - config/home-manager/programs/hypr/paper.nix | 20 -- .../home-manager/programs/media/default.nix | 12 - .../home-manager/programs/media/zathura.nix | 17 -- config/home-manager/programs/niri/binds.nix | 168 ------------ config/home-manager/programs/niri/default.nix | 173 ------------ config/home-manager/programs/swaybg.nix | 19 -- config/home-manager/programs/swayidle.nix | 20 -- config/home-manager/programs/swaylock.nix | 24 -- config/home-manager/programs/walker.nix | 32 --- .../home-manager/programs/waybar/default.nix | 187 ------------- config/home-manager/programs/wlogout.nix | 66 ----- config/home-manager/programs/xdg.nix | 35 --- config/home-manager/services/flatpak.nix | 9 - config/home-manager/services/gammastep.nix | 17 -- .../home-manager/services/swaync/default.nix | 27 -- config/home-manager/services/syncthing.nix | 5 - config/home-manager/services/udiskie.nix | 3 - config/home-manager/terminal/default.nix | 10 - .../home-manager/terminal/emulators/foot.nix | 18 -- .../terminal/emulators/gnome-terminal.nix | 16 -- .../terminal/emulators/wezterm.nix | 71 ----- config/home-manager/terminal/programs/bat.nix | 19 -- .../terminal/programs/default.nix | 23 -- .../home-manager/terminal/programs/direnv.nix | 8 - config/home-manager/terminal/programs/git.nix | 54 ---- .../home-manager/terminal/programs/gnupg.nix | 8 - .../terminal/programs/nix-index.nix | 11 - .../home-manager/terminal/programs/tmux.nix | 23 -- .../home-manager/terminal/programs/yazi.nix | 26 -- config/home-manager/terminal/shell/fish.nix | 48 ---- .../home-manager/terminal/shell/nushell.nix | 30 --- .../home-manager/terminal/shell/starship.nix | 9 - config/home-manager/terminal/shell/zoxide.nix | 6 - config/nixos/core/home-manager.nix | 31 --- config/nixos/core/lanzaboote.nix | 26 -- config/nixos/core/networking.nix | 3 - config/nixos/core/users.nix | 13 - config/nixos/default.nix | 15 -- config/nixos/hardware/fprintd.nix | 3 - config/nixos/hardware/fwupd.nix | 3 - config/nixos/hardware/mcuxpresso.nix | 9 - config/nixos/hardware/printing.nix | 28 -- config/nixos/hardware/uni-sync.nix | 37 --- config/nixos/hardware/via.nix | 7 - config/nixos/network/default.nix | 14 - config/nixos/nix/default.nix | 17 -- config/nixos/nix/nh.nix | 9 - config/nixos/nix/nixpkgs.nix | 13 - config/nixos/programs/default.nix | 5 - config/nixos/programs/fonts.nix | 24 -- config/nixos/programs/games.nix | 15 -- config/nixos/programs/gnome.nix | 40 --- config/nixos/programs/hyprland.nix | 33 --- config/nixos/programs/kde.nix | 7 - config/nixos/programs/niri/default.nix | 32 --- config/nixos/programs/xdg.nix | 14 - config/nixos/services/brightness.nix | 3 - config/nixos/services/default.nix | 9 - config/nixos/services/docker.nix | 8 - config/nixos/services/documentation.nix | 12 - config/nixos/services/flatpak.nix | 3 - config/nixos/services/forgejo.nix | 91 ------- config/nixos/services/gnome.nix | 12 - config/nixos/services/gnupg.nix | 6 - config/nixos/services/greetd.nix | 75 ------ config/nixos/services/kanata.nix | 33 --- config/nixos/services/keyd.nix | 17 -- config/nixos/services/kmscon.nix | 15 -- config/nixos/services/location.nix | 15 -- config/nixos/services/logind.nix | 9 - config/nixos/services/mail.nix | 6 - config/nixos/services/pipewire.nix | 18 -- config/nixos/services/power.nix | 8 - config/nixos/services/searx.nix | 61 ----- config/nixos/services/syncthing.nix | 8 - config/nixos/services/website.nix | 21 -- flake.lock | 112 ++++---- hosts/anastacia/default.nix | 11 +- hosts/default.nix | 107 +------- hosts/solaire/default.nix | 9 + hosts/vamos/default.nix | 14 +- modules/default.nix | 6 + modules/hm/default.nix | 6 + modules/hm/programs/browsers/default.nix | 3 + modules/hm/programs/browsers/firefox.nix | 176 +++++++++++++ modules/hm/programs/default.nix | 17 ++ modules/hm/programs/editors/default.nix | 6 + modules/hm/programs/editors/helix.nix | 64 +++++ modules/hm/programs/editors/neovim.nix | 247 ++++++++++++++++++ modules/hm/programs/games.nix | 17 ++ modules/hm/programs/gnome.nix | 16 ++ .../hm}/programs/hypr/default.nix | 0 modules/hm/programs/hypr/idle.nix | 58 ++++ modules/hm/programs/hypr/land/binds.nix | 85 ++++++ modules/hm/programs/hypr/land/default.nix | 114 ++++++++ modules/hm/programs/hypr/lock.nix | 14 + modules/hm/programs/hypr/paper.nix | 22 ++ modules/hm/programs/media/default.nix | 20 ++ modules/hm/programs/media/zathura.nix | 23 ++ modules/hm/programs/misc.nix | 40 +++ modules/hm/programs/terminal/default.nix | 17 ++ .../programs/terminal/emulators/default.nix | 3 + .../hm/programs/terminal/emulators/foot.nix | 19 ++ modules/hm/programs/terminal/programs/bat.nix | 26 ++ .../hm/programs/terminal/programs/default.nix | 12 + .../hm/programs/terminal/programs/direnv.nix | 14 + modules/hm/programs/terminal/programs/git.nix | 60 +++++ .../hm/programs/terminal/programs/gnupg.nix | 14 + .../hm/programs/terminal/programs/misc.nix | 20 ++ .../programs/terminal/programs/nix-index.nix | 19 ++ .../hm/programs/terminal/programs/tmux.nix | 30 +++ .../hm/programs/terminal/programs/yazi.nix | 33 +++ .../hm/programs}/terminal/shell/default.nix | 3 +- modules/hm/programs/terminal/shell/fish.nix | 51 ++++ .../hm/programs/terminal/shell/starship.nix | 15 ++ modules/hm/programs/terminal/shell/zoxide.nix | 12 + modules/hm/programs/walker.nix | 35 +++ modules/hm/programs/waybar.nix | 190 ++++++++++++++ modules/hm/programs/wlogout.nix | 69 +++++ modules/hm/programs/xdg.nix | 42 +++ modules/hm/services/default.nix | 8 + modules/hm/services/gammastep.nix | 23 ++ modules/hm/services/swaync/default.nix | 33 +++ .../hm}/services/swaync/style.css | 0 modules/hm/services/syncthing.nix | 11 + modules/hm/services/udiskie.nix | 9 + {config/nixos => modules/nix}/core/boot.nix | 0 modules/nix/core/default.nix | 16 ++ modules/nix/core/fonts.nix | 31 +++ modules/nix/core/hardware/default.nix | 9 + modules/nix/core/hardware/fprintd.nix | 9 + modules/nix/core/hardware/fwupd.nix | 9 + modules/nix/core/hardware/printing.nix | 36 +++ modules/nix/core/hardware/uni-sync.nix | 44 ++++ modules/nix/core/hardware/via.nix | 14 + modules/nix/core/home-manager.nix | 37 +++ .../nix/core/locales.nix | 8 - modules/nix/core/networking.nix | 21 ++ modules/nix/core/nix.nix | 35 +++ .../nixos => modules/nix}/core/security.nix | 0 modules/nix/core/users.nix | 19 ++ modules/nix/default.nix | 8 + modules/nix/programs/default.nix | 7 + modules/nix/programs/games.nix | 21 ++ modules/nix/programs/hyprland.nix | 38 +++ modules/nix/programs/xdg.nix | 21 ++ modules/nix/services/brightness.nix | 9 + modules/nix/services/default.nix | 21 ++ modules/nix/services/docker.nix | 15 ++ modules/nix/services/documentation.nix | 18 ++ modules/nix/services/flatpak.nix | 9 + modules/nix/services/forgejo.nix | 93 +++++++ modules/nix/services/gnome.nix | 19 ++ modules/nix/services/gnupg.nix | 12 + modules/nix/services/greetd.nix | 78 ++++++ modules/nix/services/keyd.nix | 18 ++ modules/nix/services/kmscon.nix | 22 ++ modules/nix/services/location.nix | 21 ++ modules/nix/services/logind.nix | 15 ++ modules/nix/services/pipewire.nix | 26 ++ modules/nix/services/power.nix | 14 + modules/nix/services/searx.nix | 69 +++++ modules/nix/services/syncthing.nix | 14 + modules/nix/services/website.nix | 25 ++ modules/nix/style/default.nix | 29 ++ .../nix}/style/modules/discord.nix | 0 .../nix}/style/modules/fish.nix | 0 .../nix}/style/modules/foot.nix | 0 .../nix}/style/modules/fuzzel.nix | 0 .../nix}/style/modules/gtk.nix | 0 .../nix}/style/modules/hyprland.nix | 0 .../nix}/style/modules/hyprlock.nix | 0 .../nix}/style/modules/niri.nix | 0 .../nix}/style/modules/nvf.nix | 0 .../nix}/style/modules/regreet.nix | 0 .../nix}/style/modules/starship.nix | 0 .../nix}/style/modules/swaylock.nix | 0 .../nix}/style/modules/swaync.nix | 0 .../nix}/style/modules/tidal-hifi.nix | 0 .../nix}/style/modules/walker.nix | 0 .../nix}/style/modules/waybar.nix | 0 .../nix}/style/modules/zathura.nix | 0 .../options}/default.nix | 7 +- .../options}/homeVars.nix | 2 +- modules/options/modules/default.nix | 3 + modules/options/modules/hyprland.nix | 7 + modules/options/profiles/default.nix | 8 + modules/options/profiles/desktop.nix | 18 ++ modules/options/profiles/gaming.nix | 18 ++ modules/options/profiles/laptop.nix | 18 ++ modules/options/profiles/server.nix | 23 ++ .../options.nix => modules/options/style.nix | 4 +- .../options}/systemVars.nix | 7 +- shared/nixosModules/style/default.nix | 34 --- 206 files changed, 2801 insertions(+), 3061 deletions(-) delete mode 100644 config/home-manager/default.nix delete mode 100644 config/home-manager/programs/browsers/default.nix delete mode 100644 config/home-manager/programs/browsers/firefox.nix delete mode 100644 config/home-manager/programs/default.nix delete mode 100644 config/home-manager/programs/editors/helix.nix delete mode 100644 config/home-manager/programs/editors/neovim.nix delete mode 100644 config/home-manager/programs/games/default.nix delete mode 100644 config/home-manager/programs/gnome/default.nix delete mode 100644 config/home-manager/programs/hypr/idle.nix delete mode 100644 config/home-manager/programs/hypr/land/binds.nix delete mode 100644 config/home-manager/programs/hypr/land/default.nix delete mode 100644 config/home-manager/programs/hypr/lock.nix delete mode 100644 config/home-manager/programs/hypr/paper.nix delete mode 100644 config/home-manager/programs/media/default.nix delete mode 100644 config/home-manager/programs/media/zathura.nix delete mode 100644 config/home-manager/programs/niri/binds.nix delete mode 100644 config/home-manager/programs/niri/default.nix delete mode 100644 config/home-manager/programs/swaybg.nix delete mode 100644 config/home-manager/programs/swayidle.nix delete mode 100644 config/home-manager/programs/swaylock.nix delete mode 100644 config/home-manager/programs/walker.nix delete mode 100644 config/home-manager/programs/waybar/default.nix delete mode 100644 config/home-manager/programs/wlogout.nix delete mode 100644 config/home-manager/programs/xdg.nix delete mode 100644 config/home-manager/services/flatpak.nix delete mode 100644 config/home-manager/services/gammastep.nix delete mode 100644 config/home-manager/services/swaync/default.nix delete mode 100644 config/home-manager/services/syncthing.nix delete mode 100644 config/home-manager/services/udiskie.nix delete mode 100644 config/home-manager/terminal/default.nix delete mode 100644 config/home-manager/terminal/emulators/foot.nix delete mode 100644 config/home-manager/terminal/emulators/gnome-terminal.nix delete mode 100644 config/home-manager/terminal/emulators/wezterm.nix delete mode 100644 config/home-manager/terminal/programs/bat.nix delete mode 100644 config/home-manager/terminal/programs/default.nix delete mode 100644 config/home-manager/terminal/programs/direnv.nix delete mode 100644 config/home-manager/terminal/programs/git.nix delete mode 100644 config/home-manager/terminal/programs/gnupg.nix delete mode 100644 config/home-manager/terminal/programs/nix-index.nix delete mode 100644 config/home-manager/terminal/programs/tmux.nix delete mode 100644 config/home-manager/terminal/programs/yazi.nix delete mode 100644 config/home-manager/terminal/shell/fish.nix delete mode 100644 config/home-manager/terminal/shell/nushell.nix delete mode 100644 config/home-manager/terminal/shell/starship.nix delete mode 100644 config/home-manager/terminal/shell/zoxide.nix delete mode 100644 config/nixos/core/home-manager.nix delete mode 100644 config/nixos/core/lanzaboote.nix delete mode 100644 config/nixos/core/networking.nix delete mode 100644 config/nixos/core/users.nix delete mode 100644 config/nixos/default.nix delete mode 100644 config/nixos/hardware/fprintd.nix delete mode 100644 config/nixos/hardware/fwupd.nix delete mode 100644 config/nixos/hardware/mcuxpresso.nix delete mode 100644 config/nixos/hardware/printing.nix delete mode 100644 config/nixos/hardware/uni-sync.nix delete mode 100644 config/nixos/hardware/via.nix delete mode 100644 config/nixos/network/default.nix delete mode 100644 config/nixos/nix/default.nix delete mode 100644 config/nixos/nix/nh.nix delete mode 100644 config/nixos/nix/nixpkgs.nix delete mode 100644 config/nixos/programs/default.nix delete mode 100644 config/nixos/programs/fonts.nix delete mode 100644 config/nixos/programs/games.nix delete mode 100644 config/nixos/programs/gnome.nix delete mode 100644 config/nixos/programs/hyprland.nix delete mode 100644 config/nixos/programs/kde.nix delete mode 100644 config/nixos/programs/niri/default.nix delete mode 100644 config/nixos/programs/xdg.nix delete mode 100644 config/nixos/services/brightness.nix delete mode 100644 config/nixos/services/default.nix delete mode 100644 config/nixos/services/docker.nix delete mode 100644 config/nixos/services/documentation.nix delete mode 100644 config/nixos/services/flatpak.nix delete mode 100644 config/nixos/services/forgejo.nix delete mode 100644 config/nixos/services/gnome.nix delete mode 100644 config/nixos/services/gnupg.nix delete mode 100644 config/nixos/services/greetd.nix delete mode 100644 config/nixos/services/kanata.nix delete mode 100644 config/nixos/services/keyd.nix delete mode 100644 config/nixos/services/kmscon.nix delete mode 100644 config/nixos/services/location.nix delete mode 100644 config/nixos/services/logind.nix delete mode 100644 config/nixos/services/mail.nix delete mode 100644 config/nixos/services/pipewire.nix delete mode 100644 config/nixos/services/power.nix delete mode 100644 config/nixos/services/searx.nix delete mode 100644 config/nixos/services/syncthing.nix delete mode 100644 config/nixos/services/website.nix create mode 100644 modules/default.nix create mode 100644 modules/hm/default.nix create mode 100644 modules/hm/programs/browsers/default.nix create mode 100644 modules/hm/programs/browsers/firefox.nix create mode 100644 modules/hm/programs/default.nix create mode 100644 modules/hm/programs/editors/default.nix create mode 100644 modules/hm/programs/editors/helix.nix create mode 100644 modules/hm/programs/editors/neovim.nix create mode 100644 modules/hm/programs/games.nix create mode 100644 modules/hm/programs/gnome.nix rename {config/home-manager => modules/hm}/programs/hypr/default.nix (100%) create mode 100644 modules/hm/programs/hypr/idle.nix create mode 100644 modules/hm/programs/hypr/land/binds.nix create mode 100644 modules/hm/programs/hypr/land/default.nix create mode 100644 modules/hm/programs/hypr/lock.nix create mode 100644 modules/hm/programs/hypr/paper.nix create mode 100644 modules/hm/programs/media/default.nix create mode 100644 modules/hm/programs/media/zathura.nix create mode 100644 modules/hm/programs/misc.nix create mode 100644 modules/hm/programs/terminal/default.nix create mode 100644 modules/hm/programs/terminal/emulators/default.nix create mode 100644 modules/hm/programs/terminal/emulators/foot.nix create mode 100644 modules/hm/programs/terminal/programs/bat.nix create mode 100644 modules/hm/programs/terminal/programs/default.nix create mode 100644 modules/hm/programs/terminal/programs/direnv.nix create mode 100644 modules/hm/programs/terminal/programs/git.nix create mode 100644 modules/hm/programs/terminal/programs/gnupg.nix create mode 100644 modules/hm/programs/terminal/programs/misc.nix create mode 100644 modules/hm/programs/terminal/programs/nix-index.nix create mode 100644 modules/hm/programs/terminal/programs/tmux.nix create mode 100644 modules/hm/programs/terminal/programs/yazi.nix rename {config/home-manager => modules/hm/programs}/terminal/shell/default.nix (80%) create mode 100644 modules/hm/programs/terminal/shell/fish.nix create mode 100644 modules/hm/programs/terminal/shell/starship.nix create mode 100644 modules/hm/programs/terminal/shell/zoxide.nix create mode 100644 modules/hm/programs/walker.nix create mode 100644 modules/hm/programs/waybar.nix create mode 100644 modules/hm/programs/wlogout.nix create mode 100644 modules/hm/programs/xdg.nix create mode 100644 modules/hm/services/default.nix create mode 100644 modules/hm/services/gammastep.nix create mode 100644 modules/hm/services/swaync/default.nix rename {config/home-manager => modules/hm}/services/swaync/style.css (100%) create mode 100644 modules/hm/services/syncthing.nix create mode 100644 modules/hm/services/udiskie.nix rename {config/nixos => modules/nix}/core/boot.nix (100%) create mode 100644 modules/nix/core/default.nix create mode 100644 modules/nix/core/fonts.nix create mode 100644 modules/nix/core/hardware/default.nix create mode 100644 modules/nix/core/hardware/fprintd.nix create mode 100644 modules/nix/core/hardware/fwupd.nix create mode 100644 modules/nix/core/hardware/printing.nix create mode 100644 modules/nix/core/hardware/uni-sync.nix create mode 100644 modules/nix/core/hardware/via.nix create mode 100644 modules/nix/core/home-manager.nix rename config/nixos/core/default.nix => modules/nix/core/locales.nix (73%) create mode 100644 modules/nix/core/networking.nix create mode 100644 modules/nix/core/nix.nix rename {config/nixos => modules/nix}/core/security.nix (100%) create mode 100644 modules/nix/core/users.nix create mode 100644 modules/nix/default.nix create mode 100644 modules/nix/programs/default.nix create mode 100644 modules/nix/programs/games.nix create mode 100644 modules/nix/programs/hyprland.nix create mode 100644 modules/nix/programs/xdg.nix create mode 100644 modules/nix/services/brightness.nix create mode 100644 modules/nix/services/default.nix create mode 100644 modules/nix/services/docker.nix create mode 100644 modules/nix/services/documentation.nix create mode 100644 modules/nix/services/flatpak.nix create mode 100644 modules/nix/services/forgejo.nix create mode 100644 modules/nix/services/gnome.nix create mode 100644 modules/nix/services/gnupg.nix create mode 100644 modules/nix/services/greetd.nix create mode 100644 modules/nix/services/keyd.nix create mode 100644 modules/nix/services/kmscon.nix create mode 100644 modules/nix/services/location.nix create mode 100644 modules/nix/services/logind.nix create mode 100644 modules/nix/services/pipewire.nix create mode 100644 modules/nix/services/power.nix create mode 100644 modules/nix/services/searx.nix create mode 100644 modules/nix/services/syncthing.nix create mode 100644 modules/nix/services/website.nix create mode 100644 modules/nix/style/default.nix rename {shared/nixosModules => modules/nix}/style/modules/discord.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/fish.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/foot.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/fuzzel.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/gtk.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/hyprland.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/hyprlock.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/niri.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/nvf.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/regreet.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/starship.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/swaylock.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/swaync.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/tidal-hifi.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/walker.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/waybar.nix (100%) rename {shared/nixosModules => modules/nix}/style/modules/zathura.nix (100%) rename {shared/nixosModules => modules/options}/default.nix (57%) rename {shared/nixosModules => modules/options}/homeVars.nix (89%) create mode 100644 modules/options/modules/default.nix create mode 100644 modules/options/modules/hyprland.nix create mode 100644 modules/options/profiles/default.nix create mode 100644 modules/options/profiles/desktop.nix create mode 100644 modules/options/profiles/gaming.nix create mode 100644 modules/options/profiles/laptop.nix create mode 100644 modules/options/profiles/server.nix rename shared/nixosModules/style/options.nix => modules/options/style.nix (97%) rename {shared/nixosModules => modules/options}/systemVars.nix (76%) delete mode 100644 shared/nixosModules/style/default.nix diff --git a/config/home-manager/default.nix b/config/home-manager/default.nix deleted file mode 100644 index 284a1aa..0000000 --- a/config/home-manager/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -_: { - imports = [ - ./services/udiskie.nix - ./terminal - ./programs - ]; -} diff --git a/config/home-manager/programs/browsers/default.nix b/config/home-manager/programs/browsers/default.nix deleted file mode 100644 index b3bcded..0000000 --- a/config/home-manager/programs/browsers/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - imports = [./firefox.nix]; - home.sessionVariables.BROWSER = "firefox"; -} diff --git a/config/home-manager/programs/browsers/firefox.nix b/config/home-manager/programs/browsers/firefox.nix deleted file mode 100644 index a2b2de9..0000000 --- a/config/home-manager/programs/browsers/firefox.nix +++ /dev/null @@ -1,172 +0,0 @@ -{ - inputs, - pkgs, - ... -}: let - betterfox = pkgs.fetchFromGitHub { - owner = "yokoffing"; - repo = "betterfox"; - rev = "e026ed7d3a763c5d3f96c2680d7bc3340831af4f"; - hash = "sha256-hpkEO5BhMVtINQG8HN4xqfas/R6q5pYPZiFK8bilIDs="; - }; -in { - programs.firefox = { - enable = true; - package = pkgs.wrapFirefox pkgs.firefox-unwrapped { - extraPolicies = { - DisableTelemetry = true; - DisablePocket = true; - DisableFeedbackCommands = true; - DisableFirefoxStudies = true; - OfferToSaveLogins = false; - OffertosaveloginsDefault = false; - PasswordManagerEnabled = false; - SearchSuggestEnabled = true; - - # https://github.com/Sly-Harvey/NixOS/blob/f9da2691ea46565256ad757959cfc26ec6cee10d/modules/programs/browser/firefox/default.nix#L58-L163 - "3rdparty".Extensions = { - "addon@darkreader.org" = { - permissions = ["internal:privateBrowsingAllowed"]; - enabled = true; - automation = { - enabled = true; - behavior = "OnOff"; - mode = "system"; - }; - detectDarkTheme = true; - enabledByDefault = true; - changeBrowserTheme = false; - enableForProtectedPages = true; - fetchNews = false; - previewNewDesign = true; - }; - "uBlock0@raymondhill.net" = { - permissions = ["internal:privateBrowsingAllowed"]; - advancedSettings = [ - [ - "userResourcesLocation" - "https://raw.githubusercontent.com/pixeltris/TwitchAdSolutions/master/video-swap-new/video-swap-new-ublock-origin.js" - ] - ]; - adminSettings = { - userSettings = { - uiTheme = "dark"; - advancedUserEnabled = true; - userFiltersTrusted = true; - importedLists = [ - "https://raw.githubusercontent.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/main/list.txt" - ]; - selectedFilterLists = [ - "FRA-0" - "adguard-cookies" - "adguard-mobile-app-banners" - "adguard-other-annoyances" - "adguard-popup-overlays" - "adguard-social" - "adguard-spyware-url" - "adguard-widgets" - "easylist" - "easylist-annoyances" - "easylist-chat" - "easylist-newsletters" - "easylist-notifications" - "easyprivacy" - "fanboy-cookiemonster" - "https://filters.adtidy.org/extension/ublock/filters/3.txt" - "https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt" - "plowe-0" - "ublock-annoyances" - "ublock-badware" - "ublock-cookies-adguard" - "ublock-cookies-easylist" - "ublock-filters" - "ublock-privacy" - "ublock-quick-fixes" - "ublock-unbreak" - "urlhaus-1" - "https://raw.githubusercontent.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/main/list.txt" - ]; - }; - }; - }; - }; - }; - }; - profiles = { - nezia = { - settings = { - "browser.search.suggest.enabled" = true; - "ui.key.menuAccessKeyFocuses" = false; - }; - - extensions = with inputs.firefox-addons.packages.${pkgs.system}; [ - darkreader - proton-pass - shinigami-eyes - stylus - ublock-origin - violentmonkey - ]; - # https://git.jacekpoz.pl/poz/niksos/src/commit/a48647a1c5bc6877a1100a65f4dc169b2fc11ed7/hosts/hape/firefox.nix - search = { - force = true; - default = "SearxNG"; - engines = { - "SearxNG" = { - urls = [ - { - rels = ["results"]; - template = "https://search.nezia.dev/search"; - params = [ - { - name = "q"; - value = "{searchTerms}"; - } - ]; - } - { - rels = ["suggestions"]; - template = "https://search.nezia.dev/autocompleter"; - params = [ - { - name = "q"; - value = "{searchTerms}"; - } - ]; - "type" = "application/x-suggestions+json"; - } - ]; - }; - "MyNixOS" = { - urls = [{template = "https://mynixos.com/search?q={searchTerms}";}]; - iconUpdateURL = "https://mynixos.com/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; - definedAliases = ["@nx"]; - }; - "Noogle" = { - urls = [{template = "https://noogle.dev/q?term={searchTerms}";}]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = ["@ng"]; - }; - "GitHub Nix" = { - # https://github.com/search?q=language%3Anix+NOT+is%3Afork+programs.neovim&type=code - urls = [{template = "https://github.com/search?q=language:nix NOT is:fork {searchTerms}&type=code";}]; - iconUpdateURL = "https://github.com/favicon.ico"; - updateInterval = 24 * 60 * 60 * 1000; - definedAliases = ["@ghn"]; - }; - "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias - }; - }; - # https://github.com/oddlama/nix-config/blob/main/users/myuser/graphical/firefox.nix#L53-L57 - extraConfig = builtins.concatStringsSep "\n" [ - (builtins.readFile "${betterfox}/user.js") - (builtins.readFile "${betterfox}/Securefox.js") - (builtins.readFile "${betterfox}/Fastfox.js") - (builtins.readFile "${betterfox}/Peskyfox.js") - (builtins.readFile "${betterfox}/Smoothfox.js") - ]; - }; - }; - }; -} diff --git a/config/home-manager/programs/default.nix b/config/home-manager/programs/default.nix deleted file mode 100644 index a502dc5..0000000 --- a/config/home-manager/programs/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./browsers - ./gnome - ./media - ./xdg.nix - ./editors/helix.nix - ./editors/neovim.nix - ]; - - # idk where to put this - programs = { - fzf.enable = true; - fastfetch.enable = true; - hyfetch = { - enable = true; - settings = { - preset = "nonbinary"; - mode = "rgb"; - backend = "fastfetch"; - color_align.mode = "horizontal"; - }; - }; - }; - - # miscellaneous programs that do not need to be configured - home.packages = with pkgs; [ - cinny-desktop - entr - fractal - geary - gns3-gui - gns3-server - imhex - logisim-evolution - mission-center - nautilus - obsidian - playerctl - proton-pass - simple-scan - vesktop - wl-clipboard - ]; -} diff --git a/config/home-manager/programs/editors/helix.nix b/config/home-manager/programs/editors/helix.nix deleted file mode 100644 index b8f9887..0000000 --- a/config/home-manager/programs/editors/helix.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - lib, - pkgs, - ... -}: { - programs.helix = { - enable = true; - settings = { - theme = "catppuccin_macchiato"; - editor = { - line-number = "relative"; - lsp.display-messages = true; - auto-format = true; - auto-completion = true; - completion-timeout = 5; - color-modes = true; - completion-trigger-len = 1; - completion-replace = true; - cursorline = true; - cursor-shape = { - insert = "bar"; - normal = "block"; - select = "underline"; - }; - indent-guides.render = true; - lsp.display-inlay-hints = true; - statusline.center = ["position-percentage"]; - true-color = true; - whitespace.characters = { - newline = "↴"; - tab = "⇥"; - }; - }; - - keys.normal = { - space = { - space = "file_picker"; - w = ":w"; - q = ":q"; - }; - esc = ["collapse_selection" "keep_primary_selection"]; - }; - }; - - languages = { - language = [ - { - name = "nix"; - auto-format = true; - } - ]; - - language-server = { - nil = { - command = lib.getExe pkgs.nil; - config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"]; - }; - }; - }; - }; -} diff --git a/config/home-manager/programs/editors/neovim.nix b/config/home-manager/programs/editors/neovim.nix deleted file mode 100644 index e61a05d..0000000 --- a/config/home-manager/programs/editors/neovim.nix +++ /dev/null @@ -1,244 +0,0 @@ -{ - inputs, - lib, - pkgs, - ... -}: { - imports = [inputs.nvf.homeManagerModules.default]; - - programs.nvf = { - enable = true; - settings.vim = { - viAlias = true; - vimAlias = true; - enableLuaLoader = true; - preventJunkFiles = true; - useSystemClipboard = true; - options = { - tabstop = 4; - autoindent = false; - }; - - luaConfigPost = '' - vim.opt.formatoptions:remove('c') - vim.opt.formatoptions:remove('r') - vim.opt.formatoptions:remove('o') - ''; - - maps = { - normal = { - "m" = { - silent = true; - action = "make"; - }; # Same as nnoremap m make - "t" = { - silent = true; - action = "Neotree toggle"; - }; - }; - }; - - theme = lib.mkDefault { - enable = true; - name = "catppuccin"; - style = "macchiato"; - }; - - ui = { - noice.enable = true; - }; - notify.nvim-notify.enable = true; - - statusline = { - lualine = { - enable = true; - theme = "auto"; - componentSeparator = { - left = ""; - }; - sectionSeparator = { - left = ""; - right = ""; - }; - - activeSection = { - a = [ - '' - { - "mode", - separator = { right = "" }, - right_padding = 2 - } - '' - ]; - b = [ - '' - { - "branch", - icon = '', - separator = { right = "" } - } - '' - ]; - c = [ - '' - "filename" - '' - ]; - x = [ - '' - { - "diagnostics", - sources = {'nvim_lsp', 'nvim_diagnostic', 'nvim_diagnostic', 'vim_lsp', 'coc'}, - symbols = {error = '󰅙 ', warn = ' ', info = ' ', hint = '󰌵 '}, - colored = true, - update_in_insert = false, - always_visible = false, - diagnostics_color = { - color_error = { fg = 'red' }, - color_warn = { fg = 'yellow' }, - color_info = { fg = 'cyan' }, - }, - } - '' - '' - "filetype" - '' - ]; - y = [ - '' - { - "progress", - separator = { left = "" }, - } - '' - '' - '' - ]; - z = [ - '' - { - "location", - separator = { left = "" }, - left_padding = 2 - } - '' - '' - { - "fileformat", - color = {fg='black'}, - symbols = { - unix = '', -- e712 - dos = '', -- e70f - mac = '', -- e711 - }, - } - '' - ]; - }; - - inactiveSection = { - a = [ - '' - "filename" - '' - ]; - z = [ - '' - "location" - '' - ]; - }; - }; - }; - - git.enable = true; - - utility = { - vim-wakatime.enable = true; - surround.enable = true; - }; - - lsp = { - enable = true; - lspSignature.enable = true; - lspconfig.enable = true; - formatOnSave = true; - mappings = { - addWorkspaceFolder = "wa"; - codeAction = "a"; - goToDeclaration = "gD"; - goToDefinition = "gd"; - hover = "K"; - listImplementations = "gi"; - listReferences = "gr"; - listWorkspaceFolders = "wl"; - nextDiagnostic = "k"; - previousDiagnostic = "j"; - openDiagnosticFloat = "e"; - removeWorkspaceFolder = "wr"; - renameSymbol = "r"; - signatureHelp = ""; - }; - }; - - autocomplete.nvim-cmp = { - enable = true; - }; - - autopairs.nvim-autopairs.enable = true; - - languages = { - enableExtraDiagnostics = true; - enableFormat = true; - enableLSP = true; - enableTreesitter = true; - - nix.enable = true; - clang.enable = true; - python.enable = true; - ts.enable = true; - css.enable = true; - typst.enable = true; - }; - - treesitter = { - enable = true; - fold = true; - context.enable = true; - grammars = [ - pkgs.vimPlugins.nvim-treesitter.builtGrammars.nix - pkgs.vimPlugins.nvim-treesitter.builtGrammars.c - pkgs.vimPlugins.nvim-treesitter.builtGrammars.python - ]; - }; - - binds.whichKey.enable = true; - filetree.neo-tree.enable = true; - - telescope.enable = true; - }; - }; - - programs.neovide = { - enable = true; - settings = { - fork = false; - frame = "full"; - idle = true; - maximized = false; - no-multigrid = false; - srgb = false; - tabs = true; - theme = "auto"; - title-hidden = true; - vsync = true; - wsl = false; - - font = { - normal = []; - size = 14.0; - }; - }; - }; -} diff --git a/config/home-manager/programs/games/default.nix b/config/home-manager/programs/games/default.nix deleted file mode 100644 index 1217a85..0000000 --- a/config/home-manager/programs/games/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{pkgs, ...}: { - home.packages = [ - pkgs.mangohud - pkgs.bolt-launcher - pkgs.ankama-launcher - pkgs.lutris - pkgs.qbittorrent - pkgs.protonplus - ]; -} diff --git a/config/home-manager/programs/gnome/default.nix b/config/home-manager/programs/gnome/default.nix deleted file mode 100644 index 839da64..0000000 --- a/config/home-manager/programs/gnome/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -_: { - dconf = { - enable = true; - settings = { - "org/gnome/desktop/wm/preferences" = { - button-layout = ""; - }; - }; - }; -} diff --git a/config/home-manager/programs/hypr/idle.nix b/config/home-manager/programs/hypr/idle.nix deleted file mode 100644 index 12e7ddb..0000000 --- a/config/home-manager/programs/hypr/idle.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - inputs, - pkgs, - lib, - config, - ... -}: { - services.hypridle = { - enable = true; - - package = inputs.hypridle.packages.${pkgs.system}.hypridle; - - settings = { - general = { - lock_cmd = "pidof hyprlock || hyprlock"; - unlock_cmd = "pkill --signal SIGUSR1 hyprlock"; - before_sleep_cmd = "loginctl lock-session"; - after_sleep_cmd = "hyprctl dispatch dpms on"; - }; - - listener = [ - { - timeout = 300; # 5m - on-timeout = "loginctl lock-session"; - } - { - timeout = 330; # 5.5m - on-timeout = "hyprctl dipsatch dpms off"; - on-resume = "hyprctl dispatch dpms on"; - } - { - timeout = 600; # 10m - on-timeout = "systemctl suspend"; - } - ]; - }; - }; - # needed when using uwsm as the session manager - systemd.user.services."hypridle" = lib.mkForce { - Unit = { - Description = "Hyprland's Idle Daemon"; - After = "graphical-session.target"; - X-Restart-Triggers = ["${config.xdg.configFile."hypr/hypridle.conf".source}"]; - }; - Service = { - Type = "exec"; - ExecStart = lib.getExe pkgs.hypridle; - Restart = "on-failure"; - Slice = "background-graphical.slice"; - }; - Install = { - WantedBy = ["graphical-session.target"]; - }; - }; -} diff --git a/config/home-manager/programs/hypr/land/binds.nix b/config/home-manager/programs/hypr/land/binds.nix deleted file mode 100644 index ec80972..0000000 --- a/config/home-manager/programs/hypr/land/binds.nix +++ /dev/null @@ -1,79 +0,0 @@ -{lib, ...}: let - # thanks https://github.com/fufexan/dotfiles/blob/c0b3c77d95ce1f574a87e7f7ead672ca0d951245/home/programs/wayland/hyprland/binds.nix#L16-L20 - toggle = program: uwsm: let - prog = builtins.substring 0 14 program; - in "pkill ${prog} || ${lib.optionalString uwsm "uwsm app --"} ${program}"; - runOnce = program: "pgrep ${program} || uwsm app -- ${program}"; - run = program: "uwsm app -- ${program}"; -in { - wayland.windowManager.hyprland.settings = { - "$mod" = "SUPER"; - bindr = [ - "$mod, SUPER_L, exec, walker" - ]; - bind = [ - "$mod, Return, exec, ${run "foot"}" - "$mod, n, exec, ${run "neovide"}" - "$mod, w, exec, ${run "firefox"}" - ", Print, exec, ${runOnce "grimblast"} --notify --cursor copysave output" - "$mod, q, killactive" - "$mod SHIFT, q, exec, loginctl terminate-user ''" - "$mod, period, exec, walker -m emojis" # not using uwsm as it already runs as a service - "CTRL, Print, exec, ${runOnce "grimblast"} --notify --cursor --freeze copysave area" - - "$mod, h, movefocus, l" - "$mod, j, movefocus, d" - "$mod, k, movefocus, u" - "$mod, l, movefocus, r" - - "$mod SHIFT, h, movewindow, l" - "$mod SHIFT, j, movewindow, d" - "$mod SHIFT, k, movewindow, u" - "$mod SHIFT, l, movewindow, r" - - "$mod, 1, workspace, 1" - "$mod, 2, workspace, 2" - "$mod, 3, workspace, 3" - "$mod, 4, workspace, 4" - "$mod, 5, workspace, 5" - "$mod, 6, workspace, 6" - "$mod, 7, workspace, 7" - "$mod, 8, workspace, 8" - "$mod, 9, workspace, 9" - "$mod, 0, workspace, 10" - - "$mod SHIFT, 1, movetoworkspacesilent, 1" - "$mod SHIFT, 2, movetoworkspacesilent, 2" - "$mod SHIFT, 3, movetoworkspacesilent, 3" - "$mod SHIFT, 4, movetoworkspacesilent, 4" - "$mod SHIFT, 5, movetoworkspacesilent, 5" - "$mod SHIFT, 6, movetoworkspacesilent, 6" - "$mod SHIFT, 7, movetoworkspacesilent, 7" - "$mod SHIFT, 8, movetoworkspacesilent, 8" - "$mod SHIFT, 9, movetoworkspacesilent, 9" - "$mod SHIFT, 0, movetoworkspacesilent, 10" - - "$mod, t, togglefloating" - ", F11, fullscreen, 0" - "$mod, f, fullscreen, 1" - - "$mod, e, togglespecialworkspace, file_manager_tui" - "$mod SHIFT, e, togglespecialworkspace, file_manager_gui" - - ", XF86PowerOff, exec, ${toggle "wlogout" true}" - ]; - - bindel = [ - ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" - ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - - ", XF86MonBrightnessUp, exec, brillo -q -u 300000 -A 5" - ", XF86MonBrightnessDown, exec, brillo -q -u 300000 -U 5" - ", XF86AudioMedia, exec, XDG_CURRENT_DESKTOP=gnome gnome-control-center" - ]; - binde = [ - "$mod Alt, l, exec, loginctl lock-session" - ]; - }; -} diff --git a/config/home-manager/programs/hypr/land/default.nix b/config/home-manager/programs/hypr/land/default.nix deleted file mode 100644 index 3bf39c7..0000000 --- a/config/home-manager/programs/hypr/land/default.nix +++ /dev/null @@ -1,109 +0,0 @@ -{ - inputs, - pkgs, - ... -}: { - imports = [./binds.nix]; - home.packages = [ - inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast - # disable unused panels - https://github.com/maydayv7/dotfiles/blob/4de45008a6915753834aa7e1cbafbacfff8b7adc/modules/gui/desktop/hyprland/apps/utilities.nix#L42-L57 - (pkgs.gnome-control-center.overrideAttrs (old: { - postInstall = - old.postInstall - + '' - dir=$out/share/applications - for panel in $dir/* - do - [ "$panel" = "$dir/gnome-network-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-bluetooth-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-wifi-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-wwan-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-sharing-panel.desktop" ] && continue - [ "$panel" = "$dir/gnome-wacom-panel.desktop" ] && continue - rm "$panel" - done - ''; - })) - ]; - wayland.windowManager.hyprland = { - enable = true; - xwayland.enable = true; - - systemd.enable = false; - - settings = { - xwayland = { - force_zero_scaling = true; - }; - - env = [ - "GDK_SCALE,1" - ]; - monitor = [ - "eDP-1, preferred, auto, 1.33" - ]; - workspace = [ - "special:terminal, on-created-empty:foot" - "special:mixer_gui, on-created-empty:pavucontrol" - "special:file_manager_gui, on-created-empty:nautilus" - "special:file_manager_tui, on-created-empty:foot -- yazi" - ]; - - windowrulev2 = [ - # fixes fullscreen windows (mostly games) - "stayfocused, initialtitle:^()$, initialclass:^(steam)$" - "minsize 1 1, initialtitle:^()$, initialclass:^(steam)$" - "maximize, initialtitle:^(\S+)$, initialclass:^(steamwebhelper)$" - - "immediate, initialclass:^(steam_app_)(.*)$" - "fullscreen, initialclass:^(steam_app_)(.*)$" - - # inhibit idle on every fullscreen app except games - "idleinhibit always, fullscreen:1,!initialclass:^(steam_app_)(.*)$" - ]; - - render = { - explicit_sync = 1; - explicit_sync_kms = 1; - expand_undersized_textures = false; - }; - - animations = { - enabled = true; - bezier = "myBezier, 0.05, 0.9, 0.1, 1.1"; - animation = [ - "windows, 1, 5, myBezier" - "windowsOut, 1, 5, default, popin 80%" - "windowsMove, 1, 5, default, popin 80%" - "fade, 1, 5, default" - "border, 1, 5, default" - "borderangle, 0, 8, default" - "workspaces, 0" - "specialWorkspace, 0" - ]; - }; - - input = { - kb_options = "compose:ralt"; - touchpad = { - natural_scroll = true; - scroll_factor = 0.8; - tap-to-click = true; - clickfinger_behavior = true; - }; - }; - - gestures = { - workspace_swipe = true; - workspace_swipe_direction_lock = false; - workspace_swipe_cancel_ratio = 0.15; - }; - - misc = { - force_default_wallpaper = 0; - disable_hyprland_logo = true; - middle_click_paste = false; - }; - }; - }; -} diff --git a/config/home-manager/programs/hypr/lock.nix b/config/home-manager/programs/hypr/lock.nix deleted file mode 100644 index b839ba4..0000000 --- a/config/home-manager/programs/hypr/lock.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - inputs, - pkgs, - ... -}: { - programs.hyprlock = { - enable = true; - package = inputs.hyprlock.packages.${pkgs.system}.hyprlock; - }; -} diff --git a/config/home-manager/programs/hypr/paper.nix b/config/home-manager/programs/hypr/paper.nix deleted file mode 100644 index 8ae67e3..0000000 --- a/config/home-manager/programs/hypr/paper.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - lib, - osConfig, - inputs, - pkgs, - ... -}: { - services.hyprpaper = { - enable = true; - package = inputs.hyprpaper.packages.${pkgs.system}.default; - - settings = { - preload = ["${osConfig.local.style.wallpaper}"]; - wallpaper = [", ${osConfig.local.style.wallpaper}"]; - }; - }; - - systemd.user.services.hyprpaper.Unit.After = lib.mkForce "graphical-session.target"; - systemd.user.services.hyprpaper.Service.Slice = "background-graphical.slice"; -} diff --git a/config/home-manager/programs/media/default.nix b/config/home-manager/programs/media/default.nix deleted file mode 100644 index 773e7b0..0000000 --- a/config/home-manager/programs/media/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{pkgs, ...}: { - imports = [./zathura.nix]; - programs.mpv.enable = true; - home.packages = [ - pkgs.gnome-calculator - pkgs.gthumb - pkgs.spotify - pkgs.stremio - pkgs.tidal-hifi - pkgs.celluloid - ]; -} diff --git a/config/home-manager/programs/media/zathura.nix b/config/home-manager/programs/media/zathura.nix deleted file mode 100644 index 82bdf35..0000000 --- a/config/home-manager/programs/media/zathura.nix +++ /dev/null @@ -1,17 +0,0 @@ -_: { - programs.zathura = { - enable = true; - options = { - font = "Inter 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/config/home-manager/programs/niri/binds.nix b/config/home-manager/programs/niri/binds.nix deleted file mode 100644 index 98372c9..0000000 --- a/config/home-manager/programs/niri/binds.nix +++ /dev/null @@ -1,168 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - appLauncher = "fuzzel"; - terminal = "foot"; - browser = "firefox"; - prefix = "Mod"; - guiFileManager = "nautilus"; - cliFileManager = "yazi"; -in { - programs.niri.settings.binds = { - "${prefix}+D".action.spawn = appLauncher; - "${prefix}+Return".action.spawn = terminal; - "${prefix}+W".action.spawn = browser; - "${prefix}+E".action.spawn = guiFileManager; - "${prefix}+Shift+E".action.spawn = [terminal "-e" cliFileManager]; - - "${prefix}+Shift+Slash".action = config.lib.niri.actions.show-hotkey-overlay; - "${prefix}+Q".action = config.lib.niri.actions.close-window; - "${prefix}+Shift+Q".action.quit.skip-confirmation = true; - "${prefix}+F".action = config.lib.niri.actions.maximize-column; - "${prefix}+Shift+F".action = config.lib.niri.actions.fullscreen-window; - "${prefix}+C".action = config.lib.niri.actions.center-column; - - # Focus - "${prefix}+Left".action = config.lib.niri.actions.focus-column-left; - "${prefix}+Down".action = config.lib.niri.actions.focus-window-down; - "${prefix}+Up".action = config.lib.niri.actions.focus-window-up; - "${prefix}+Right".action = config.lib.niri.actions.focus-column-right; - "${prefix}+H".action = config.lib.niri.actions.focus-column-left; - "${prefix}+J".action = config.lib.niri.actions.focus-window-down; - "${prefix}+K".action = config.lib.niri.actions.focus-window-up; - "${prefix}+L".action = config.lib.niri.actions.focus-column-right; - "${prefix}+Home".action = config.lib.niri.actions.focus-column-first; - "${prefix}+End".action = config.lib.niri.actions.focus-column-last; - - # Move - "${prefix}+Ctrl+Left".action = config.lib.niri.actions.move-column-left; - "${prefix}+Ctrl+Down".action = config.lib.niri.actions.move-window-down; - "${prefix}+Ctrl+Up".action = config.lib.niri.actions.move-window-up; - "${prefix}+Ctrl+Right".action = config.lib.niri.actions.move-column-right; - "${prefix}+Ctrl+H".action = config.lib.niri.actions.move-column-left; - "${prefix}+Ctrl+J".action = config.lib.niri.actions.move-window-down; - "${prefix}+Ctrl+K".action = config.lib.niri.actions.move-window-up; - "${prefix}+Ctrl+L".action = config.lib.niri.actions.move-column-right; - "${prefix}+Ctrl+Home".action = config.lib.niri.actions.move-column-to-first; - "${prefix}+Ctrl+End".action = config.lib.niri.actions.move-column-to-last; - - # Monitor focus - "${prefix}+Shift+Left".action = config.lib.niri.actions.focus-monitor-left; - "${prefix}+Shift+Down".action = config.lib.niri.actions.focus-monitor-down; - "${prefix}+Shift+Up".action = config.lib.niri.actions.focus-monitor-up; - "${prefix}+Shift+Right".action = config.lib.niri.actions.focus-monitor-right; - "${prefix}+Shift+H".action = config.lib.niri.actions.focus-monitor-left; - "${prefix}+Shift+J".action = config.lib.niri.actions.focus-monitor-down; - "${prefix}+Shift+K".action = config.lib.niri.actions.focus-monitor-up; - "${prefix}+Shift+L".action = config.lib.niri.actions.focus-monitor-right; - - # Move to monitor - "${prefix}+Shift+Ctrl+Left".action = config.lib.niri.actions.move-column-to-monitor-left; - "${prefix}+Shift+Ctrl+Down".action = config.lib.niri.actions.move-column-to-monitor-down; - "${prefix}+Shift+Ctrl+Up".action = config.lib.niri.actions.move-column-to-monitor-up; - "${prefix}+Shift+Ctrl+Right".action = config.lib.niri.actions.move-column-to-monitor-right; - "${prefix}+Shift+Ctrl+H".action = config.lib.niri.actions.move-column-to-monitor-left; - "${prefix}+Shift+Ctrl+J".action = config.lib.niri.actions.move-column-to-monitor-down; - "${prefix}+Shift+Ctrl+K".action = config.lib.niri.actions.move-column-to-monitor-up; - "${prefix}+Shift+Ctrl+L".action = config.lib.niri.actions.move-column-to-monitor-right; - - # Workspace navigation - "${prefix}+Page_Down".action = config.lib.niri.actions.focus-workspace-down; - "${prefix}+Page_Up".action = config.lib.niri.actions.focus-workspace-up; - "${prefix}+U".action = config.lib.niri.actions.focus-workspace-down; - "${prefix}+I".action = config.lib.niri.actions.focus-workspace-up; - "${prefix}+Ctrl+Page_Down".action = config.lib.niri.actions.move-column-to-workspace-down; - "${prefix}+Ctrl+Page_Up".action = config.lib.niri.actions.move-column-to-workspace-up; - "${prefix}+Ctrl+U".action = config.lib.niri.actions.move-column-to-workspace-down; - "${prefix}+Ctrl+I".action = config.lib.niri.actions.move-column-to-workspace-up; - "${prefix}+Shift+Page_Down".action = config.lib.niri.actions.move-workspace-down; - "${prefix}+Shift+Page_Up".action = config.lib.niri.actions.move-workspace-up; - "${prefix}+Shift+U".action = config.lib.niri.actions.move-workspace-down; - - # Workspace focus - "${prefix}+1".action.focus-workspace = 1; - "${prefix}+2".action.focus-workspace = 2; - "${prefix}+3".action.focus-workspace = 3; - "${prefix}+4".action.focus-workspace = 4; - "${prefix}+5".action.focus-workspace = 5; - "${prefix}+6".action.focus-workspace = 6; - "${prefix}+7".action.focus-workspace = 7; - "${prefix}+8".action.focus-workspace = 8; - "${prefix}+9".action.focus-workspace = 9; - - # Move to workspace - "${prefix}+Ctrl+1".action.move-column-to-workspace = 1; - "${prefix}+Ctrl+2".action.move-column-to-workspace = 2; - "${prefix}+Ctrl+3".action.move-column-to-workspace = 3; - "${prefix}+Ctrl+4".action.move-column-to-workspace = 4; - "${prefix}+Ctrl+5".action.move-column-to-workspace = 5; - "${prefix}+Ctrl+6".action.move-column-to-workspace = 6; - "${prefix}+Ctrl+7".action.move-column-to-workspace = 7; - "${prefix}+Ctrl+8".action.move-column-to-workspace = 8; - "${prefix}+Ctrl+9".action.move-column-to-workspace = 9; - "${prefix}+Shift+I".action = config.lib.niri.actions.move-workspace-up; - - # Window management - "${prefix}+Comma".action = config.lib.niri.actions.consume-window-into-column; - "${prefix}+Period".action = config.lib.niri.actions.expel-window-from-column; - "${prefix}+BracketLeft".action = config.lib.niri.actions.consume-or-expel-window-left; - "${prefix}+BracketRight".action = config.lib.niri.actions.consume-or-expel-window-right; - - # Column management - "${prefix}+R".action = config.lib.niri.actions.switch-preset-column-width; - "${prefix}+Shift+R".action = config.lib.niri.actions.switch-preset-window-height; - "${prefix}+Ctrl+R".action = config.lib.niri.actions.reset-window-height; - "${prefix}+Minus".action = config.lib.niri.actions.set-column-width "-10%"; - "${prefix}+Equal".action = config.lib.niri.actions.set-column-width "+10%"; - "${prefix}+Shift+Minus".action = config.lib.niri.actions.set-window-height "-10%"; - "${prefix}+Shift+Equal".action = config.lib.niri.actions.set-window-height "+10%"; - - # Screenshots - "Print".action = config.lib.niri.actions.screenshot-screen; - "Ctrl+Print".action = config.lib.niri.actions.screenshot; - - # System - "${prefix}+Alt+L".action.spawn = [ - "${lib.getExe' pkgs.systemd "loginctl"}" - "lock-session" - ]; - - # Media keys - "XF86AudioRaiseVolume" = { - action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"]; - allow-when-locked = true; - }; - "XF86AudioLowerVolume" = { - action.spawn = ["wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"]; - allow-when-locked = true; - }; - "XF86AudioMute" = { - action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"]; - allow-when-locked = true; - }; - "XF86AudioMicMute" = { - action.spawn = ["wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"]; - allow-when-locked = true; - }; - "XF86AudioPlay" = { - action.spawn = ["playerctl" "play-pause"]; - }; - "XF86MonBrightnessUp" = { - action.spawn = ["brillo" "-q" "-u 300000" "-A 5"]; - allow-when-locked = true; - }; - "XF86MonBrightnessDown" = { - action.spawn = ["brillo" "-q" "-u 300000" "-U 5"]; - allow-when-locked = true; - }; - # set on media key since framework laptops have a gear as the button label - "XF86AudioMedia" = { - action.spawn = ["sh" "-c" "env XDG_CURRENT_DESKTOP=gnome gnome-control-center"]; - }; - - "XF86PowerOff".action.spawn = "wlogout"; - }; -} diff --git a/config/home-manager/programs/niri/default.nix b/config/home-manager/programs/niri/default.nix deleted file mode 100644 index 858a703..0000000 --- a/config/home-manager/programs/niri/default.nix +++ /dev/null @@ -1,173 +0,0 @@ -{ - lib, - pkgs, - config, - ... -}: { - imports = [./binds.nix]; - - xdg.portal = { - enable = true; - xdgOpenUsePortal = true; - extraPortals = [pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-gnome pkgs.gnome-keyring]; - config = { - common = { - default = ["gtk"]; - "org.freedesktop.impl.portal.ScreenCast" = ["gnome"]; - "org.freedesktop.impl.portal.Secret" = ["gnome-keyring"]; - }; - }; - }; - - programs.niri = { - settings = { - input = { - power-key-handling.enable = false; - keyboard.xkb = { - layout = "us"; - options = "compose:ralt"; - }; - }; - - prefer-no-csd = true; - hotkey-overlay.skip-at-startup = true; - - layout = { - focus-ring = { - enable = true; - }; - always-center-single-column = true; - }; - - # https://github.com/sodiboo/system/blob/2978f4d79c51a5bd7e38a9cd75e3ec9046aa7e75/niri.mod.nix#L418-L434 - outputs = let - cfg = config.programs.niri.settings.outputs; - in { - "HDMI-A-1" = { - mode = { - width = 1920; - height = 1080; - refresh = 60.0; - }; - position.x = -cfg."HDMI-A-1".mode.width; - position.y = 0; - }; - "DP-1" = { - mode = { - width = 2560; - height = 1440; - refresh = 144.0; - }; - position.x = 0; - position.y = 0; - }; - }; - - window-rules = [ - { - draw-border-with-background = false; - geometry-corner-radius = let - r = 8.0; - in { - top-left = r; - top-right = r; - bottom-left = r; - bottom-right = r; - }; - clip-to-geometry = true; - } - { - matches = [ - {app-id = "foot";} - ]; - default-column-width = {proportion = 0.5;}; - } - ]; - - environment = { - "NIXOS_OZONE_WL" = "1"; - "DISPLAY" = ":0"; - "_JAVA_AWT_WM_NONREPARENTING" = "1"; # https://wiki.archlinux.org/title/Sway#Java_applications - }; - }; - }; - - # copied from https://github.com/linyinfeng/dotfiles/blob/c00fe3b1562ad947672863a43e455bc2f01a56b6/home-manager/profiles/niri/default.nix#L594-L611 - systemd.user.services.xwayland-satellite = { - Unit = { - PartOf = ["graphical-session.target"]; - After = ["graphical-session.target"]; - Requisite = ["graphical-session.target"]; - }; - Install = { - WantedBy = ["niri.service"]; - }; - Service = { - Type = "simple"; - ExecStart = "${lib.getExe pkgs.xwayland-satellite} :0"; - NotifyAccess = "all"; - StandardOutput = "journal"; - Restart = "on-failure"; - }; - }; - - programs.wlogout = { - enable = true; - - layout = let - systemd = let - systemd = lib.getExe' pkgs.systemd; - in { - loginctl = systemd "loginctl"; - systemctl = systemd "systemctl"; - }; - in [ - { - action = "${systemd.loginctl} lock-session"; - keybind = "l"; - label = "lock"; - text = "Lock"; - } - - { - action = "${systemd.systemctl} hibernate"; - keybind = "h"; - label = "hibernate"; - text = "Hibernate"; - } - - { - action = "${ - systemd.loginctl - } terminate-user ${ - config.home.username - }"; - - keybind = "q"; - label = "logout"; - text = "Logout"; - } - - { - action = "${systemd.systemctl} poweroff"; - keybind = "p"; - label = "shutdown"; - text = "Shutdown"; - } - - { - action = "${systemd.systemctl} suspend"; - keybind = "s"; - label = "suspend"; - text = "Suspend"; - } - - { - action = "${systemd.systemctl} reboot"; - keybind = "r"; - label = "reboot"; - text = "Reboot"; - } - ]; - }; -} diff --git a/config/home-manager/programs/swaybg.nix b/config/home-manager/programs/swaybg.nix deleted file mode 100644 index f136e86..0000000 --- a/config/home-manager/programs/swaybg.nix +++ /dev/null @@ -1,19 +0,0 @@ -# stolen from https://raw.githubusercontent.com/carlsvelz/dotfiles/a7a109b2e19f73062b4961e7be75836e6d13408c/home/wayland/swaybg.nix -{ - pkgs, - lib, - osConfig, - ... -}: { - systemd.user.services.swaybg = { - Unit = { - Description = "Wayland wallpaper daemon"; - PartOf = ["graphical-session.target"]; - }; - Service = { - ExecStart = "${lib.getExe pkgs.swaybg} -i ${osConfig.local.style.wallpaper} -m fill"; - Restart = "on-failure"; - }; - Install.WantedBy = ["graphical-session.target"]; - }; -} diff --git a/config/home-manager/programs/swayidle.nix b/config/home-manager/programs/swayidle.nix deleted file mode 100644 index 2af615b..0000000 --- a/config/home-manager/programs/swayidle.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ - lib, - config, - ... -}: { - services.swayidle = { - enable = true; - events = [ - { - event = "lock"; - command = "${lib.getExe config.programs.swaylock.package} --daemonize"; - } - { - event = "before-sleep"; - command = "${lib.getExe config.programs.swaylock.package} --daemonize"; - } - ]; - }; - systemd.user.services.swayidle.Unit.After = lib.mkForce ["graphical-session.target"]; -} diff --git a/config/home-manager/programs/swaylock.nix b/config/home-manager/programs/swaylock.nix deleted file mode 100644 index d9c0d04..0000000 --- a/config/home-manager/programs/swaylock.nix +++ /dev/null @@ -1,24 +0,0 @@ -{pkgs, ...}: { - # requires `security.pam.services.swaylock = { };` at the system level or else - # unlock will not work. - programs.swaylock = { - enable = true; - package = pkgs.swaylock-effects; - - settings = { - clock = true; - timestr = "%H:%M"; - - indicator = true; - indicator-radius = 111; - indicator-thickness = 9; - - screenshots = true; - effect-blur = "7x5"; - effect-vignette = "0.75:0.75"; - effect-pixelate = 5; - - ignore-empty-password = false; # needed for PAM to work with fprintd / password - }; - }; -} diff --git a/config/home-manager/programs/walker.nix b/config/home-manager/programs/walker.nix deleted file mode 100644 index c9295ea..0000000 --- a/config/home-manager/programs/walker.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - lib, - inputs, - ... -}: { - imports = [ - inputs.walker.homeManagerModules.default - ]; - programs.walker = { - enable = true; - runAsService = true; - # All options from the config.json can be used here. - config = { - list = { - height = 200; - }; - app_launch_prefix = "uwsm app -- "; - websearch.prefix = "?"; - switcher.prefix = "/"; - }; - }; - - systemd.user.services.walker = { - Unit = { - PartOf = lib.mkForce []; - After = lib.mkForce ["graphical-session.target"]; - }; - Service = { - Slice = lib.mkForce "background-graphical.slice"; - }; - }; -} diff --git a/config/home-manager/programs/waybar/default.nix b/config/home-manager/programs/waybar/default.nix deleted file mode 100644 index d84656c..0000000 --- a/config/home-manager/programs/waybar/default.nix +++ /dev/null @@ -1,187 +0,0 @@ -{ - pkgs, - lib, - ... -}: { - programs.waybar = { - enable = true; - systemd.enable = true; - settings = { - mainBar = { - layer = "top"; - position = "top"; - - modules-left = [ - "hyprland/window" - "pulseaudio" - "cpu" - "memory" - "idle_inhibitor" - ]; - - modules-center = ["hyprland/workspaces"]; - modules-right = [ - "custom/swaync" - "custom/power" - "network" - "battery" - "tray" - "clock" - ]; - - tray = { - icon-size = 16; - spacing = 12; - }; - - battery = { - interval = 10; - states = { - warning = 30; - critical = 15; - }; - format = "{icon} {capacity}%"; - format-charging = " {capacity}% - {time}"; - format-full = " {capacity}% - Full"; - format-icons = [ - "" - "" - "" - "" - "" - ]; - max-length = 25; - }; - - "pulseaudio" = { - format = "{icon} {volume}%"; - format-bluetooth = "{icon} {volume}%"; - format-muted = ""; - format-icons = { - "alsa_output.pci-0000_00_1f.3.analog-stereo" = ""; - "alsa_output.pci-0000_00_1f.3.analog-stereo-muted" = ""; - headphone = ""; - hands-free = ""; - headset = ""; - phone = ""; - phone-muted = ""; - portable = ""; - car = ""; - default = [ - "" - "" - ]; - }; - scroll-step = 1; - on-click = "pavucontrol"; - ignored-sinks = [ - "Easy Effects Sink" - ]; - }; - - "power-profiles-daemon" = { - format-icons = { - default = ""; - performance = ""; - balanced = ""; - power-saver = ""; - }; - }; - - "custom/power" = { - format = ""; - tooltip = false; - on-click = lib.getExe pkgs.wlogout; - }; - - "memory" = { - interval = 5; - format = " {}%"; - tooltip = true; - }; - - "cpu" = { - interval = 5; - format = " {usage:2}%"; - tooltip = true; - }; - - "idle_inhibitor" = { - format = "{icon}"; - format-icons = { - activated = ""; - deactivated = ""; - }; - tooltip = "true"; - }; - - "clock" = { - format = " {:L%H:%M}"; - tooltip = true; - tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; - }; - - "network" = { - format-icons = [ - "󰤯" - "󰤟" - "󰤢" - "󰤥" - "󰤨" - ]; - format-ethernet = " {bandwidthDownOctets}"; - format-wifi = "{icon} {signalStrength}%"; - format-disconnected = "󰤮"; - tooltip = false; - on-click = "XDG_CURRENT_DESKTOP=gnome gnome-control-center"; - }; - - "hyprland/window" = { - max-length = 22; - separate-outputs = false; - }; - - "hyprland/workspaces" = { - format = "{name}"; - format-icons = { - default = " "; - active = " "; - urgent = " "; - }; - on-scroll-up = "hyprctl dispatch workspace e+1"; - on-scroll-down = "hyprctl dispatch workspace e-1"; - }; - - "custom/swaync" = { - tooltip = false; - format = "{icon}"; - format-icons = { - none = ""; - notification = ""; - dnd-notification = ""; - dnd-none = ""; - inhibited-notification = ""; - inhibited-none = ""; - dnd-inhibited-notification = ""; - dnd-inhibited-none = ""; - }; - return-type = "json"; - escape = true; - exec-if = "which ${pkgs.swaynotificationcenter}/bin/swaync-client"; - exec = "${pkgs.swaynotificationcenter}/bin/swaync-client --subscribe-waybar"; - on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-panel --skip-wait"; - on-click-middle = "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-dnd --skip-wait"; - }; - }; - }; - }; - - systemd.user.services.waybar = { - Unit.After = lib.mkForce "graphical-session.target"; - Service.Slice = "app-graphical.slice"; - }; - - home.packages = [ - pkgs.pavucontrol - ]; -} diff --git a/config/home-manager/programs/wlogout.nix b/config/home-manager/programs/wlogout.nix deleted file mode 100644 index 8423a8e..0000000 --- a/config/home-manager/programs/wlogout.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - programs.wlogout = { - enable = true; - - layout = let - systemd = let - systemd = lib.getExe' pkgs.systemd; - in { - loginctl = systemd "loginctl"; - systemctl = systemd "systemctl"; - }; - in [ - { - action = "${systemd.loginctl} lock-session"; - keybind = "l"; - label = "lock"; - text = "Lock"; - } - - { - action = "${systemd.systemctl} hibernate"; - keybind = "h"; - label = "hibernate"; - text = "Hibernate"; - } - - { - action = "${ - systemd.loginctl - } terminate-user ${ - config.home.username - }"; - - keybind = "q"; - label = "logout"; - text = "Logout"; - } - - { - action = "${systemd.systemctl} poweroff"; - keybind = "p"; - label = "shutdown"; - text = "Shutdown"; - } - - { - action = "${systemd.systemctl} suspend"; - keybind = "s"; - label = "suspend"; - text = "Suspend"; - } - - { - action = "${systemd.systemctl} reboot"; - keybind = "r"; - label = "reboot"; - text = "Reboot"; - } - ]; - }; -} diff --git a/config/home-manager/programs/xdg.nix b/config/home-manager/programs/xdg.nix deleted file mode 100644 index 315898e..0000000 --- a/config/home-manager/programs/xdg.nix +++ /dev/null @@ -1,35 +0,0 @@ -{config, ...}: { - xdg = { - enable = true; - cacheHome = config.home.homeDirectory + "/.local/cache"; - - mimeApps = { - enable = true; - defaultApplications = { - "default-web-browser" = ["firefox.desktop"]; - "text/html" = ["firefox.desktop"]; - "x-scheme-handler/http" = ["firefox.desktop"]; - "x-scheme-handler/https" = ["firefox.desktop"]; - "x-scheme-handler/about" = ["firefox.desktop"]; - "x-scheme-handler/unknown" = ["firefox.desktop"]; - "x-scheme-handler/chrome" = ["chromium-browser.desktop"]; - "inode/directory" = ["yazi.desktop"]; - "application/pdf" = ["org.pwmt.zathura-pdf-mupdf.desktop"]; - "image/png" = ["org.gnome.gThumb.desktop"]; - "image/svg" = [" org.gnome.gThumb.desktop"]; - "image/jpeg" = ["org.gnome.gThumb.desktop"]; - "image/gif" = [" org.gnome.gThumb.desktop"]; - "video/mp4" = ["io.github.celluloid_player.Celluloid.desktop"]; - "video/avi" = ["io.github.celluloid_player.Celluloid.desktop"]; - "video/mkv" = ["io.github.celluloid_player.Celluloid.desktop"]; - }; - }; - userDirs = { - enable = true; - createDirectories = true; - extraConfig = { - XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; - }; - }; - }; -} diff --git a/config/home-manager/services/flatpak.nix b/config/home-manager/services/flatpak.nix deleted file mode 100644 index f7d04c0..0000000 --- a/config/home-manager/services/flatpak.nix +++ /dev/null @@ -1,9 +0,0 @@ -{inputs, ...}: { - imports = [inputs.nix-flatpak.homeManagerModules.nix-flatpak]; - services.flatpak.packages = [ - { - flatpakref = "https://sober.vinegarhq.org/sober.flatpakref"; - sha256 = "1pj8y1xhiwgbnhrr3yr3ybpfis9slrl73i0b1lc9q89vhip6ym2l"; - } - ]; -} diff --git a/config/home-manager/services/gammastep.nix b/config/home-manager/services/gammastep.nix deleted file mode 100644 index 68bd073..0000000 --- a/config/home-manager/services/gammastep.nix +++ /dev/null @@ -1,17 +0,0 @@ -{lib, ...}: { - services.gammastep = { - enable = true; - tray = true; - provider = "geoclue2"; - }; - - systemd.user.services.gammastep = { - Unit = { - PartOf = lib.mkForce []; - After = lib.mkForce ["graphical-session.target"]; - }; - Service = { - Slice = lib.mkForce "background-graphical.slice"; - }; - }; -} diff --git a/config/home-manager/services/swaync/default.nix b/config/home-manager/services/swaync/default.nix deleted file mode 100644 index 1028d2d..0000000 --- a/config/home-manager/services/swaync/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{lib, ...}: let - inherit (builtins) readFile; -in { - services.swaync = { - enable = true; - style = readFile ./style.css; - settings = { - positionX = "right"; - positionY = "top"; - layer = "overlay"; - control-center-layer = "top"; - layer-shell = true; - cssPriority = "application"; - control-center-margin-top = 0; - control-center-margin-bottom = 0; - control-center-margin-right = 0; - control-center-margin-left = 0; - notification-2fa-action = true; - notification-inline-replies = false; - notification-icon-size = 64; - notification-body-image-height = 100; - notification-body-image-width = 200; - }; - }; - # systemd.user.services.swaync.Service.Environment = "WAYLAND_DISPLAY=wayland-1"; - systemd.user.services.swaync.Unit.ConditionEnvironment = lib.mkForce ""; -} diff --git a/config/home-manager/services/syncthing.nix b/config/home-manager/services/syncthing.nix deleted file mode 100644 index fae0786..0000000 --- a/config/home-manager/services/syncthing.nix +++ /dev/null @@ -1,5 +0,0 @@ -_: { - services.syncthing = { - enable = true; - }; -} diff --git a/config/home-manager/services/udiskie.nix b/config/home-manager/services/udiskie.nix deleted file mode 100644 index f3ea3b8..0000000 --- a/config/home-manager/services/udiskie.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - services.udiskie.enable = true; -} diff --git a/config/home-manager/terminal/default.nix b/config/home-manager/terminal/default.nix deleted file mode 100644 index dcf4368..0000000 --- a/config/home-manager/terminal/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -_: { - imports = [ - ./programs - ./shell - ]; - - home.sessionVariables = { - EDITOR = "nvim"; - }; -} diff --git a/config/home-manager/terminal/emulators/foot.nix b/config/home-manager/terminal/emulators/foot.nix deleted file mode 100644 index 5172de2..0000000 --- a/config/home-manager/terminal/emulators/foot.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - osConfig, - config, - lib, - ... -}: let -in { - programs.foot = { - enable = true; - settings = { - main = { - term = "xterm-256color"; - font = "monospace:size=14"; - shell = "${lib.getExe config.programs.fish.package}"; - }; - }; - }; -} diff --git a/config/home-manager/terminal/emulators/gnome-terminal.nix b/config/home-manager/terminal/emulators/gnome-terminal.nix deleted file mode 100644 index 42ba538..0000000 --- a/config/home-manager/terminal/emulators/gnome-terminal.nix +++ /dev/null @@ -1,16 +0,0 @@ -_: { - programs.gnome-terminal = { - enable = true; - showMenubar = true; - profile = { - "4621184a-b921-42cf-80a0-7784516606f2" = { - default = true; - audibleBell = false; - allowBold = true; - boldIsBright = true; - visibleName = "default"; - font = "Intel One Mono 14"; - }; - }; - }; -} diff --git a/config/home-manager/terminal/emulators/wezterm.nix b/config/home-manager/terminal/emulators/wezterm.nix deleted file mode 100644 index 70631f1..0000000 --- a/config/home-manager/terminal/emulators/wezterm.nix +++ /dev/null @@ -1,71 +0,0 @@ -{ - programs.wezterm = { - enable = true; - # package = inputs.wezterm.packages.${pkgs.system}.default; - extraConfig = '' - local w = require('wezterm') - - local function is_vim(pane) - return pane:get_user_vars().IS_NVIM == 'true' - end - - local direction_keys = { - h = 'Left', - j = 'Down', - k = 'Up', - l = 'Right', - } - - local function split_nav(resize_or_move, key) - return { - key = key, - mods = resize_or_move == 'resize' and 'META' or 'CTRL', - action = w.action_callback(function(win, pane) - if is_vim(pane) then - win:perform_action({ - SendKey = { key = key, mods = resize_or_move == 'resize' and 'META' or 'CTRL' }, - }, pane) - else - if resize_or_move == 'resize' then - win:perform_action({ AdjustPaneSize = { direction_keys[key], 3 } }, pane) - else - win:perform_action({ ActivatePaneDirection = direction_keys[key] }, pane) - end - end - end), - } - end - - return { - enable_wayland = false, - front_end = "WebGpu", - hide_tab_bar_if_only_one_tab = true, - show_new_tab_button_in_tab_bar = false, - harfbuzz_features = { "ss01", "ss03" }, - - leader = { key = " ", mods = "CTRL", timeout_milliseconds = 1000 }, - - keys = { - { - mods = "LEADER", - key = "-", - action = wezterm.action.SplitVertical { domain = "CurrentPaneDomain" } - }, - { - mods = "LEADER", - key = "=", - action = wezterm.action.SplitHorizontal { domain = "CurrentPaneDomain" } - }, - split_nav('move', 'h'), - split_nav('move', 'j'), - split_nav('move', 'k'), - split_nav('move', 'l'), - split_nav('resize', 'h'), - split_nav('resize', 'j'), - split_nav('resize', 'k'), - split_nav('resize', 'l'), - }, - } - ''; - }; -} diff --git a/config/home-manager/terminal/programs/bat.nix b/config/home-manager/terminal/programs/bat.nix deleted file mode 100644 index 4a7e8eb..0000000 --- a/config/home-manager/terminal/programs/bat.nix +++ /dev/null @@ -1,19 +0,0 @@ -{pkgs, ...}: { - programs.bat = { - enable = true; - config.theme = "base16"; - }; - - home = { - sessionVariables = { - MANPAGER = "sh -c 'col -bx | bat --language man' "; - MANROFFOPT = "-c"; - }; - - packages = with pkgs.bat-extras; [ - batman - ]; - - shellAliases.man = "batman"; - }; -} diff --git a/config/home-manager/terminal/programs/default.nix b/config/home-manager/terminal/programs/default.nix deleted file mode 100644 index 22e02a9..0000000 --- a/config/home-manager/terminal/programs/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./bat.nix - ./git.nix - ./gnupg.nix - ./tmux.nix - ./direnv.nix - ./nix-index.nix - ./yazi.nix - ]; - - home.packages = with pkgs; [ - # archives - zip - unzip - unrar - - # utils - fd - file - ripgrep - ]; -} diff --git a/config/home-manager/terminal/programs/direnv.nix b/config/home-manager/terminal/programs/direnv.nix deleted file mode 100644 index bf4e94e..0000000 --- a/config/home-manager/terminal/programs/direnv.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs = { - direnv = { - enable = true; - nix-direnv.enable = true; - }; - }; -} diff --git a/config/home-manager/terminal/programs/git.nix b/config/home-manager/terminal/programs/git.nix deleted file mode 100644 index d452fa7..0000000 --- a/config/home-manager/terminal/programs/git.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - programs.git = { - enable = true; - userName = "Anthony Rodriguez"; - userEmail = "anthony@nezia.dev"; - signing = { - signByDefault = true; - key = "EE3BE97C040A86CE"; - }; - extraConfig = { - push.autoSetupRemote = true; - init = { - defaultBranch = "main"; - }; - }; - }; - - programs.lazygit = { - enable = true; - }; - - home.shellAliases = { - lg = "lazygit"; - g = "git"; - gs = "git status"; - gsh = "git show HEAD"; - gshs = "DELTA_FEATURES=+side-by-side git show HEAD"; - ga = "git add"; - gaa = "git add :/"; - gap = "git add -p"; - gc = "git commit"; - gca = "git commit --amend"; - gcm = "git commit --message"; - gcf = "git commit --fixup"; - gk = "git checkout"; - gkp = "git checkout -p"; - gd = "git diff"; - gds = "DELTA_FEATURES=+side-by-side git diff"; - gdc = "git diff --cached"; - gdcs = "DELTA_FEATURES=+side-by-side git diff --cached"; - gf = "git fetch"; - gl = "git log"; - glp = "git log -p"; - glps = "DELTA_FEATURES=+side-by-side git log -p"; - gp = "git push"; - gpf = "git push --force-with-lease"; - gr = "git reset"; - gra = "git reset :/"; - grp = "git reset -p"; - gt = "git stash"; - gtp = "git stash pop"; - gu = "git pull"; - }; -} diff --git a/config/home-manager/terminal/programs/gnupg.nix b/config/home-manager/terminal/programs/gnupg.nix deleted file mode 100644 index 26a0a49..0000000 --- a/config/home-manager/terminal/programs/gnupg.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs.gpg.enable = true; - services.gpg-agent = { - enable = true; - enableBashIntegration = true; - enableFishIntegration = true; - }; -} diff --git a/config/home-manager/terminal/programs/nix-index.nix b/config/home-manager/terminal/programs/nix-index.nix deleted file mode 100644 index 04a55a2..0000000 --- a/config/home-manager/terminal/programs/nix-index.nix +++ /dev/null @@ -1,11 +0,0 @@ -{inputs, ...}: { - imports = [inputs.nix-index-db.hmModules.nix-index]; - programs = { - nix-index = { - enable = true; - symlinkToCacheHome = true; # needed for comma - }; - command-not-found.enable = false; - nix-index-database.comma.enable = true; - }; -} diff --git a/config/home-manager/terminal/programs/tmux.nix b/config/home-manager/terminal/programs/tmux.nix deleted file mode 100644 index 7c08d03..0000000 --- a/config/home-manager/terminal/programs/tmux.nix +++ /dev/null @@ -1,23 +0,0 @@ -{pkgs, ...}: { - programs.tmux = { - enable = true; - prefix = "C-space"; - escapeTime = 10; - clock24 = true; - keyMode = "vi"; - mouse = true; - baseIndex = 1; - extraConfig = '' - set-option -a terminal-features "''${TERM}:RGB" - bind c new-window -c "#{pane_current_path}" - bind '"' split-window -v -c "#{pane_current_path}" - bind '%' split-window -h -c "#{pane_current_path}" - bind C-k clear-history - ''; - plugins = with pkgs; [ - tmuxPlugins.vim-tmux-navigator - tmuxPlugins.yank - ]; - }; - programs.fzf.tmux.enableShellIntegration = true; -} diff --git a/config/home-manager/terminal/programs/yazi.nix b/config/home-manager/terminal/programs/yazi.nix deleted file mode 100644 index e439e7f..0000000 --- a/config/home-manager/terminal/programs/yazi.nix +++ /dev/null @@ -1,26 +0,0 @@ -{pkgs, ...}: { - programs.yazi = let - # https://github.com/iynaix/dotfiles/blob/8bb1568019ea26f034ac1af9c499b3ff102391a5/home-manager/shell/yazi.nix#L9-L11 - mkYaziPlugin = name: text: { - "${name}" = toString (pkgs.writeTextDir "${name}.yazi/init.lua" text) + "/${name}.yazi"; - }; - in { - enable = true; - enableFishIntegration = true; - plugins = mkYaziPlugin "smart-enter" '' - return { - entry = function() - local h = cx.active.current.hovered - ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true }) - end, - } - ''; - keymap.manager.prepend_keymap = [ - { - on = "l"; - run = "plugin --sync smart-enter"; - desc = "Enter the child directory, or open the file"; - } - ]; - }; -} diff --git a/config/home-manager/terminal/shell/fish.nix b/config/home-manager/terminal/shell/fish.nix deleted file mode 100644 index 0e4e4f9..0000000 --- a/config/home-manager/terminal/shell/fish.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - starshipTransient = lib.strings.optionalString config.programs.starship.enableTransience '' - function starship_transient_prompt_func - starship module character - end - - function starship_transient_rprompt_func - starship module cmd_duration - end - ''; -in { - programs.fish = { - enable = true; - interactiveShellInit = - starshipTransient - + '' - set fish_greeting # Disable greeting - fish_vi_key_bindings # Enable Vi mode - - ''; - plugins = [ - { - name = "fzf"; - inherit (pkgs.fishPlugins.fzf) src; - } - { - name = "autopair"; - inherit (pkgs.fishPlugins.autopair) src; - } - ]; - }; - - programs.bash = { - enable = true; - initExtra = '' - if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] - then - shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" - exec ${pkgs.fish}/bin/fish $LOGIN_OPTION - fi - ''; - }; -} diff --git a/config/home-manager/terminal/shell/nushell.nix b/config/home-manager/terminal/shell/nushell.nix deleted file mode 100644 index 9cd0c78..0000000 --- a/config/home-manager/terminal/shell/nushell.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - programs.nushell = { - enable = true; - extraConfig = '' - let carapace_completer = {|spans| - carapace $spans.0 nushell ...$spans | from json - } - $env.config = { - show_banner: false, - completions: { - case_sensitive: false # case-sensitive completions - quick: true # set to false to prevent auto-selecting completions - partial: true # set to false to prevent partial filling of the prompt - algorithm: "fuzzy" # prefix or fuzzy - external: { - # set to false to prevent nushell looking into $env.PATH to find more suggestions - enable: true - # set to lower can improve completion performance at the cost of omitting some options - max_results: 100 - completer: $carapace_completer # check 'carapace_completer' - } - } - } - ''; - }; - - programs.carapace = { - enable = true; - }; -} diff --git a/config/home-manager/terminal/shell/starship.nix b/config/home-manager/terminal/shell/starship.nix deleted file mode 100644 index 0ddba82..0000000 --- a/config/home-manager/terminal/shell/starship.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - programs.starship = { - enable = true; - enableTransience = true; - settings = { - add_newline = true; - }; - }; -} diff --git a/config/home-manager/terminal/shell/zoxide.nix b/config/home-manager/terminal/shell/zoxide.nix deleted file mode 100644 index 6317ebe..0000000 --- a/config/home-manager/terminal/shell/zoxide.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.zoxide = { - enable = true; - enableBashIntegration = false; - }; -} diff --git a/config/nixos/core/home-manager.nix b/config/nixos/core/home-manager.nix deleted file mode 100644 index f7bfbf6..0000000 --- a/config/nixos/core/home-manager.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ - config, - inputs, - ... -}: let - inherit (config.local.systemVars) username; -in { - imports = [ - inputs.home-manager.nixosModules.default - ]; - - home-manager = { - backupFileExtension = "backup"; - useGlobalPkgs = true; - useUserPackages = true; - }; - - home-manager.users.${username} = { - home = { - homeDirectory = "/home/${username}"; - stateVersion = "24.05"; - }; - - programs.home-manager.enable = true; - }; - - programs = { - # make HM-managed GTK stuff work - dconf.enable = true; - }; -} diff --git a/config/nixos/core/lanzaboote.nix b/config/nixos/core/lanzaboote.nix deleted file mode 100644 index d6cc73d..0000000 --- a/config/nixos/core/lanzaboote.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - pkgs, - lib, - inputs, - ... -}: { - imports = [ - inputs.lanzaboote.nixosModules.lanzaboote - ]; - - environment.systemPackages = [ - # For debugging and troubleshooting Secure Boot. - pkgs.sbctl - ]; - - # Lanzaboote currently replaces the systemd-boot module. - # This setting is usually set to true in configuration.nix - # generated at installation time. So we force it to false - # for now. - boot.loader.systemd-boot.enable = lib.mkForce false; - - boot.lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - }; -} diff --git a/config/nixos/core/networking.nix b/config/nixos/core/networking.nix deleted file mode 100644 index 3e48d2f..0000000 --- a/config/nixos/core/networking.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - networking.nameservers = ["1.1.1.1" "1.0.0.1"]; -} diff --git a/config/nixos/core/users.nix b/config/nixos/core/users.nix deleted file mode 100644 index 8f9f138..0000000 --- a/config/nixos/core/users.nix +++ /dev/null @@ -1,13 +0,0 @@ -{config, ...}: { - users.users.${config.local.systemVars.username} = { - isNormalUser = true; - description = config.local.homeVars.fullName or "User"; - extraGroups = [ - "networkmanager" - "audio" - "video" - "wheel" - "plugdev" - ]; - }; -} diff --git a/config/nixos/default.nix b/config/nixos/default.nix deleted file mode 100644 index 48a6962..0000000 --- a/config/nixos/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - imports = [ - ./core - ./nix - - ./hardware/printing.nix - ./hardware/fwupd.nix - - ./network - - ./programs - - ./services - ]; -} diff --git a/config/nixos/hardware/fprintd.nix b/config/nixos/hardware/fprintd.nix deleted file mode 100644 index 366fa60..0000000 --- a/config/nixos/hardware/fprintd.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - services.fprintd.enable = true; -} diff --git a/config/nixos/hardware/fwupd.nix b/config/nixos/hardware/fwupd.nix deleted file mode 100644 index a62f709..0000000 --- a/config/nixos/hardware/fwupd.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - services.fwupd.enable = true; -} diff --git a/config/nixos/hardware/mcuxpresso.nix b/config/nixos/hardware/mcuxpresso.nix deleted file mode 100644 index 57e7ba6..0000000 --- a/config/nixos/hardware/mcuxpresso.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - inputs, - pkgs, - ... -}: { - services.udev.packages = [ - inputs.self.packages.${pkgs.system}.mcuxpresso - ]; -} diff --git a/config/nixos/hardware/printing.nix b/config/nixos/hardware/printing.nix deleted file mode 100644 index 09c1f43..0000000 --- a/config/nixos/hardware/printing.nix +++ /dev/null @@ -1,28 +0,0 @@ -{pkgs, ...}: { - services = { - # setup printing service - printing.enable = true; - - avahi = { - enable = true; - nssmdns4 = true; - openFirewall = true; - }; - - printing.drivers = [ - pkgs.gutenprint - pkgs.hplip - ]; - udev.packages = [ - pkgs.sane-airscan - pkgs.utsushi - ]; - }; - - hardware.sane.enable = true; # enables support for SANE scanners - hardware.sane.extraBackends = [ - pkgs.sane-airscan # generic - pkgs.hplip # HP - pkgs.utsushi # other printers - ]; -} diff --git a/config/nixos/hardware/uni-sync.nix b/config/nixos/hardware/uni-sync.nix deleted file mode 100644 index 41c238d..0000000 --- a/config/nixos/hardware/uni-sync.nix +++ /dev/null @@ -1,37 +0,0 @@ -{pkgs, ...}: { - hardware.uni-sync = { - enable = true; - devices = [ - { - device_id = "VID:3314/PID:41218/SN:6243168001"; - sync_rgb = true; - channels = [ - { - mode = "Manual"; - speed = 60; - } - { - mode = "Manual"; - speed = 60; - } - { - mode = "Manual"; - speed = 60; - } - { - mode = "Manual"; - speed = 60; - } - ]; - } - ]; - }; - - systemd.services.uni-sync = { - enable = true; - serviceConfig = { - ExecStart = "${pkgs.uni-sync}/bin/uni-sync"; - }; - wantedBy = ["multi-user.target"]; - }; -} diff --git a/config/nixos/hardware/via.nix b/config/nixos/hardware/via.nix deleted file mode 100644 index 05c1c48..0000000 --- a/config/nixos/hardware/via.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: { - hardware.keyboard.qmk.enable = true; - environment.systemPackages = with pkgs; [ - via - ]; - services.udev.packages = [pkgs.via]; -} diff --git a/config/nixos/network/default.nix b/config/nixos/network/default.nix deleted file mode 100644 index bd330cd..0000000 --- a/config/nixos/network/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{config, ...}: { - networking = { - inherit (config.local.systemVars) hostName; - networkmanager = { - enable = true; - dns = "systemd-resolved"; - wifi.powersave = true; - }; - }; - services.resolved = { - enable = true; - dnsovertls = "opportunistic"; - }; -} diff --git a/config/nixos/nix/default.nix b/config/nixos/nix/default.nix deleted file mode 100644 index 3cef10e..0000000 --- a/config/nixos/nix/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{pkgs, ...}: { - imports = [./nixpkgs.nix ./nh.nix]; - environment.systemPackages = [pkgs.git]; - nix = { - package = pkgs.lix; - settings = { - accept-flake-config = true; - warn-dirty = false; - auto-optimise-store = true; - trusted-users = ["root" "@wheel"]; - experimental-features = [ - "nix-command" - "flakes" - ]; - }; - }; -} diff --git a/config/nixos/nix/nh.nix b/config/nixos/nix/nh.nix deleted file mode 100644 index d6508cf..0000000 --- a/config/nixos/nix/nh.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - programs.nh = { - enable = true; - clean = { - enable = true; - extraArgs = "--keep-since 30d --keep 3"; - }; - }; -} diff --git a/config/nixos/nix/nixpkgs.nix b/config/nixos/nix/nixpkgs.nix deleted file mode 100644 index bc54cff..0000000 --- a/config/nixos/nix/nixpkgs.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ - nixpkgs = { - config = { - allowUnfree = true; - permittedInsecurePackages = [ - "cinny-4.2.3" - "cinny-unwrapped-4.2.3" - "segger-jlink-qt4-810" - ]; - segger-jlink.acceptLicense = true; - }; - }; -} diff --git a/config/nixos/programs/default.nix b/config/nixos/programs/default.nix deleted file mode 100644 index 2b547d6..0000000 --- a/config/nixos/programs/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - imports = [ - ./fonts.nix - ]; -} diff --git a/config/nixos/programs/fonts.nix b/config/nixos/programs/fonts.nix deleted file mode 100644 index 7136175..0000000 --- a/config/nixos/programs/fonts.nix +++ /dev/null @@ -1,24 +0,0 @@ -{pkgs, ...}: { - fonts = { - enableDefaultPackages = false; - packages = [ - pkgs.noto-fonts - pkgs.noto-fonts-cjk-sans - pkgs.noto-fonts-extra - pkgs.intel-one-mono - pkgs.noto-fonts-color-emoji - pkgs.nerd-fonts._0xproto - pkgs.nerd-fonts.symbols-only - ]; - - fontconfig = { - enable = true; - defaultFonts = { - serif = ["Noto Serif"]; - sansSerif = ["Inter Medium"]; - monospace = ["0xProto Nerd Font"]; - emoji = ["Noto Color Emoji"]; - }; - }; - }; -} diff --git a/config/nixos/programs/games.nix b/config/nixos/programs/games.nix deleted file mode 100644 index a825437..0000000 --- a/config/nixos/programs/games.nix +++ /dev/null @@ -1,15 +0,0 @@ -_: { - programs = { - steam = { - enable = true; - }; - - gamemode.enable = true; - gamescope.enable = true; - - coolercontrol = { - enable = true; - nvidiaSupport = true; - }; - }; -} diff --git a/config/nixos/programs/gnome.nix b/config/nixos/programs/gnome.nix deleted file mode 100644 index 773e712..0000000 --- a/config/nixos/programs/gnome.nix +++ /dev/null @@ -1,40 +0,0 @@ -{pkgs, ...}: { - services.xserver = { - enable = true; - displayManager.gdm.enable = true; - desktopManager.gnome = { - enable = true; - extraGSettingsOverridePackages = [pkgs.mutter]; - extraGSettingsOverrides = '' - [org.gnome.mutter] - experimental-features=['scale-monitor-framebuffer'] - ''; - }; - }; - - environment.gnome.excludePackages = with pkgs; [ - gnome-console - gnome-photos - gnome-tour - gnome-software - iagno - hitori - atomix - gnome-contacts - gnome-initial-setup - gnome-terminal - gnome-music - gedit - cheese - tali - epiphany - geary - yelp - ]; - - environment.systemPackages = with pkgs; [ - gnome-tweaks - gnome-power-manager - rhythmbox - ]; -} diff --git a/config/nixos/programs/hyprland.nix b/config/nixos/programs/hyprland.nix deleted file mode 100644 index 9cf85c2..0000000 --- a/config/nixos/programs/hyprland.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - inputs, - config, - lib, - pkgs, - ... -}: { - environment.systemPackages = [ - inputs.hyprland-qtutils.packages.${pkgs.system}.default - ]; - programs.hyprland = { - enable = true; - package = inputs.hyprland.packages.${pkgs.system}.hyprland; - portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; - withUWSM = true; - systemd.setPath.enable = true; - }; - - # copied from https://github.com/linyinfeng/dotfiles/blob/91b0363b093303f57885cbae9da7f8a99bbb4432/nixos/profiles/graphical/niri/default.nix#L17-L29 - security.pam.services.hyprlock.text = lib.mkIf config.services.fprintd.enable '' - account required pam_unix.so - - # check passwork before fprintd - auth sufficient pam_unix.so try_first_pass likeauth - auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so - auth required pam_deny.so - - password sufficient pam_unix.so nullok yescrypt - - session required pam_env.so conffile=/etc/pam/environment readenv=0 - session required pam_unix.so - ''; -} diff --git a/config/nixos/programs/kde.nix b/config/nixos/programs/kde.nix deleted file mode 100644 index 5a5ace6..0000000 --- a/config/nixos/programs/kde.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - services = { - displayManager.sddm.enable = true; - displayManager.sddm.wayland.enable = true; - desktopManager.plasma6.enable = true; - }; -} diff --git a/config/nixos/programs/niri/default.nix b/config/nixos/programs/niri/default.nix deleted file mode 100644 index 6f8bb7b..0000000 --- a/config/nixos/programs/niri/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ - inputs, - lib, - pkgs, - config, - ... -}: { - imports = [ - inputs.niri.nixosModules.niri - ]; - - programs.niri = { - enable = true; - }; - - # copied from https://github.com/linyinfeng/dotfiles/blob/91b0363b093303f57885cbae9da7f8a99bbb4432/nixos/profiles/graphical/niri/default.nix#L17-L29 - security.pam.services.swaylock.text = lib.mkIf config.services.fprintd.enable '' - account required pam_unix.so - - # check passwork before fprintd - auth sufficient pam_unix.so try_first_pass likeauth - auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so - auth required pam_deny.so - - password sufficient pam_unix.so nullok yescrypt - - session required pam_env.so conffile=/etc/pam/environment readenv=0 - session required pam_unix.so - ''; - - environment.systemPackages = [pkgs.xwayland-satellite]; -} diff --git a/config/nixos/programs/xdg.nix b/config/nixos/programs/xdg.nix deleted file mode 100644 index 209796f..0000000 --- a/config/nixos/programs/xdg.nix +++ /dev/null @@ -1,14 +0,0 @@ -{pkgs, ...}: { - xdg.portal = { - enable = true; - xdgOpenUsePortal = true; - config = { - common.default = ["gtk"]; - hyprland.default = ["gtk" "hyprland"]; - }; - - extraPortals = [ - pkgs.xdg-desktop-portal-gtk - ]; - }; -} diff --git a/config/nixos/services/brightness.nix b/config/nixos/services/brightness.nix deleted file mode 100644 index 4cbef77..0000000 --- a/config/nixos/services/brightness.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - hardware.brillo.enable = true; -} diff --git a/config/nixos/services/default.nix b/config/nixos/services/default.nix deleted file mode 100644 index b12c274..0000000 --- a/config/nixos/services/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{pkgs, ...}: { - imports = [ - ./docker.nix - ./gnupg.nix - ./pipewire.nix - ./kmscon.nix - ]; - services.udev.packages = [pkgs.segger-jlink]; -} diff --git a/config/nixos/services/docker.nix b/config/nixos/services/docker.nix deleted file mode 100644 index 36e58a8..0000000 --- a/config/nixos/services/docker.nix +++ /dev/null @@ -1,8 +0,0 @@ -{pkgs, ...}: { - virtualisation.podman = { - enable = true; - dockerCompat = true; - }; - - environment.systemPackages = [pkgs.distrobox]; -} diff --git a/config/nixos/services/documentation.nix b/config/nixos/services/documentation.nix deleted file mode 100644 index 0919470..0000000 --- a/config/nixos/services/documentation.nix +++ /dev/null @@ -1,12 +0,0 @@ -_: { - documentation = { - enable = true; - - man = { - enable = true; - man-db.enable = false; - mandoc.enable = true; - generateCaches = true; - }; - }; -} diff --git a/config/nixos/services/flatpak.nix b/config/nixos/services/flatpak.nix deleted file mode 100644 index cf588bd..0000000 --- a/config/nixos/services/flatpak.nix +++ /dev/null @@ -1,3 +0,0 @@ -_: { - services.flatpak.enable = true; -} diff --git a/config/nixos/services/forgejo.nix b/config/nixos/services/forgejo.nix deleted file mode 100644 index 0f0f33d..0000000 --- a/config/nixos/services/forgejo.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: let - inherit (lib) mkAfter removePrefix removeSuffix; - srv = config.services.forgejo.settings.server; - - # https://github.com/isabelroses/dotfiles/blob/06f8f70914c8e672541a52563ee624ce2e62adfb/modules/nixos/services/selfhosted/forgejo.nix#L19-L23 - theme = pkgs.fetchzip { - url = "https://github.com/catppuccin/gitea/releases/download/v1.0.1/catppuccin-gitea.tar.gz"; - sha256 = "et5luA3SI7iOcEIQ3CVIu0+eiLs8C/8mOitYlWQa/uI="; - stripRoot = false; - }; -in { - services = { - forgejo = { - enable = true; - package = pkgs.forgejo; - lfs.enable = true; - database.type = "postgres"; - dump = { - enable = true; - type = "tar.xz"; - }; - settings = { - server = { - DOMAIN = "git.nezia.dev"; - HTTP_PORT = 1849; - ROOT_URL = "https://${srv.DOMAIN}/"; - HTTP_ADDR = "localhost"; - }; - service = { - DISABLE_REGISTRATION = true; - }; - federation = { - ENABLED = true; - }; - ui = { - DEFAULT_THEME = "catppuccin-mocha-lavender"; - THEMES = builtins.concatStringsSep "," ( - ["auto,forgejo-auto,forgejo-dark,forgejo-light,arc-gree,gitea"] - ++ (map (name: removePrefix "theme-" (removeSuffix ".css" name)) ( - builtins.attrNames (builtins.readDir theme) - )) - ); - }; - - actions = { - ENABLED = true; - DEFAULT_ACTIONS_URL = "https://code.forgejo.org"; - }; - }; - }; - - caddy = { - enable = true; - virtualHosts."git.nezia.dev".extraConfig = '' - reverse_proxy * localhost:${toString srv.HTTP_PORT} - ''; - }; - }; - - # https://github.com/isabelroses/dotfiles/blob/06f8f70914c8e672541a52563ee624ce2e62adfb/modules/nixos/services/selfhosted/forgejo.nix#L59-L71 - systemd.services = { - forgejo = { - preStart = let - inherit (config.services.forgejo) stateDir; - in - mkAfter '' - rm -rf ${stateDir}/custom/public/assets - mkdir -p ${stateDir}/custom/public/assets - ln -sf ${theme} ${stateDir}/custom/public/assets/css - ''; - }; - }; - - networking.firewall = { - enable = true; - allowedTCPPorts = [80 443]; - - # If you're using nftables (default in newer NixOS) - extraForwardRules = '' - ip6 saddr { ::/0 } accept - ''; - }; - - # Ensure IPv6 is enabled - networking.enableIPv6 = true; -} diff --git a/config/nixos/services/gnome.nix b/config/nixos/services/gnome.nix deleted file mode 100644 index 2b27167..0000000 --- a/config/nixos/services/gnome.nix +++ /dev/null @@ -1,12 +0,0 @@ -{pkgs, ...}: { - services = { - # needed for GNOME services outside of GNOME Desktop - dbus.packages = with pkgs; [ - gcr - gnome-settings-daemon - ]; - - gnome.gnome-keyring.enable = true; - gvfs.enable = true; - }; -} diff --git a/config/nixos/services/gnupg.nix b/config/nixos/services/gnupg.nix deleted file mode 100644 index 5785e22..0000000 --- a/config/nixos/services/gnupg.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; -} diff --git a/config/nixos/services/greetd.nix b/config/nixos/services/greetd.nix deleted file mode 100644 index 25e70da..0000000 --- a/config/nixos/services/greetd.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ - config, - inputs, - lib, - pkgs, - ... -}: -# thanks https://git.jacekpoz.pl/poz/niksos/src/commit/f8d5e7ccd9c769f7c0b564f10dff419285e75248/modules/services/greetd.nix -let - inherit (lib) getExe getExe'; - inherit (inputs.hyprland.packages.${pkgs.stdenv.system}) hyprland; - - hyprctl = getExe' hyprland "hyprctl"; - Hyprland = getExe' hyprland "Hyprland"; - - greeter = getExe pkgs.greetd.gtkgreet; - - hyprlandConfig = - pkgs.writeText "greetd-hyprland-config" - '' - misc { - force_default_wallpaper=0 - focus_on_activate=1 - } - - animations { - enabled=0 - first_launch_animation=0 - } - - workspace=1,default:true,gapsout:0,gapsin:0,border:false,decorate:false - - exec-once=[workspace 1;fullscreen;noanim] ${greeter} -l; ${hyprctl} dispatch exit - exec-once=${hyprctl} dispatch focuswindow ${greeter} - ''; -in { - services.greetd = { - enable = true; - settings = { - default_session = { - command = "${Hyprland} --config ${hyprlandConfig}"; - user = config.local.systemVars.username; - }; - }; - }; - - programs.regreet = { - enable = true; - }; - - security.pam.services = { - greetd.enableGnomeKeyring = true; - login.enableGnomeKeyring = true; - gdm-password.enableGnomeKeyring = true; - greetd.fprintAuth = false; - }; - - environment.etc."greetd/environments".text = let - environments = [ - { - name = "Hyprland"; - condition = with config.programs.hyprland; enable && !withUWSM; - } - { - name = "uwsm start -S hyprland-uwsm.desktop"; - condition = with config.programs.hyprland; enable && withUWSM; - } - { - name = "sway"; - condition = config.programs.sway.enable; - } - ]; - in - builtins.concatStringsSep "\n" (map (env: env.name) (builtins.filter (env: env.condition) environments)); -} diff --git a/config/nixos/services/kanata.nix b/config/nixos/services/kanata.nix deleted file mode 100644 index 35b84e2..0000000 --- a/config/nixos/services/kanata.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - services.kanata = { - enable = true; - keyboards.default = { - extraDefCfg = "process-unmapped-keys yes"; - config = '' - (defsrc - caps a s d f j k l ; - ) - (defvar - tap-time 150 - hold-time 200 - ) - - (defalias - escctrl (tap-hold 100 100 esc lctl) - a (tap-hold $tap-time $hold-time a lmet) - s (tap-hold $tap-time $hold-time s lalt) - d (tap-hold $tap-time $hold-time d lsft) - f (tap-hold $tap-time $hold-time f lctl) - j (tap-hold $tap-time $hold-time j rctl) - k (tap-hold $tap-time $hold-time k rsft) - l (tap-hold $tap-time $hold-time l ralt) - ; (tap-hold $tap-time $hold-time ; rmet) - ) - - (deflayer base - @escctrl @a @s @d @f @j @k @l @; - ) - ''; - }; - }; -} diff --git a/config/nixos/services/keyd.nix b/config/nixos/services/keyd.nix deleted file mode 100644 index 27a47b5..0000000 --- a/config/nixos/services/keyd.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - services = { - keyd = { - enable = true; - keyboards = { - default = { - ids = ["*"]; - settings = { - main = { - capslock = "overload(control, esc)"; - }; - }; - }; - }; - }; - }; -} diff --git a/config/nixos/services/kmscon.nix b/config/nixos/services/kmscon.nix deleted file mode 100644 index 62930c9..0000000 --- a/config/nixos/services/kmscon.nix +++ /dev/null @@ -1,15 +0,0 @@ -{pkgs, ...}: { - services.kmscon = { - enable = true; - fonts = [ - { - name = "0xProto Nerd Font"; - package = pkgs.nerd-fonts._0xproto; - } - ]; - extraConfig = '' - font-size=13 - font-dpi=144 - ''; - }; -} diff --git a/config/nixos/services/location.nix b/config/nixos/services/location.nix deleted file mode 100644 index b5eb16d..0000000 --- a/config/nixos/services/location.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ - location.provider = "geoclue2"; - - services.geoclue2 = { - enable = true; - geoProviderUrl = "https://beacondb.net/v1/geolocate"; - submissionUrl = "https://beacondb.net/v2/geosubmit"; - submissionNick = "geoclue"; - - appConfig.gammastep = { - isAllowed = true; - isSystem = false; - }; - }; -} diff --git a/config/nixos/services/logind.nix b/config/nixos/services/logind.nix deleted file mode 100644 index 44eb438..0000000 --- a/config/nixos/services/logind.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - services.logind = { - lidSwitch = "suspend"; - extraConfig = '' - HandlePowerKey=ignore - HandlePowerKeyLongPress=poweroff - ''; - }; -} diff --git a/config/nixos/services/mail.nix b/config/nixos/services/mail.nix deleted file mode 100644 index e1fc963..0000000 --- a/config/nixos/services/mail.nix +++ /dev/null @@ -1,6 +0,0 @@ -{pkgs, ...}: { - services.protonmail-bridge = { - enable = true; - package = pkgs.protonmail-bridge; - }; -} diff --git a/config/nixos/services/pipewire.nix b/config/nixos/services/pipewire.nix deleted file mode 100644 index c8055ca..0000000 --- a/config/nixos/services/pipewire.nix +++ /dev/null @@ -1,18 +0,0 @@ -{inputs, ...}: { - imports = [ - inputs.nix-gaming.nixosModules.pipewireLowLatency - ]; - services = { - pulseaudio.enable = false; - pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - lowLatency.enable = true; - }; - }; - # rtkit is optional but recommended - security.rtkit.enable = true; -} diff --git a/config/nixos/services/power.nix b/config/nixos/services/power.nix deleted file mode 100644 index a5094e9..0000000 --- a/config/nixos/services/power.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - services = { - power-profiles-daemon.enable = true; - - # battery info - upower.enable = true; - }; -} diff --git a/config/nixos/services/searx.nix b/config/nixos/services/searx.nix deleted file mode 100644 index 9c4efbb..0000000 --- a/config/nixos/services/searx.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - config, - pkgs, - ... -}: { - age.secrets.searx-env-file.file = ../../../secrets/searx-env-file.age; - services = { - searx = { - enable = true; - package = pkgs.searxng; - environmentFile = config.age.secrets.searx-env-file.path; - settings = { - search = { - safe_search = 1; # 0 = None, 1 = Moderate, 2 = Strict - autocomplete = "google"; # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "swisscows", "qwant", "wikipedia" - leave blank to turn it off by default - default_lang = "en"; - }; - server = { - secret_key = "@SEARX_SECRET_KEY@"; - port = 8888; # Internal port - bind_address = "localhost"; # Only listen locally - base_url = "https://search.nezia.dev/"; - image_proxy = true; - default_http_headers = { - X-Content-Type-Options = "nosniff"; - X-XSS-Protection = "1; mode=block"; - X-Download-Options = "noopen"; - X-Robots-Tag = "noindex, nofollow"; - Referrer-Policy = "no-referrer"; - }; - }; - engines = [ - { - name = "qwant"; - disabled = true; - } - ]; - }; - }; - - caddy = { - enable = true; - virtualHosts."search.nezia.dev" = { - extraConfig = '' - encode gzip - reverse_proxy localhost:8888 { - header_up Host {host} - header_up X-Real-IP {remote_addr} - header_up X-Forwarded-For {remote_addr} - header_up X-Forwarded-Proto {scheme} - } - ''; - }; - }; - }; - - # Open required ports - networking.firewall = { - allowedTCPPorts = [80 443]; # For Caddy - }; -} diff --git a/config/nixos/services/syncthing.nix b/config/nixos/services/syncthing.nix deleted file mode 100644 index 3922ad7..0000000 --- a/config/nixos/services/syncthing.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - services = { - syncthing = { - enable = true; - }; - }; - systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder -} diff --git a/config/nixos/services/website.nix b/config/nixos/services/website.nix deleted file mode 100644 index b8e4955..0000000 --- a/config/nixos/services/website.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - inputs, - pkgs, - ... -}: { - services.caddy.enable = true; - services.caddy.virtualHosts = { - "www.nezia.dev" = { - extraConfig = '' - redir https://nezia.dev{uri} - ''; - }; - "nezia.dev" = { - extraConfig = '' - root * ${inputs."nezia_dev".packages.${pkgs.system}.default} - file_server - encode gzip - ''; - }; - }; -} diff --git a/flake.lock b/flake.lock index ce2d08d..1795cb1 100644 --- a/flake.lock +++ b/flake.lock @@ -148,11 +148,11 @@ }, "locked": { "dir": "pkgs/firefox-addons", - "lastModified": 1736510876, - "narHash": "sha256-gQtPuV+VH1ZZUAZrwxo6WNMdZao+5zIlMLUBBD+UatE=", + "lastModified": 1736913802, + "narHash": "sha256-72be03HWS5Q8I1W9hlWRVicZxL5MJURVKbnJGIcbjIE=", "owner": "rycee", "repo": "nur-expressions", - "rev": "da021d3646bf8fc6c7a74ad6edbab6fd7e59b828", + "rev": "79a77a7d0b22e82d52a90055cc8206447ab85285", "type": "gitlab" }, "original": { @@ -445,11 +445,11 @@ ] }, "locked": { - "lastModified": 1736508663, - "narHash": "sha256-ZOaGwa+WnB7Zn3YXimqjmIugAnHePdXCmNu+AHkq808=", + "lastModified": 1736785676, + "narHash": "sha256-TY0jUwR3EW0fnS0X5wXMAVy6h4Z7Y6a3m+Yq++C9AyE=", "owner": "nix-community", "repo": "home-manager", - "rev": "2532b500c3ed2b8940e831039dcec5a5ea093afc", + "rev": "fc52a210b60f2f52c74eac41a8647c1573d2071d", "type": "github" }, "original": { @@ -623,11 +623,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1736534546, - "narHash": "sha256-1qws+RifbJO6BQ50hNkmanKASmvpyhfnP8qXcIiOGAo=", + "lastModified": 1736873552, + "narHash": "sha256-VByeYPOu3I0a5r5Nn45loSaEV8M9fmZrTByUdu9sjfY=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "a8b568c6c451cdce3c8d40ae010247be3f25728b", + "rev": "25add26881d7b98d2b80eb7a95d3aee0449b72b9", "type": "github" }, "original": { @@ -725,11 +725,11 @@ "systems": "systems_4" }, "locked": { - "lastModified": 1736524264, - "narHash": "sha256-9m/Ha7hrxtbBl4UylZTYzTT/8a6Sy5DvTmBJrcQ6FwQ=", + "lastModified": 1736774415, + "narHash": "sha256-pb8v7axHdVKFGhQHEAxIuZP/9REsmlyuDW5eLGIplLc=", "owner": "hyprwm", "repo": "hyprland-qtutils", - "rev": "b0214844d8aaa7b46b5735666b9a9edcbe45cef8", + "rev": "534cd1badc46ec9bdd986ab41ad2408bf845961e", "type": "github" }, "original": { @@ -789,11 +789,11 @@ ] }, "locked": { - "lastModified": 1736514927, - "narHash": "sha256-Xd+GIAy8cHkCyFbmtJ/E02fSBq18JgVggc1r5Ox1b20=", + "lastModified": 1736702298, + "narHash": "sha256-1sjfbzsJo37H9KqSp6kJUgTlzKEGiLPMF8k6IGo2D2Y=", "owner": "hyprwm", "repo": "hyprlock", - "rev": "a5e346783ff0e65b1bf23e0eb9ae473dd6ab48c0", + "rev": "4f964371ccbea65331ee151c4f87d793cb7ac110", "type": "github" }, "original": { @@ -1080,11 +1080,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1736520719, - "narHash": "sha256-3hL4U5aqfelsX2QoDa0JVavRzuTKJE2M1I3tXZXsAVQ=", + "lastModified": 1736884105, + "narHash": "sha256-WHxMcVuEmJvToC5DEVnSLwUrpHgJyqUqd/O8gZuaQsU=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "dfba1ea03856f26db6936c9999951719de56e367", + "rev": "a4e712bccfbe0526327c10b67f765b49cbbd7701", "type": "github" }, "original": { @@ -1096,16 +1096,16 @@ "niri-stable": { "flake": false, "locked": { - "lastModified": 1731483594, - "narHash": "sha256-Qjf7alRbPPERfiZsM9EMKX+HwjESky1tieh5PJIkLwE=", + "lastModified": 1736614405, + "narHash": "sha256-AJ1rlgNOPb3/+DbS5hkhm21t6Oz8IgqLllwmZt0lyzk=", "owner": "YaLTeR", "repo": "niri", - "rev": "75c79116a7e40cbc0e110ce0cdd500e896458679", + "rev": "e05bc269e678ecf828b96ae79c991c13b00b38a5", "type": "github" }, "original": { "owner": "YaLTeR", - "ref": "v0.1.10.1", + "ref": "v25.01", "repo": "niri", "type": "github" } @@ -1113,11 +1113,11 @@ "niri-unstable": { "flake": false, "locked": { - "lastModified": 1736518221, - "narHash": "sha256-c+3Qa0ft19mOUAs7fXZRxNECFHEJgXCa5edgljcuVMc=", + "lastModified": 1736879117, + "narHash": "sha256-elG0TiWNFwgfTLrTTZVZQp3dEN6F6Qds6UF6BVxCIHs=", "owner": "YaLTeR", "repo": "niri", - "rev": "279c8b6aa29e8e5692aa6f56f0721a11134ca42b", + "rev": "a3cbe3514ba195bf74815008f75819944f888527", "type": "github" }, "original": { @@ -1149,11 +1149,11 @@ "umu": "umu" }, "locked": { - "lastModified": 1736499181, - "narHash": "sha256-G1DHB4JJH/iWe4dhxNKq2jBxguNZEk5oUbX6jqPpX8w=", + "lastModified": 1736818546, + "narHash": "sha256-rehuAIJzjQ5/vBar7xvPzHzqrxcHHDBHqqhsDZHu55M=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "58c0f214331ce8fb13e6a4bfb40f30000bd2a10e", + "rev": "1a9c52cd7517137c9cc74d4b73dfd63678e17c5f", "type": "github" }, "original": { @@ -1169,11 +1169,11 @@ ] }, "locked": { - "lastModified": 1736440205, - "narHash": "sha256-QJgTI//KEGuEJC6FDxuI9Dq8PewIpnxD2NVx2/OHbfc=", + "lastModified": 1736652904, + "narHash": "sha256-8uolHABgroXqzs03QdulHp8H9e5kWQZnnhcda1MKbBM=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "a2200b499efa01ca8646173e94cdfcc93188f2b8", + "rev": "271e5bd7c57e1f001693799518b10a02d1123b12", "type": "github" }, "original": { @@ -1267,11 +1267,11 @@ }, "nixpkgs-stable_2": { "locked": { - "lastModified": 1736200483, - "narHash": "sha256-JO+lFN2HsCwSLMUWXHeOad6QUxOuwe9UOAF/iSl1J4I=", + "lastModified": 1736754065, + "narHash": "sha256-hcETjfECLklW1ND8svDvN0Nw6H/1qtuoz3rbFNQ1Lrk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3f0a8ac25fb674611b98089ca3a5dd6480175751", + "rev": "67e9c880898889470f153157a96b595e758167fc", "type": "github" }, "original": { @@ -1347,11 +1347,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1736344531, - "narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=", + "lastModified": 1736798957, + "narHash": "sha256-qwpCtZhSsSNQtK4xYGzMiyEDhkNzOCz/Vfu4oL2ETsQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bffc22eb12172e6db3c5dde9e3e5628f8e3e7912", + "rev": "9abb87b552b7f55ac8916b6fc9e5cb486656a2f3", "type": "github" }, "original": { @@ -1363,11 +1363,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1736166416, - "narHash": "sha256-U47xeACNBpkSO6IcCm0XvahsVXpJXzjPIQG7TZlOToU=", + "lastModified": 1736420959, + "narHash": "sha256-dMGNa5UwdtowEqQac+Dr0d2tFO/60ckVgdhZU9q2E2o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b30f97d8c32d804d2d832ee837d0f1ca0695faa5", + "rev": "32af3611f6f05655ca166a0b1f47b57c762b5192", "type": "github" }, "original": { @@ -1379,11 +1379,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1736344531, - "narHash": "sha256-8YVQ9ZbSfuUk2bUf2KRj60NRraLPKPS0Q4QFTbc+c2c=", + "lastModified": 1736798957, + "narHash": "sha256-qwpCtZhSsSNQtK4xYGzMiyEDhkNzOCz/Vfu4oL2ETsQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bffc22eb12172e6db3c5dde9e3e5628f8e3e7912", + "rev": "9abb87b552b7f55ac8916b6fc9e5cb486656a2f3", "type": "github" }, "original": { @@ -1573,11 +1573,11 @@ "systems": "systems_7" }, "locked": { - "lastModified": 1736520152, - "narHash": "sha256-0TClUw4txxpRiCFvDdKwDlSpEeYETT9ySUJRAy0ibEk=", + "lastModified": 1736946667, + "narHash": "sha256-7z13M0L4DK9srgXnTXFFnfQsYioL2BrkfQieRI7A7wo=", "owner": "notashelf", "repo": "nvf", - "rev": "4df1cc3a7f161def084c6eca799e3a6c10dbf480", + "rev": "45a6d9b890e97fe8183874aafb1f17b1335f8bdf", "type": "github" }, "original": { @@ -1596,11 +1596,11 @@ ] }, "locked": { - "lastModified": 1736527164, - "narHash": "sha256-sLfRtFIVsn3scpWGLQXyX/e9m1oJGKKINhDJTpEoJL0=", + "lastModified": 1736549395, + "narHash": "sha256-XzwkB62Tt5UYoL1jXiHzgk/qz2fUpGHExcSIbyGTtI0=", "owner": "nix-community", "repo": "plasma-manager", - "rev": "1756b31ae1649a98f6d0e8c075ca73d33259854e", + "rev": "a53af7f1514ef4cce8620a9d6a50f238cdedec8b", "type": "github" }, "original": { @@ -3871,11 +3871,11 @@ }, "locked": { "dir": "packaging/nix", - "lastModified": 1736271378, - "narHash": "sha256-j1TqXcffjqp/xmWvY9j4Johj1AdKiGXv94pNZHXEz6Y=", + "lastModified": 1736743784, + "narHash": "sha256-AOzUhOCk1pQboWmCI2BrQ/K7PygcOc5LTt/Wiht1JnY=", "ref": "refs/heads/main", - "rev": "f423d6683cac7037333fbf38db8d0cc94c984fda", - "revCount": 880, + "rev": "2b4eb95a37d8680deb9ec14415743334ec85202e", + "revCount": 898, "submodules": true, "type": "git", "url": "https://github.com/Open-Wine-Components/umu-launcher/" @@ -3912,11 +3912,11 @@ "systems": "systems_8" }, "locked": { - "lastModified": 1736493558, - "narHash": "sha256-BT5zGc97sGOVwwLz3BJrxmbOumuzgWso7RoWlHZA9rc=", + "lastModified": 1736883896, + "narHash": "sha256-Lx6MHiRD69xSpneaFTr6wjp9jX28ZkVt+glxTLonJc4=", "owner": "abenz1267", "repo": "walker", - "rev": "e9762f648dde790e2a92c3849216104489c0412e", + "rev": "f8690c097551de73f098ff1ab56ac2f62f821f88", "type": "github" }, "original": { diff --git a/hosts/anastacia/default.nix b/hosts/anastacia/default.nix index 8db4196..3991df9 100644 --- a/hosts/anastacia/default.nix +++ b/hosts/anastacia/default.nix @@ -8,14 +8,21 @@ in { inputs.agenix.nixosModules.default ]; + local = { + systemVars = { + hostName = "anastacia"; + }; + + profiles.server.enable = true; + }; + boot.tmp.cleanOnBoot = true; - zramSwap.enable = true; - networking.hostName = "anastacia"; networking.domain = ""; services.openssh.enable = true; users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEzs7SQH0Vjt9JHoXXmWy9fPU1I3rrRWV5magZFrI5al" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHKEPlN/GU9nJZPleA77HH5NA+6vyhhM84fTSjEwnEgq" ]; + system.stateVersion = "23.11"; } diff --git a/hosts/default.nix b/hosts/default.nix index 257e16b..3ac48e0 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -1,114 +1,23 @@ -{ - self, - inputs, - ... -}: let +{inputs, ...}: let lib' = import ../shared/lib inputs.nixpkgs.lib; mkSystem = args: inputs.nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs lib';}; - modules = args.modules or []; + modules = (args.modules or []) ++ [../modules]; }; - - base = [ - ../shared/nixosModules - "${self}/config/nixos" - "${self}/config/nixos/core/home-manager.nix" - - "${self}/config/nixos/services/documentation.nix" - - "${self}/config/nixos/services/location.nix" - - "${self}/config/nixos/hardware/mcuxpresso.nix" - ({ - config, - specialArgs, - ... - }: { - home-manager = { - users.${config.local.systemVars.username}.imports = [ - "${self}/config/home-manager" - - "${self}/config/home-manager/services/udiskie.nix" - "${self}/config/home-manager/services/syncthing.nix" - ]; - - extraSpecialArgs = specialArgs; - }; - }) - ]; - - graphical = [ - "${self}/config/nixos/services/logind.nix" - "${self}/config/nixos/services/greetd.nix" - - "${self}/config/nixos/programs/hyprland.nix" - "${self}/config/nixos/programs/xdg.nix" - "${self}/config/nixos/services/gnome.nix" - ({config, ...}: { - home-manager.users.${config.local.systemVars.username}.imports = [ - "${self}/config/home-manager/programs/waybar" - "${self}/config/home-manager/programs/walker.nix" - "${self}/config/home-manager/programs/hypr" - "${self}/config/home-manager/programs/wlogout.nix" - - "${self}/config/home-manager/services/swaync" - - "${self}/config/home-manager/terminal/emulators/foot.nix" - "${self}/config/home-manager/services/gammastep.nix" - ]; - }) - ]; - - gaming = [ - ../config/nixos/programs/games.nix - ../config/nixos/services/flatpak.nix - ../config/nixos/hardware/uni-sync.nix - ({config, ...}: { - home-manager.users.${config.local.systemVars.username}.imports = [ - "${self}/config/home-manager/programs/games" - "${self}/config/home-manager/services/flatpak.nix" - ]; - }) - ]; - - laptop = [ - "${self}/config/nixos/core/lanzaboote.nix" - - "${self}/config/nixos/hardware/fprintd.nix" - "${self}/config/nixos/services/kanata.nix" - "${self}/config/nixos/services/power.nix" - "${self}/config/nixos/services/brightness.nix" - ]; in { vamos = mkSystem { - modules = - [ - ./vamos - inputs.nixos-hardware.nixosModules.framework-13-7040-amd - ] - ++ base - ++ graphical - ++ laptop; + modules = [ + ./vamos + inputs.nixos-hardware.nixosModules.framework-13-7040-amd + ]; }; solaire = mkSystem { - modules = - [ - ./solaire - ] - ++ base - ++ graphical - ++ gaming; + modules = [./solaire]; }; anastacia = mkSystem { - modules = [ - ./anastacia - - "${self}/config/nixos/services/forgejo.nix" - "${self}/config/nixos/services/searx.nix" - "${self}/config/nixos/services/website.nix" - ]; + modules = [./anastacia]; }; } diff --git a/hosts/solaire/default.nix b/hosts/solaire/default.nix index e9b210f..a3f60af 100644 --- a/hosts/solaire/default.nix +++ b/hosts/solaire/default.nix @@ -10,6 +10,15 @@ _: { fullName = "Anthony Rodriguez"; email = "anthony@nezia.dev"; }; + + profiles = { + desktop.enable = true; + gaming.enable = true; + }; + + modules = { + hyprland.enable = true; + }; }; environment.variables.FLAKE = "/home/nezia/.dotfiles"; diff --git a/hosts/vamos/default.nix b/hosts/vamos/default.nix index 7cc58e3..026c044 100644 --- a/hosts/vamos/default.nix +++ b/hosts/vamos/default.nix @@ -1,5 +1,8 @@ _: { - imports = [./hardware-configuration.nix ./config/theme.nix]; + imports = [ + ./hardware-configuration.nix + ./config/theme.nix + ]; local = { systemVars = { @@ -11,6 +14,15 @@ _: { fullName = "Anthony Rodriguez"; email = "anthony@nezia.dev"; }; + + profiles = { + desktop.enable = true; + laptop.enable = true; + }; + + modules = { + hyprland.enable = true; + }; }; environment.variables.FLAKE = "/home/nezia/.dotfiles"; diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..78f847c --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./options + ./nix + ]; +} diff --git a/modules/hm/default.nix b/modules/hm/default.nix new file mode 100644 index 0000000..a5aa301 --- /dev/null +++ b/modules/hm/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./programs + ./services + ]; +} diff --git a/modules/hm/programs/browsers/default.nix b/modules/hm/programs/browsers/default.nix new file mode 100644 index 0000000..dad3d2f --- /dev/null +++ b/modules/hm/programs/browsers/default.nix @@ -0,0 +1,3 @@ +{ + imports = [./firefox.nix]; +} diff --git a/modules/hm/programs/browsers/firefox.nix b/modules/hm/programs/browsers/firefox.nix new file mode 100644 index 0000000..0e5c3ac --- /dev/null +++ b/modules/hm/programs/browsers/firefox.nix @@ -0,0 +1,176 @@ +{ + lib, + inputs, + pkgs, + osConfig, + ... +}: let + betterfox = pkgs.fetchFromGitHub { + owner = "yokoffing"; + repo = "betterfox"; + rev = "e026ed7d3a763c5d3f96c2680d7bc3340831af4f"; + hash = "sha256-hpkEO5BhMVtINQG8HN4xqfas/R6q5pYPZiFK8bilIDs="; + }; +in { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.firefox = { + enable = true; + package = pkgs.wrapFirefox pkgs.firefox-unwrapped { + extraPolicies = { + DisableTelemetry = true; + DisablePocket = true; + DisableFeedbackCommands = true; + DisableFirefoxStudies = true; + OfferToSaveLogins = false; + OffertosaveloginsDefault = false; + PasswordManagerEnabled = false; + SearchSuggestEnabled = true; + + # https://github.com/Sly-Harvey/NixOS/blob/f9da2691ea46565256ad757959cfc26ec6cee10d/modules/programs/browser/firefox/default.nix#L58-L163 + "3rdparty".Extensions = { + "addon@darkreader.org" = { + permissions = ["internal:privateBrowsingAllowed"]; + enabled = true; + automation = { + enabled = true; + behavior = "OnOff"; + mode = "system"; + }; + detectDarkTheme = true; + enabledByDefault = true; + changeBrowserTheme = false; + enableForProtectedPages = true; + fetchNews = false; + previewNewDesign = true; + }; + "uBlock0@raymondhill.net" = { + permissions = ["internal:privateBrowsingAllowed"]; + advancedSettings = [ + [ + "userResourcesLocation" + "https://raw.githubusercontent.com/pixeltris/TwitchAdSolutions/master/video-swap-new/video-swap-new-ublock-origin.js" + ] + ]; + adminSettings = { + userSettings = { + uiTheme = "dark"; + advancedUserEnabled = true; + userFiltersTrusted = true; + importedLists = [ + "https://raw.githubusercontent.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/main/list.txt" + ]; + selectedFilterLists = [ + "FRA-0" + "adguard-cookies" + "adguard-mobile-app-banners" + "adguard-other-annoyances" + "adguard-popup-overlays" + "adguard-social" + "adguard-spyware-url" + "adguard-widgets" + "easylist" + "easylist-annoyances" + "easylist-chat" + "easylist-newsletters" + "easylist-notifications" + "easyprivacy" + "fanboy-cookiemonster" + "https://filters.adtidy.org/extension/ublock/filters/3.txt" + "https://github.com/DandelionSprout/adfilt/raw/master/LegitimateURLShortener.txt" + "plowe-0" + "ublock-annoyances" + "ublock-badware" + "ublock-cookies-adguard" + "ublock-cookies-easylist" + "ublock-filters" + "ublock-privacy" + "ublock-quick-fixes" + "ublock-unbreak" + "urlhaus-1" + "https://raw.githubusercontent.com/laylavish/uBlockOrigin-HUGE-AI-Blocklist/main/list.txt" + ]; + }; + }; + }; + }; + }; + }; + profiles = { + nezia = { + settings = { + "browser.search.suggest.enabled" = true; + "ui.key.menuAccessKeyFocuses" = false; + }; + + extensions = with inputs.firefox-addons.packages.${pkgs.system}; [ + darkreader + proton-pass + shinigami-eyes + stylus + ublock-origin + violentmonkey + ]; + # https://git.jacekpoz.pl/poz/niksos/src/commit/a48647a1c5bc6877a1100a65f4dc169b2fc11ed7/hosts/hape/firefox.nix + search = { + force = true; + default = "SearxNG"; + engines = { + "SearxNG" = { + urls = [ + { + rels = ["results"]; + template = "https://search.nezia.dev/search"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + } + { + rels = ["suggestions"]; + template = "https://search.nezia.dev/autocompleter"; + params = [ + { + name = "q"; + value = "{searchTerms}"; + } + ]; + "type" = "application/x-suggestions+json"; + } + ]; + }; + "MyNixOS" = { + urls = [{template = "https://mynixos.com/search?q={searchTerms}";}]; + iconUpdateURL = "https://mynixos.com/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = ["@nx"]; + }; + "Noogle" = { + urls = [{template = "https://noogle.dev/q?term={searchTerms}";}]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = ["@ng"]; + }; + "GitHub Nix" = { + # https://github.com/search?q=language%3Anix+NOT+is%3Afork+programs.neovim&type=code + urls = [{template = "https://github.com/search?q=language:nix NOT is:fork {searchTerms}&type=code";}]; + iconUpdateURL = "https://github.com/favicon.ico"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = ["@ghn"]; + }; + "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias + }; + }; + # https://github.com/oddlama/nix-config/blob/main/users/myuser/graphical/firefox.nix#L53-L57 + extraConfig = builtins.concatStringsSep "\n" [ + (builtins.readFile "${betterfox}/user.js") + (builtins.readFile "${betterfox}/Securefox.js") + (builtins.readFile "${betterfox}/Fastfox.js") + (builtins.readFile "${betterfox}/Peskyfox.js") + (builtins.readFile "${betterfox}/Smoothfox.js") + ]; + }; + }; + }; + }; +} diff --git a/modules/hm/programs/default.nix b/modules/hm/programs/default.nix new file mode 100644 index 0000000..49f08d0 --- /dev/null +++ b/modules/hm/programs/default.nix @@ -0,0 +1,17 @@ +{ + imports = [ + ./browsers + ./editors + ./hypr + ./media + ./terminal + + ./games.nix + ./gnome.nix + ./misc.nix + ./walker.nix + ./waybar.nix + ./wlogout.nix + ./xdg.nix + ]; +} diff --git a/modules/hm/programs/editors/default.nix b/modules/hm/programs/editors/default.nix new file mode 100644 index 0000000..6ab9a63 --- /dev/null +++ b/modules/hm/programs/editors/default.nix @@ -0,0 +1,6 @@ +{ + imports = [ + ./helix.nix + ./neovim.nix + ]; +} diff --git a/modules/hm/programs/editors/helix.nix b/modules/hm/programs/editors/helix.nix new file mode 100644 index 0000000..907aba1 --- /dev/null +++ b/modules/hm/programs/editors/helix.nix @@ -0,0 +1,64 @@ +{ + lib, + pkgs, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.helix = { + enable = true; + settings = { + theme = "catppuccin_macchiato"; + editor = { + line-number = "relative"; + lsp.display-messages = true; + auto-format = true; + auto-completion = true; + completion-timeout = 5; + color-modes = true; + completion-trigger-len = 1; + completion-replace = true; + cursorline = true; + cursor-shape = { + insert = "bar"; + normal = "block"; + select = "underline"; + }; + indent-guides.render = true; + lsp.display-inlay-hints = true; + statusline.center = ["position-percentage"]; + true-color = true; + whitespace.characters = { + newline = "↴"; + tab = "⇥"; + }; + }; + + keys.normal = { + space = { + space = "file_picker"; + w = ":w"; + q = ":q"; + }; + esc = ["collapse_selection" "keep_primary_selection"]; + }; + }; + + languages = { + language = [ + { + name = "nix"; + auto-format = true; + } + ]; + + language-server = { + nil = { + command = lib.getExe pkgs.nil; + config.nil.formatting.command = ["${lib.getExe pkgs.alejandra}" "-q"]; + }; + }; + }; + }; + }; +} diff --git a/modules/hm/programs/editors/neovim.nix b/modules/hm/programs/editors/neovim.nix new file mode 100644 index 0000000..f596493 --- /dev/null +++ b/modules/hm/programs/editors/neovim.nix @@ -0,0 +1,247 @@ +{ + lib, + inputs, + pkgs, + osConfig, + ... +}: { + imports = [inputs.nvf.homeManagerModules.default]; + + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.nvf = { + enable = true; + settings.vim = { + viAlias = true; + vimAlias = true; + enableLuaLoader = true; + preventJunkFiles = true; + useSystemClipboard = true; + options = { + tabstop = 4; + autoindent = false; + }; + + luaConfigPost = '' + vim.opt.formatoptions:remove('c') + vim.opt.formatoptions:remove('r') + vim.opt.formatoptions:remove('o') + ''; + + maps = { + normal = { + "m" = { + silent = true; + action = "make"; + }; # Same as nnoremap m make + "t" = { + silent = true; + action = "Neotree toggle"; + }; + }; + }; + + theme = lib.mkDefault { + enable = true; + name = "catppuccin"; + style = "macchiato"; + }; + + ui = { + noice.enable = true; + }; + notify.nvim-notify.enable = true; + + statusline = { + lualine = { + enable = true; + theme = "auto"; + componentSeparator = { + left = ""; + }; + sectionSeparator = { + left = ""; + right = ""; + }; + + activeSection = { + a = [ + '' + { + "mode", + separator = { right = "" }, + right_padding = 2 + } + '' + ]; + b = [ + '' + { + "branch", + icon = '', + separator = { right = "" } + } + '' + ]; + c = [ + '' + "filename" + '' + ]; + x = [ + '' + { + "diagnostics", + sources = {'nvim_lsp', 'nvim_diagnostic', 'nvim_diagnostic', 'vim_lsp', 'coc'}, + symbols = {error = '󰅙 ', warn = ' ', info = ' ', hint = '󰌵 '}, + colored = true, + update_in_insert = false, + always_visible = false, + diagnostics_color = { + color_error = { fg = 'red' }, + color_warn = { fg = 'yellow' }, + color_info = { fg = 'cyan' }, + }, + } + '' + '' + "filetype" + '' + ]; + y = [ + '' + { + "progress", + separator = { left = "" }, + } + '' + '' + '' + ]; + z = [ + '' + { + "location", + separator = { left = "" }, + left_padding = 2 + } + '' + '' + { + "fileformat", + color = {fg='black'}, + symbols = { + unix = '', -- e712 + dos = '', -- e70f + mac = '', -- e711 + }, + } + '' + ]; + }; + + inactiveSection = { + a = [ + '' + "filename" + '' + ]; + z = [ + '' + "location" + '' + ]; + }; + }; + }; + + git.enable = true; + + utility = { + vim-wakatime.enable = true; + surround.enable = true; + }; + + lsp = { + enable = true; + lspSignature.enable = true; + lspconfig.enable = true; + formatOnSave = true; + mappings = { + addWorkspaceFolder = "wa"; + codeAction = "a"; + goToDeclaration = "gD"; + goToDefinition = "gd"; + hover = "K"; + listImplementations = "gi"; + listReferences = "gr"; + listWorkspaceFolders = "wl"; + nextDiagnostic = "k"; + previousDiagnostic = "j"; + openDiagnosticFloat = "e"; + removeWorkspaceFolder = "wr"; + renameSymbol = "r"; + signatureHelp = ""; + }; + }; + + autocomplete.nvim-cmp = { + enable = true; + }; + + autopairs.nvim-autopairs.enable = true; + + languages = { + enableExtraDiagnostics = true; + enableFormat = true; + enableLSP = true; + enableTreesitter = true; + + nix.enable = true; + clang.enable = true; + python.enable = true; + ts.enable = true; + css.enable = true; + typst.enable = true; + }; + + treesitter = { + enable = true; + fold = true; + context.enable = true; + grammars = [ + pkgs.vimPlugins.nvim-treesitter.builtGrammars.nix + pkgs.vimPlugins.nvim-treesitter.builtGrammars.c + pkgs.vimPlugins.nvim-treesitter.builtGrammars.python + ]; + }; + + binds.whichKey.enable = true; + filetree.neo-tree.enable = true; + + telescope.enable = true; + }; + }; + + programs.neovide = { + enable = true; + settings = { + fork = false; + frame = "full"; + idle = true; + maximized = false; + no-multigrid = false; + srgb = false; + tabs = true; + theme = "auto"; + title-hidden = true; + vsync = true; + wsl = false; + + font = { + normal = []; + size = 14.0; + }; + }; + }; + }; +} diff --git a/modules/hm/programs/games.nix b/modules/hm/programs/games.nix new file mode 100644 index 0000000..6b23cdb --- /dev/null +++ b/modules/hm/programs/games.nix @@ -0,0 +1,17 @@ +{ + lib, + pkgs, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.gaming.enable { + home.packages = [ + pkgs.mangohud + pkgs.bolt-launcher + pkgs.ankama-launcher + pkgs.lutris + pkgs.qbittorrent + pkgs.protonplus + ]; + }; +} diff --git a/modules/hm/programs/gnome.nix b/modules/hm/programs/gnome.nix new file mode 100644 index 0000000..9ddd704 --- /dev/null +++ b/modules/hm/programs/gnome.nix @@ -0,0 +1,16 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + dconf = { + enable = true; + settings = { + "org/gnome/desktop/wm/preferences" = { + button-layout = ""; + }; + }; + }; + }; +} diff --git a/config/home-manager/programs/hypr/default.nix b/modules/hm/programs/hypr/default.nix similarity index 100% rename from config/home-manager/programs/hypr/default.nix rename to modules/hm/programs/hypr/default.nix diff --git a/modules/hm/programs/hypr/idle.nix b/modules/hm/programs/hypr/idle.nix new file mode 100644 index 0000000..5f44ae2 --- /dev/null +++ b/modules/hm/programs/hypr/idle.nix @@ -0,0 +1,58 @@ +{ + lib, + inputs, + pkgs, + config, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.modules.hyprland.enable { + services.hypridle = { + enable = true; + + package = inputs.hypridle.packages.${pkgs.system}.hypridle; + + settings = { + general = { + lock_cmd = "pidof hyprlock || hyprlock"; + unlock_cmd = "pkill --signal SIGUSR1 hyprlock"; + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + }; + + listener = [ + { + timeout = 300; # 5m + on-timeout = "loginctl lock-session"; + } + { + timeout = 330; # 5.5m + on-timeout = "hyprctl dipsatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + { + timeout = 600; # 10m + on-timeout = "systemctl suspend"; + } + ]; + }; + }; + # needed when using uwsm as the session manager + systemd.user.services."hypridle" = lib.mkForce { + Unit = { + Description = "Hyprland's Idle Daemon"; + After = "graphical-session.target"; + X-Restart-Triggers = ["${config.xdg.configFile."hypr/hypridle.conf".source}"]; + }; + Service = { + Type = "exec"; + ExecStart = lib.getExe pkgs.hypridle; + Restart = "on-failure"; + Slice = "background-graphical.slice"; + }; + Install = { + WantedBy = ["graphical-session.target"]; + }; + }; + }; +} diff --git a/modules/hm/programs/hypr/land/binds.nix b/modules/hm/programs/hypr/land/binds.nix new file mode 100644 index 0000000..9b41ff1 --- /dev/null +++ b/modules/hm/programs/hypr/land/binds.nix @@ -0,0 +1,85 @@ +{ + lib, + osConfig, + ... +}: let + # thanks https://github.com/fufexan/dotfiles/blob/c0b3c77d95ce1f574a87e7f7ead672ca0d951245/home/programs/wayland/hyprland/binds.nix#L16-L20 + toggle = program: uwsm: let + prog = builtins.substring 0 14 program; + in "pkill ${prog} || ${lib.optionalString uwsm "uwsm app -- "} ${program}"; + runOnce = program: "pgrep ${program} || uwsm app -- ${program}"; + run = program: "uwsm app -- ${program}"; +in { + config = lib.mkIf osConfig.local.modules.hyprland.enable { + wayland.windowManager.hyprland.settings = { + "$mod" = "SUPER"; + bindr = [ + "$mod, SUPER_L, exec, walker" + ]; + bind = [ + "$mod, Return, exec, ${run "foot"}" + "$mod, n, exec, ${run "neovide"}" + "$mod, w, exec, ${run "firefox"}" + ", Print, exec, ${runOnce "grimblast"} --notify --cursor copysave output" + "$mod, q, killactive" + "$mod SHIFT, q, exec, loginctl terminate-user ''" + "$mod, period, exec, ${toggle "walker -m emojis" false}" # not using uwsm as it already runs as a service + "CTRL, Print, exec, ${runOnce "grimblast"} --notify --cursor --freeze copysave area" + + "$mod, h, movefocus, l" + "$mod, j, movefocus, d" + "$mod, k, movefocus, u" + "$mod, l, movefocus, r" + + "$mod SHIFT, h, movewindow, l" + "$mod SHIFT, j, movewindow, d" + "$mod SHIFT, k, movewindow, u" + "$mod SHIFT, l, movewindow, r" + + "$mod, 1, workspace, 1" + "$mod, 2, workspace, 2" + "$mod, 3, workspace, 3" + "$mod, 4, workspace, 4" + "$mod, 5, workspace, 5" + "$mod, 6, workspace, 6" + "$mod, 7, workspace, 7" + "$mod, 8, workspace, 8" + "$mod, 9, workspace, 9" + "$mod, 0, workspace, 10" + + "$mod SHIFT, 1, movetoworkspacesilent, 1" + "$mod SHIFT, 2, movetoworkspacesilent, 2" + "$mod SHIFT, 3, movetoworkspacesilent, 3" + "$mod SHIFT, 4, movetoworkspacesilent, 4" + "$mod SHIFT, 5, movetoworkspacesilent, 5" + "$mod SHIFT, 6, movetoworkspacesilent, 6" + "$mod SHIFT, 7, movetoworkspacesilent, 7" + "$mod SHIFT, 8, movetoworkspacesilent, 8" + "$mod SHIFT, 9, movetoworkspacesilent, 9" + "$mod SHIFT, 0, movetoworkspacesilent, 10" + + "$mod, t, togglefloating" + ", F11, fullscreen, 0" + "$mod, f, fullscreen, 1" + + "$mod, e, togglespecialworkspace, file_manager_tui" + "$mod SHIFT, e, togglespecialworkspace, file_manager_gui" + + ", XF86PowerOff, exec, ${toggle "wlogout" true}" + ]; + + bindel = [ + ", XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+" + ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + + ", XF86MonBrightnessUp, exec, brillo -q -u 300000 -A 5" + ", XF86MonBrightnessDown, exec, brillo -q -u 300000 -U 5" + ", XF86AudioMedia, exec, XDG_CURRENT_DESKTOP=gnome gnome-control-center" + ]; + binde = [ + "$mod Alt, l, exec, loginctl lock-session" + ]; + }; + }; +} diff --git a/modules/hm/programs/hypr/land/default.nix b/modules/hm/programs/hypr/land/default.nix new file mode 100644 index 0000000..2eeb366 --- /dev/null +++ b/modules/hm/programs/hypr/land/default.nix @@ -0,0 +1,114 @@ +{ + lib, + inputs, + pkgs, + osConfig, + ... +}: { + imports = [./binds.nix]; + + config = lib.mkIf osConfig.local.modules.hyprland.enable { + home.packages = [ + inputs.hyprwm-contrib.packages.${pkgs.system}.grimblast + # disable unused panels - https://github.com/maydayv7/dotfiles/blob/4de45008a6915753834aa7e1cbafbacfff8b7adc/modules/gui/desktop/hyprland/apps/utilities.nix#L42-L57 + (pkgs.gnome-control-center.overrideAttrs (old: { + postInstall = + old.postInstall + + '' + dir=$out/share/applications + for panel in $dir/* + do + [ "$panel" = "$dir/gnome-network-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-bluetooth-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-wifi-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-wwan-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-sharing-panel.desktop" ] && continue + [ "$panel" = "$dir/gnome-wacom-panel.desktop" ] && continue + rm "$panel" + done + ''; + })) + ]; + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + + systemd.enable = false; + + settings = { + xwayland = { + force_zero_scaling = true; + }; + + env = [ + "GDK_SCALE,1" + ]; + monitor = [ + "eDP-1, preferred, auto, 1.33" + ]; + workspace = [ + "special:terminal, on-created-empty:foot" + "special:mixer_gui, on-created-empty:pavucontrol" + "special:file_manager_gui, on-created-empty:nautilus" + "special:file_manager_tui, on-created-empty:foot -- yazi" + ]; + + windowrulev2 = [ + # fixes fullscreen windows (mostly games) + "stayfocused, initialtitle:^()$, initialclass:^(steam)$" + "minsize 1 1, initialtitle:^()$, initialclass:^(steam)$" + "maximize, initialtitle:^(\S+)$, initialclass:^(steamwebhelper)$" + + "immediate, initialclass:^(steam_app_)(.*)$" + "fullscreen, initialclass:^(steam_app_)(.*)$" + + # inhibit idle on every fullscreen app except games + "idleinhibit always, fullscreen:1,!initialclass:^(steam_app_)(.*)$" + ]; + + render = { + explicit_sync = 1; + explicit_sync_kms = 1; + expand_undersized_textures = false; + }; + + animations = { + enabled = true; + bezier = "myBezier, 0.05, 0.9, 0.1, 1.1"; + animation = [ + "windows, 1, 5, myBezier" + "windowsOut, 1, 5, default, popin 80%" + "windowsMove, 1, 5, default, popin 80%" + "fade, 1, 5, default" + "border, 1, 5, default" + "borderangle, 0, 8, default" + "workspaces, 0" + "specialWorkspace, 0" + ]; + }; + + input = { + kb_options = "compose:ralt"; + touchpad = { + natural_scroll = true; + scroll_factor = 0.8; + tap-to-click = true; + clickfinger_behavior = true; + }; + }; + + gestures = { + workspace_swipe = true; + workspace_swipe_direction_lock = false; + workspace_swipe_cancel_ratio = 0.15; + }; + + misc = { + force_default_wallpaper = 0; + disable_hyprland_logo = true; + middle_click_paste = false; + }; + }; + }; + }; +} diff --git a/modules/hm/programs/hypr/lock.nix b/modules/hm/programs/hypr/lock.nix new file mode 100644 index 0000000..477c7b0 --- /dev/null +++ b/modules/hm/programs/hypr/lock.nix @@ -0,0 +1,14 @@ +{ + lib, + inputs, + pkgs, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.modules.hyprland.enable { + programs.hyprlock = { + enable = true; + package = inputs.hyprlock.packages.${pkgs.system}.hyprlock; + }; + }; +} diff --git a/modules/hm/programs/hypr/paper.nix b/modules/hm/programs/hypr/paper.nix new file mode 100644 index 0000000..4fea20b --- /dev/null +++ b/modules/hm/programs/hypr/paper.nix @@ -0,0 +1,22 @@ +{ + lib, + osConfig, + inputs, + pkgs, + ... +}: { + config = lib.mkIf osConfig.local.modules.hyprland.enable { + services.hyprpaper = { + enable = true; + package = inputs.hyprpaper.packages.${pkgs.system}.default; + + settings = { + preload = ["${osConfig.local.style.wallpaper}"]; + wallpaper = [", ${osConfig.local.style.wallpaper}"]; + }; + }; + + systemd.user.services.hyprpaper.Unit.After = lib.mkForce "graphical-session.target"; + systemd.user.services.hyprpaper.Service.Slice = "background-graphical.slice"; + }; +} diff --git a/modules/hm/programs/media/default.nix b/modules/hm/programs/media/default.nix new file mode 100644 index 0000000..917a9d3 --- /dev/null +++ b/modules/hm/programs/media/default.nix @@ -0,0 +1,20 @@ +{ + lib, + pkgs, + osConfig, + ... +}: { + imports = [./zathura.nix]; + + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.mpv.enable = true; + home.packages = [ + pkgs.gnome-calculator + pkgs.gthumb + pkgs.spotify + pkgs.stremio + pkgs.tidal-hifi + pkgs.celluloid + ]; + }; +} diff --git a/modules/hm/programs/media/zathura.nix b/modules/hm/programs/media/zathura.nix new file mode 100644 index 0000000..aef015e --- /dev/null +++ b/modules/hm/programs/media/zathura.nix @@ -0,0 +1,23 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.zathura = { + enable = true; + options = { + font = "Inter 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/modules/hm/programs/misc.nix b/modules/hm/programs/misc.nix new file mode 100644 index 0000000..d6dbbca --- /dev/null +++ b/modules/hm/programs/misc.nix @@ -0,0 +1,40 @@ +{ + lib, + pkgs, + osConfig, + ... +}: { + # miscellaneous programs that do not need to be configured + config = lib.mkIf osConfig.local.profiles.desktop.enable { + home.packages = with pkgs; [ + cinny-desktop + entr + fractal + geary + imhex + logisim-evolution + mission-center + nautilus + obsidian + playerctl + proton-pass + simple-scan + vesktop + wl-clipboard + ]; + + programs = { + fzf.enable = true; + fastfetch.enable = true; + hyfetch = { + enable = true; + settings = { + preset = "nonbinary"; + mode = "rgb"; + backend = "fastfetch"; + color_align.mode = "horizontal"; + }; + }; + }; + }; +} diff --git a/modules/hm/programs/terminal/default.nix b/modules/hm/programs/terminal/default.nix new file mode 100644 index 0000000..59cc704 --- /dev/null +++ b/modules/hm/programs/terminal/default.nix @@ -0,0 +1,17 @@ +{ + lib, + osConfig, + ... +}: { + imports = [ + ./emulators + ./programs + ./shell + ]; + + config = lib.mkIf osConfig.local.profiles.desktop.enable { + home.sessionVariables = { + EDITOR = "nvim"; + }; + }; +} diff --git a/modules/hm/programs/terminal/emulators/default.nix b/modules/hm/programs/terminal/emulators/default.nix new file mode 100644 index 0000000..4f0ca1e --- /dev/null +++ b/modules/hm/programs/terminal/emulators/default.nix @@ -0,0 +1,3 @@ +{ + imports = [./foot.nix]; +} diff --git a/modules/hm/programs/terminal/emulators/foot.nix b/modules/hm/programs/terminal/emulators/foot.nix new file mode 100644 index 0000000..685b434 --- /dev/null +++ b/modules/hm/programs/terminal/emulators/foot.nix @@ -0,0 +1,19 @@ +{ + lib, + config, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.modules.hyprland.enable { + programs.foot = { + enable = true; + settings = { + main = { + term = "xterm-256color"; + font = "monospace:size=14"; + shell = "${lib.getExe config.programs.fish.package}"; + }; + }; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/bat.nix b/modules/hm/programs/terminal/programs/bat.nix new file mode 100644 index 0000000..9ac81a0 --- /dev/null +++ b/modules/hm/programs/terminal/programs/bat.nix @@ -0,0 +1,26 @@ +{ + lib, + pkgs, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.bat = { + enable = true; + config.theme = "base16"; + }; + + home = { + sessionVariables = { + MANPAGER = "sh -c 'col -bx | bat --language man' "; + MANROFFOPT = "-c"; + }; + + packages = with pkgs.bat-extras; [ + batman + ]; + + shellAliases.man = "batman"; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/default.nix b/modules/hm/programs/terminal/programs/default.nix new file mode 100644 index 0000000..8b56212 --- /dev/null +++ b/modules/hm/programs/terminal/programs/default.nix @@ -0,0 +1,12 @@ +{ + imports = [ + ./bat.nix + ./direnv.nix + ./git.nix + ./gnupg.nix + ./misc.nix + ./nix-index.nix + ./tmux.nix + ./yazi.nix + ]; +} diff --git a/modules/hm/programs/terminal/programs/direnv.nix b/modules/hm/programs/terminal/programs/direnv.nix new file mode 100644 index 0000000..89e35ba --- /dev/null +++ b/modules/hm/programs/terminal/programs/direnv.nix @@ -0,0 +1,14 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs = { + direnv = { + enable = true; + nix-direnv.enable = true; + }; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/git.nix b/modules/hm/programs/terminal/programs/git.nix new file mode 100644 index 0000000..455d541 --- /dev/null +++ b/modules/hm/programs/terminal/programs/git.nix @@ -0,0 +1,60 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.git = { + enable = true; + userName = "Anthony Rodriguez"; + userEmail = "anthony@nezia.dev"; + signing = { + signByDefault = true; + key = "EE3BE97C040A86CE"; + }; + extraConfig = { + push.autoSetupRemote = true; + init = { + defaultBranch = "main"; + }; + }; + }; + + programs.lazygit = { + enable = true; + }; + + home.shellAliases = { + lg = "lazygit"; + g = "git"; + gs = "git status"; + gsh = "git show HEAD"; + gshs = "DELTA_FEATURES=+side-by-side git show HEAD"; + ga = "git add"; + gaa = "git add :/"; + gap = "git add -p"; + gc = "git commit"; + gca = "git commit --amend"; + gcm = "git commit --message"; + gcf = "git commit --fixup"; + gk = "git checkout"; + gkp = "git checkout -p"; + gd = "git diff"; + gds = "DELTA_FEATURES=+side-by-side git diff"; + gdc = "git diff --cached"; + gdcs = "DELTA_FEATURES=+side-by-side git diff --cached"; + gf = "git fetch"; + gl = "git log"; + glp = "git log -p"; + glps = "DELTA_FEATURES=+side-by-side git log -p"; + gp = "git push"; + gpf = "git push --force-with-lease"; + gr = "git reset"; + gra = "git reset :/"; + grp = "git reset -p"; + gt = "git stash"; + gtp = "git stash pop"; + gu = "git pull"; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/gnupg.nix b/modules/hm/programs/terminal/programs/gnupg.nix new file mode 100644 index 0000000..a800ef8 --- /dev/null +++ b/modules/hm/programs/terminal/programs/gnupg.nix @@ -0,0 +1,14 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.gpg.enable = true; + services.gpg-agent = { + enable = true; + enableBashIntegration = true; + enableFishIntegration = true; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/misc.nix b/modules/hm/programs/terminal/programs/misc.nix new file mode 100644 index 0000000..b74aa4f --- /dev/null +++ b/modules/hm/programs/terminal/programs/misc.nix @@ -0,0 +1,20 @@ +{ + lib, + pkgs, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + home.packages = with pkgs; [ + # archives + zip + unzip + unrar + + # utils + fd + file + ripgrep + ]; + }; +} diff --git a/modules/hm/programs/terminal/programs/nix-index.nix b/modules/hm/programs/terminal/programs/nix-index.nix new file mode 100644 index 0000000..372060d --- /dev/null +++ b/modules/hm/programs/terminal/programs/nix-index.nix @@ -0,0 +1,19 @@ +{ + lib, + inputs, + osConfig, + ... +}: { + imports = [inputs.nix-index-db.hmModules.nix-index]; + + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs = { + nix-index = { + enable = true; + symlinkToCacheHome = true; # needed for comma + }; + command-not-found.enable = false; + nix-index-database.comma.enable = true; + }; + }; +} diff --git a/modules/hm/programs/terminal/programs/tmux.nix b/modules/hm/programs/terminal/programs/tmux.nix new file mode 100644 index 0000000..da828e2 --- /dev/null +++ b/modules/hm/programs/terminal/programs/tmux.nix @@ -0,0 +1,30 @@ +{ + lib, + pkgs, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.tmux = { + enable = true; + prefix = "C-space"; + escapeTime = 10; + clock24 = true; + keyMode = "vi"; + mouse = true; + baseIndex = 1; + extraConfig = '' + set-option -a terminal-features "''${TERM}:RGB" + bind c new-window -c "#{pane_current_path}" + bind '"' split-window -v -c "#{pane_current_path}" + bind '%' split-window -h -c "#{pane_current_path}" + bind C-k clear-history + ''; + plugins = with pkgs; [ + tmuxPlugins.vim-tmux-navigator + tmuxPlugins.yank + ]; + }; + programs.fzf.tmux.enableShellIntegration = true; + }; +} diff --git a/modules/hm/programs/terminal/programs/yazi.nix b/modules/hm/programs/terminal/programs/yazi.nix new file mode 100644 index 0000000..3b60a2b --- /dev/null +++ b/modules/hm/programs/terminal/programs/yazi.nix @@ -0,0 +1,33 @@ +{ + lib, + pkgs, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.modules.hyprland.enable { + programs.yazi = let + # https://github.com/iynaix/dotfiles/blob/8bb1568019ea26f034ac1af9c499b3ff102391a5/home-manager/shell/yazi.nix#L9-L11 + mkYaziPlugin = name: text: { + "${name}" = toString (pkgs.writeTextDir "${name}.yazi/init.lua" text) + "/${name}.yazi"; + }; + in { + enable = true; + enableFishIntegration = true; + plugins = mkYaziPlugin "smart-enter" '' + return { + entry = function() + local h = cx.active.current.hovered + ya.manager_emit(h and h.cha.is_dir and "enter" or "open", { hovered = true }) + end, + } + ''; + keymap.manager.prepend_keymap = [ + { + on = "l"; + run = "plugin --sync smart-enter"; + desc = "Enter the child directory, or open the file"; + } + ]; + }; + }; +} diff --git a/config/home-manager/terminal/shell/default.nix b/modules/hm/programs/terminal/shell/default.nix similarity index 80% rename from config/home-manager/terminal/shell/default.nix rename to modules/hm/programs/terminal/shell/default.nix index 53f04c4..3910822 100644 --- a/config/home-manager/terminal/shell/default.nix +++ b/modules/hm/programs/terminal/shell/default.nix @@ -1,8 +1,7 @@ { imports = [ + ./fish.nix ./starship.nix ./zoxide.nix - ./nushell.nix - ./fish.nix ]; } diff --git a/modules/hm/programs/terminal/shell/fish.nix b/modules/hm/programs/terminal/shell/fish.nix new file mode 100644 index 0000000..fc66325 --- /dev/null +++ b/modules/hm/programs/terminal/shell/fish.nix @@ -0,0 +1,51 @@ +{ + lib, + pkgs, + config, + osConfig, + ... +}: let + starshipTransient = lib.strings.optionalString config.programs.starship.enableTransience '' + function starship_transient_prompt_func + starship module character + end + + function starship_transient_rprompt_func + starship module cmd_duration + end + ''; +in { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.fish = { + enable = true; + interactiveShellInit = + starshipTransient + + '' + set fish_greeting # Disable greeting + fish_vi_key_bindings # Enable Vi mode + + ''; + plugins = [ + { + name = "fzf"; + inherit (pkgs.fishPlugins.fzf) src; + } + { + name = "autopair"; + inherit (pkgs.fishPlugins.autopair) src; + } + ]; + }; + + programs.bash = { + enable = true; + initExtra = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; + }; + }; +} diff --git a/modules/hm/programs/terminal/shell/starship.nix b/modules/hm/programs/terminal/shell/starship.nix new file mode 100644 index 0000000..f70c521 --- /dev/null +++ b/modules/hm/programs/terminal/shell/starship.nix @@ -0,0 +1,15 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.starship = { + enable = true; + enableTransience = true; + settings = { + add_newline = true; + }; + }; + }; +} diff --git a/modules/hm/programs/terminal/shell/zoxide.nix b/modules/hm/programs/terminal/shell/zoxide.nix new file mode 100644 index 0000000..63f3106 --- /dev/null +++ b/modules/hm/programs/terminal/shell/zoxide.nix @@ -0,0 +1,12 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + programs.zoxide = { + enable = true; + enableBashIntegration = false; + }; + }; +} diff --git a/modules/hm/programs/walker.nix b/modules/hm/programs/walker.nix new file mode 100644 index 0000000..7a701da --- /dev/null +++ b/modules/hm/programs/walker.nix @@ -0,0 +1,35 @@ +{ + lib, + inputs, + osConfig, + ... +}: { + imports = [ + inputs.walker.homeManagerModules.default + ]; + config = lib.mkIf osConfig.local.modules.hyprland.enable { + programs.walker = { + enable = true; + runAsService = true; + # All options from the config.json can be used here. + config = { + list = { + height = 200; + }; + app_launch_prefix = "uwsm app -- "; + websearch.prefix = "?"; + switcher.prefix = "/"; + }; + }; + + systemd.user.services.walker = { + Unit = { + PartOf = lib.mkForce []; + After = lib.mkForce ["graphical-session.target"]; + }; + Service = { + Slice = lib.mkForce "background-graphical.slice"; + }; + }; + }; +} diff --git a/modules/hm/programs/waybar.nix b/modules/hm/programs/waybar.nix new file mode 100644 index 0000000..a7c201d --- /dev/null +++ b/modules/hm/programs/waybar.nix @@ -0,0 +1,190 @@ +{ + lib, + pkgs, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.modules.hyprland.enable { + programs.waybar = { + enable = true; + systemd.enable = true; + settings = { + mainBar = { + layer = "top"; + position = "top"; + + modules-left = [ + "hyprland/window" + "pulseaudio" + "cpu" + "memory" + "idle_inhibitor" + ]; + + modules-center = ["hyprland/workspaces"]; + modules-right = [ + "custom/swaync" + "custom/power" + "network" + "battery" + "tray" + "clock" + ]; + + tray = { + icon-size = 16; + spacing = 12; + }; + + battery = { + interval = 10; + states = { + warning = 30; + critical = 15; + }; + format = "{icon} {capacity}%"; + format-charging = " {capacity}% - {time}"; + format-full = " {capacity}% - Full"; + format-icons = [ + "" + "" + "" + "" + "" + ]; + max-length = 25; + }; + + "pulseaudio" = { + format = "{icon} {volume}%"; + format-bluetooth = "{icon} {volume}%"; + format-muted = ""; + format-icons = { + "alsa_output.pci-0000_00_1f.3.analog-stereo" = ""; + "alsa_output.pci-0000_00_1f.3.analog-stereo-muted" = ""; + headphone = ""; + hands-free = ""; + headset = ""; + phone = ""; + phone-muted = ""; + portable = ""; + car = ""; + default = [ + "" + "" + ]; + }; + scroll-step = 1; + on-click = "pavucontrol"; + ignored-sinks = [ + "Easy Effects Sink" + ]; + }; + + "power-profiles-daemon" = { + format-icons = { + default = ""; + performance = ""; + balanced = ""; + power-saver = ""; + }; + }; + + "custom/power" = { + format = ""; + tooltip = false; + on-click = lib.getExe pkgs.wlogout; + }; + + "memory" = { + interval = 5; + format = " {}%"; + tooltip = true; + }; + + "cpu" = { + interval = 5; + format = " {usage:2}%"; + tooltip = true; + }; + + "idle_inhibitor" = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + tooltip = "true"; + }; + + "clock" = { + format = " {:L%H:%M}"; + tooltip = true; + tooltip-format = "{:%A, %d.%B %Y }\n{calendar}"; + }; + + "network" = { + format-icons = [ + "󰤯" + "󰤟" + "󰤢" + "󰤥" + "󰤨" + ]; + format-ethernet = " {bandwidthDownOctets}"; + format-wifi = "{icon} {signalStrength}%"; + format-disconnected = "󰤮"; + tooltip = false; + on-click = "XDG_CURRENT_DESKTOP=gnome gnome-control-center"; + }; + + "hyprland/window" = { + max-length = 22; + separate-outputs = false; + }; + + "hyprland/workspaces" = { + format = "{name}"; + format-icons = { + default = " "; + active = " "; + urgent = " "; + }; + on-scroll-up = "hyprctl dispatch workspace e+1"; + on-scroll-down = "hyprctl dispatch workspace e-1"; + }; + + "custom/swaync" = { + tooltip = false; + format = "{icon}"; + format-icons = { + none = ""; + notification = ""; + dnd-notification = ""; + dnd-none = ""; + inhibited-notification = ""; + inhibited-none = ""; + dnd-inhibited-notification = ""; + dnd-inhibited-none = ""; + }; + return-type = "json"; + escape = true; + exec-if = "which ${pkgs.swaynotificationcenter}/bin/swaync-client"; + exec = "${pkgs.swaynotificationcenter}/bin/swaync-client --subscribe-waybar"; + on-click = "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-panel --skip-wait"; + on-click-middle = "${pkgs.swaynotificationcenter}/bin/swaync-client --toggle-dnd --skip-wait"; + }; + }; + }; + }; + + systemd.user.services.waybar = { + Unit.After = lib.mkForce "graphical-session.target"; + Service.Slice = "app-graphical.slice"; + }; + + home.packages = [ + pkgs.pavucontrol + ]; + }; +} diff --git a/modules/hm/programs/wlogout.nix b/modules/hm/programs/wlogout.nix new file mode 100644 index 0000000..b9938d9 --- /dev/null +++ b/modules/hm/programs/wlogout.nix @@ -0,0 +1,69 @@ +{ + lib, + pkgs, + config, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.modules.hyprland.enable { + programs.wlogout = { + enable = true; + + layout = let + systemd = let + systemd = lib.getExe' pkgs.systemd; + in { + loginctl = systemd "loginctl"; + systemctl = systemd "systemctl"; + }; + in [ + { + action = "${systemd.loginctl} lock-session"; + keybind = "l"; + label = "lock"; + text = "Lock"; + } + + { + action = "${systemd.systemctl} hibernate"; + keybind = "h"; + label = "hibernate"; + text = "Hibernate"; + } + + { + action = "${ + systemd.loginctl + } terminate-user ${ + config.home.username + }"; + + keybind = "q"; + label = "logout"; + text = "Logout"; + } + + { + action = "${systemd.systemctl} poweroff"; + keybind = "p"; + label = "shutdown"; + text = "Shutdown"; + } + + { + action = "${systemd.systemctl} suspend"; + keybind = "s"; + label = "suspend"; + text = "Suspend"; + } + + { + action = "${systemd.systemctl} reboot"; + keybind = "r"; + label = "reboot"; + text = "Reboot"; + } + ]; + }; + }; +} diff --git a/modules/hm/programs/xdg.nix b/modules/hm/programs/xdg.nix new file mode 100644 index 0000000..33ccf54 --- /dev/null +++ b/modules/hm/programs/xdg.nix @@ -0,0 +1,42 @@ +{ + lib, + config, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + xdg = { + enable = true; + cacheHome = config.home.homeDirectory + "/.local/cache"; + + mimeApps = { + enable = true; + defaultApplications = { + "default-web-browser" = ["firefox.desktop"]; + "text/html" = ["firefox.desktop"]; + "x-scheme-handler/http" = ["firefox.desktop"]; + "x-scheme-handler/https" = ["firefox.desktop"]; + "x-scheme-handler/about" = ["firefox.desktop"]; + "x-scheme-handler/unknown" = ["firefox.desktop"]; + "x-scheme-handler/chrome" = ["chromium-browser.desktop"]; + "inode/directory" = ["yazi.desktop"]; + "application/pdf" = ["org.pwmt.zathura-pdf-mupdf.desktop"]; + "image/png" = ["org.gnome.gThumb.desktop"]; + "image/svg" = [" org.gnome.gThumb.desktop"]; + "image/jpeg" = ["org.gnome.gThumb.desktop"]; + "image/gif" = [" org.gnome.gThumb.desktop"]; + "video/mp4" = ["io.github.celluloid_player.Celluloid.desktop"]; + "video/avi" = ["io.github.celluloid_player.Celluloid.desktop"]; + "video/mkv" = ["io.github.celluloid_player.Celluloid.desktop"]; + }; + }; + userDirs = { + enable = true; + createDirectories = true; + extraConfig = { + XDG_SCREENSHOTS_DIR = "${config.xdg.userDirs.pictures}/Screenshots"; + }; + }; + }; + }; +} diff --git a/modules/hm/services/default.nix b/modules/hm/services/default.nix new file mode 100644 index 0000000..39128e4 --- /dev/null +++ b/modules/hm/services/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./gammastep.nix + ./syncthing.nix + ./swaync + ./udiskie.nix + ]; +} diff --git a/modules/hm/services/gammastep.nix b/modules/hm/services/gammastep.nix new file mode 100644 index 0000000..91c4ea6 --- /dev/null +++ b/modules/hm/services/gammastep.nix @@ -0,0 +1,23 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.laptop.enable { + services.gammastep = { + enable = true; + tray = true; + provider = "geoclue2"; + }; + + systemd.user.services.gammastep = { + Unit = { + PartOf = lib.mkForce []; + After = lib.mkForce ["graphical-session.target"]; + }; + Service = { + Slice = lib.mkForce "background-graphical.slice"; + }; + }; + }; +} diff --git a/modules/hm/services/swaync/default.nix b/modules/hm/services/swaync/default.nix new file mode 100644 index 0000000..f96130f --- /dev/null +++ b/modules/hm/services/swaync/default.nix @@ -0,0 +1,33 @@ +{ + lib, + osConfig, + ... +}: let + inherit (builtins) readFile; +in { + config = lib.mkIf osConfig.local.modules.hyprland.enable { + services.swaync = { + enable = true; + style = readFile ./style.css; + settings = { + positionX = "right"; + positionY = "top"; + layer = "overlay"; + control-center-layer = "top"; + layer-shell = true; + cssPriority = "application"; + control-center-margin-top = 0; + control-center-margin-bottom = 0; + control-center-margin-right = 0; + control-center-margin-left = 0; + notification-2fa-action = true; + notification-inline-replies = false; + notification-icon-size = 64; + notification-body-image-height = 100; + notification-body-image-width = 200; + }; + }; + # systemd.user.services.swaync.Service.Environment = "WAYLAND_DISPLAY=wayland-1"; + systemd.user.services.swaync.Unit.ConditionEnvironment = lib.mkForce ""; + }; +} diff --git a/config/home-manager/services/swaync/style.css b/modules/hm/services/swaync/style.css similarity index 100% rename from config/home-manager/services/swaync/style.css rename to modules/hm/services/swaync/style.css diff --git a/modules/hm/services/syncthing.nix b/modules/hm/services/syncthing.nix new file mode 100644 index 0000000..d0cd12a --- /dev/null +++ b/modules/hm/services/syncthing.nix @@ -0,0 +1,11 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + services.syncthing = { + enable = true; + }; + }; +} diff --git a/modules/hm/services/udiskie.nix b/modules/hm/services/udiskie.nix new file mode 100644 index 0000000..cc2e2fb --- /dev/null +++ b/modules/hm/services/udiskie.nix @@ -0,0 +1,9 @@ +{ + lib, + osConfig, + ... +}: { + config = lib.mkIf osConfig.local.profiles.desktop.enable { + services.udiskie.enable = true; + }; +} diff --git a/config/nixos/core/boot.nix b/modules/nix/core/boot.nix similarity index 100% rename from config/nixos/core/boot.nix rename to modules/nix/core/boot.nix diff --git a/modules/nix/core/default.nix b/modules/nix/core/default.nix new file mode 100644 index 0000000..1930a98 --- /dev/null +++ b/modules/nix/core/default.nix @@ -0,0 +1,16 @@ +{lib, ...}: { + imports = [ + ./hardware + + ./boot.nix + ./fonts.nix + ./home-manager.nix + ./locales.nix + ./networking.nix + ./nix.nix + ./users.nix + ./security.nix + ]; + system.stateVersion = lib.mkDefault "24.05"; + zramSwap.enable = true; +} diff --git a/modules/nix/core/fonts.nix b/modules/nix/core/fonts.nix new file mode 100644 index 0000000..5154644 --- /dev/null +++ b/modules/nix/core/fonts.nix @@ -0,0 +1,31 @@ +{ + lib, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + fonts = { + enableDefaultPackages = false; + packages = [ + pkgs.noto-fonts + pkgs.noto-fonts-cjk-sans + pkgs.noto-fonts-extra + pkgs.intel-one-mono + pkgs.noto-fonts-color-emoji + pkgs.nerd-fonts._0xproto + pkgs.nerd-fonts.symbols-only + ]; + + fontconfig = { + enable = true; + defaultFonts = { + serif = ["Noto Serif"]; + sansSerif = ["Inter Medium"]; + monospace = ["0xProto Nerd Font"]; + emoji = ["Noto Color Emoji"]; + }; + }; + }; + }; +} diff --git a/modules/nix/core/hardware/default.nix b/modules/nix/core/hardware/default.nix new file mode 100644 index 0000000..660a10f --- /dev/null +++ b/modules/nix/core/hardware/default.nix @@ -0,0 +1,9 @@ +{ + imports = [ + ./fprintd.nix + ./fwupd.nix + ./printing.nix + ./uni-sync.nix + ./via.nix + ]; +} diff --git a/modules/nix/core/hardware/fprintd.nix b/modules/nix/core/hardware/fprintd.nix new file mode 100644 index 0000000..d5b4fc3 --- /dev/null +++ b/modules/nix/core/hardware/fprintd.nix @@ -0,0 +1,9 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.laptop.enable { + services.fprintd.enable = true; + }; +} diff --git a/modules/nix/core/hardware/fwupd.nix b/modules/nix/core/hardware/fwupd.nix new file mode 100644 index 0000000..db3e785 --- /dev/null +++ b/modules/nix/core/hardware/fwupd.nix @@ -0,0 +1,9 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + services.fwupd.enable = true; + }; +} diff --git a/modules/nix/core/hardware/printing.nix b/modules/nix/core/hardware/printing.nix new file mode 100644 index 0000000..39b1bc9 --- /dev/null +++ b/modules/nix/core/hardware/printing.nix @@ -0,0 +1,36 @@ +{ + lib, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + services = { + # setup printing service + printing.enable = true; + + avahi = { + enable = true; + nssmdns4 = true; + openFirewall = true; + }; + + printing.drivers = [ + pkgs.gutenprint + pkgs.hplip + ]; + + udev.packages = [ + pkgs.sane-airscan + pkgs.utsushi + ]; + }; + + hardware.sane.enable = true; # enables support for SANE scanners + hardware.sane.extraBackends = [ + pkgs.sane-airscan # generic + pkgs.hplip # HP + pkgs.utsushi # other printers + ]; + }; +} diff --git a/modules/nix/core/hardware/uni-sync.nix b/modules/nix/core/hardware/uni-sync.nix new file mode 100644 index 0000000..15e061a --- /dev/null +++ b/modules/nix/core/hardware/uni-sync.nix @@ -0,0 +1,44 @@ +{ + lib, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.gaming.enable { + hardware.uni-sync = { + enable = true; + devices = [ + { + device_id = "VID:3314/PID:41218/SN:6243168001"; + sync_rgb = true; + channels = [ + { + mode = "Manual"; + speed = 60; + } + { + mode = "Manual"; + speed = 60; + } + { + mode = "Manual"; + speed = 60; + } + { + mode = "Manual"; + speed = 60; + } + ]; + } + ]; + }; + + systemd.services.uni-sync = { + enable = true; + serviceConfig = { + ExecStart = "${pkgs.uni-sync}/bin/uni-sync"; + }; + wantedBy = ["multi-user.target"]; + }; + }; +} diff --git a/modules/nix/core/hardware/via.nix b/modules/nix/core/hardware/via.nix new file mode 100644 index 0000000..8b1b22e --- /dev/null +++ b/modules/nix/core/hardware/via.nix @@ -0,0 +1,14 @@ +{ + lib, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.gaming.enable { + hardware.keyboard.qmk.enable = true; + environment.systemPackages = with pkgs; [ + via + ]; + services.udev.packages = [pkgs.via]; + }; +} diff --git a/modules/nix/core/home-manager.nix b/modules/nix/core/home-manager.nix new file mode 100644 index 0000000..c8befd6 --- /dev/null +++ b/modules/nix/core/home-manager.nix @@ -0,0 +1,37 @@ +{ + inputs, + lib, + config, + ... +}: let + inherit (config.local.systemVars) username; +in { + imports = [ + inputs.home-manager.nixosModules.default + ]; + + config = lib.mkIf (!config.local.profiles.server.enable) { + home-manager = { + backupFileExtension = "backup"; + useGlobalPkgs = true; + useUserPackages = true; + + extraSpecialArgs = {inherit inputs;}; + sharedModules = [../../hm]; + }; + + home-manager.users.${username} = { + home = { + homeDirectory = "/home/${username}"; + stateVersion = "24.05"; + }; + + programs.home-manager.enable = true; + }; + + programs = { + # make HM-managed GTK stuff work + dconf.enable = true; + }; + }; +} diff --git a/config/nixos/core/default.nix b/modules/nix/core/locales.nix similarity index 73% rename from config/nixos/core/default.nix rename to modules/nix/core/locales.nix index fd481b2..7e36090 100644 --- a/config/nixos/core/default.nix +++ b/modules/nix/core/locales.nix @@ -1,10 +1,4 @@ {lib, ...}: { - imports = [ - ./boot.nix - ./users.nix - ./security.nix - ./networking.nix - ]; i18n = { defaultLocale = "en_US.UTF-8"; extraLocaleSettings = { @@ -20,7 +14,5 @@ }; }; - system.stateVersion = lib.mkDefault "24.05"; time.timeZone = lib.mkDefault "Europe/Paris"; - zramSwap.enable = true; } diff --git a/modules/nix/core/networking.nix b/modules/nix/core/networking.nix new file mode 100644 index 0000000..c09f634 --- /dev/null +++ b/modules/nix/core/networking.nix @@ -0,0 +1,21 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf (!config.local.profiles.server.enable) { + networking = { + inherit (config.local.systemVars) hostName; + nameservers = ["1.1.1.1" "1.0.0.1"]; + networkmanager = { + enable = true; + dns = "systemd-resolved"; + wifi.powersave = true; + }; + }; + services.resolved = { + enable = true; + dnsovertls = "opportunistic"; + }; + }; +} diff --git a/modules/nix/core/nix.nix b/modules/nix/core/nix.nix new file mode 100644 index 0000000..af14dbb --- /dev/null +++ b/modules/nix/core/nix.nix @@ -0,0 +1,35 @@ +{pkgs, ...}: { + nix = { + package = pkgs.lix; + settings = { + accept-flake-config = true; + warn-dirty = false; + auto-optimise-store = true; + trusted-users = ["root" "@wheel"]; + experimental-features = [ + "nix-command" + "flakes" + ]; + }; + }; + + programs.nh = { + enable = true; + clean = { + enable = true; + extraArgs = "--keep-since 30d --keep 3"; + }; + }; + + nixpkgs = { + config = { + allowUnfree = true; + permittedInsecurePackages = [ + "cinny-4.2.3" + "cinny-unwrapped-4.2.3" + "segger-jlink-qt4-810" + ]; + segger-jlink.acceptLicense = true; + }; + }; +} diff --git a/config/nixos/core/security.nix b/modules/nix/core/security.nix similarity index 100% rename from config/nixos/core/security.nix rename to modules/nix/core/security.nix diff --git a/modules/nix/core/users.nix b/modules/nix/core/users.nix new file mode 100644 index 0000000..8ec21af --- /dev/null +++ b/modules/nix/core/users.nix @@ -0,0 +1,19 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf (!config.local.profiles.server.enable) { + users.users.${config.local.systemVars.username} = { + isNormalUser = true; + description = config.local.homeVars.fullName or "User"; + extraGroups = [ + "networkmanager" + "audio" + "video" + "wheel" + "plugdev" + ]; + }; + }; +} diff --git a/modules/nix/default.nix b/modules/nix/default.nix new file mode 100644 index 0000000..ab88cb6 --- /dev/null +++ b/modules/nix/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./core + ./programs + ./services + ./style + ]; +} diff --git a/modules/nix/programs/default.nix b/modules/nix/programs/default.nix new file mode 100644 index 0000000..11b433e --- /dev/null +++ b/modules/nix/programs/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./hyprland.nix + ./games.nix + ./xdg.nix + ]; +} diff --git a/modules/nix/programs/games.nix b/modules/nix/programs/games.nix new file mode 100644 index 0000000..8d1a05e --- /dev/null +++ b/modules/nix/programs/games.nix @@ -0,0 +1,21 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.gaming.enable { + programs = { + steam = { + enable = true; + }; + + gamemode.enable = true; + gamescope.enable = true; + + coolercontrol = { + enable = true; + nvidiaSupport = true; + }; + }; + }; +} diff --git a/modules/nix/programs/hyprland.nix b/modules/nix/programs/hyprland.nix new file mode 100644 index 0000000..8d72df2 --- /dev/null +++ b/modules/nix/programs/hyprland.nix @@ -0,0 +1,38 @@ +{ + inputs, + config, + lib, + pkgs, + ... +}: { + config = lib.mkIf config.local.modules.hyprland.enable { + environment.systemPackages = [ + inputs.hyprland-qtutils.packages.${pkgs.system}.default + ]; + + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + + programs.hyprland = { + enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland; + withUWSM = true; + systemd.setPath.enable = true; + }; + + # copied from https://github.com/linyinfeng/dotfiles/blob/91b0363b093303f57885cbae9da7f8a99bbb4432/nixos/profiles/graphical/niri/default.nix#L17-L29 + security.pam.services.hyprlock.text = lib.mkIf config.services.fprintd.enable '' + account required pam_unix.so + + # check passwork before fprintd + auth sufficient pam_unix.so try_first_pass likeauth + auth sufficient ${pkgs.fprintd}/lib/security/pam_fprintd.so + auth required pam_deny.so + + password sufficient pam_unix.so nullok yescrypt + + session required pam_env.so conffile=/etc/pam/environment readenv=0 + session required pam_unix.so + ''; + }; +} diff --git a/modules/nix/programs/xdg.nix b/modules/nix/programs/xdg.nix new file mode 100644 index 0000000..1724017 --- /dev/null +++ b/modules/nix/programs/xdg.nix @@ -0,0 +1,21 @@ +{ + lib, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + config = { + common.default = ["gtk"]; + hyprland.default = ["gtk" "hyprland"]; + }; + + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + ]; + }; + }; +} diff --git a/modules/nix/services/brightness.nix b/modules/nix/services/brightness.nix new file mode 100644 index 0000000..05da8b3 --- /dev/null +++ b/modules/nix/services/brightness.nix @@ -0,0 +1,9 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.laptop.enable { + hardware.brillo.enable = true; + }; +} diff --git a/modules/nix/services/default.nix b/modules/nix/services/default.nix new file mode 100644 index 0000000..9f454d8 --- /dev/null +++ b/modules/nix/services/default.nix @@ -0,0 +1,21 @@ +{ + imports = [ + ./brightness.nix + ./docker.nix + ./documentation.nix + ./flatpak.nix + ./forgejo.nix + ./gnome.nix + ./gnupg.nix + ./greetd.nix + ./keyd.nix + ./kmscon.nix + ./location.nix + ./logind.nix + ./pipewire.nix + ./power.nix + ./searx.nix + ./syncthing.nix + ./website.nix + ]; +} diff --git a/modules/nix/services/docker.nix b/modules/nix/services/docker.nix new file mode 100644 index 0000000..97ecd28 --- /dev/null +++ b/modules/nix/services/docker.nix @@ -0,0 +1,15 @@ +{ + lib, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + virtualisation.podman = { + enable = true; + dockerCompat = true; + }; + + environment.systemPackages = [pkgs.distrobox]; + }; +} diff --git a/modules/nix/services/documentation.nix b/modules/nix/services/documentation.nix new file mode 100644 index 0000000..c715c55 --- /dev/null +++ b/modules/nix/services/documentation.nix @@ -0,0 +1,18 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + documentation = { + enable = true; + + man = { + enable = true; + man-db.enable = false; + mandoc.enable = true; + generateCaches = true; + }; + }; + }; +} diff --git a/modules/nix/services/flatpak.nix b/modules/nix/services/flatpak.nix new file mode 100644 index 0000000..bbf4f92 --- /dev/null +++ b/modules/nix/services/flatpak.nix @@ -0,0 +1,9 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + services.flatpak.enable = true; + }; +} diff --git a/modules/nix/services/forgejo.nix b/modules/nix/services/forgejo.nix new file mode 100644 index 0000000..904c276 --- /dev/null +++ b/modules/nix/services/forgejo.nix @@ -0,0 +1,93 @@ +{ + config, + lib, + pkgs, + ... +}: let + inherit (lib) mkAfter removePrefix removeSuffix; + srv = config.services.forgejo.settings.server; + + # https://github.com/isabelroses/dotfiles/blob/06f8f70914c8e672541a52563ee624ce2e62adfb/modules/nixos/services/selfhosted/forgejo.nix#L19-L23 + theme = pkgs.fetchzip { + url = "https://github.com/catppuccin/gitea/releases/download/v1.0.1/catppuccin-gitea.tar.gz"; + sha256 = "et5luA3SI7iOcEIQ3CVIu0+eiLs8C/8mOitYlWQa/uI="; + stripRoot = false; + }; +in { + config = lib.mkIf config.local.profiles.server.enable { + services = { + forgejo = { + enable = true; + package = pkgs.forgejo; + lfs.enable = true; + database.type = "postgres"; + dump = { + enable = true; + type = "tar.xz"; + }; + settings = { + server = { + DOMAIN = "git.nezia.dev"; + HTTP_PORT = 1849; + ROOT_URL = "https://${srv.DOMAIN}/"; + HTTP_ADDR = "localhost"; + }; + service = { + DISABLE_REGISTRATION = true; + }; + federation = { + ENABLED = true; + }; + ui = { + DEFAULT_THEME = "catppuccin-mocha-lavender"; + THEMES = builtins.concatStringsSep "," ( + ["auto,forgejo-auto,forgejo-dark,forgejo-light,arc-gree,gitea"] + ++ (map (name: removePrefix "theme-" (removeSuffix ".css" name)) ( + builtins.attrNames (builtins.readDir theme) + )) + ); + }; + + actions = { + ENABLED = true; + DEFAULT_ACTIONS_URL = "https://code.forgejo.org"; + }; + }; + }; + + caddy = { + enable = true; + virtualHosts."git.nezia.dev".extraConfig = '' + reverse_proxy * localhost:${toString srv.HTTP_PORT} + ''; + }; + }; + + # https://github.com/isabelroses/dotfiles/blob/06f8f70914c8e672541a52563ee624ce2e62adfb/modules/nixos/services/selfhosted/forgejo.nix#L59-L71 + systemd.services = { + forgejo = { + preStart = let + inherit (config.services.forgejo) stateDir; + in + mkAfter '' + rm -rf ${stateDir}/custom/public/assets + mkdir -p ${stateDir}/custom/public/assets + ln -sf ${theme} ${stateDir}/custom/public/assets/css + ''; + }; + }; + + networking.firewall = { + enable = true; + allowedTCPPorts = [80 443]; + + # if using nftables + extraForwardRules = '' + ip6 saddr { ::/0 } accept + ''; + }; + + # ensure IPv6 is enabled + networking.enableIPv6 = true; + }; +} diff --git a/modules/nix/services/gnome.nix b/modules/nix/services/gnome.nix new file mode 100644 index 0000000..5596fd2 --- /dev/null +++ b/modules/nix/services/gnome.nix @@ -0,0 +1,19 @@ +{ + lib, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + services = { + # needed for GNOME services outside of GNOME Desktop + dbus.packages = with pkgs; [ + gcr + gnome-settings-daemon + ]; + + gnome.gnome-keyring.enable = true; + gvfs.enable = true; + }; + }; +} diff --git a/modules/nix/services/gnupg.nix b/modules/nix/services/gnupg.nix new file mode 100644 index 0000000..a33cdb0 --- /dev/null +++ b/modules/nix/services/gnupg.nix @@ -0,0 +1,12 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + }; +} diff --git a/modules/nix/services/greetd.nix b/modules/nix/services/greetd.nix new file mode 100644 index 0000000..df70a0d --- /dev/null +++ b/modules/nix/services/greetd.nix @@ -0,0 +1,78 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: +# thanks https://git.jacekpoz.pl/poz/niksos/src/commit/f8d5e7ccd9c769f7c0b564f10dff419285e75248/modules/services/greetd.nix +let + inherit (lib) getExe getExe'; + inherit (inputs.hyprland.packages.${pkgs.stdenv.system}) hyprland; + + hyprctl = getExe' hyprland "hyprctl"; + Hyprland = getExe' hyprland "Hyprland"; + + greeter = getExe pkgs.greetd.gtkgreet; + + hyprlandConfig = + pkgs.writeText "greetd-hyprland-config" + '' + misc { + force_default_wallpaper=0 + focus_on_activate=1 + } + + animations { + enabled=0 + first_launch_animation=0 + } + + workspace=1,default:true,gapsout:0,gapsin:0,border:false,decorate:false + + exec-once=[workspace 1;fullscreen;noanim] ${greeter} -l; ${hyprctl} dispatch exit + exec-once=${hyprctl} dispatch focuswindow ${greeter} + ''; +in { + # TODO: perhaps turn this into a more generic module if we wanna use other wayland compositors + config = lib.mkIf config.local.modules.hyprland.enable { + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${Hyprland} --config ${hyprlandConfig}"; + user = config.local.systemVars.username; + }; + }; + }; + + programs.regreet = { + enable = true; + }; + + security.pam.services = { + greetd.enableGnomeKeyring = true; + login.enableGnomeKeyring = true; + gdm-password.enableGnomeKeyring = true; + greetd.fprintAuth = false; + }; + + environment.etc."greetd/environments".text = let + environments = [ + { + name = "Hyprland"; + condition = with config.programs.hyprland; enable && !withUWSM; + } + { + name = "uwsm start -S hyprland-uwsm.desktop"; + condition = with config.programs.hyprland; enable && withUWSM; + } + { + name = "sway"; + condition = config.programs.sway.enable; + } + ]; + in + builtins.concatStringsSep "\n" (map (env: env.name) (builtins.filter (env: env.condition) environments)); + }; +} diff --git a/modules/nix/services/keyd.nix b/modules/nix/services/keyd.nix new file mode 100644 index 0000000..12e44f4 --- /dev/null +++ b/modules/nix/services/keyd.nix @@ -0,0 +1,18 @@ +{ + lib, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + services.keyd = { + enable = true; + keyboards.default = { + ids = ["*"]; + settings.main = { + capslock = "overload(control, esc)"; + }; + }; + }; + }; +} diff --git a/modules/nix/services/kmscon.nix b/modules/nix/services/kmscon.nix new file mode 100644 index 0000000..758df65 --- /dev/null +++ b/modules/nix/services/kmscon.nix @@ -0,0 +1,22 @@ +{ + lib, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + services.kmscon = { + enable = true; + fonts = [ + { + name = "0xProto Nerd Font"; + package = pkgs.nerd-fonts._0xproto; + } + ]; + extraConfig = '' + font-size=13 + font-dpi=144 + ''; + }; + }; +} diff --git a/modules/nix/services/location.nix b/modules/nix/services/location.nix new file mode 100644 index 0000000..ac22b89 --- /dev/null +++ b/modules/nix/services/location.nix @@ -0,0 +1,21 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.modules.hyprland.enable { + location.provider = "geoclue2"; + + services.geoclue2 = { + enable = true; + geoProviderUrl = "https://beacondb.net/v1/geolocate"; + submissionUrl = "https://beacondb.net/v2/geosubmit"; + submissionNick = "geoclue"; + + appConfig.gammastep = { + isAllowed = true; + isSystem = false; + }; + }; + }; +} diff --git a/modules/nix/services/logind.nix b/modules/nix/services/logind.nix new file mode 100644 index 0000000..11b55b8 --- /dev/null +++ b/modules/nix/services/logind.nix @@ -0,0 +1,15 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.laptop.enable { + services.logind = { + lidSwitch = "suspend"; + extraConfig = '' + HandlePowerKey=ignore + HandlePowerKeyLongPress=poweroff + ''; + }; + }; +} diff --git a/modules/nix/services/pipewire.nix b/modules/nix/services/pipewire.nix new file mode 100644 index 0000000..25cc868 --- /dev/null +++ b/modules/nix/services/pipewire.nix @@ -0,0 +1,26 @@ +{ + lib, + inputs, + config, + ... +}: { + imports = [ + inputs.nix-gaming.nixosModules.pipewireLowLatency + ]; + + config = lib.mkIf config.local.profiles.desktop.enable { + services = { + pulseaudio.enable = false; + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + lowLatency.enable = true; + }; + }; + # rtkit is optional but recommended + security.rtkit.enable = true; + }; +} diff --git a/modules/nix/services/power.nix b/modules/nix/services/power.nix new file mode 100644 index 0000000..952a629 --- /dev/null +++ b/modules/nix/services/power.nix @@ -0,0 +1,14 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.laptop.enable { + services = { + power-profiles-daemon.enable = true; + + # battery info + upower.enable = true; + }; + }; +} diff --git a/modules/nix/services/searx.nix b/modules/nix/services/searx.nix new file mode 100644 index 0000000..fe3f097 --- /dev/null +++ b/modules/nix/services/searx.nix @@ -0,0 +1,69 @@ +{ + inputs, + lib, + pkgs, + config, + ... +}: { + imports = [ + inputs.agenix.nixosModules.default + ]; + + config = lib.mkIf config.local.profiles.server.enable { + age.secrets.searx-env-file.file = ../../../secrets/searx-env-file.age; + services = { + searx = { + enable = true; + package = pkgs.searxng; + environmentFile = config.age.secrets.searx-env-file.path; + settings = { + search = { + safe_search = 1; # 0 = None, 1 = Moderate, 2 = Strict + autocomplete = "google"; # Existing autocomplete backends: "dbpedia", "duckduckgo", "google", "startpage", "swisscows", "qwant", "wikipedia" - leave blank to turn it off by default + default_lang = "en"; + }; + server = { + secret_key = "@SEARX_SECRET_KEY@"; + port = 8888; # Internal port + bind_address = "localhost"; # Only listen locally + base_url = "https://search.nezia.dev/"; + image_proxy = true; + default_http_headers = { + X-Content-Type-Options = "nosniff"; + X-XSS-Protection = "1; mode=block"; + X-Download-Options = "noopen"; + X-Robots-Tag = "noindex, nofollow"; + Referrer-Policy = "no-referrer"; + }; + }; + engines = [ + { + name = "qwant"; + disabled = true; + } + ]; + }; + }; + + caddy = { + enable = true; + virtualHosts."search.nezia.dev" = { + extraConfig = '' + encode gzip + reverse_proxy localhost:8888 { + header_up Host {host} + header_up X-Real-IP {remote_addr} + header_up X-Forwarded-For {remote_addr} + header_up X-Forwarded-Proto {scheme} + } + ''; + }; + }; + }; + + # Open required ports + networking.firewall = { + allowedTCPPorts = [80 443]; # For Caddy + }; + }; +} diff --git a/modules/nix/services/syncthing.nix b/modules/nix/services/syncthing.nix new file mode 100644 index 0000000..258af23 --- /dev/null +++ b/modules/nix/services/syncthing.nix @@ -0,0 +1,14 @@ +{ + lib, + config, + ... +}: { + config = lib.mkIf config.local.profiles.desktop.enable { + services = { + syncthing = { + enable = true; + }; + }; + systemd.services.syncthing.environment.STNODEFAULTFOLDER = "true"; # Don't create default ~/Sync folder + }; +} diff --git a/modules/nix/services/website.nix b/modules/nix/services/website.nix new file mode 100644 index 0000000..4eb573c --- /dev/null +++ b/modules/nix/services/website.nix @@ -0,0 +1,25 @@ +{ + lib, + inputs, + pkgs, + config, + ... +}: { + config = lib.mkIf config.local.profiles.server.enable { + services.caddy.enable = true; + services.caddy.virtualHosts = { + "www.nezia.dev" = { + extraConfig = '' + redir https://nezia.dev{uri} + ''; + }; + "nezia.dev" = { + extraConfig = '' + root * ${inputs."nezia_dev".packages.${pkgs.system}.default} + file_server + encode gzip + ''; + }; + }; + }; +} diff --git a/modules/nix/style/default.nix b/modules/nix/style/default.nix new file mode 100644 index 0000000..bce44b0 --- /dev/null +++ b/modules/nix/style/default.nix @@ -0,0 +1,29 @@ +{ + inputs, + config, + lib, + ... +}: let + inherit (lib) mkIf; + + cfg = config.local.style; +in { + imports = + [ + inputs.niri.nixosModules.niri + inputs.hyprland.nixosModules.default + ] + ++ lib.filesystem.listFilesRecursive ./modules; + + config = mkIf cfg.enable { + home-manager.sharedModules = [ + { + home.pointerCursor = { + inherit (cfg.cursorTheme) name package size; + x11.enable = true; + gtk.enable = true; + }; + } + ]; + }; +} diff --git a/shared/nixosModules/style/modules/discord.nix b/modules/nix/style/modules/discord.nix similarity index 100% rename from shared/nixosModules/style/modules/discord.nix rename to modules/nix/style/modules/discord.nix diff --git a/shared/nixosModules/style/modules/fish.nix b/modules/nix/style/modules/fish.nix similarity index 100% rename from shared/nixosModules/style/modules/fish.nix rename to modules/nix/style/modules/fish.nix diff --git a/shared/nixosModules/style/modules/foot.nix b/modules/nix/style/modules/foot.nix similarity index 100% rename from shared/nixosModules/style/modules/foot.nix rename to modules/nix/style/modules/foot.nix diff --git a/shared/nixosModules/style/modules/fuzzel.nix b/modules/nix/style/modules/fuzzel.nix similarity index 100% rename from shared/nixosModules/style/modules/fuzzel.nix rename to modules/nix/style/modules/fuzzel.nix diff --git a/shared/nixosModules/style/modules/gtk.nix b/modules/nix/style/modules/gtk.nix similarity index 100% rename from shared/nixosModules/style/modules/gtk.nix rename to modules/nix/style/modules/gtk.nix diff --git a/shared/nixosModules/style/modules/hyprland.nix b/modules/nix/style/modules/hyprland.nix similarity index 100% rename from shared/nixosModules/style/modules/hyprland.nix rename to modules/nix/style/modules/hyprland.nix diff --git a/shared/nixosModules/style/modules/hyprlock.nix b/modules/nix/style/modules/hyprlock.nix similarity index 100% rename from shared/nixosModules/style/modules/hyprlock.nix rename to modules/nix/style/modules/hyprlock.nix diff --git a/shared/nixosModules/style/modules/niri.nix b/modules/nix/style/modules/niri.nix similarity index 100% rename from shared/nixosModules/style/modules/niri.nix rename to modules/nix/style/modules/niri.nix diff --git a/shared/nixosModules/style/modules/nvf.nix b/modules/nix/style/modules/nvf.nix similarity index 100% rename from shared/nixosModules/style/modules/nvf.nix rename to modules/nix/style/modules/nvf.nix diff --git a/shared/nixosModules/style/modules/regreet.nix b/modules/nix/style/modules/regreet.nix similarity index 100% rename from shared/nixosModules/style/modules/regreet.nix rename to modules/nix/style/modules/regreet.nix diff --git a/shared/nixosModules/style/modules/starship.nix b/modules/nix/style/modules/starship.nix similarity index 100% rename from shared/nixosModules/style/modules/starship.nix rename to modules/nix/style/modules/starship.nix diff --git a/shared/nixosModules/style/modules/swaylock.nix b/modules/nix/style/modules/swaylock.nix similarity index 100% rename from shared/nixosModules/style/modules/swaylock.nix rename to modules/nix/style/modules/swaylock.nix diff --git a/shared/nixosModules/style/modules/swaync.nix b/modules/nix/style/modules/swaync.nix similarity index 100% rename from shared/nixosModules/style/modules/swaync.nix rename to modules/nix/style/modules/swaync.nix diff --git a/shared/nixosModules/style/modules/tidal-hifi.nix b/modules/nix/style/modules/tidal-hifi.nix similarity index 100% rename from shared/nixosModules/style/modules/tidal-hifi.nix rename to modules/nix/style/modules/tidal-hifi.nix diff --git a/shared/nixosModules/style/modules/walker.nix b/modules/nix/style/modules/walker.nix similarity index 100% rename from shared/nixosModules/style/modules/walker.nix rename to modules/nix/style/modules/walker.nix diff --git a/shared/nixosModules/style/modules/waybar.nix b/modules/nix/style/modules/waybar.nix similarity index 100% rename from shared/nixosModules/style/modules/waybar.nix rename to modules/nix/style/modules/waybar.nix diff --git a/shared/nixosModules/style/modules/zathura.nix b/modules/nix/style/modules/zathura.nix similarity index 100% rename from shared/nixosModules/style/modules/zathura.nix rename to modules/nix/style/modules/zathura.nix diff --git a/shared/nixosModules/default.nix b/modules/options/default.nix similarity index 57% rename from shared/nixosModules/default.nix rename to modules/options/default.nix index 8286746..362164d 100644 --- a/shared/nixosModules/default.nix +++ b/modules/options/default.nix @@ -1,7 +1,10 @@ { imports = [ - ./systemVars.nix + ./modules + ./profiles + ./homeVars.nix - ./style + ./style.nix + ./systemVars.nix ]; } diff --git a/shared/nixosModules/homeVars.nix b/modules/options/homeVars.nix similarity index 89% rename from shared/nixosModules/homeVars.nix rename to modules/options/homeVars.nix index 3b2688c..fe69889 100644 --- a/shared/nixosModules/homeVars.nix +++ b/modules/options/homeVars.nix @@ -20,7 +20,7 @@ in { }; }; - config.assertions = mkIf (!config.local.systemVars.isServer) [ + config.assertions = mkIf (!config.local.profiles.server.enable) [ { assertion = options.local.homeVars.fullName.isDefined; } diff --git a/modules/options/modules/default.nix b/modules/options/modules/default.nix new file mode 100644 index 0000000..6597dda --- /dev/null +++ b/modules/options/modules/default.nix @@ -0,0 +1,3 @@ +{ + imports = [./hyprland.nix]; +} diff --git a/modules/options/modules/hyprland.nix b/modules/options/modules/hyprland.nix new file mode 100644 index 0000000..928dc76 --- /dev/null +++ b/modules/options/modules/hyprland.nix @@ -0,0 +1,7 @@ +{lib, ...}: let + inherit (lib) mkEnableOption; +in { + options.local.modules.hyprland = { + enable = mkEnableOption "Hyprland modules"; + }; +} diff --git a/modules/options/profiles/default.nix b/modules/options/profiles/default.nix new file mode 100644 index 0000000..7c946dc --- /dev/null +++ b/modules/options/profiles/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./desktop.nix + ./gaming.nix + ./laptop.nix + ./server.nix + ]; +} diff --git a/modules/options/profiles/desktop.nix b/modules/options/profiles/desktop.nix new file mode 100644 index 0000000..5b0fb45 --- /dev/null +++ b/modules/options/profiles/desktop.nix @@ -0,0 +1,18 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkEnableOption; +in { + options = { + local.profiles.desktop.enable = mkEnableOption "the desktop profile"; + }; + + config.assertions = lib.mkIf config.local.profiles.desktop.enable [ + { + assertion = !config.local.profiles.server.enable; + message = "The desktop profile cannot be enabled if `local.profiles.server.enable` is set to true."; + } + ]; +} diff --git a/modules/options/profiles/gaming.nix b/modules/options/profiles/gaming.nix new file mode 100644 index 0000000..b434b8f --- /dev/null +++ b/modules/options/profiles/gaming.nix @@ -0,0 +1,18 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkEnableOption; +in { + options = { + local.profiles.gaming.enable = mkEnableOption "the gaming profile"; + }; + + config.assertions = lib.mkIf config.local.profiles.gaming.enable [ + { + assertion = !config.local.profiles.server.enable; + message = "The gaming profile cannot be enabled if `local.profiles.server.enable` is set to true."; + } + ]; +} diff --git a/modules/options/profiles/laptop.nix b/modules/options/profiles/laptop.nix new file mode 100644 index 0000000..7fa4859 --- /dev/null +++ b/modules/options/profiles/laptop.nix @@ -0,0 +1,18 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkEnableOption; +in { + options = { + local.profiles.laptop.enable = mkEnableOption "the laptop profile"; + }; + + config.assertions = lib.mkIf config.local.profiles.laptop.enable [ + { + assertion = !config.local.profiles.server.enable; + message = "The laptop profile cannot be enabled if `local.profiles.server.enable` is set to true."; + } + ]; +} diff --git a/modules/options/profiles/server.nix b/modules/options/profiles/server.nix new file mode 100644 index 0000000..a772aff --- /dev/null +++ b/modules/options/profiles/server.nix @@ -0,0 +1,23 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkEnableOption; +in { + options = { + local.profiles.server.enable = mkEnableOption "the server profile"; + }; + + config.assertions = lib.mkIf config.local.profiles.server.enable [ + { + assertion = !config.local.profiles.desktop.enable; + message = "The server profile cannot be enabled if `local.profiles.desktop.enable` is set to true."; + } + + { + assertion = !config.local.profiles.gaming.enable; + message = "The server profile cannot be enabled if `local.profiles.gaming.enable` is set to true."; + } + ]; +} diff --git a/shared/nixosModules/style/options.nix b/modules/options/style.nix similarity index 97% rename from shared/nixosModules/style/options.nix rename to modules/options/style.nix index 5160be3..ee20d63 100644 --- a/shared/nixosModules/style/options.nix +++ b/modules/options/style.nix @@ -67,7 +67,7 @@ in { description = '' Path to an avatar image (used for hyprlock). ''; - default = ../../../assets/avatar.png; # TODO silly, change this + default = ../../assets/avatar.png; # TODO silly, change this }; gtk = { @@ -111,7 +111,7 @@ in { }; }; - config = { + config = lib.mkIf cfg.enable { assertions = [ (let themePath = cfg.gtk.theme.package + /share/themes + "/${cfg.gtk.theme.name}"; diff --git a/shared/nixosModules/systemVars.nix b/modules/options/systemVars.nix similarity index 76% rename from shared/nixosModules/systemVars.nix rename to modules/options/systemVars.nix index cb8d169..b4aad13 100644 --- a/shared/nixosModules/systemVars.nix +++ b/modules/options/systemVars.nix @@ -4,7 +4,7 @@ ... }: let inherit (lib) mkOption; - inherit (lib.types) bool str; + inherit (lib.types) str; in { options.local.systemVars = { hostName = mkOption { @@ -17,11 +17,6 @@ in { description = "username for the home directory"; default = null; }; - isServer = mkOption { - type = bool; - description = "whether or not this host is a server"; - default = false; - }; }; config.assertions = [ diff --git a/shared/nixosModules/style/default.nix b/shared/nixosModules/style/default.nix deleted file mode 100644 index b45a5a2..0000000 --- a/shared/nixosModules/style/default.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ - inputs, - config, - lib, - ... -}: let - inherit (lib) mkIf; - - cfg = config.local.style; -in { - imports = - [ - inputs.niri.nixosModules.niri - inputs.hyprland.nixosModules.default - - ./options.nix - ] - ++ lib.filesystem.listFilesRecursive ./modules; - - config = - mkIf - cfg.enable - { - home-manager.sharedModules = [ - { - home.pointerCursor = { - inherit (cfg.cursorTheme) name package size; - x11.enable = true; - gtk.enable = true; - }; - } - ]; - }; -}