diff --git a/modules/nixos/system/default.nix b/modules/nixos/system/default.nix index e46437b..5137e13 100644 --- a/modules/nixos/system/default.nix +++ b/modules/nixos/system/default.nix @@ -1,36 +1,3 @@ { ... }: { imports = [ ./dbus ./fonts ./hw ./locale ./network ./nix ./security ./xdg ]; - - environment.sessionVariables = rec { - PATH = [ "$HOME/.local/bin/:$PATH" ]; - XDG_CACHE_HOME = "$HOME/.cache"; - XDG_CONFIG_HOME = "$HOME/.config"; - XDG_DATA_HOME = "$HOME/.local/share"; - XDG_STATE_HOME = "$HOME/.local/state"; - XDG_BIN_HOME = "$HOME/.local/bin"; - XDG_DESKTOP_DIR = "$HOME/desktop"; - XDG_DOCUMENTS_DIR = "$HOME/files"; - XDG_DOWNLOAD_DIR = "$HOME/download"; - XDG_MUSIC_DIR = "$HOME/media/music"; - XDG_PICTURES_DIR = "$HOME/media/photo"; - XDG_PUBLICSHARE_DIR = "$HOME/pub"; - XDG_TEMPLATES_DIR = "$HOME/media/templates"; - XDG_VIDEOS_DIR = "$HOME/media/video"; - }; - - environment.etc."xdg/user-dirs.defaults".text = '' - XDG_CACHE_HOME="$HOME/.cache" - XDG_CONFIG_HOME="$HOME/.config" - XDG_DATA_HOME="$HOME/.local/share" - XDG_STATE_HOME="$HOME/.local/state" - XDG_BIN_HOME="$HOME/.local/bin" - XDG_DESKTOP_DIR="$HOME/desktop" - XDG_DOCUMENTS_DIR="$HOME/files" - XDG_DOWNLOAD_DIR="$HOME/download" - XDG_MUSIC_DIR="$HOME/media/music" - XDG_PICTURES_DIR="$HOME/media/photo" - XDG_PUBLICSHARE_DIR="$HOME/pub" - XDG_TEMPLATES_DIR="$HOME/media/templates" - XDG_VIDEOS_DIR="$HOME/media/video" - ''; } diff --git a/modules/nixos/system/xdg/default.nix b/modules/nixos/system/xdg/default.nix index 707600e..c7734eb 100644 --- a/modules/nixos/system/xdg/default.nix +++ b/modules/nixos/system/xdg/default.nix @@ -1,5 +1,6 @@ { config, lib, pkgs, ... }: { - config = lib.mkIf (config.syscfg.make.gui) { + config = lib.mkMerge[ + (lib.mkIf (config.syscfg.make.gui) { xdg.portal = { enable = true; # wlr.enable = true; @@ -27,5 +28,40 @@ XCURSOR_SIZE = "24"; NIXOS_OZONE_WL = "1"; }; + }) + ({ + + environment.sessionVariables = rec { + PATH = [ "$HOME/.local/bin/:$PATH" ]; + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_STATE_HOME = "$HOME/.local/state"; + XDG_BIN_HOME = "$HOME/.local/bin"; + XDG_DESKTOP_DIR = "$HOME/desktop"; + XDG_DOCUMENTS_DIR = "$HOME/files"; + XDG_DOWNLOAD_DIR = "$HOME/download"; + XDG_MUSIC_DIR = "$HOME/media/music"; + XDG_PICTURES_DIR = "$HOME/media/photo"; + XDG_PUBLICSHARE_DIR = "$HOME/pub"; + XDG_TEMPLATES_DIR = "$HOME/media/templates"; + XDG_VIDEOS_DIR = "$HOME/media/video"; }; + + environment.etc."xdg/user-dirs.defaults".text = '' + XDG_CACHE_HOME="$HOME/.cache" + XDG_CONFIG_HOME="$HOME/.config" + XDG_DATA_HOME="$HOME/.local/share" + XDG_STATE_HOME="$HOME/.local/state" + XDG_BIN_HOME="$HOME/.local/bin" + XDG_DESKTOP_DIR="$HOME/desktop" + XDG_DOCUMENTS_DIR="$HOME/files" + XDG_DOWNLOAD_DIR="$HOME/download" + XDG_MUSIC_DIR="$HOME/media/music" + XDG_PICTURES_DIR="$HOME/media/photo" + XDG_PUBLICSHARE_DIR="$HOME/pub" + XDG_TEMPLATES_DIR="$HOME/media/templates" + XDG_VIDEOS_DIR="$HOME/media/video" + ''; + })]; }