From fd220567dfdb7120cfe64d3c1f8d1e315bafa4db Mon Sep 17 00:00:00 2001 From: James Patrick Date: Tue, 30 Nov 2021 23:39:03 -0500 Subject: [PATCH] Added basic xdg support --- modules/profiles/minimal.nix | 1 + modules/system/xdg.nix | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 modules/system/xdg.nix diff --git a/modules/profiles/minimal.nix b/modules/profiles/minimal.nix index d6245a6..da62cb9 100644 --- a/modules/profiles/minimal.nix +++ b/modules/profiles/minimal.nix @@ -6,6 +6,7 @@ let sha256 = "sha256-Btjo+v/xA26CwwFauNmSdJOauIq/yZoBV1Com39nu6E="; }; in { + imports = [ ../system/xdg.nix ]; # Allow Cleanup, nix, & flakes nix = { autoOptimiseStore = true; diff --git a/modules/system/xdg.nix b/modules/system/xdg.nix new file mode 100644 index 0000000..7ba65f0 --- /dev/null +++ b/modules/system/xdg.nix @@ -0,0 +1,34 @@ +# This was cribed from Hlisser's dotfiles see here +# https://github.com/hlissner/dotfiles/blob/8fe1fbb6e7fc0d2f95fe75cdb9df7eb0595a0047/modules/xdg.nix +# +{ config, pkgs, ... }: { + + home-manager.users.james = { + home.packages = with pkgs; [ xdg-utils xdg-launch ]; + xdg.enable = true; + }; + + environment = { + sessionVariables = { + # These are the defaults, and xdg.enable does set them, but due to load + # order, they're not set before environment.variables are set, which could + # cause race conditions. + XDG_CACHE_HOME = "$HOME/.cache"; + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + XDG_BIN_HOME = "$HOME/.local/bin"; + }; + variables = { + # Conform more programs to XDG conventions. The rest are handled by their + # respective modules. + ASPELL_CONF = '' + per-conf $XDG_CONFIG_HOME/aspell/aspell.conf; + personal $XDG_CONFIG_HOME/aspell/en_US.pws; + repl $XDG_CONFIG_HOME/aspell/en.prepl; + ''; + LESSHISTFILE = "$XDG_CACHE_HOME/lesshst"; + WGETRC = "$XDG_CONFIG_HOME/wgetrc"; + }; + + }; +}