From 85dd534f532a7c0112b723075cec4d01b786c6cc Mon Sep 17 00:00:00 2001 From: jackjohn7 <70782491+jackjohn7@users.noreply.github.com> Date: Sat, 28 Mar 2026 20:32:24 -0500 Subject: [PATCH] init options, move ralph, fix wallpapers --- modules/features/hyprland/default.nix | 24 ++----- modules/features/hyprland/hyprland.conf | 6 +- modules/features/hyprland/hyprpaper.conf | 2 +- modules/features/layers/base.nix | 89 +++++++++++++----------- modules/features/layers/cursors.nix | 51 +++++--------- modules/features/layers/user.nix | 17 +++-- modules/features/layers/users/jingo.nix | 9 --- modules/features/layers/users/jingus.nix | 9 --- modules/features/layers/wallpapers.nix | 29 +++----- modules/features/niri.nix | 11 +-- modules/features/waybar/default.nix | 32 +++++---- modules/hosts/desktop/configuration.nix | 1 - modules/hosts/laptop/configuration.nix | 16 +---- modules/options.nix | 8 +++ modules/{features => packages}/ralph.nix | 0 15 files changed, 123 insertions(+), 181 deletions(-) delete mode 100644 modules/features/layers/users/jingo.nix delete mode 100644 modules/features/layers/users/jingus.nix create mode 100644 modules/options.nix rename modules/{features => packages}/ralph.nix (100%) diff --git a/modules/features/hyprland/default.nix b/modules/features/hyprland/default.nix index a9ad502..42745ea 100644 --- a/modules/features/hyprland/default.nix +++ b/modules/features/hyprland/default.nix @@ -14,13 +14,8 @@ self.nixosModules.wallpapers ]; - options.hyprland-users = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = [ ]; - description = "List of users to configure hyprland for"; - }; - config = { + wallpaper-destinations = [ "Pictures/wallpapers" ]; # System-level configuration programs.hyprland.enable = true; @@ -58,18 +53,13 @@ }; # Configure hjem for specified users - hjem = lib.mkIf (config.hyprland-users != [ ]) { - users = lib.genAttrs config.hyprland-users (username: { - enable = true; - files = { - ".config/hypr/hyprland.conf".source = ./hyprland.conf; - ".config/hypr/hyprpaper.conf".source = ./hyprpaper.conf; - }; - }); + hjem.users."${config.username}" = { + enable = true; + files = { + ".config/hypr/hyprland.conf".source = ./hyprland.conf; + ".config/hypr/hyprpaper.conf".source = ./hyprpaper.conf; + }; }; - - # Enable cursors for hyprland users - cursor-users = lib.mkDefault config.hyprland-users; }; }; } diff --git a/modules/features/hyprland/hyprland.conf b/modules/features/hyprland/hyprland.conf index 80b83c6..79c60a0 100644 --- a/modules/features/hyprland/hyprland.conf +++ b/modules/features/hyprland/hyprland.conf @@ -17,7 +17,7 @@ env = HYPRCURSOR_THEME,Bibata-Modern-Ice # Set programs that you use $terminal = kitty -$browser = firefox +$browser = librewolf $fileManager = dolphin $menu = wofi --show drun @@ -292,8 +292,8 @@ bindl = , XF86AudioPrev, exec, playerctl previous # Example windowrule windowrule { - name = firefox-on-w2 - match:class = ^(firefox)$ + name = librewolf-on-w2 + match:class = ^(librewolf)$ workspace = 2 } windowrule { diff --git a/modules/features/hyprland/hyprpaper.conf b/modules/features/hyprland/hyprpaper.conf index 8e1493e..32393c9 100644 --- a/modules/features/hyprland/hyprpaper.conf +++ b/modules/features/hyprland/hyprpaper.conf @@ -1,6 +1,6 @@ wallpaper { monitor = eDP-1 - path = /home/jingo/dev/dotfiles/wallpapers/Augustine/Augustine-catppuccin-mocha.png + path = ~/Pictures/wallpapers/Augustine/Augustine-catppuccin-mocha.png fit_mode = cover } diff --git a/modules/features/layers/base.nix b/modules/features/layers/base.nix index aa01534..82ca5dd 100644 --- a/modules/features/layers/base.nix +++ b/modules/features/layers/base.nix @@ -3,51 +3,58 @@ flake.nixosModules.base = { pkgs, lib, ... }: { - imports = [ inputs.hjem.nixosModules.default ]; + imports = [ + inputs.hjem.nixosModules.default + ../../options.nix + ]; - nixpkgs.overlays = [ inputs.millennium.overlays.default ]; - # Set your time zone. - time.timeZone = "America/Chicago"; + config = { + username = "jingus"; + nixpkgs.overlays = [ inputs.millennium.overlays.default ]; + # Set your time zone. + time.timeZone = "America/Chicago"; - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; }; - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = ""; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - # programs.gnupg.agent = { - # enable = true; - # enableSSHSupport = true; - # }; - - # List services that you want to enable: - }; } diff --git a/modules/features/layers/cursors.nix b/modules/features/layers/cursors.nix index 6e83d0f..50810f7 100644 --- a/modules/features/layers/cursors.nix +++ b/modules/features/layers/cursors.nix @@ -8,41 +8,22 @@ ... }: { - options.cursor-users = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = [ ]; - description = "List of users to configure cursors for"; - }; - - config = { - # Install cursor packages system-wide - environment.systemPackages = with pkgs; [ - bibata-cursors - ]; - - # Set up XDG data directories for cursor themes - environment.pathsToLink = [ "/share/icons" ]; - - # Configure hjem for specified users - set cursor theme in user config - hjem = lib.mkIf (config.cursor-users != [ ]) { - users = lib.genAttrs config.cursor-users (username: { - enable = true; - files = { - # GTK cursor settings - ".config/gtk-3.0/settings.ini".text = '' - [Settings] - gtk-cursor-theme-name=Bibata-Modern-Ice - gtk-cursor-theme-size=24 - ''; - # X11/Wayland cursor environment - ".config/environment.d/cursor.conf".text = '' - XCURSOR_THEME=Bibata-Modern-Ice - XCURSOR_SIZE=24 - HYPRCURSOR_THEME=Bibata-Modern-Ice - HYPRCURSOR_SIZE=24 - ''; - }; - }); + hjem.users."${config.username}" = { + enable = true; + files = { + # GTK cursor settings + ".config/gtk-3.0/settings.ini".text = '' + [Settings] + gtk-cursor-theme-name=Bibata-Modern-Ice + gtk-cursor-theme-size=24 + ''; + # X11/Wayland cursor environment + ".config/environment.d/cursor.conf".text = '' + XCURSOR_THEME=Bibata-Modern-Ice + XCURSOR_SIZE=24 + HYPRCURSOR_THEME=Bibata-Modern-Ice + HYPRCURSOR_SIZE=24 + ''; }; }; }; diff --git a/modules/features/layers/user.nix b/modules/features/layers/user.nix index 43fd392..80db827 100644 --- a/modules/features/layers/user.nix +++ b/modules/features/layers/user.nix @@ -1,20 +1,25 @@ -{ self, inputs, ... }: +{ + self, + inputs, + config, + ... +}: { flake.nixosModules.user = { pkgs, lib, ... }: { # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.jingus = { + users.users."${config.username}" = { isNormalUser = true; - description = "jingus"; + description = "${config.username} user account"; extraGroups = [ "networkmanager" "wheel" + "docker" + "dialout" ]; shell = pkgs.zsh; - packages = with pkgs; [ - # thunderbird - ]; }; + hjem.users."${config.username}".enable = true; }; } diff --git a/modules/features/layers/users/jingo.nix b/modules/features/layers/users/jingo.nix deleted file mode 100644 index d7053ea..0000000 --- a/modules/features/layers/users/jingo.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ self, inputs, ... }: -{ - flake.nixosModules.user-jingo = - { ... }: - { - hyprland-users = [ "jingo" ]; - wallpaper-users = [ "jingo" ]; - }; -} diff --git a/modules/features/layers/users/jingus.nix b/modules/features/layers/users/jingus.nix deleted file mode 100644 index a3b3cde..0000000 --- a/modules/features/layers/users/jingus.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ self, inputs, ... }: -{ - flake.nixosModules.user-jingus = - { ... }: - { - niri-users = [ "jingus" ]; - wallpaper-users = [ "jingus" ]; - }; -} diff --git a/modules/features/layers/wallpapers.nix b/modules/features/layers/wallpapers.nix index 61ca8b8..f8d89b9 100644 --- a/modules/features/layers/wallpapers.nix +++ b/modules/features/layers/wallpapers.nix @@ -8,29 +8,20 @@ ... }: { - - options.wallpaper-users = lib.mkOption { + options.wallpaper-destinations = lib.mkOption { type = lib.types.listOf lib.types.str; - default = [ ]; - description = "List of users to include wallpapers for"; - }; - - options.wallpaper-destination = lib.mkOption { - type = lib.types.str; - default = "Pictures/Wallpapers"; - description = "Destination path for wallpapers"; + default = []; + description = "Destination paths for wallpapers"; }; config = { - hjem = lib.mkIf (config.wallpaper-users != [ ]) { - users = lib.genAttrs config.wallpaper-users (username: { - enable = true; - files = { - "${config.wallpaper-destination}".source = pkgs.runCommand "wallpapers" { } '' - mkdir -p $out - cp -r ${../../../assets/wallpapers}/* $out/ - ''; - }; + hjem.users."${config.username}" = { + enable = true; + files = lib.genAttrs config.wallpaper-destinations (_: { + source = pkgs.runCommand "wallpapers" { } '' + mkdir -p $out + cp -r ${../../../assets/wallpapers}/* $out/ + ''; }); }; }; diff --git a/modules/features/niri.nix b/modules/features/niri.nix index 6d8347f..2801863 100644 --- a/modules/features/niri.nix +++ b/modules/features/niri.nix @@ -13,23 +13,14 @@ self.nixosModules.wallpapers ]; - options.niri-users = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = [ ]; - description = "List of users to configure niri for"; - }; - config = { programs.niri = { enable = true; package = self.packages.${pkgs.stdenv.hostPlatform.system}.myNiri; }; - # Enable cursors for niri users - cursor-users = lib.mkDefault config.niri-users; - # Set wallpaper destination explicitly - wallpaper-destination = "Pictures/Wallpapers"; + wallpaper-destinations = [ "Pictures/Wallpapers" ]; }; }; diff --git a/modules/features/waybar/default.nix b/modules/features/waybar/default.nix index 33c77b2..2c7dbd0 100644 --- a/modules/features/waybar/default.nix +++ b/modules/features/waybar/default.nix @@ -14,21 +14,23 @@ ]; # Configure hjem for specified users - hjem = lib.mkIf (config.hyprland-users != [ ]) { - users = lib.genAttrs config.hyprland-users (username: { - enable = true; - files = { - ".config/waybar/config.jsonc".source = ./config/config.jsonc; - ".config/waybar/style.css".source = ./config/style.css; - ".config/waybar/power_menu.xml".source = ./config/power_menu.xml; - ".config/waybar/mediaplayer.py".source = ./config/mediaplayer.py; - ".config/waybar/icons/meson.build".source = ./config/icons/meson.build; - ".config/waybar/icons/waybar_icons.gresource.xml".source = ./config/icons/waybar_icons.gresource.xml; - ".config/waybar/icons/waybar-privacy-audio-input-symbolic.svg".source = ./config/icons/waybar-privacy-audio-input-symbolic.svg; - ".config/waybar/icons/waybar-privacy-audio-output-symbolic.svg".source = ./config/icons/waybar-privacy-audio-output-symbolic.svg; - ".config/waybar/icons/waybar-privacy-screen-share-symbolic.svg".source = ./config/icons/waybar-privacy-screen-share-symbolic.svg; - }; - }); + hjem.users."${config.username}" = { + enable = true; + files = { + ".config/waybar/config.jsonc".source = ./config/config.jsonc; + ".config/waybar/style.css".source = ./config/style.css; + ".config/waybar/power_menu.xml".source = ./config/power_menu.xml; + ".config/waybar/mediaplayer.py".source = ./config/mediaplayer.py; + ".config/waybar/icons/meson.build".source = ./config/icons/meson.build; + ".config/waybar/icons/waybar_icons.gresource.xml".source = + ./config/icons/waybar_icons.gresource.xml; + ".config/waybar/icons/waybar-privacy-audio-input-symbolic.svg".source = + ./config/icons/waybar-privacy-audio-input-symbolic.svg; + ".config/waybar/icons/waybar-privacy-audio-output-symbolic.svg".source = + ./config/icons/waybar-privacy-audio-output-symbolic.svg; + ".config/waybar/icons/waybar-privacy-screen-share-symbolic.svg".source = + ./config/icons/waybar-privacy-screen-share-symbolic.svg; + }; }; }; }; diff --git a/modules/hosts/desktop/configuration.nix b/modules/hosts/desktop/configuration.nix index a3e7cf4..03d0aea 100644 --- a/modules/hosts/desktop/configuration.nix +++ b/modules/hosts/desktop/configuration.nix @@ -13,7 +13,6 @@ self.nixosModules.niri self.nixosModules.librewolf self.nixosModules.user - self.nixosModules.user-jingus ]; programs.firefox.enable = true; diff --git a/modules/hosts/laptop/configuration.nix b/modules/hosts/laptop/configuration.nix index 9682764..5787e06 100644 --- a/modules/hosts/laptop/configuration.nix +++ b/modules/hosts/laptop/configuration.nix @@ -11,7 +11,7 @@ self.nixosModules.development self.nixosModules.librewolf self.nixosModules.hyprland - self.nixosModules.user-jingo + self.nixosModules.user ]; # Bootloader. @@ -37,20 +37,6 @@ variant = ""; }; - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.jingo = { - isNormalUser = true; - description = "j"; - extraGroups = [ - "networkmanager" - "wheel" - "docker" - "dialout" - ]; - packages = with pkgs; [ ]; - shell = pkgs.zsh; - }; - # Allow unfree packages nixpkgs.config.allowUnfree = true; diff --git a/modules/options.nix b/modules/options.nix new file mode 100644 index 0000000..8e86292 --- /dev/null +++ b/modules/options.nix @@ -0,0 +1,8 @@ +{ lib, ... }: +{ + options.username = lib.mkOption { + type = lib.types.str; + description = "Global username used across the evaluation."; + default = "jingus"; + }; +} diff --git a/modules/features/ralph.nix b/modules/packages/ralph.nix similarity index 100% rename from modules/features/ralph.nix rename to modules/packages/ralph.nix