Sample Header Ad - 728x90

Which settings of XFCE can be currently configured on NixOS (during build, or afterwards via Home Manager etc.)?

1 vote
1 answer
1488 views
Currently I am trying to create a basic configuration for my NixOS 23.05 installation with the XFCE Desktop and Window Manager. My approach is to use home-manager in standalone-mode to configure the XFCE Theme etc. on a per-user basis, which is inspired by a [gist by nat-418](https://gist.github.com/nat-418/1101881371c9a7b419ba5f944a7118b0) .
My configuration looks as follows:
#~/.config/home-manager/home.nix

{ config, pkgs, ... }:

{
  imports = [
    ./xfce/xfce-home.nix
  ];

  home.username = USERNAME;
  home.homeDirectory = PATH/TO/HOME/DIR;

  home.stateVersion = "23.05"; # Please read the comment before changing.

  home.packages = [
    # installing icon themes
    pkgs.matcha-gtk-theme
    pkgs.zuki-themes
    pkgs.elementary-xfce-icon-theme
    pkgs.xfce.xfce4-icon-theme
  ];

  programs.home-manager.enable = true;
}
#~/.config/home-manager/xfce/xfce-home.nix

{ config, pkgs, lib, ... }:

{
  gtk = {
    enable = true;
      iconTheme = {
      name = "xfce4-icon-theme";
      package = pkgs.xfce.xfce4-icon-theme;
    };
    theme = {
      name = "matcha-dark-sea";
      package = pkgs.matcha-gtk-theme;
    };
    gtk3.extraConfig = {
      Settings = ''
        gtk-application-prefer-dark-theme=1
      '';
    };
    gtk4.extraConfig = {
      Settings = ''
        gtk-application-prefer-dark-theme=1
      '';
    };
  };

  programs.gpg.enable = true;
  services.gpg-agent.enable = true;
}
My programs.xfconf.enable = true; is already set in my configuration.nix and would throw an error if I would set it again in my home-manager configuration.
However, non of the changes are applied after running home-manager switch (or any of the other applicable commands). There are no errors, and the output claims that the changes are applied. But neither a log-out nor a reboot would result in visible changes in the (icon) theme, wallpaper etc. (sometimes there might occur glitches like switching from dark theme to light theme, even though this is configured nowhere). The majority of the sources say that [not many options exist](https://www.reddit.com/r/NixOS/comments/c8yqxl/is_there_a_way_to_configure_xfce_look_and_feel/) besides basic things like setting the wallpaper, [startup commands](https://unix.stackexchange.com/questions/445048/configure-xfce-startup-commands-in-nixos) or general options
services.xserver.desktopManager.xfce.enableScreensaver
services.xserver.desktopManager.xfce.enable
services.xserver.desktopManager.xfce.noDesktop
programs.thunar.enable
programs.xfconf.enable
programs.gnupg.agent.pinentryFlavor
sound.mediaKeys.enable
services.xserver.desktopManager.xfce.enableXfwm

#source: https://search.nixos.org/options?channel=23.05&from=0&size=50&sort=relevance&type=packages&query=xfce 
# Questions: # 1. Did I miss something (like additional commands to enable xfconf properly also for home-manager?) 2. Since nix is a functional language, I would not expect so, but: Do I have to move some package installation logic to other than home-manager files? 3. Is there a way with home-manager to do any detailed XFCE configuration changes (like task bar position) after having build the default NixOS XFCE? 4. Is it easily possible to make the configuration changes already during building the default NixOS XFCE? And if so, in an easy way with little to no additional scripting/settings that have to be applied manually by the user?
Asked by dsacre (111 rep)
Aug 28, 2023, 07:32 AM
Last activity: Sep 21, 2024, 05:38 PM