home-manager: fix use of `~` in paths

This commit is contained in:
Jez Cope 2020-11-10 09:08:56 +00:00
parent 55dcefab38
commit 4344d47e43
3 changed files with 17 additions and 12 deletions

View File

@ -5,6 +5,7 @@ let
util = import ./util.nix { inherit pkgs; };
hostname = lib.strings.fileContents /etc/hostname;
host-config = ./machines + "/${hostname}.nix";
h = "/home/jez";
in
{
programs.home-manager.enable = true;
@ -22,7 +23,7 @@ in
};
home.username = "jez";
home.homeDirectory = "/home/jez";
home.homeDirectory = h;
home.stateVersion = "20.09";
@ -64,18 +65,18 @@ in
];
home.sessionVariables = {
WORKON_HOME = ~/.local/lib/languages/Python/virtualenvs;
RUSTUP_HOME = ~/.local/lib/languages/Rust/rustup;
CABAL_CONFIG = ~/.config/cabal/config;
CABAL_DIR = ~/.local/lib/languages/Haskell/cabal;
WORKON_HOME = "${h}/.local/lib/languages/Python/virtualenvs";
RUSTUP_HOME = "${h}/.local/lib/languages/Rust/rustup";
CABAL_CONFIG = "${h}/.config/cabal/config";
CABAL_DIR = "${h}/.local/lib/languages/Haskell/cabal";
PASSWORD_STORE_DIR = ~/Reference/Passwords;
PASSWORD_STORE_DIR = "${h}/Reference/Passwords";
PASSWORD_STORE_KEY = "9E42CE071C4559D1";
EDITOR = pkgs.vim + /bin/vim;
TERMINFO_DIRS = lib.concatStringsSep ":" [
"~/.nix-profile/share/terminfo"
"${h}/.nix-profile/share/terminfo"
""
];
};

View File

@ -1,8 +1,9 @@
{ pkgs, lib, ... }:
{ pkgs, config, lib, ... }:
with builtins;
let
nixGL = pkgs.callPackage (fetchTarball https://github.com/guibou/nixGL/archive/master.tar.gz) { inherit pkgs; };
h = config.home.homeDirectory;
in
{
@ -10,7 +11,7 @@ in
home.file = {
".pam_environment".text = ''
XDG_DATA_DIRS=${toString ~/.nix-profile/share}:/usr/local/share:/usr/share
XDG_DATA_DIRS=${h}/.nix-profile/share:/usr/local/share:/usr/share
'';
".config/fontconfig/conf.d/10-nix-fonts.conf".text = ''
@ -24,7 +25,7 @@ in
services.mpd = {
enable = true;
musicDirectory = ~/Music/Best;
musicDirectory = h + "/Music/Best";
extraConfig = ''
audio_output {
type "pulse"

View File

@ -1,5 +1,8 @@
{ pkgs, ... }:
{ pkgs, config, ... }:
let
h = config.home.homeDirectory;
in
{
home.packages = with pkgs; [
steam minecraft
@ -7,7 +10,7 @@
services.mpd = {
enable = true;
musicDirectory = ~/Music/Best;
musicDirectory = h + "/Music/Best";
network.listenAddress = "any";
extraConfig = ''
audio_output {