meta: Don't hardcode home directory

This is a much better way of handling things.
This commit is contained in:
Donovan Glover 2024-04-04 19:38:57 -04:00
parent 6f1b17a600
commit a6f2c58d51
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
4 changed files with 27 additions and 20 deletions

View File

@ -1,17 +1,20 @@
{ pkgs, ... }: { pkgs, config, ... }:
let
inherit (config.home) homeDirectory;
in
{ {
home.packages = with pkgs; [ eww ]; home.packages = with pkgs; [ eww ];
xdg.configFile."eww/eww.yuck".text = /* yuck */ '' xdg.configFile."eww/eww.yuck".text = /* yuck */ ''
(defwidget icons [] (defwidget icons []
(box :orientation "h" :spacing 32 (box :orientation "h" :spacing 32
(icon :img "default-user-home" :exec "/home/user") (icon :img "default-user-home" :exec "${homeDirectory}")
(icon :img "default-folder-download" :exec "/home/user/") (icon :img "default-folder-download" :exec "${homeDirectory}/")
(icon :img "default-folder-documents" :exec "/home/user/") (icon :img "default-folder-documents" :exec "${homeDirectory}/")
(icon :img "default-folder-music" :exec "/home/user/") (icon :img "default-folder-music" :exec "${homeDirectory}/")
(icon :img "default-folder-pictures" :exec "/home/user/") (icon :img "default-folder-pictures" :exec "${homeDirectory}/")
(icon :img "default-folder-video" :exec "/home/user/"))) (icon :img "default-folder-video" :exec "${homeDirectory}/")))
(defwidget icon [img exec] (defwidget icon [img exec]
(eventbox :cursor "pointer" :onclick "lnch thunar ''${exec}" :tooltip "''${exec}" (eventbox :cursor "pointer" :onclick "lnch thunar ''${exec}" :tooltip "''${exec}"

View File

@ -1,9 +1,10 @@
{ pkgs, ... }: { pkgs, config, ... }:
let let
inherit (pkgs) mpc-cli; inherit (pkgs) mpc-cli;
inherit (config.xdg.userDirs) music;
musicDirectory = "/home/user/"; musicDirectory = music;
changeScript = "ncmpcpp/on-song-change.sh"; changeScript = "ncmpcpp/on-song-change.sh";
fallbackImage = ../assets/wallpaper.png; fallbackImage = ../assets/wallpaper.png;
in in

View File

@ -1,3 +1,8 @@
{ config, ... }:
let
inherit (config.home) homeDirectory;
in
{ {
xdg.userDirs = { xdg.userDirs = {
enable = true; enable = true;
@ -7,11 +12,11 @@
templates = null; templates = null;
publicShare = null; publicShare = null;
download = "/home/user/"; download = "${homeDirectory}/";
documents = "/home/user/"; documents = "${homeDirectory}/";
music = "/home/user/"; music = "${homeDirectory}/";
pictures = "/home/user/"; pictures = "${homeDirectory}/";
videos = "/home/user/"; videos = "${homeDirectory}/";
}; };
xdg.configFile."user-dirs.locale".text = "ja_JP"; xdg.configFile."user-dirs.locale".text = "ja_JP";

View File

@ -1,10 +1,8 @@
{ stylix { config, stylix, home-manager, sakaya, ... }:
, home-manager
, sakaya
, ...
}:
let let
inherit (config.modules.system) username;
template = { template = {
privateNetwork = true; privateNetwork = true;
ephemeral = true; ephemeral = true;
@ -13,7 +11,7 @@ let
bindMounts = { bindMounts = {
"/mnt" = { "/mnt" = {
hostPath = "/home/user/containers/wine"; hostPath = "/home/${username}/containers/wine";
isReadOnly = false; isReadOnly = false;
}; };