From ae9d676e3d6aedef515cd3bdcafa1a0a469a9cf6 Mon Sep 17 00:00:00 2001 From: 514fpv Date: Tue, 2 Jan 2024 14:53:03 +0800 Subject: [PATCH] feat(xdg): add persistence and configure paths The default xdg directories are noisy and unhelpful. --- home/xdg/home.nix | 21 +++++++++++++++++++++ home/xdg/nixos.nix | 3 +++ 2 files changed, 24 insertions(+) create mode 100644 home/xdg/home.nix create mode 100644 home/xdg/nixos.nix diff --git a/home/xdg/home.nix b/home/xdg/home.nix new file mode 100644 index 00000000..ff3f93d5 --- /dev/null +++ b/home/xdg/home.nix @@ -0,0 +1,21 @@ +{ config +, ... }: { + xdg = { + enable = true; + userDirs = let + home = config.home.homeDirectory; + local = "${home}/local"; + in { + enable = true; + createDirectories = true; + download = "${home}/dl"; + desktop = "${local}/desktop"; + documents = "${local}/documents"; + music = "${local}/music"; + pictures = "${local}/pictures"; + publicShare = "${local}/public"; + templates = "${local}/templates"; + videos = "${local}/videos"; + }; + }; +} diff --git a/home/xdg/nixos.nix b/home/xdg/nixos.nix new file mode 100644 index 00000000..f6e35f91 --- /dev/null +++ b/home/xdg/nixos.nix @@ -0,0 +1,3 @@ +{ + users.home.persist.directories = [ "local" "dl" ]; +}