Fix path to profile dir when using as nixos submodule

This commit is contained in:
Malte Brandy 2018-05-31 20:14:55 +02:00
parent 13b6955460
commit 3c6f3c29d6
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
8 changed files with 25 additions and 10 deletions

View file

@ -6,6 +6,8 @@ let
cfg = config.programs.bash;
profileDir = if config.nixosSubmodule then "${config.home.path}" else "$HOME/.nix-profile";
in
{
@ -183,7 +185,7 @@ in
home.file.".profile".text = ''
# -*- mode: sh -*-
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
. "${profileDir}/etc/profile.d/hm-session-vars.sh"
${sessionVarsStr}

View file

@ -28,8 +28,10 @@ let
dag = config.lib.dag;
profileDir = if config.nixosSubmodule then "${config.home.path}" else "$HOME/.nix-profile";
# Indexes info files found in this location
homeInfoPath = "$HOME/.nix-profile/share/info";
homeInfoPath = "${profileDir}/share/info";
# Installs this package -- the interactive just means that it
# includes the curses `info` program. We also use `install-info`

View file

@ -19,6 +19,8 @@ let
zdotdir = "$HOME/" + cfg.dotDir;
profileDir = if config.nixosSubmodule then "${config.home.path}" else "$HOME/.nix-profile";
historyModule = types.submodule ({ config, ... }: {
options = {
size = mkOption {
@ -302,7 +304,7 @@ in
}
# Environment variables
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
. "${profileDir}/etc/profile.d/hm-session-vars.sh"
${envVarsStr}
${optionalString cfg.oh-my-zsh.enable ''

View file

@ -99,7 +99,7 @@ in
basePaths = [
"/run/current-system/sw"
"${config.home.homeDirectory}/.nix-profile"
(if config.nixosSubmodule then "${config.home.path}" else "${config.home.homeDirectory}/.nix-profile")
cfg.iconTheme.package
] ++ optional useCustomTheme hicolorTheme.package;

View file

@ -6,6 +6,7 @@ let
cfg = config.services.flameshot;
package = pkgs.flameshot;
profileDir = if config.nixosSubmodule then "${config.home.path}" else "%h/.nix-profile";
in
@ -33,7 +34,7 @@ in
};
Service = {
Environment = "PATH=%h/.nix-profile/bin";
Environment = "PATH=${profileDir}/bin";
ExecStart = "${package}/bin/flameshot";
Restart = "on-abort";
};

View file

@ -2,7 +2,11 @@
with lib;
{
let
profileDir = if config.nixosSubmodule then "${config.home.path}" else "%h/.nix-profile";
in {
options = {
services.owncloud-client = {
enable = mkEnableOption "Owncloud Client";
@ -18,7 +22,7 @@ with lib;
};
Service = {
Environment = "PATH=%h/.nix-profile/bin";
Environment = "PATH=${profileDir}/bin";
ExecStart = "${pkgs.owncloud-client}/bin/owncloud";
};

View file

@ -1,8 +1,11 @@
{ config, lib, pkgs, ... }:
with lib;
let
{
profileDir = if config.nixosSubmodule then "${config.home.path}" else "%h/.nix-profile";
in {
meta.maintainers = [ maintainers.rycee ];
options = {
@ -54,7 +57,7 @@ with lib;
};
Service = {
Environment = "PATH=%h/.nix-profile/bin";
Environment = "PATH=${profileDir}/bin";
ExecStart = "${pkgs.qsyncthingtray}/bin/QSyncthingTray";
};

View file

@ -5,6 +5,7 @@ with lib;
let
cfg = config.xsession;
profileDir = if config.nixosSubmodule then "${config.home.path}" else "$HOME/.nix-profile";
in
@ -82,7 +83,7 @@ in
};
home.file.".xprofile".text = ''
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
. "${profileDir}/etc/profile.d/hm-session-vars.sh"
if [[ -e "$HOME/.profile" ]]; then
. "$HOME/.profile"