mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-24 17:23:09 +01:00
meta: Don't hardcode home directory
This is a much better way of handling things.
This commit is contained in:
parent
6f1b17a600
commit
a6f2c58d51
17
home/eww.nix
17
home/eww.nix
@ -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}"
|
||||
|
@ -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
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user