aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/xsession.nix
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2020-02-03 10:05:30 +0100
committerKatharina Fey <kookie@spacekookie.de>2020-02-03 10:05:30 +0100
commitc488527c95c874d3b8743c915173ad7bfb05d5af (patch)
tree2b874dc5606a9dff44096a5e8557f00dc52ac2b6 /home-manager/modules/xsession.nix
parent899a451e08f7d6d2c8214d119c2a0316849a0ed4 (diff)
parent6cc4fd6ede4909226cb81d3475834251ed1b7210 (diff)
Merge commit '6cc4fd6ede4909226cb81d3475834251ed1b7210'
Diffstat (limited to 'home-manager/modules/xsession.nix')
-rw-r--r--home-manager/modules/xsession.nix46
1 files changed, 19 insertions, 27 deletions
diff --git a/home-manager/modules/xsession.nix b/home-manager/modules/xsession.nix
index e1cf9942e7c..d32c2849163 100644
--- a/home-manager/modules/xsession.nix
+++ b/home-manager/modules/xsession.nix
@@ -6,9 +6,7 @@ let
cfg = config.xsession;
-in
-
-{
+in {
meta.maintainers = [ maintainers.rycee ];
options = {
@@ -89,30 +87,25 @@ in
systemd.user = {
services = mkIf (config.home.keyboard != null) {
- setxkbmap = {
+ setxkbmap = {
Unit = {
Description = "Set up keyboard in X";
After = [ "graphical-session-pre.target" ];
PartOf = [ "graphical-session.target" ];
};
- Install = {
- WantedBy = [ "graphical-session.target" ];
- };
+ Install = { WantedBy = [ "graphical-session.target" ]; };
Service = {
Type = "oneshot";
RemainAfterExit = true;
- ExecStart =
- with config.home.keyboard;
+ ExecStart = with config.home.keyboard;
let
- args =
- optional (layout != null) "-layout '${layout}'"
+ args = optional (layout != null) "-layout '${layout}'"
++ optional (variant != null) "-variant '${variant}'"
++ optional (model != null) "-model '${model}'"
++ map (v: "-option '${v}'") options;
- in
- "${pkgs.xorg.setxkbmap}/bin/setxkbmap ${toString args}";
+ in "${pkgs.xorg.setxkbmap}/bin/setxkbmap ${toString args}";
};
};
};
@@ -128,25 +121,24 @@ in
};
home.file.".xprofile".text = ''
- . "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
+ . "${config.home.profileDirectory}/etc/profile.d/hm-session-vars.sh"
- if [ -e "$HOME/.profile" ]; then
- . "$HOME/.profile"
- fi
+ if [ -e "$HOME/.profile" ]; then
+ . "$HOME/.profile"
+ fi
- # If there are any running services from a previous session.
- # Need to run this in xprofile because the NixOS xsession
- # script starts up graphical-session.target.
- systemctl --user stop graphical-session.target graphical-session-pre.target
+ # If there are any running services from a previous session.
+ # Need to run this in xprofile because the NixOS xsession
+ # script starts up graphical-session.target.
+ systemctl --user stop graphical-session.target graphical-session-pre.target
- ${optionalString (cfg.importedVariables != []) (
- "systemctl --user import-environment "
- + toString (unique cfg.importedVariables)
- )}
+ ${optionalString (cfg.importedVariables != [ ])
+ ("systemctl --user import-environment "
+ + toString (unique cfg.importedVariables))}
- ${cfg.profileExtra}
+ ${cfg.profileExtra}
- export HM_XPROFILE_SOURCED=1
+ export HM_XPROFILE_SOURCED=1
'';
home.file.${cfg.scriptPath} = {