From e8d3987578181cc77bbf73051d3ca0ff48a38485 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 19 Mar 2023 15:35:02 +0100 Subject: [PATCH] profile/sway: migrate autostart --- legacy/modules/desktop-default.nix | 7 ------- profiles/sway/autostart.nix | 19 +++++++++++++++++++ profiles/sway/default.nix | 2 ++ 3 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 profiles/sway/autostart.nix diff --git a/legacy/modules/desktop-default.nix b/legacy/modules/desktop-default.nix index ac58c88..3d3cda5 100644 --- a/legacy/modules/desktop-default.nix +++ b/legacy/modules/desktop-default.nix @@ -66,11 +66,4 @@ enable = true; package = pkgs.wireshark; # enable the gui }; - - # start sway if login happens - environment.interactiveShellInit = '' - if test `tty` = /dev/tty1; then - exec sway - fi - ''; } diff --git a/profiles/sway/autostart.nix b/profiles/sway/autostart.nix new file mode 100644 index 0000000..b8678fa --- /dev/null +++ b/profiles/sway/autostart.nix @@ -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 + ''; + }; +} diff --git a/profiles/sway/default.nix b/profiles/sway/default.nix index 799ad11..4bd2014 100644 --- a/profiles/sway/default.nix +++ b/profiles/sway/default.nix @@ -4,6 +4,7 @@ let in { imports = [ + ./autostart.nix ./location.nix ./screen-sharing.nix ./theme.nix @@ -16,6 +17,7 @@ in config = lib.mkIf cfg.enable { my.profiles = { + sway-autostart.enable = true; sway-location.enable = true; sway-screen-sharing.enable = true; sway-theme.enable = true;