User activation scripts instead of env extraInit
This commit is contained in:
parent
c6c6e18036
commit
a30af3f837
|
@ -41,7 +41,6 @@
|
||||||
cc.enable = true;
|
cc.enable = true;
|
||||||
common-lisp.enable = true;
|
common-lisp.enable = true;
|
||||||
rust.enable = true;
|
rust.enable = true;
|
||||||
scala.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
media = {
|
media = {
|
||||||
|
|
|
@ -38,7 +38,7 @@
|
||||||
# For my intuos4 pro. Doesn't work for cintiqs.
|
# For my intuos4 pro. Doesn't work for cintiqs.
|
||||||
services.xserver.wacom.enable = true;
|
services.xserver.wacom.enable = true;
|
||||||
# TODO Move this to udev
|
# TODO Move this to udev
|
||||||
# my.init = ''
|
# system.userActivationScripts.wacom.text = ''
|
||||||
# # lock tablet to main display
|
# # lock tablet to main display
|
||||||
# if xinput list --id-only "Wacom Intuos Pro S Pen stylus" 2>&1 >/dev/null; then
|
# if xinput list --id-only "Wacom Intuos Pro S Pen stylus" 2>&1 >/dev/null; then
|
||||||
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen stylus") DVI-I-1
|
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen stylus") DVI-I-1
|
||||||
|
|
|
@ -49,9 +49,7 @@
|
||||||
INPUTRC = "$XDG_CACHE_HOME/readline/inputrc";
|
INPUTRC = "$XDG_CACHE_HOME/readline/inputrc";
|
||||||
LESSHISTFILE = "$XDG_CACHE_HOME/lesshst";
|
LESSHISTFILE = "$XDG_CACHE_HOME/lesshst";
|
||||||
WGETRC = "$XDG_CACHE_HOME/wgetrc";
|
WGETRC = "$XDG_CACHE_HOME/wgetrc";
|
||||||
XAUTHORITY = "/tmp/Xauthority";
|
|
||||||
};
|
};
|
||||||
my.init = "[ -e ~/.Xauthority ] && mv -f ~/.Xauthority \"$XAUTHORITY\"";
|
|
||||||
|
|
||||||
# Prevents ~/.esd_auth files by disabling the esound protocol module for
|
# Prevents ~/.esd_auth files by disabling the esound protocol module for
|
||||||
# pulseaudio, which I likely don't need. Is there a better way?
|
# pulseaudio, which I likely don't need. Is there a better way?
|
||||||
|
@ -67,7 +65,7 @@
|
||||||
"${paConfigFile}/default.pa";
|
"${paConfigFile}/default.pa";
|
||||||
|
|
||||||
# Clean up leftovers, as much as we can
|
# Clean up leftovers, as much as we can
|
||||||
system.activationScripts.clearHome = ''
|
system.userActivationScripts.cleanupHome = ''
|
||||||
pushd /home/${config.my.username}
|
pushd /home/${config.my.username}
|
||||||
rm -rf .compose-cache .nv .pki .dbus .fehbg
|
rm -rf .compose-cache .nv .pki .dbus .fehbg
|
||||||
[ -s .xsession-errors ] || rm -f .xsession-errors*
|
[ -s .xsession-errors ] || rm -f .xsession-errors*
|
||||||
|
|
|
@ -35,13 +35,6 @@ in {
|
||||||
then concatMapStringsSep ":" (x: toString x) v
|
then concatMapStringsSep ":" (x: toString x) v
|
||||||
else (toString v));
|
else (toString v));
|
||||||
};
|
};
|
||||||
init = mkOption {
|
|
||||||
type = types.lines;
|
|
||||||
description = ''
|
|
||||||
An init script that runs after the environment has been rebuilt or
|
|
||||||
booted. Anything done here should be idempotent and inexpensive.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
alias = mkOption {
|
alias = mkOption {
|
||||||
type = with types; nullOr (attrsOf (nullOr (either str path)));
|
type = with types; nullOr (attrsOf (nullOr (either str path)));
|
||||||
|
@ -78,8 +71,10 @@ in {
|
||||||
environment.extraInit =
|
environment.extraInit =
|
||||||
let exportLines = mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.my.env;
|
let exportLines = mapAttrsToList (n: v: "export ${n}=\"${v}\"") config.my.env;
|
||||||
in ''
|
in ''
|
||||||
|
export XAUTHORITY=/tmp/Xauthority
|
||||||
|
[ -e ~/.Xauthority ] && mv -f ~/.Xauthority "$XAUTHORITY"
|
||||||
|
|
||||||
${concatStringsSep "\n" exportLines}
|
${concatStringsSep "\n" exportLines}
|
||||||
${config.my.init}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# I avoid programs.zsh.*Init variables because they initialize too soon. My
|
# I avoid programs.zsh.*Init variables because they initialize too soon. My
|
||||||
|
|
|
@ -17,7 +17,8 @@ with lib;
|
||||||
config = mkIf config.modules.desktop.apps.vm.enable {
|
config = mkIf config.modules.desktop.apps.vm.enable {
|
||||||
virtualisation.virtualbox.host = {
|
virtualisation.virtualbox.host = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableExtensionPack = true; # urg, takes so long to build
|
# urg, takes so long to build, but needed for macOS guest
|
||||||
|
enableExtensionPack = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
my.user.extraGroups = [ "vboxusers" ];
|
my.user.extraGroups = [ "vboxusers" ];
|
||||||
|
|
|
@ -16,9 +16,10 @@ in {
|
||||||
pinentry
|
pinentry
|
||||||
];
|
];
|
||||||
env.GNUPGHOME = "$XDG_CONFIG_HOME/gnupg";
|
env.GNUPGHOME = "$XDG_CONFIG_HOME/gnupg";
|
||||||
init = "mkdir -p \"$GNUPGHOME\" -m 700";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
system.activationScripts.setupGnuPG = "mkdir -p \"${config.my.env.GNUPGHOME}\" -m 700";
|
||||||
|
|
||||||
programs.gnupg.agent = {
|
programs.gnupg.agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableSSHSupport = true;
|
enableSSHSupport = true;
|
||||||
|
|
|
@ -51,8 +51,6 @@ with lib;
|
||||||
promptInit = "";
|
promptInit = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
system.userActivationScripts.cleanupZgen = ''
|
system.userActivationScripts.cleanupZgen = "rm -fv $XDG_CACHE_HOME/zsh/*";
|
||||||
rm -fv $XDG_CACHE_HOME/zsh/*
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue