mirror of
https://github.com/nmasur/dotfiles
synced 2024-11-09 22:12:56 +00:00
replace manual home dir with config option
This commit is contained in:
parent
fdfc66c7ad
commit
5a43ad997f
@ -26,15 +26,18 @@
|
||||
description = "Base16 color scheme";
|
||||
};
|
||||
};
|
||||
dotfilesPath = let
|
||||
homePath = if pkgs.stdenv.isDarwin then
|
||||
homePath = mkOption {
|
||||
type = types.path;
|
||||
description = "Path of user's home directory.";
|
||||
default = builtins.toPath (if pkgs.stdenv.isDarwin then
|
||||
"/Users/${config.user}"
|
||||
else
|
||||
"/home/${config.user}";
|
||||
in mkOption {
|
||||
"/home/${config.user}");
|
||||
};
|
||||
dotfilesPath = mkOption {
|
||||
type = types.path;
|
||||
description = "Path of dotfiles repository.";
|
||||
default = builtins.toPath "${homePath}/dev/personal/dotfiles";
|
||||
default = config.homePath + "/dev/personal/dotfiles";
|
||||
};
|
||||
dotfilesRepo = mkOption {
|
||||
type = types.str;
|
||||
|
@ -1,19 +1,8 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
users.users."${config.user}" = { # macOS user
|
||||
home = "/Users/${config.user}";
|
||||
home = config.homePath;
|
||||
shell = pkgs.zsh; # Default shell
|
||||
};
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
accounts.email.accounts.home = {
|
||||
passwordCommand = lib.mkForce
|
||||
"${pkgs.age}/bin/age --decrypt --identity /Users/${config.user}/.ssh/id_ed25519 ${
|
||||
builtins.toString ./mailpass.age
|
||||
}";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.sessionVariables = {
|
||||
NOTES_PATH = "/home/${config.user}/dev/personal/notes";
|
||||
NOTES_PATH = "${config.homePath}/dev/personal/notes";
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -23,7 +23,7 @@ in {
|
||||
; Disables the notice about an available update on exit
|
||||
disable_update_notice = true
|
||||
; Set install directory
|
||||
install_dir = /home/${config.user}/media/games
|
||||
install_dir = ${config.homePath}/media/games
|
||||
; Make output quiet
|
||||
log_level = error
|
||||
'';
|
||||
|
@ -246,7 +246,7 @@ in {
|
||||
|
||||
# Update lock screen cache only if cache is empty
|
||||
home.activation.updateLockScreenCache =
|
||||
let cacheDir = "/home/${config.user}/.cache/betterlockscreen/current";
|
||||
let cacheDir = "${config.homePath}/.cache/betterlockscreen/current";
|
||||
in config.home-manager.users.${config.user}.lib.dag.entryAfter
|
||||
[ "writeBoundary" ] ''
|
||||
if [ ! -d ${cacheDir} ] || [ -z "$(ls ${cacheDir})" ]; then
|
||||
|
@ -68,7 +68,7 @@
|
||||
mu.enable = false;
|
||||
notmuch.enable = false;
|
||||
passwordCommand =
|
||||
"${pkgs.age}/bin/age --decrypt --identity /home/${config.user}/.ssh/id_ed25519 ${
|
||||
"${pkgs.age}/bin/age --decrypt --identity ${config.homePath}/.ssh/id_ed25519 ${
|
||||
builtins.toString ./mailpass.age
|
||||
}";
|
||||
smtp = {
|
||||
|
@ -9,8 +9,8 @@
|
||||
projects = {
|
||||
description = "Jump to a project";
|
||||
body = ''
|
||||
set projdir (ls /home/${config.user}/dev/personal | fzf)
|
||||
and cd /home/${config.user}/dev/personal/$projdir
|
||||
set projdir (ls ${config.homePath}/dev/personal | fzf)
|
||||
and cd ${config.homePath}/dev/personal/$projdir
|
||||
and commandline -f execute
|
||||
'';
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user