From daefb8b3a67a70e0b3d60db9f52b6b144cf52c02 Mon Sep 17 00:00:00 2001 From: shinya Date: Mon, 27 Oct 2025 14:37:13 +0100 Subject: [PATCH] cleanup and modularization --- mate-xp-config.nix | 66 ++++---- mate-xp-home.nix | 334 ++++++++++++++++++++++++---------------- windows-xp-cursor.nix | 3 +- windows-xp-grub.nix | 15 +- windows-xp-icons.nix | 4 +- windows-xp-plymouth.nix | 10 +- 6 files changed, 251 insertions(+), 181 deletions(-) diff --git a/mate-xp-config.nix b/mate-xp-config.nix index 7b90bca..4b09bbc 100644 --- a/mate-xp-config.nix +++ b/mate-xp-config.nix @@ -1,36 +1,46 @@ -{ - config, - lib, - pkgs, - system, - windows-theme, - ... +{ config +, lib +, system +, windows-theme +, ... }: { options = { - nixp.mate.enable = lib.mkEnableOption "Enable XP configuration in MATE"; - }; + nixp = { + enable = lib.mkEnableOption "enable XP configuration in MATE"; - config = lib.mkIf config.nixp.mate.enable { - boot = { - plymouth = { - theme = "xp"; - themePackages = [ windows-theme.packages.${system}.windows-xp-plymouth ]; + theme = { + plymouth.enable = lib.mkEnableOption "enable plymouth Windows XP theme"; }; }; - - services = { - xserver.displayManager.lightdm.background = ./wall.png; - - displayManager = { - defaultSession = lib.mkDefault "mate"; - }; - }; - - environment.systemPackages = with windows-theme.packages.x86_64-linux; [ - windows-xp-theme - windows-xp-icons - windows-xp-cursor - ]; }; + + config = lib.mkMerge [ + (lib.mkIf config.nixp.enable { + + config.nixp = { + theme = { + plymouth.enable = lib.mkDefault true; + }; + }; + + services = { + xserver.displayManager.lightdm.background = ./wall.png; + }; + + environment.systemPackages = with windows-theme.packages.x86_64-linux; [ + windows-xp-theme + windows-xp-icons + windows-xp-cursor + ]; + }) + (lib.mkIf config.nixp.theme.plymouth.enable { + boot = { + plymouth = { + theme = "xp"; + themePackages = [ windows-theme.packages.${system}.windows-xp-plymouth ]; + }; + }; + }) + ]; } diff --git a/mate-xp-home.nix b/mate-xp-home.nix index 1ff3e78..3aa3881 100644 --- a/mate-xp-home.nix +++ b/mate-xp-home.nix @@ -1,143 +1,211 @@ -{ - pkgs, - self, - windows-theme, - system, - ... +{ windows-theme +, system +, lib +, config +, ... }: { - dconf.settings = { - "org/mate/desktop/interface" = { - gtk-theme = "Windows XP Luna"; - icon-theme = "windows-xp-icon-theme"; - }; + options = { + nixp.mate = { + panel.enable = lib.mkEnableOption "enable panel settings for mate"; - "org/mate/marco/general" = { - theme = "Windows XP Luna"; - }; + background = { + enable = lib.mkEnableOption "enable and set background for mate"; + path = lib.mkOption { + type = lib.types.path; + default = ./wall.png; + description = "Set path to the background"; + }; + }; - "org/mate/desktop/peripherals/mouse" = { - cursor-theme = "ModernXP"; - }; + theme = { + enable = lib.mkEnableOption "enable windows xp gtk theme for mate"; + name = lib.mkOption { + type = lib.types.enum [ "Windows XP Luna" "Windows XP Embedded" "Windows XP Homestead Windows XP Metallic" "Windows XP Royale" "Windows XP Royale Dark" "Windows XP Zune" ]; + default = "Windows XP Luna"; + description = "set the windows xp gtk theme for mate"; + }; + }; - "org/mate/panel/menubar" = { - item-icon-size = "32px"; - show-places = false; - show-desktop = false; - icon-name = ""; - }; + cursor = { + enable = lib.mkEnableOption "enable windows xp cursor theme for mate"; + }; - "org/mate/desktop/background" = { - picture-filename = "/home/admin/.background-image"; - }; - - "org/mate/panel/general" = { - toplevel-id-list = [ "bottom" ]; - object-id-list = [ - "menu-bar" - "window-list" - "battery" - "brightness" - "notification-area" - "clock" - ]; - }; - - "org/mate/panel/objects/menu-bar" = { - locked = true; - object-type = "menu-bar"; - panel-right-stick = false; - position = 0; - toplevel-id = "bottom"; - }; - - "org/mate/panel/objects/window-list" = { - locked = true; - applet-iid = "WnckletFactory::WindowListApplet"; - object-type = "applet"; - #panel-right-stick = ; - position = 20; - toplevel-id = "bottom"; - }; - - "org/mate/panel/objects/battery" = { - locked = true; - applet-iid = "BattstatAppletFactory::BattstatApplet"; - object-type = "applet"; - panel-right-stick = true; - position = 222; - toplevel-id = "bottom"; - }; - - "org/mate/panel/objects/battery/prefs" = { - red-value = 15; - red-value-is-tiem = false; - show-text = 1; - }; - - "org/mate/panel/objects/brightness" = { - locked = true; - applet-iid = "BrightnessAppletFactory::BrightnessApplet"; - object-type = "applet"; - panel-right-stick = true; - position = 182; - toplevel-id = "bottom"; - }; - - "org/mate/panel/objects/notification-area"= { - locked = true; - applet-iid = "NotificationAreaAppletFactory::NotificationArea"; - object-type = "applet"; - panel-right-stick = true; - position = 158; - toplevel-id = "bottom"; - }; - - "org/mate/panel/objects/clock" = { - locked = true; - applet-iid = "ClockAppletFactory::ClockApplet"; - object-type = "applet"; - panel-right-stick = true; - position = 124; - toplevel-id = "bottom"; - }; - - "org/mate/panel/objects/clock/prefs" = { - expand-locations = false; - show-temperature = false; - show-weather = false; - }; - - "org/mate/panel/toplevels/bottom" = { - orientation = "bottom"; - y-bottom = 0; + icon = { + enable = lib.mkEnableOption "enable windows xp icon theme for mate"; + }; }; }; - - home.packages = with windows-theme.packages.x86_64-linux; [ - windows-xp-theme - windows-xp-icons - windows-xp-cursor + config = lib.mkMerge [ + (lib.mkIf config.nixp.mate.enable { + config.nixp.mate = { + panel.enable = lib.mkDefault true; + theme.enable = lib.mkDefault true; + cursor.enable = lib.mkDefault true; + icon.enable = lib.mkDefault true; + }; + + gtk = { + enable = true; + #gtk3 = { + # extraConfig.gtk-application-prefer-dark-theme = true; + #}; + }; + }) + (lib.mkIf config.nixp.mate.panel.enable { + dconf.settings = { + "org/mate/panel/general" = { + toplevel-id-list = [ "bottom" ]; + object-id-list = [ + "menu-bar" + "window-list" + "notification-area" + "brightness" + "clock" + "poweroff" + ]; + }; + + "org/mate/panel/toplevels/bottom" = { + orientation = "bottom"; + y-bottom = 0; + }; + + "org/mate/panel/menubar" = { + item-icon-size = "32px"; + show-places = false; + show-desktop = false; + icon-name = ""; + }; + + "org/mate/panel/objects/menu-bar" = { + locked = true; + object-type = "menu-bar"; + panel-right-stick = false; + position = 0; + toplevel-id = "bottom"; + }; + + "org/mate/panel/objects/window-list" = { + locked = true; + applet-iid = "WnckletFactory::WindowListApplet"; + object-type = "applet"; + #panel-right-stick = ; + position = 20; + toplevel-id = "bottom"; + }; + + # "org/mate/panel/objects/battery" = { + # locked = true; + # applet-iid = "BattstatAppletFactory::BattstatApplet"; + # object-type = "applet"; + # panel-right-stick = true; + # position = 222; + # toplevel-id = "bottom"; + # }; + + # "org/mate/panel/objects/battery/prefs" = { + # red-value = 15; + # red-value-is-tiem = false; + # show-text = 1; + # }; + + "org/mate/panel/objects/notification-area" = { + locked = true; + applet-iid = "NotificationAreaAppletFactory::NotificationArea"; + object-type = "applet"; + panel-right-stick = true; + position = 158; + toplevel-id = "bottom"; + }; + + "org/mate/panel/objects/brightness" = { + locked = true; + applet-iid = "BrightnessAppletFactory::BrightnessApplet"; + object-type = "applet"; + panel-right-stick = true; + position = 182; + toplevel-id = "bottom"; + }; + + "org/mate/panel/objects/clock" = { + locked = true; + applet-iid = "ClockAppletFactory::ClockApplet"; + object-type = "applet"; + panel-right-stick = true; + position = 124; + toplevel-id = "bottom"; + }; + + "org/mate/panel/objects/clock/prefs" = { + expand-locations = false; + show-temperature = false; + show-weather = false; + }; + + "org/mate/panel/objects/poweroff" = { + locked = true; + object-type = "action"; + action-type = "shutdown"; + panel-right-stick = true; + position = 24; + toplevel-id = "bottom"; + }; + }; + }) + (lib.mkIf config.nixp.mate.background.enable { + home.file.".background-image".source = config.nixp.mate.background.path; + dconf.settings = { + "org/mate/desktop/background" = { + picture-filename = "/home/admin/.background-image"; # FIX: THIS PATH + }; + }; + }) + (lib.mkIf config.nixp.mate.theme.enable { + dconf.settings = { + "org/mate/desktop/interface" = { + gtk-theme = "${config.nixp.mate.theme.name}"; + icon-theme = "windows-xp-icon-theme"; + }; + + "org/mate/marco/general" = { + theme = "${config.nixp.mate.theme.name}"; + }; + }; + + gtk = { + theme = { + name = "${config.nixp.theme.name}"; + package = windows-theme.packages.${system}.windows-xp-theme; + }; + }; + }) + (lib.mkIf config.nixp.mate.cursor.enable { + dconf.settings = { + "org/mate/desktop/peripherals/mouse" = { + cursor-theme = "ModernXP"; + }; + }; + gtk = { + cursorTheme = { + name = "ModernXP"; + package = windows-theme.packages.${system}.windows-xp-cursor; + }; + }; + }) + (lib.mkIf config.nixp.mate.icon.enable { + dconf.settings = { + "org/mate/desktop/interface" = { + icon-theme = "windows-xp-icon-theme"; + }; + }; + + gtk = { + iconTheme = { + name = "windows-XP"; + package = windows-theme.packages.${system}.windows-xp-icons; + }; + }; + }) ]; - - home.file.".background-image".source = ./wall.png; - - gtk = { - enable = true; - theme = { - name = "Windows XP Luna"; - package = windows-theme.packages.${system}.windows-xp-theme; - }; - iconTheme = { - name = "windows-XP"; - package = windows-theme.packages.${system}.windows-xp-icons; - }; - cursorTheme = { - name = "ModernXP"; - package = windows-theme.packages.${system}.windows-xp-cursor; - }; - #gtk3 = { - # extraConfig.gtk-application-prefer-dark-theme = true; - #}; - }; } diff --git a/windows-xp-cursor.nix b/windows-xp-cursor.nix index 5d1829d..cef460e 100644 --- a/windows-xp-cursor.nix +++ b/windows-xp-cursor.nix @@ -23,11 +23,10 @@ stdenv.mkDerivation rec { ''; meta = with lib; { - description = "Modern Windows XP cursor theme"; + description = "Windows XP cursor theme"; homepage = "https://github.com/na0miluv/modernXP-cursor-theme"; license = licenses.gpl3; platforms = platforms.linux; - maintainers = [ maintainers.yourself ]; }; } diff --git a/windows-xp-grub.nix b/windows-xp-grub.nix index 3f1e15f..a7dd956 100644 --- a/windows-xp-grub.nix +++ b/windows-xp-grub.nix @@ -1,8 +1,8 @@ -{ - lib, - stdenvNoCC, - fetchFromGitHub, - nix-update-script, +{ lib +, stdenvNoCC +, fetchFromGitHub +, nix-update-script +, }: stdenvNoCC.mkDerivation { @@ -27,7 +27,6 @@ stdenvNoCC.mkDerivation { echo "Copying files from source root:" ls -R . - # Copy all files safely cp -r ./OldBIOS/* "$themeDir/" runHook postInstall @@ -36,10 +35,8 @@ stdenvNoCC.mkDerivation { passthru.updateScript = nix-update-script { }; meta = { - description = "GRUB theme 'BIOS boot device' — minimalistic GRUB theme inspired by Vimix and primitivistical."; + description = "Minimalistic GRUB theme"; homepage = "https://github.com/Blaysht/grub_bios_theme"; - license = lib.licenses.mit; - maintainers = with lib.maintainers; [ azuwis ]; platforms = lib.platforms.linux; }; } diff --git a/windows-xp-icons.nix b/windows-xp-icons.nix index 69aed0a..51c3e54 100644 --- a/windows-xp-icons.nix +++ b/windows-xp-icons.nix @@ -1,4 +1,3 @@ - { lib , stdenvNoCC , fetchFromGitHub @@ -35,9 +34,8 @@ stdenvNoCC.mkDerivation rec { meta = with lib; { description = "Windows XP icon theme for Linux (B00merang Artwork)"; homepage = "https://github.com/B00merang-Artwork/Windows-XP"; - license = licenses.gpl3Only; + license = licenses.gpl2; platforms = platforms.linux; - maintainers = with maintainers; [ ]; }; } diff --git a/windows-xp-plymouth.nix b/windows-xp-plymouth.nix index 776afed..f378696 100644 --- a/windows-xp-plymouth.nix +++ b/windows-xp-plymouth.nix @@ -1,8 +1,7 @@ -{ - stdenvNoCC, - fetchFromGitHub, - lib, - unstableGitUpdater, +{ stdenvNoCC +, fetchFromGitHub +, lib +, ... }: stdenvNoCC.mkDerivation { @@ -39,7 +38,6 @@ stdenvNoCC.mkDerivation { homepage = "https://github.com/FraioVeio/plymouth-xp-theme"; license = lib.licenses.gpl3; platforms = lib.platforms.linux; - maintainers = with lib.maintainers; [ ]; }; }