profile/sway: migrate autostart

This commit is contained in:
Felix Buehler 2023-03-19 15:35:02 +01:00
parent ecf335add5
commit e8d3987578
3 changed files with 21 additions and 7 deletions

View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
let
cfg = config.my.profiles.sway-autostart;
in
{
options.my.profiles.sway-autostart = with lib; {
enable = mkEnableOption "sway-autostart profile";
};
config = lib.mkIf cfg.enable {
# start sway if login happens
environment.interactiveShellInit = ''
if test `tty` = /dev/tty1; then
exec sway
fi
'';
};
}