mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
Parametrize path to profile directory
This commit is contained in:
parent
93ef6aefce
commit
c18b1328a5
12 changed files with 27 additions and 14 deletions
|
@ -121,6 +121,17 @@ in
|
|||
description = "The user's home directory.";
|
||||
};
|
||||
|
||||
home.profileDirectory = mkOption {
|
||||
type = types.path;
|
||||
defaultText = "~/.nix-profile";
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
description = ''
|
||||
The profile directory where Home Manager generations are
|
||||
installed.
|
||||
'';
|
||||
};
|
||||
|
||||
home.language = mkOption {
|
||||
type = languageSubModule;
|
||||
default = {};
|
||||
|
@ -249,6 +260,8 @@ in
|
|||
home.username = mkDefault (builtins.getEnv "USER");
|
||||
home.homeDirectory = mkDefault (builtins.getEnv "HOME");
|
||||
|
||||
home.profileDirectory = cfg.homeDirectory + "/.nix-profile";
|
||||
|
||||
home.sessionVariables =
|
||||
let
|
||||
maybeSet = n: v: optionalAttrs (v != null) { ${n} = v; };
|
||||
|
|
|
@ -33,8 +33,8 @@ in
|
|||
<?xml version='1.0'?>
|
||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||
<fontconfig>
|
||||
<dir>~/.nix-profile/lib/X11/fonts</dir>
|
||||
<dir>~/.nix-profile/share/fonts</dir>
|
||||
<dir>${config.home.profileDirectory}/lib/X11/fonts</dir>
|
||||
<dir>${config.home.profileDirectory}/share/fonts</dir>
|
||||
</fontconfig>
|
||||
'';
|
||||
};
|
||||
|
|
|
@ -182,7 +182,7 @@ in
|
|||
home.file.".profile".text = ''
|
||||
# -*- mode: sh -*-
|
||||
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||
|
||||
${sessionVarsStr}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ let
|
|||
dag = config.lib.dag;
|
||||
|
||||
# Indexes info files found in this location
|
||||
homeInfoPath = "$HOME/.nix-profile/share/info";
|
||||
homeInfoPath = "${config.home.profileDirectory}/share/info";
|
||||
|
||||
# Installs this package -- the interactive just means that it
|
||||
# includes the curses `info` program. We also use `install-info`
|
||||
|
|
|
@ -314,7 +314,7 @@ in
|
|||
}
|
||||
|
||||
# Environment variables
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||
${envVarsStr}
|
||||
|
||||
${optionalString cfg.oh-my-zsh.enable ''
|
||||
|
|
|
@ -99,7 +99,7 @@ in
|
|||
|
||||
basePaths = [
|
||||
"/run/current-system/sw"
|
||||
"${config.home.homeDirectory}/.nix-profile"
|
||||
config.home.profileDirectory
|
||||
cfg.iconTheme.package
|
||||
] ++ optional useCustomTheme hicolorTheme.package;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ in
|
|||
};
|
||||
|
||||
Service = {
|
||||
Environment = "PATH=%h/.nix-profile/bin";
|
||||
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||
ExecStart = "${package}/bin/flameshot";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
|
|
|
@ -41,7 +41,7 @@ in
|
|||
};
|
||||
|
||||
Service = {
|
||||
Environment = "PATH=%h/.nix-profile/bin";
|
||||
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||
ExecStart = "${package}/lib/libexec/kdeconnectd";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
|
@ -64,7 +64,7 @@ in
|
|||
};
|
||||
|
||||
Service = {
|
||||
Environment = "PATH=%h/.nix-profile/bin";
|
||||
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||
ExecStart = "${package}/bin/kdeconnect-indicator";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
|
|
|
@ -131,13 +131,13 @@ in {
|
|||
After = [ "network.target" "sound.target" ];
|
||||
Description = "Music Player Daemon";
|
||||
};
|
||||
|
||||
|
||||
Install = {
|
||||
WantedBy = [ "default.target" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Environment = "PATH=%h/.nix-profile/bin";
|
||||
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||
ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon ${mpdConf}";
|
||||
Type = "notify";
|
||||
ExecStartPre = ''${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p '${cfg.dataDir}' '${cfg.playlistDirectory}'"'';
|
||||
|
|
|
@ -18,7 +18,7 @@ with lib;
|
|||
};
|
||||
|
||||
Service = {
|
||||
Environment = "PATH=%h/.nix-profile/bin";
|
||||
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||
ExecStart = "${pkgs.owncloud-client}/bin/owncloud";
|
||||
};
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ with lib;
|
|||
};
|
||||
|
||||
Service = {
|
||||
Environment = "PATH=%h/.nix-profile/bin";
|
||||
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||
ExecStart = "${pkgs.qsyncthingtray}/bin/QSyncthingTray";
|
||||
};
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ in
|
|||
};
|
||||
|
||||
home.file.".xprofile".text = ''
|
||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
||||
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||
|
||||
if [[ -e "$HOME/.profile" ]]; then
|
||||
. "$HOME/.profile"
|
||||
|
|
Loading…
Reference in a new issue