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 ];
xdg.configFile."eww/eww.yuck".text = /* yuck */ ''
(defwidget icons []
(box :orientation "h" :spacing 32
(icon :img "default-user-home" :exec "/home/user")
(icon :img "default-folder-download" :exec "/home/user/")
(icon :img "default-folder-documents" :exec "/home/user/")
(icon :img "default-folder-music" :exec "/home/user/")
(icon :img "default-folder-pictures" :exec "/home/user/")
(icon :img "default-folder-video" :exec "/home/user/")))
(icon :img "default-user-home" :exec "${homeDirectory}")
(icon :img "default-folder-download" :exec "${homeDirectory}/")
(icon :img "default-folder-documents" :exec "${homeDirectory}/")
(icon :img "default-folder-music" :exec "${homeDirectory}/")
(icon :img "default-folder-pictures" :exec "${homeDirectory}/")
(icon :img "default-folder-video" :exec "${homeDirectory}/")))
(defwidget icon [img exec]
(eventbox :cursor "pointer" :onclick "lnch thunar ''${exec}" :tooltip "''${exec}"

View File

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

View File

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

View File

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