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 ];
|
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}"
|
||||||
|
@ -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
|
||||||
|
@ -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";
|
||||||
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user