From 91d4b21cdf1d26111a1327aa595207b593dcb022 Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Sat, 20 Jul 2024 13:56:02 +0200 Subject: [PATCH] moving along wiht the refactoring --- hosts/vali/hermit/configuration.nix | 31 +++-- modules/gui/default.nix | 1 - modules/gui/schizofox.nix | 143 -------------------- modules/options/style/gtk.nix | 0 modules/options/style/module.nix | 12 ++ modules/options/style/qt.nix | 0 modules/options/style/stylix.nix | 0 modules/options/usrEnv/desktop.nix | 2 +- modules/options/usrEnv/services/default.nix | 14 ++ modules/other/home-manager.nix | 2 +- modules/other/system.nix | 4 - modules/{gui => runners}/anyrun/anyrun.nix | 0 modules/{gui => runners}/anyrun/default.nix | 0 modules/{gui => runners}/anyrun/style.css | 0 modules/runners/default.nix | 6 + modules/services/mpd.nix | 16 +-- modules/services/pipewire.nix | 4 +- modules/wms/wayland/hypr/land.nix | 8 +- 18 files changed, 63 insertions(+), 180 deletions(-) delete mode 100644 modules/gui/schizofox.nix create mode 100644 modules/options/style/gtk.nix create mode 100644 modules/options/style/module.nix create mode 100644 modules/options/style/qt.nix create mode 100644 modules/options/style/stylix.nix rename modules/{gui => runners}/anyrun/anyrun.nix (100%) rename modules/{gui => runners}/anyrun/default.nix (100%) rename modules/{gui => runners}/anyrun/style.css (100%) create mode 100644 modules/runners/default.nix diff --git a/hosts/vali/hermit/configuration.nix b/hosts/vali/hermit/configuration.nix index 4220842..086a097 100644 --- a/hosts/vali/hermit/configuration.nix +++ b/hosts/vali/hermit/configuration.nix @@ -43,7 +43,7 @@ }; }; }; - boot.kernelPackages = pkgs.linuxPackages_xanmod_stable; + boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; modules = { other = { system = { @@ -62,28 +62,41 @@ hyprland.enable = true; }; }; + system = { + programs = { + discord.enable = true; + firefox.enable = true; + zathura.enable = true; + terminals = { + foot.enable = true; + kitty.enable = true; + }; + }; + }; + usrEnv = { + programs = { + launchers = { + anyrun.enable = true; + }; + }; + services = { + mpd.enable = true; + }; + }; programs = { vesktop.enable = true; ssh.enable = true; btop.enable = true; mpv.enable = true; - kitty.enable = true; newsboat.enable = true; fish.enable = true; ncmpcpp.enable = true; nh.enable = true; - wtfutil.enable = true; waybar.enable = true; beets.enable = true; spicetify.enable = true; - schizofox.enable = true; anyrun.enable = true; - zathura.enable = true; ags.enable = true; - foot = { - enable = true; - server = false; - }; }; editors = { emacs.enable = true; diff --git a/modules/gui/default.nix b/modules/gui/default.nix index cfbe3da..7428284 100644 --- a/modules/gui/default.nix +++ b/modules/gui/default.nix @@ -8,7 +8,6 @@ _: { ./qt.nix ./zathura.nix ./spicetify.nix - ./anyrun ./rofi.nix ./kitty.nix #./vivado.nix diff --git a/modules/gui/schizofox.nix b/modules/gui/schizofox.nix deleted file mode 100644 index 76511d7..0000000 --- a/modules/gui/schizofox.nix +++ /dev/null @@ -1,143 +0,0 @@ -{ - config, - inputs, - lib, - ... -}: let - cfg = config.modules.system.programs.firefox; - inherit (config.modules.other.system) username; - - inherit (lib) mkIf; -in { - config = mkIf cfg.enable { - home-manager.users.${username} = { - imports = [inputs.schizofox.homeManagerModule]; - - programs.schizofox = { - enable = true; - theme = { - # colors = { - # background-darker = "181825"; - # background = "1e1e2e"; - # foreground = "cdd6f4"; - # }; - colors = { - background-darker = "1d2021"; - background = "282828"; - foreground = "ebdbb2"; - }; - - font = "Lexend"; - extraUserChrome = '' - body { - color: red !important; - } - ''; - }; - search = { - defaultSearchEngine = "DuckDuckGo"; - removeEngines = ["Google" "Bing" "Amazon.com" "eBay" "Twitter" "Wikipedia"]; - addEngines = [ - { - Name = "NixOS Packages"; - Description = "NixOS Unstable package search"; - Alias = "!np"; - Method = "GET"; - URLTemplate = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; - } - { - Name = "NixOS Options"; - Description = "NixOS Unstable option search"; - Alias = "!no"; - Method = "GET"; - URLTemplate = "https://search.nixos.org/options?channel=unstable&query={searchTerms}"; - } - { - Name = "NixOS Wiki"; - Description = "NixOS Wiki search"; - Alias = "!nw"; - Method = "GET"; - URLTemplate = "https://nixos.wiki/index.php?search={searchTerms}"; - } - { - Name = "Home Manager Options"; - Description = "Home Manager option search"; - Alias = "!hm"; - Method = "GET"; - URLTemplate = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master"; - } - { - Name = "Arch Wiki"; - Description = "Arch Wiki search"; - Alias = "!aw"; - Method = "GET"; - URLTemplate = "https://wiki.archlinux.org/index.php?search={searchTerms}"; - } - { - Name = "Gentoo Wiki"; - Description = "Gentoo Wiki search"; - Alias = "!gw"; - Method = "GET"; - URLTemplate = "https://wiki.gentoo.org/index.php?search={searchTerms}"; - } - { - Name = "Debian Wiki"; - Description = "Debian Wiki search"; - Alias = "!dw"; - Method = "GET"; - URLTemplate = "https://wiki.debian.org/FrontPage?action=fullsearch&value={searchTerms}"; - } - { - Name = "noogle"; - Descriptiom = "Noogle Search"; - Alias = "!ng"; - Method = "GET"; - URLTemplate = "https://noogle.dev/"; - } - ]; - }; - extensions = { - simplefox.enable = true; - darkreader.enable = true; - extraExtensions = let - mkUrl = name: "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi"; - extensions = [ - { - id = "1018e4d6-728f-4b20-ad56-37578a4de76"; - name = "flagfox"; - } - { - id = "{c2c003ee-bd69-42a2-b0e9-6f34222cb046}"; - name = "auto-tab-discard"; - } - { - id = "{a4c4eda4-fb84-4a84-b4a1-f7c1cbf2a1ad}"; - name = "refined-github-"; - } - { - id = "sponsorBlocker@ajay.app"; - name = "sponsorblock"; - } - { - id = "uBlock0@raymondhill.net"; - name = "UBlock Origin"; - } - ]; - extraExtensions = builtins.foldl' (acc: ext: acc // {ext.id = {install_url = mkUrl ext.name;};}) {} extensions; - in - extraExtensions; - }; - security = { - sanitizeOnShutdown = false; - sandbox = true; - userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:106.0) Gecko/20100101 Firefox/106.0"; - }; - - misc = { - drm.enable = true; - disableWebgl = true; - }; - }; - }; - }; -} diff --git a/modules/options/style/gtk.nix b/modules/options/style/gtk.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/options/style/module.nix b/modules/options/style/module.nix new file mode 100644 index 0000000..915a080 --- /dev/null +++ b/modules/options/style/module.nix @@ -0,0 +1,12 @@ +{ + lib, + pkgs, + config, +}: let +in { + imports = [ + ./stylix.nix + ./qt.nix + ./gtk.nix + ]; +} diff --git a/modules/options/style/qt.nix b/modules/options/style/qt.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/options/style/stylix.nix b/modules/options/style/stylix.nix new file mode 100644 index 0000000..e69de29 diff --git a/modules/options/usrEnv/desktop.nix b/modules/options/usrEnv/desktop.nix index 2635500..8ad6129 100644 --- a/modules/options/usrEnv/desktop.nix +++ b/modules/options/usrEnv/desktop.nix @@ -11,7 +11,7 @@ in { options.modules.usrEnv = { desktop = mkOption { - type = enum ["none" "Hyprland" "sway" "awesomewm" "i3"]; + type = enum ["none" "Hyprland" "awesomewm" "i3"]; default = "none"; description = '' The desktop environment to be used. diff --git a/modules/options/usrEnv/services/default.nix b/modules/options/usrEnv/services/default.nix index e69de29..12e3ee4 100644 --- a/modules/options/usrEnv/services/default.nix +++ b/modules/options/usrEnv/services/default.nix @@ -0,0 +1,14 @@ +{lib, ...}: let + inherit (lib.options) mkOption mkEnableOption; + inherit (lib) types; +in { + options.modules.usrEnv.services.media = { + mpd = { + enable = mkEnableOption "mpd service"; + musicDirectory = mkOption { + description = "music directory for mpd"; + type = types.str; + }; + }; + }; +} diff --git a/modules/other/home-manager.nix b/modules/other/home-manager.nix index 6f724cc..61d6176 100644 --- a/modules/other/home-manager.nix +++ b/modules/other/home-manager.nix @@ -7,7 +7,7 @@ }: with lib; let cfg = config.modules.other.home-manager; - username = config.modules.other.system.username; + inherit (config.modules.other.system) username; in { options.modules.other.home-manager = { enable = mkEnableOption "home-manager"; diff --git a/modules/other/system.nix b/modules/other/system.nix index 1df6219..60040d8 100644 --- a/modules/other/system.nix +++ b/modules/other/system.nix @@ -30,9 +30,5 @@ in { isNormalUser = true; extraGroups = ["wheel"]; }; - users.users.test = { - isNormalUser = true; - extraGroups = ["wheel"]; - }; }; } diff --git a/modules/gui/anyrun/anyrun.nix b/modules/runners/anyrun/anyrun.nix similarity index 100% rename from modules/gui/anyrun/anyrun.nix rename to modules/runners/anyrun/anyrun.nix diff --git a/modules/gui/anyrun/default.nix b/modules/runners/anyrun/default.nix similarity index 100% rename from modules/gui/anyrun/default.nix rename to modules/runners/anyrun/default.nix diff --git a/modules/gui/anyrun/style.css b/modules/runners/anyrun/style.css similarity index 100% rename from modules/gui/anyrun/style.css rename to modules/runners/anyrun/style.css diff --git a/modules/runners/default.nix b/modules/runners/default.nix new file mode 100644 index 0000000..83416d6 --- /dev/null +++ b/modules/runners/default.nix @@ -0,0 +1,6 @@ +_: { + imports = [ + ./rofi + ./anyrun + ]; +} diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix index 665dfc0..e1b3c85 100644 --- a/modules/services/mpd.nix +++ b/modules/services/mpd.nix @@ -4,22 +4,11 @@ pkgs, ... }: let - cfg = config.modules.services.mpd; + cfg = config.modules.usrEnv.services.media.mpd; inherit (config.modules.other.system) username; - - inherit (lib) mkEnableOption mkIf mkOption; - inherit (lib.types) str; + inherit (lib) mkIf; in { - options.modules.services.mpd = { - enable = mkEnableOption "mpd"; - musicDirectory = mkOption { - description = "music directory for mpd"; - type = str; - }; - }; - config = mkIf cfg.enable { - environment.systemPackages = with pkgs; [mpc-cli]; systemd.services.mpd.environment = { # https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/609 XDG_RUNTIME_DIR = "/run/user/1000"; @@ -49,6 +38,7 @@ in { ''; }; home-manager.users.${username} = { + home.Packages = with pkgs; [mpc-cli]; services = { mpd-mpris = { enable = true; diff --git a/modules/services/pipewire.nix b/modules/services/pipewire.nix index 0219222..b2090c5 100644 --- a/modules/services/pipewire.nix +++ b/modules/services/pipewire.nix @@ -4,10 +4,8 @@ ... }: with lib; let - cfg = config.modules.services.pipewire; + cfg = config.modules.system.sound; in { - options.modules.services.pipewire.enable = mkEnableOption "pipewire"; - config = mkIf cfg.enable { hardware.pulseaudio.enable = false; services.pipewire = { diff --git a/modules/wms/wayland/hypr/land.nix b/modules/wms/wayland/hypr/land.nix index a13c618..3c018ec 100644 --- a/modules/wms/wayland/hypr/land.nix +++ b/modules/wms/wayland/hypr/land.nix @@ -5,9 +5,8 @@ inputs, ... }: let - cfg = config.modules.wms.wayland.hyprland; + cfg = config.modules.usrEnv.desktops.hyprland; inherit (config.modules.other.system) username; - inherit (inputs.hyprland.packages.${pkgs.system}) hyprland; inherit (inputs.anyrun.packages.${pkgs.system}) anyrun; inherit (inputs.nixpkgs-wayland.packages.${pkgs.system}) @@ -20,13 +19,12 @@ split-monitor-workspaces ; in { - options.modules.wms.wayland.hyprland.enable = lib.mkEnableOption "hyprland"; config = lib.mkIf cfg.enable { # xdg Portal xdg.portal = { enable = true; configPackages = [ - hyprland + # hyprland # TODO Fix hyprland package ]; extraPortals = [ pkgs.xdg-desktop-portal-gtk @@ -37,7 +35,7 @@ in { home-manager.users.${username} = { wayland.windowManager.hyprland = { enable = true; - package = hyprland; + # package = hyprland; TODO Fix hyprland package # Split-monitor-workspaces provides awesome-like workspace behaviour plugins = [ split-monitor-workspaces