diff --git a/Configurations/Hosts/Default/configuration.nix b/Configurations/Hosts/Default/configuration.nix index 8df8f3e..a7de2f6 100644 --- a/Configurations/Hosts/Default/configuration.nix +++ b/Configurations/Hosts/Default/configuration.nix @@ -23,48 +23,61 @@ in { # Home Manager integration inputs.home-manager.nixosModules.home-manager + # nixos95 + inputs.self.nixosModules.nixos95 + ]; ################################################################ # Display & Desktop Environment ################################################################ - services.xserver = { + nixos95 = { enable = true; - desktopManager.xfce.enable = true; - xkb = { - layout = "de"; - variant = ""; + user = username; + + taskbar = { + homeIcon = "whisker-menu-button"; + battery-plugin.enable = false; + applications = [ + { + name = "Brave"; + description = "Browse the Web"; + pkg = pkgs.brave; + icon = "world"; + } + { + name = "Signal"; + description = "Private Messenger"; + pkg = pkgs.signal-desktop; + icon = "signal"; + } + { + name = "Obsidian"; + description = "Markdown Editor"; + exe = "obsidian %u"; + icon = "obsidian"; + } + { + name = "Spotify"; + description = "Spotify Music"; + exe = "spotify %U"; + icon = "spotify"; + } + ]; + }; + + keybinds = { + commands = [ + { key="l"; exe="xflock4"; } + ]; }; }; - services.xserver.displayManager.lightdm.enable = false; - - services.displayManager.sddm = { - enable = true; - package = pkgs.qt6Packages.sddm; - }; - - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - ################################################################ # System Packages (XFCE & Utilities) ################################################################ environment.systemPackages = with pkgs; [ - xdg-desktop-portal-gtk - - # XFCE Core - xfce.xfwm4 - xfce.xfce4-panel - xfce.xfce4-session - xfce.xfce4-settings - xfce.thunar - xfce.mousepad - xfce.xfce4-terminal - xfce.xfce4-appfinder - xfce.xfce4-power-manager - xfce.xfce4-notifyd - xfce.xfce4-whiskermenu-plugin # Optional Extras xfce.gigolo @@ -136,4 +149,4 @@ in { ################################################################ system.stateVersion = "25.05"; -} \ No newline at end of file +} diff --git a/Configurations/Hosts/Default/home/home.nix b/Configurations/Hosts/Default/home/home.nix index 7c4a2a1..c81b378 100644 --- a/Configurations/Hosts/Default/home/home.nix +++ b/Configurations/Hosts/Default/home/home.nix @@ -24,9 +24,6 @@ in { # All Home Manager Modules ../../../../Modules/Applications - # Extended Retro theme - ../../../../Modules/Desktops/XFCE-retro - # Desktop applications ./desktop.nix ]; diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/launcher-13/brave.desktop b/Modules/Desktops/XFCE-retro/Dotfiles/launcher-13/brave.desktop deleted file mode 100644 index 82e79b8..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/launcher-13/brave.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=Brave -GenericName=Web Browser -Comment=Browse the Web -Exec=brave -Icon=world -Terminal=false -Categories=Network;WebBrowser; diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/launcher-14/signal.desktop b/Modules/Desktops/XFCE-retro/Dotfiles/launcher-14/signal.desktop deleted file mode 100644 index cd6cee7..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/launcher-14/signal.desktop +++ /dev/null @@ -1,11 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=Signal - -Comment=Private Messenger -Exec=signal-desktop %U -Icon=signal-desktop -Terminal=false -Categories=Network;InstantMessaging; - diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/launcher-15/obsidian.desktop b/Modules/Desktops/XFCE-retro/Dotfiles/launcher-15/obsidian.desktop deleted file mode 100644 index 80b6393..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/launcher-15/obsidian.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=Obsidian - -Comment=Markdown Editor -Exec=obsidian %u -Icon=obsidian -Terminal=false -Categories=Office;Utility; \ No newline at end of file diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/launcher-16/spotify.desktop b/Modules/Desktops/XFCE-retro/Dotfiles/launcher-16/spotify.desktop deleted file mode 100644 index e514b9d..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/launcher-16/spotify.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Version=1.0 -Type=Application -Name=Spotify - -Comment=Spotify Music -Exec=spotify %U -Icon=spotify -Terminal=false -Categories=AudioVideo;Player; diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-keyboard-shortcuts.xml b/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-keyboard-shortcuts.xml deleted file mode 100644 index f5582e2..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-keyboard-shortcuts.xml +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-panel.xml b/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-panel.xml deleted file mode 100644 index 6286790..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-panel.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-sessions.xml b/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-sessions.xml deleted file mode 100644 index 6ac9b5b..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-sessions.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xfwm4.xml b/Modules/Desktops/XFCE-retro/Dotfiles/xfwm4.xml deleted file mode 100644 index 25adfc6..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xfwm4.xml +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xsettings.xml b/Modules/Desktops/XFCE-retro/Dotfiles/xsettings.xml deleted file mode 100644 index c79abe1..0000000 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xsettings.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Modules/Desktops/XFCE-retro/default.nix b/Modules/Desktops/XFCE-retro/default.nix deleted file mode 100644 index c561c3a..0000000 --- a/Modules/Desktops/XFCE-retro/default.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - - chicago95 = pkgs.callPackage ../../../Ressources/Themes/Chicago95/chicago95.nix {}; - dotfilesPath = ./Dotfiles; - resourcesPath = ../../../Ressources; - wallpaperFile = "Wallpaper/NixOS-95-wallpaper.png"; - wallpaperPath = "${config.home.homeDirectory}/${wallpaperFile}"; - wallpaperOrigin = "${resourcesPath}/Images/Wallpapers/Wallpaper-1.png"; - dotfiles = "${dotfilesPath}"; -in { - gtk = { - enable = true; - theme = { - name = "Chicago95"; - package = chicago95; - }; - iconTheme = { - name = "Win95_plus"; - package = pkgs.callPackage ../../../Ressources/Themes/Win95_plus/win95_plus.nix {}; - }; - cursorTheme = { - name = "Chicago95"; - package = chicago95; - }; - font = { - name = "Sans"; - size = 12; - }; - }; - - home.pointerCursor = { - name = "Chicago95"; - package = chicago95; - size = 24; - gtk.enable = true; - x11.enable = true; - }; - - home.packages = with pkgs; [ - xfce.xfce4-panel - xfce.xfconf - xfce.xfdesktop - xfce.xfce4-whiskermenu-plugin - xfce.xfce4-docklike-plugin - xorg.xrandr - ]; - - home.file = { - "${wallpaperFile}" = { - source = wallpaperOrigin; - }; - }; - - xdg.configFile = { - "xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml".source = "${dotfiles}/xfce4-desktop.xml"; - "xfce4/xfconf/xfce-perchannel-xml/xfce4-sessions.xml".source = "${dotfiles}/xfce4-sessions.xml"; - "xfce4/xfconf/xfce-perchannel-xml/xsettings.xml".source = "${dotfiles}/xsettings.xml"; - "xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml".source = "${dotfiles}/xfwm4.xml"; - "xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml".source = "${dotfiles}/xfce4-keyboard-shortcuts.xml"; - - # Panel: - "xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml".source = "${dotfiles}/xfce4-panel.xml"; - "xfce4/panel/launcher-13/brave.desktop".source = "${dotfiles}/launcher-13/brave.desktop"; - "xfce4/panel/launcher-14/signal.desktop".source = "${dotfiles}/launcher-14/signal.desktop"; - "xfce4/panel/launcher-15/obsidian.desktop".source = "${dotfiles}/launcher-15/obsidian.desktop"; - "xfce4/panel/launcher-16/spotify.desktop".source = "${dotfiles}/launcher-16/spotify.desktop"; - - - }; - - home.activation.applyXfceTweaks = lib.hm.dag.entryAfter ["writeBoundary"] '' - ${pkgs.xfce.xfdesktop}/bin/xfdesktop --reload - ''; -} diff --git a/Modules/System/common.nix b/Modules/System/common.nix index dde1865..c5c7661 100644 --- a/Modules/System/common.nix +++ b/Modules/System/common.nix @@ -39,7 +39,7 @@ LC_TIME = "de_DE.UTF-8"; }; - nix.settings.experimental-features = ["nix-command" "flakes"]; + nix.settings.experimental-features = ["nix-command" "flakes" "pipe-operators"]; nixpkgs.config.allowUnfree = true; console.keyMap = "de"; diff --git a/README.md b/README.md index cf8f3ad..e28565c 100644 --- a/README.md +++ b/README.md @@ -40,11 +40,15 @@ NixOS-95/ │ └── user-vars.nix ├── Modules/ │ ├── Applications/ -│ ├── Desktops/ -│ │ └── XFCE-retro/ -│ │ ├── default.nix -│ │ └── Dotfiles/ │ └── System/ +├── nixos95 +│   ├── dotfiles/ +│   ├── core.nix +│   ├── default.nix +│   ├── desktop.nix +│   ├── keybinds.nix +│   ├── taskbar.nix +│   └── theme.nix ├── Ressources/ │ ├── Icons/ │ ├── Images/ @@ -87,7 +91,9 @@ Some have been lightly edited. Originals were created by [aconfuseddragon](https 3. **Build and switch to the system configuration**: ```bash - sudo nixos-rebuild switch --flake .#default + sudo nixos-rebuild switch --flake .#default \ + --extra-experimental-features flakes \ + --extra-experimental-features pipe-operators ``` 4. **Apply user settings with Home Manager**: @@ -96,6 +102,20 @@ Some have been lightly edited. Originals were created by [aconfuseddragon](https home-manager switch ``` +### Experimental Features + +NixOS-95 relys on multiple experimental nix features. These are: +1. [flakes](https://wiki.nixos.org/wiki/Flakes) +2. [pipe-operators](https://nix.dev/manual/nix/2.26/language/operators#pipe-operators) +They are needed to activate the configuration. + +To enable them in your config set: +```nix +nix.settings.experimental-features = [ + "flakes" "pipe-operators" +]; +``` + ### Rebuild Notes Due to how **Home Manager** and XFCE handle theming, changes may not fully apply on the first attempt. diff --git a/flake.nix b/flake.nix index 8e08c98..2950a72 100644 --- a/flake.nix +++ b/flake.nix @@ -23,6 +23,9 @@ home-manager, ... }: { + + nixosModules.nixos95 = import ./nixos95; + nixosConfigurations = { ############################################################ # 💻 Default Host diff --git a/nixos95/core.nix b/nixos95/core.nix new file mode 100644 index 0000000..5695274 --- /dev/null +++ b/nixos95/core.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: let + cfg = config.nixos95; +in lib.mkIf cfg.enable { + + services.xserver = { + enable = true; + desktopManager.xfce.enable = true; + xkb = { + layout = "de"; + variant = ""; + }; + }; + services.xserver.displayManager.lightdm.enable = false; + + services.displayManager.sddm = { + enable = true; + package = pkgs.qt6Packages.sddm; + }; + + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; + +} diff --git a/nixos95/default.nix b/nixos95/default.nix new file mode 100644 index 0000000..744b77b --- /dev/null +++ b/nixos95/default.nix @@ -0,0 +1,24 @@ +{ config, lib, ...}: let + cfg = config.nixos95; +in { + + options.nixos95 = { + enable = lib.mkEnableOption "NixOS-95 Desktop environment"; + user = lib.mkOption { + description = '' + Username of the home-manager user. + ''; + type = lib.types.str; + example = "user"; + }; + }; + + imports = [ + ./core.nix + ./desktop.nix + ./keybinds.nix + ./taskbar.nix + ./theme.nix + ]; + +} diff --git a/nixos95/desktop.nix b/nixos95/desktop.nix new file mode 100644 index 0000000..39d1c94 --- /dev/null +++ b/nixos95/desktop.nix @@ -0,0 +1,35 @@ +{ inputs, config, lib, pkgs, ... }: let + cfg = config.nixos95; +in { + + options.nixos95 = { + + wallpaper = lib.mkOption { + description = "The wallpaper to use"; + type = lib.types.path; + default = ../Ressources/Images/Wallpapers/Wallpaper-1.png; + }; + + }; + + config = lib.mkIf cfg.enable { + + home-manager.users.${cfg.user} = { + + xdg.configFile = { + "xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml" = let + sed = lib.getExe pkgs.gnused; + desktop = pkgs.runCommand "desktop.xml" { } '' + ${sed} -e "s|NIXOS-95_WALLPAPER|${cfg.wallpaper}|g" ${./dotfiles/xfce4-desktop.xml} > $out + ''; + in { + force = true; + source = desktop; + }; + }; + + }; + + }; + +} diff --git a/nixos95/dotfiles/battery.rc b/nixos95/dotfiles/battery.rc new file mode 100644 index 0000000..cc72256 --- /dev/null +++ b/nixos95/dotfiles/battery.rc @@ -0,0 +1,19 @@ +display_label=false +display_icon=true +display_power=false +display_percentage=false +display_bar=false +display_time=false +tooltip_display_percentage=true +tooltip_display_time=false +low_percentage=30 +critical_percentage=20 +action_on_low=1 +action_on_critical=1 +hide_when_full=0 +colorA=rgb(119,118,123) +colorH=rgb(143,240,164) +colorL=rgb(248,228,92) +colorC=rgb(237,51,59) +command_on_low= +command_on_critical= diff --git a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-desktop.xml b/nixos95/dotfiles/xfce4-desktop.xml similarity index 85% rename from Modules/Desktops/XFCE-retro/Dotfiles/xfce4-desktop.xml rename to nixos95/dotfiles/xfce4-desktop.xml index 8c8d4cb..f74c768 100644 --- a/Modules/Desktops/XFCE-retro/Dotfiles/xfce4-desktop.xml +++ b/nixos95/dotfiles/xfce4-desktop.xml @@ -5,13 +5,13 @@ - + - + diff --git a/nixos95/keybinds.nix b/nixos95/keybinds.nix new file mode 100644 index 0000000..0ae9207 --- /dev/null +++ b/nixos95/keybinds.nix @@ -0,0 +1,113 @@ +/** +* For now this just hard copies the config file. +* This can be improved by allowing users to define there own keybinds +*/ +{ config, lib, pkgs, ... }: let + cfg = config.nixos95.keybinds; + t = lib.types; + slib = pkgs.callPackage ./util/lib.nix { }; +in { + + options.nixos95.keybinds = { + commands = lib.mkOption { + description = '' + Keyboard shortcuts that should be made available. + + Each keyboard shortcut is defined as a set with the follwoing schema: + { + enable = bool; [optional; default = true] + key = string; [key sequence to triggger the command] + # to specify which command to execute use on of the following: + pkg = package; [use mainProgramm of a nix package; e.g. pkgs.firefox] + exe = string; [provide a program name directly; e.g. firefox] + } + + > Modifier keys must be surrounded by angle brackets + ''; + type = t.listOf t.attrs; + default = [ + { + key = "r"; + exe = "xfce4-appfinder --collapsed"; + } + { + key = "XF86WWW"; + exe = "exo-open --launch WebBrowser"; + } + { + key = "XF86Mail"; + exe = "exo-open --launch MailReder"; + } + { + key = "Print"; + exe = "xfce4-screenshooter"; + } + ]; + }; + xfwm4 = lib.mkOption { + description = '' + Keyboard shortcuts to control xfwm4 + + Each keyboard shortcut is defined as a set with the follwoing schema: + { + enable = bool; [optional; default = true] + key = string; [key sequence to triggger the command] + # to specify which command to execute use on of the following: + pkg = package; [use mainProgramm of a nix package; e.g. pkgs.firefox] + exe = string; [provide a program name directly; e.g. firefox] + } + + > Modifier keys must be surrounded by angle brackets + ''; + type = t.listOf t.attrs; + default = [ ]; + }; + }; + + config = lib.mkIf config.nixos95.enable { + + home-manager.users.${config.nixos95.user} = { + + xdg.configFile = let + to_xml = list : list + |> lib.filter slib.isEnable + |> lib.map ( elm : let + key = lib.escapeXML elm.key; + exe = lib.escapeXML (slib.getExe elm); + in '' '') + |> lib.concatStringsSep "\n"; + commands_xml = to_xml cfg.commands; + xfwm4_xml = to_xml cfg.xfwm4; + in { + "xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml" = { + force = true; + text = '' + + + + + + + ${commands_xml} + + + + + + ${xfwm4_xml} + + + + + + + + ''; + }; + }; + + }; + + }; + +} diff --git a/nixos95/taskbar.nix b/nixos95/taskbar.nix new file mode 100644 index 0000000..7fad763 --- /dev/null +++ b/nixos95/taskbar.nix @@ -0,0 +1,214 @@ +/** +* For now this just hard copies the config file. +* This can be improved by allowing users to define there own task bar config +*/ +{ config, lib, pkgs, ... }: let + cfg = config.nixos95.taskbar; + user = config.nixos95.user; + t = lib.types; + slib = pkgs.callPackage ./util/lib.nix { }; +in { + + options.nixos95.taskbar = { + + homeIcon = lib.mkOption { + description = '' + Home icon used in the lefter corner of the taskbar + + Can be either a `path` to an icon to use, + or the name (string) of an icon in the current theme. + This will be the `Win95_plus` theme by default. + You can check for existing icons inside `/Ressources/Icons/Win95_plus`. + ''; + default = "whisker-menu-button"; + type = t.either t.str t.path; + example = "world"; + }; + + battery-plugin = { + enable = lib.mkOption { + description = '' + Enable the battery plugin in the taskbar. + + This will show the charging status in the right corner. + On hover it will show the excat percentage. + ''; + default = true; + example = false; + type = t.bool; + }; + }; + + applications = lib.mkOption { + description = '' + (in order) list of applications to pin in the taskbar. + + Applications must be defined as a set each with the following name-value paris: + { + enable = bool; [optional; default = true] + name = string; [application name shown on hover; optional] + description = string; [text shown on hover; optional] + icon = string | path; [icon shown in the task bar] + terminal = bool; [start the program inside a terminal; optional; default = false] + [either pkg or exe must be defined] + pkg = package; [use mainProgramm of a nix package; e.g. pkgs.firefox] + exe = string; [provide a program name directly; e.g. firefox] + } + + The `icon` can be specified as an icon name (in the current Iocn pack) + or as a `path` to an image directly. + See `/Ressources/Icons/Win95_plus` for the default icons. + + ''; + default = [ + { + name = "Files"; + description = "View and manage local files"; + icon = "folder_open"; + exe = "exo-open --launch FileManager"; + } + { + name = "Terminal"; + description = "Run commands"; + icon = "xfce4-terminal"; + pkg = pkgs.xfce.xfce4-terminal; + } + { + name = "Browser"; + description = "Access the world wide web"; + icon = "firefox"; + exe = "exo-open --launch WebBrowser"; + } + ]; + type = t.listOf t.attrs; + }; + + }; + + config = lib.mkIf config.nixos95.enable { + + environment.systemPackages = [ + pkgs.xfce.xfce4-whiskermenu-plugin + (lib.mkIf cfg.battery-plugin.enable pkgs.xfce.xfce4-battery-plugin) + ]; + + home-manager.users.${user} = { + + xdg.configFile = { + + "xfce4/panel/battery-7.rc" = { + force = true; + enable = cfg.battery-plugin.enable; + source = ./dotfiles/battery.rc; + }; + + "xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml" = let + + ifBattery = str : if cfg.battery-plugin.enable then str else ""; + battery_id = ifBattery '' ''; + battery_xml = ifBattery '' ''; + + applications_cfg = cfg.applications + |> lib.filter slib.isEnable + |> lib.imap0 ( ptr : elm : rec { + # we start IDs in the 20 range to not get confilics with other plugins + plugin_id = "2" + builtins.toString ptr; + plugin_desktop = let + desc = if elm ? description then elm.description else ""; + term = if elm ? term && elm.term then "true" else "false"; + exec = slib.getExe elm; + in pkgs.writeTextFile { + name = "${elm.name}.desktop"; + text = '' + [Desktop Entry] + Version=1.0 + Type=Application + Name=${elm.name} + Icon=${elm.icon} + Exec=${exec} + Comment=${desc} + Terminal=${term} + ''; + }; + plugin_xml = '' + + + + + + + ''; + }); + + app_ids = applications_cfg + |> lib.map ( elm : '' '' ) + |> lib.concatStringsSep "\n"; + app_xml = applications_cfg + |> lib.map ( elm : elm.plugin_xml ) + |> lib.concatStringsSep "\n"; + + in { + force = true; + text = '' + + + + + + + + + + + + + + + ${app_ids} + + + + + ${battery_id} + + + + + + + + + + + + ${app_xml} + + + + + + + + + + + + + + + + + + + ${battery_xml} + + + ''; + }; + + }; + + }; + }; + +} diff --git a/nixos95/theme.nix b/nixos95/theme.nix new file mode 100644 index 0000000..a8413be --- /dev/null +++ b/nixos95/theme.nix @@ -0,0 +1,35 @@ +{ inputs, config, lib, pkgs, ... }: let + cfg = config.nixos95; + + root = ../.; + baseTheme = { + name = "Chicago95"; + package = pkgs.callPackage "${root}/Ressources/Themes/Chicago95/chicago95.nix" { }; + }; + iconTheme = { + name = "Win95_plus"; + package = pkgs.callPackage "${root}/Ressources/Themes/Win95_plus/win95_plus.nix" { }; + }; +in lib.mkIf cfg.enable { + + home-manager.users.${cfg.user} = { + gtk = { + enable = true; + theme = baseTheme; + iconTheme = iconTheme; + cursorTheme = baseTheme; + font = { + name = "Sans"; + size = 12; + }; + }; + + home.pointerCursor = { + size = 24; + gtk.enable = true; + x11.enable = true; + } // baseTheme; + }; + +} + diff --git a/nixos95/util/lib.nix b/nixos95/util/lib.nix new file mode 100644 index 0000000..b84463e --- /dev/null +++ b/nixos95/util/lib.nix @@ -0,0 +1,6 @@ +{ lib, ... }: { + # return true if elm.enable is not set or elm.enable is true + isEnable = elm : !( lib.hasAttr "enable" elm ) || elm.enable; + # return executable path from elm.pkg if defined or elm.exe + getExe = elm : if elm ? pkg then lib.getExe elm.pkg else elm.exe; +}