diff --git a/flake.nix b/flake.nix index 99a293a..3deac61 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,7 @@ ./machines/katana.nix #machine specific configuration "speccon18" #default user [ - # hyprland.nixosModules.default + ./modules/system/desktop-environments/tuigreet.nix ./modules/system/desktop-environments/hyprland.nix ./hosts/katana/default.nix ./hosts/katana/networkd.nix diff --git a/hosts/katana/default.nix b/hosts/katana/default.nix index f75f5af..b6c59a0 100644 --- a/hosts/katana/default.nix +++ b/hosts/katana/default.nix @@ -60,6 +60,11 @@ options = "--delete-older-than 7d"; }; }; - speccon18.desktop.hyprland.enable = true; - speccon18.desktop.gnome.enable = false; + speccon18 = { + desktop = { + hyprland.enable = true; + gnome.enable = false; + displayManager.tuigreet.enable = true; + }; + }; } \ No newline at end of file diff --git a/modules/home-manager/hyprland.nix b/modules/home-manager/hyprland.nix index 7eddf63..b3f8329 100644 --- a/modules/home-manager/hyprland.nix +++ b/modules/home-manager/hyprland.nix @@ -10,6 +10,7 @@ exec-once=waybar exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP exec-once=mako + monitor=,highres,auto,1 ''; }; } diff --git a/modules/system/desktop-environments/tuigreet.nix b/modules/system/desktop-environments/tuigreet.nix new file mode 100644 index 0000000..04119af --- /dev/null +++ b/modules/system/desktop-environments/tuigreet.nix @@ -0,0 +1,45 @@ +{config,lib,pkgs,...}: +let + inherit (lib) mkEnableOption mkOption optionalString mkIf types; + dmcfg = config.services.xserver.displayManager; + cfg = config.speccon18.desktop.displayManager.tuigreet; + gduser = config.services.greetd.settings.default_session.user; +in { + options.speccon18.desktop.displayManager.tuigreet = { + enable = mkEnableOption "enables tuigreet"; + args = mkOption { + default = "--time --asterisks --remember -s ${dmcfg.sessionData.desktops}/share/wayland-sessions:${dmcfg.sessionData.desktops}/share/xsessions"; + type = types.str; + }; + }; + config = mkIf cfg.enable { + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet ${cfg.args}"; + user = "greeter"; + }; + }; + }; + # this is a life saver. + # literally no documentation about this anywhere. + # might be good to write about this... + # https://www.reddit.com/r/NixOS/comments/u0cdpi/tuigreet_with_xmonad_how/ + systemd = { + services.greetd.serviceConfig = { + Type = "idle"; + StandardInput = "tty"; + StandardOutput = "tty"; + StandardError = "journal"; # Without this errors will spam on screen + # Without these bootlogs will spam on screen + TTYReset = true; + TTYVHangup = true; + TTYVTDisallocate = true; + }; + tmpfiles.rules = [ + "d /var/cache/tuigreet/ 0755 greeter ${gduser} - -" + ]; + }; + }; +} \ No newline at end of file