diff --git a/README.md b/README.md index 66550eb..cf7a4ea 100644 --- a/README.md +++ b/README.md @@ -14,17 +14,17 @@ Hey, you. This is my nixos configurations. - david@Tytonidae -| Specialisation | DE / WM | Shell | Editor | Terminal | Launcher | Browser | DM | -| -------------- | --------- | ----------- | ----------- | -------- | --------------- | ------- | -------------- | -| default | niri | fish + bash | helix + zed | ghostty | fuzzel | firefox | gdm | -| cosmic | cosmic de | fish + bash | helix + zed | ghostty | cosmic-launcher | firefox | cosmic-greeter | -| kde | kde | fish + bash | helix + zed | ghostty | - | firefox | sddm | +| Specialisation | DE / WM | Shell | Editor | Terminal | Launcher | Browser | DM | +| -------------- | --------- | ----------- | ----------- | -------- | --------------- | ------- | ---------------- | +| default | niri | fish + bash | helix + zed | ghostty | fuzzel | firefox | greetd + regreet | +| cosmic | cosmic de | fish + bash | helix + zed | ghostty | cosmic-launcher | firefox | cosmic-greeter | +| kde | kde | fish + bash | helix + zed | ghostty | - | firefox | sddm | - david@Akun -| Specialisation | DE / WM | Shell | Editor | Terminal | Launcher | Browser | DM | -| -------------- | ------- | ----------- | ----------- | -------- | -------- | ------- | -------------- | -| default | cosmic | fish + bash | helix + zed | ghostty | - | firefox | cosmic-greeter | +| Specialisation | DE / WM | Shell | Editor | Terminal | Launcher | Browser | DM | +| -------------- | ------- | ----------- | ----------- | -------- | -------- | ------- | ---------------- | +| default | niri | fish + bash | helix + zed | ghostty | - | firefox | greetd + regreet | - alice@Cape diff --git a/nixos/configurations/Akun/default.nix b/nixos/configurations/Akun/default.nix index 6c1788a..4989924 100644 --- a/nixos/configurations/Akun/default.nix +++ b/nixos/configurations/Akun/default.nix @@ -1,5 +1,6 @@ {pkgs, ...}: { imports = [ + ./gui.nix ./hardware-configuration.nix ./stylix.nix ./users @@ -21,7 +22,6 @@ kanata.enable = true; tailscale.enable = true; }; - gui.enabled = "niri"; }; programs.gnupg.agent = { enable = true; diff --git a/nixos/configurations/Akun/gui.nix b/nixos/configurations/Akun/gui.nix new file mode 100644 index 0000000..53a3b5d --- /dev/null +++ b/nixos/configurations/Akun/gui.nix @@ -0,0 +1,20 @@ +{...}: let + extraConfig = '' + output "eDP-1" { + mode "1920x1200@60.018" + scale 1.0 + focus-at-startup + position x=0 y=0 + transform "normal" + } + window-rule { + match app-id="apps.regreet" + open-on-output "eDP-1" + } + ''; +in { + youthlic.gui = { + enabled = "niri"; + niri.extraConfig = extraConfig; + }; +} diff --git a/nixos/configurations/Tytonidae/default.nix b/nixos/configurations/Tytonidae/default.nix index 5bcc8e8..f19f633 100644 --- a/nixos/configurations/Tytonidae/default.nix +++ b/nixos/configurations/Tytonidae/default.nix @@ -2,6 +2,7 @@ lib, pkgs, inputs, + config, ... }: { imports = @@ -11,6 +12,7 @@ ++ [ ./users ./stylix.nix + ./gui.nix # Include the hardware related config ./hardware-configuration.nix @@ -44,7 +46,6 @@ owncast.enable = true; minio.enable = true; }; - gui.enabled = "niri"; }; # specialisation = { diff --git a/nixos/configurations/Tytonidae/gui.nix b/nixos/configurations/Tytonidae/gui.nix new file mode 100644 index 0000000..fc9c3f0 --- /dev/null +++ b/nixos/configurations/Tytonidae/gui.nix @@ -0,0 +1,26 @@ +{pkgs, ...}: let + extraConfig = '' + output "DP-1" { + mode "2560x1440@169.900" + scale 1.0 + position x=0 y=0 + transform "normal" + focus-at-startup + } + output "eDP-1" { + mode "2560x1440@165.003" + scale 1.5 + position x=2560 y=0 + transform "normal" + } + window-rule { + match app-id="apps.regreet" + open-on-output "DP-1" + } + ''; +in { + youthlic.gui = { + enabled = "niri"; + niri.extraConfig = extraConfig; + }; +} diff --git a/nixos/modules/gui/niri.nix b/nixos/modules/gui/niri.nix index dc42cda..faeec95 100644 --- a/nixos/modules/gui/niri.nix +++ b/nixos/modules/gui/niri.nix @@ -6,6 +6,13 @@ }: let cfg = config.youthlic.gui; in { + options = { + youthlic.gui.niri = { + extraConfig = lib.mkOption { + type = lib.types.str; + }; + }; + }; config = lib.mkIf (cfg.enabled == "niri") { qt = { enable = true; @@ -61,20 +68,49 @@ in { hardware.bluetooth = { enable = true; }; - services.xserver = { - enable = true; - xkb = { - layout = "cn"; - variant = ""; - }; - displayManager.gdm = { + services = { + greetd = let + niriConfig = pkgs.writeText "greetd-niri-config.kdl" ('' + binds {} + hotkey-overlay { + skip-at-startup + } + gestures { + hot-corners { + off + } + } + spawn-at-startup "${lib.getExe pkgs.swaybg}" "-i" "${config.stylix.image}" + '' + + config.youthlic.gui.niri.extraConfig); + in { enable = true; - wayland = true; + settings = { + default_session = { + command = "env GTK_USE_PORTAL=0 GDK_DEBUG=no-portals ${lib.getExe' config.programs.niri.package "niri"} --config ${niriConfig} -- ${lib.getExe config.programs.regreet.package}"; + }; + }; + }; + xserver = { + enable = true; + xkb = { + layout = "us"; + variant = ""; + }; + # displayManager.gdm = { + # enable = true; + # wayland = true; + # }; }; }; - programs.niri = { - enable = true; - package = pkgs.niri-unstable; + programs = { + regreet = { + enable = true; + }; + niri = { + enable = true; + package = pkgs.niri-unstable; + }; }; }; }