tv xmonad: cleanup service definition
This commit is contained in:
parent
8ce6ab8401
commit
761ce9cefd
@ -48,34 +48,35 @@ in {
|
|||||||
|
|
||||||
systemd.services.xmonad = let
|
systemd.services.xmonad = let
|
||||||
xmonad = "${pkgs.haskellPackages.xmonad-tv}/bin/xmonad";
|
xmonad = "${pkgs.haskellPackages.xmonad-tv}/bin/xmonad";
|
||||||
|
xmonad-prepare = pkgs.writeDash "xmonad-prepare" ''
|
||||||
|
${pkgs.coreutils}/bin/mkdir -p "$XMONAD_CACHE_DIR"
|
||||||
|
${pkgs.coreutils}/bin/mkdir -p "$XMONAD_CONFIG_DIR"
|
||||||
|
${pkgs.coreutils}/bin/mkdir -p "$XMONAD_DATA_DIR"
|
||||||
|
'';
|
||||||
|
xmonad-ready = pkgs.writeDash "xmonad-ready" ''
|
||||||
|
{
|
||||||
|
${pkgs.xorg.xhost}/bin/xhost +SI:localuser:${cfg.user.name}
|
||||||
|
${pkgs.xorg.xhost}/bin/xhost -LOCAL:
|
||||||
|
} &
|
||||||
|
${pkgs.xorg.xmodmap}/bin/xmodmap ${import ./Xmodmap.nix args} &
|
||||||
|
${pkgs.xorg.xrdb}/bin/xrdb ${import ./Xresources.nix args} &
|
||||||
|
${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' &
|
||||||
|
wait
|
||||||
|
'';
|
||||||
in {
|
in {
|
||||||
wantedBy = [ "graphical.target" ];
|
wantedBy = [ "graphical.target" ];
|
||||||
requires = [ "xserver.service" ];
|
requires = [ "xserver.service" ];
|
||||||
environment = {
|
environment = {
|
||||||
DISPLAY = ":${toString config.services.xserver.display}";
|
DISPLAY = ":${toString config.services.xserver.display}";
|
||||||
|
|
||||||
FZMENU_FZF_DEFAULT_OPTS = toString [
|
FZMENU_FZF_DEFAULT_OPTS = toString [
|
||||||
"--color=dark,border:126,bg+:090"
|
"--color=dark,border:126,bg+:090"
|
||||||
"--inline-info"
|
"--inline-info"
|
||||||
];
|
];
|
||||||
|
|
||||||
XMONAD_CACHE_DIR = cfg.cacheDir;
|
XMONAD_CACHE_DIR = cfg.cacheDir;
|
||||||
XMONAD_CONFIG_DIR = cfg.configDir;
|
XMONAD_CONFIG_DIR = cfg.configDir;
|
||||||
XMONAD_DATA_DIR = cfg.dataDir;
|
XMONAD_DATA_DIR = cfg.dataDir;
|
||||||
|
XMONAD_STARTUP_HOOK = xmonad-ready;
|
||||||
XMONAD_STARTUP_HOOK = pkgs.writeDash "xmonad-startup-hook" ''
|
XMONAD_WORKSPACES0_FILE = pkgs.writeJSON "xmonad-workspaces0.json" [
|
||||||
{
|
|
||||||
${pkgs.xorg.xhost}/bin/xhost +SI:localuser:${cfg.user.name}
|
|
||||||
${pkgs.xorg.xhost}/bin/xhost -LOCAL:
|
|
||||||
} &
|
|
||||||
${pkgs.xorg.xmodmap}/bin/xmodmap ${import ./Xmodmap.nix args} &
|
|
||||||
${pkgs.xorg.xrdb}/bin/xrdb ${import ./Xresources.nix args} &
|
|
||||||
${pkgs.xorg.xsetroot}/bin/xsetroot -solid '#1c1c1c' &
|
|
||||||
wait
|
|
||||||
'';
|
|
||||||
|
|
||||||
# XXX JSON is close enough :)
|
|
||||||
XMONAD_WORKSPACES0_FILE = pkgs.writeText "xmonad.workspaces0" (toJSON [
|
|
||||||
"Dashboard" # we start here
|
"Dashboard" # we start here
|
||||||
"23"
|
"23"
|
||||||
"cr"
|
"cr"
|
||||||
@ -85,7 +86,7 @@ in {
|
|||||||
"mail"
|
"mail"
|
||||||
"stockholm"
|
"stockholm"
|
||||||
"za" "zh" "zj" "zs"
|
"za" "zh" "zj" "zs"
|
||||||
]);
|
];
|
||||||
};
|
};
|
||||||
path = [
|
path = [
|
||||||
config.tv.slock.package
|
config.tv.slock.package
|
||||||
@ -96,14 +97,10 @@ in {
|
|||||||
"/run/wrappers" # for su
|
"/run/wrappers" # for su
|
||||||
];
|
];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
SyslogIdentifier = "xmonad";
|
ExecStartPre = "@${xmonad-prepare} xmonad-prepare";
|
||||||
ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${toString [
|
ExecStart = "@${xmonad} xmonad-${currentSystem}";
|
||||||
"\${XMONAD_CACHE_DIR}"
|
|
||||||
"\${XMONAD_CONFIG_DIR}"
|
|
||||||
"\${XMONAD_DATA_DIR}"
|
|
||||||
]}";
|
|
||||||
ExecStart = "@${xmonad} xmonad-${currentSystem} ";
|
|
||||||
ExecStop = "@${xmonad} xmonad-${currentSystem} --shutdown";
|
ExecStop = "@${xmonad} xmonad-${currentSystem} --shutdown";
|
||||||
|
SyslogIdentifier = "xmonad";
|
||||||
User = cfg.user.name;
|
User = cfg.user.name;
|
||||||
WorkingDirectory = cfg.user.home;
|
WorkingDirectory = cfg.user.home;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user