mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 13: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.";
|
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 {
|
home.language = mkOption {
|
||||||
type = languageSubModule;
|
type = languageSubModule;
|
||||||
default = {};
|
default = {};
|
||||||
|
@ -249,6 +260,8 @@ in
|
||||||
home.username = mkDefault (builtins.getEnv "USER");
|
home.username = mkDefault (builtins.getEnv "USER");
|
||||||
home.homeDirectory = mkDefault (builtins.getEnv "HOME");
|
home.homeDirectory = mkDefault (builtins.getEnv "HOME");
|
||||||
|
|
||||||
|
home.profileDirectory = cfg.homeDirectory + "/.nix-profile";
|
||||||
|
|
||||||
home.sessionVariables =
|
home.sessionVariables =
|
||||||
let
|
let
|
||||||
maybeSet = n: v: optionalAttrs (v != null) { ${n} = v; };
|
maybeSet = n: v: optionalAttrs (v != null) { ${n} = v; };
|
||||||
|
|
|
@ -33,8 +33,8 @@ in
|
||||||
<?xml version='1.0'?>
|
<?xml version='1.0'?>
|
||||||
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
|
||||||
<fontconfig>
|
<fontconfig>
|
||||||
<dir>~/.nix-profile/lib/X11/fonts</dir>
|
<dir>${config.home.profileDirectory}/lib/X11/fonts</dir>
|
||||||
<dir>~/.nix-profile/share/fonts</dir>
|
<dir>${config.home.profileDirectory}/share/fonts</dir>
|
||||||
</fontconfig>
|
</fontconfig>
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
|
@ -182,7 +182,7 @@ in
|
||||||
home.file.".profile".text = ''
|
home.file.".profile".text = ''
|
||||||
# -*- mode: sh -*-
|
# -*- mode: sh -*-
|
||||||
|
|
||||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||||
|
|
||||||
${sessionVarsStr}
|
${sessionVarsStr}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ let
|
||||||
dag = config.lib.dag;
|
dag = config.lib.dag;
|
||||||
|
|
||||||
# Indexes info files found in this location
|
# 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
|
# Installs this package -- the interactive just means that it
|
||||||
# includes the curses `info` program. We also use `install-info`
|
# includes the curses `info` program. We also use `install-info`
|
||||||
|
|
|
@ -314,7 +314,7 @@ in
|
||||||
}
|
}
|
||||||
|
|
||||||
# Environment variables
|
# Environment variables
|
||||||
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
|
. "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
|
||||||
${envVarsStr}
|
${envVarsStr}
|
||||||
|
|
||||||
${optionalString cfg.oh-my-zsh.enable ''
|
${optionalString cfg.oh-my-zsh.enable ''
|
||||||
|
|
|
@ -99,7 +99,7 @@ in
|
||||||
|
|
||||||
basePaths = [
|
basePaths = [
|
||||||
"/run/current-system/sw"
|
"/run/current-system/sw"
|
||||||
"${config.home.homeDirectory}/.nix-profile"
|
config.home.profileDirectory
|
||||||
cfg.iconTheme.package
|
cfg.iconTheme.package
|
||||||
] ++ optional useCustomTheme hicolorTheme.package;
|
] ++ optional useCustomTheme hicolorTheme.package;
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Environment = "PATH=%h/.nix-profile/bin";
|
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||||
ExecStart = "${package}/bin/flameshot";
|
ExecStart = "${package}/bin/flameshot";
|
||||||
Restart = "on-abort";
|
Restart = "on-abort";
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,7 +41,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Environment = "PATH=%h/.nix-profile/bin";
|
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||||
ExecStart = "${package}/lib/libexec/kdeconnectd";
|
ExecStart = "${package}/lib/libexec/kdeconnectd";
|
||||||
Restart = "on-abort";
|
Restart = "on-abort";
|
||||||
};
|
};
|
||||||
|
@ -64,7 +64,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Environment = "PATH=%h/.nix-profile/bin";
|
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||||
ExecStart = "${package}/bin/kdeconnect-indicator";
|
ExecStart = "${package}/bin/kdeconnect-indicator";
|
||||||
Restart = "on-abort";
|
Restart = "on-abort";
|
||||||
};
|
};
|
||||||
|
|
|
@ -137,7 +137,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Environment = "PATH=%h/.nix-profile/bin";
|
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||||
ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon ${mpdConf}";
|
ExecStart = "${pkgs.mpd}/bin/mpd --no-daemon ${mpdConf}";
|
||||||
Type = "notify";
|
Type = "notify";
|
||||||
ExecStartPre = ''${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p '${cfg.dataDir}' '${cfg.playlistDirectory}'"'';
|
ExecStartPre = ''${pkgs.bash}/bin/bash -c "${pkgs.coreutils}/bin/mkdir -p '${cfg.dataDir}' '${cfg.playlistDirectory}'"'';
|
||||||
|
|
|
@ -18,7 +18,7 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Environment = "PATH=%h/.nix-profile/bin";
|
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||||
ExecStart = "${pkgs.owncloud-client}/bin/owncloud";
|
ExecStart = "${pkgs.owncloud-client}/bin/owncloud";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
Service = {
|
Service = {
|
||||||
Environment = "PATH=%h/.nix-profile/bin";
|
Environment = "PATH=${config.home.profileDirectory}/bin";
|
||||||
ExecStart = "${pkgs.qsyncthingtray}/bin/QSyncthingTray";
|
ExecStart = "${pkgs.qsyncthingtray}/bin/QSyncthingTray";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
home.file.".xprofile".text = ''
|
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
|
if [[ -e "$HOME/.profile" ]]; then
|
||||||
. "$HOME/.profile"
|
. "$HOME/.profile"
|
||||||
|
|
Loading…
Reference in a new issue