diff --git a/hosts/luci/home-config.nix b/hosts/luci/home-config.nix index 2d28771..601195e 100644 --- a/hosts/luci/home-config.nix +++ b/hosts/luci/home-config.nix @@ -29,7 +29,7 @@ accounts.dav.enable = true; desktop.sway = { enable = true; - kanshi = true; + kanshi.enable = true; wallpapers.lockscreen = "${./files/lockscreen.png}"; wallpapers.desktop = "${./files/wallpaper.png} center #000000"; waybar = { diff --git a/hosts/morty/home-config.nix b/hosts/morty/home-config.nix index 5fff91e..435106c 100644 --- a/hosts/morty/home-config.nix +++ b/hosts/morty/home-config.nix @@ -46,7 +46,20 @@ desktop.sway = { enable = true; wallpapers.lockscreen = "${./files/lockscreen.png}"; - kanshi = true; + kanshi = { + enable = true; + standalone = { + profile.name = "standalone"; + profile.outputs = [ + { + criteria = "eDP-1"; + scale = 1.325; + transform = "90"; + status = "enable"; + } + ]; + }; + }; waybar = { laptop = true; gpuThermal.enable = false; diff --git a/hosts/morty/includes/home-manager.nix b/hosts/morty/includes/home-manager.nix index aedd064..3ef0de6 100644 --- a/hosts/morty/includes/home-manager.nix +++ b/hosts/morty/includes/home-manager.nix @@ -22,11 +22,5 @@ "pointer_accel" = "0.3"; }; }; - wayland.windowManager.sway.config.output = { - "eDP-1" = { - transform = "90"; - scale = "1.3"; - }; - }; sops.age.keyFile = "/home/ephase/.config/sops/age/keys.txt"; } diff --git a/hosts/rick/home-config.nix b/hosts/rick/home-config.nix index 6fc8d29..fe5a66f 100644 --- a/hosts/rick/home-config.nix +++ b/hosts/rick/home-config.nix @@ -38,7 +38,7 @@ gaming.lutris.enable = false; desktop.sway = { enable = true; - kanshi = false; + kanshi.enable = false; swaylock.useNullPackage = true; wallpapers.lockscreen = "${./files/lockscreen.png}"; wallpapers.desktop = "${./files/background.png} fill #000000"; diff --git a/hosts/work/home-config.nix b/hosts/work/home-config.nix index 262c650..8bfb54b 100644 --- a/hosts/work/home-config.nix +++ b/hosts/work/home-config.nix @@ -36,7 +36,28 @@ }; desktop.sway = { enable = true; - kanshi = true; + kanshi = { + enable = true; + profiles = [ + + { + profile.name = "work"; + profile.outputs = [ + { + criteria = "Iiyama North America PL2792QN 1179214201663"; + mode = "2560x1440"; + position = "1450,0"; + scale = 1.15; + } + { + criteria = "BOE 0x0A95 Unknown"; + mode = "1920x1080"; + position = "0,0"; + scale = 1.325; + } + ]; + } + ]; swaylock.useNullPackage = true; waybar = { laptop = true; diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 25d030b..efdc0c8 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -10,12 +10,66 @@ in { options.modules.desktop.sway = { enable = mkEnableOption "enable Sway Windows Manager"; - kanshi = mkOption { + kanshi.enable = mkOption { type = types.bool; default = false; description = "configure laptop mode"; }; + kanshi.standalone = mkOption { + type = types.attrs; + default = { + profile.name = "standalone"; + profile.outputs = [ + { + criteria = "eDP-1"; + scale = 1.325; + status = "enable"; + } + ]; + }; + description = '' + Default configuration for laptop internal screen when no others screen + are connected. + ''; + }; + kanshi.home = mkOption { + type = types.attrs; + default = { + profile.name = "home"; + profile.outputs = [ + { + criteria = "Iiyama North America PL2792UH 1166310803122"; + mode = "3840x2160"; + position = "1235,0"; + scale = 1.75; + } + { + criteria = "Iiyama North America PL2792UH 1176923201598"; + mode = "3840x2160"; + position = "0,0"; + transform = "90"; + scale = 1.75; + } + { + criteria = "eDP-1"; + status = "disable"; + } + ]; + }; + description = '' + Default home configuration use on most of my laptops + ''; + }; + + kanshi.others = mkOption { + type = types.listOf types.attrs; + default = []; + description = '' + Kanshi profile to use specifically for host + ''; + }; + swaylock.useNullPackage = mkOption { type = types.bool; default = false; diff --git a/modules/home-manager/desktop/sway/includes/kanshi.nix b/modules/home-manager/desktop/sway/includes/kanshi.nix index 61cc764..b3cd36d 100644 --- a/modules/home-manager/desktop/sway/includes/kanshi.nix +++ b/modules/home-manager/desktop/sway/includes/kanshi.nix @@ -3,61 +3,18 @@ lib, ... }: -with lib; { - config = mkIf config.modules.desktop.sway.enable { +with lib; let + cfg = config.modules.desktop.sway; +in { + config = mkIf cfg.enable { services.kanshi = { - enable = config.modules.desktop.sway.kanshi; - settings = [ - { - profile.name = "standalone"; - profile.outputs = [ - { - criteria = "eDP-1"; - scale = 1.33; - status = "enable"; - } - ]; - } - { - profile.name = "home"; - profile.outputs = [ - { - criteria = "Iiyama North America PL2792UH 1166310803122"; - mode = "3840x2160"; - position = "1235,0"; - scale = 1.75; - } - { - criteria = "Iiyama North America PL2792UH 1176923201598"; - mode = "3840x2160"; - position = "0,0"; - transform = "90"; - scale = 1.75; - } - { - criteria = "eDP-1"; - status = "disable"; - } - ]; - } - { - profile.name = "work"; - profile.outputs = [ - { - criteria = "Iiyama North America PL2792QN 1179214201663"; - mode = "2560x1440"; - position = "1450,0"; - scale = 1.15; - } - { - criteria = "BOE 0x0A95 Unknown"; - mode = "1920x1080"; - position = "0,0"; - scale = 1.325; - } - ]; - } - ]; + enable = cfg.kanshi.enable; + settings = + [ + cfg.kanshi.standalone + cfg.kanshi.home + ] + ++ cfg.kanshi.others; }; }; }