diff --git a/flake.lock b/flake.lock index 89414fc..6f6f54e 100644 --- a/flake.lock +++ b/flake.lock @@ -1974,6 +1974,7 @@ "treefmt-nix": "treefmt-nix_4", "trok": "trok", "tshell": "tshell", + "twm": "twm", "vicinae-extensions": "vicinae-extensions", "voxtype": "voxtype", "wezterm-flake": "wezterm-flake" @@ -2486,6 +2487,21 @@ "type": "github" } }, + "twm": { + "locked": { + "lastModified": 1789847958, + "narHash": "sha256-0XZpBvmt677u2zqy53OI2gBtkJCOtH2lxUAgv3Lvnxc=", + "owner": "tuxdotrs", + "repo": "twm", + "rev": "e3352d44ce24e3319901c4eb30a0758cb0fb6171", + "type": "github" + }, + "original": { + "owner": "tuxdotrs", + "repo": "twm", + "type": "github" + } + }, "utils": { "inputs": { "systems": "systems" diff --git a/flake.nix b/flake.nix index a1c3f6f..310fee3 100644 --- a/flake.nix +++ b/flake.nix @@ -95,5 +95,6 @@ opencode.url = "github:anomalyco/opencode"; serpantinum.url = "github:ilyamiro/serpantinum"; llm-agents.url = "github:numtide/llm-agents.nix"; + twm.url = "github:tuxdotrs/twm"; }; } diff --git a/modules/flake/overlays.nix b/modules/flake/overlays.nix index 9caa356..9fb8284 100644 --- a/modules/flake/overlays.nix +++ b/modules/flake/overlays.nix @@ -39,6 +39,7 @@ nur = inputs.nur.overlays.default; copyparty = inputs.copyparty.overlays.default; llm-agents = inputs.llm-agents.overlays.shared-nixpkgs; + twm = inputs.twm.overlays.default; }; perSystem = {system, ...}: let diff --git a/modules/hm/desktop/hyprland.nix b/modules/hm/desktop/hyprland.nix index 23f5485..aaec5ad 100644 --- a/modules/hm/desktop/hyprland.nix +++ b/modules/hm/desktop/hyprland.nix @@ -1,43 +1,58 @@ { flake.modules.homeManager.desktop = { config, + lib, pkgs, ... - }: { - # TODO: Hyprland 0.55 switched to Lua-based configuration. - # HM module is updated but I'm too lazy at this point so we symlink our config instead. - wayland.windowManager.hyprland = { - enable = true; - package = null; - portalPackage = null; - xwayland.enable = true; - configType = "hyprlang"; - systemd.variables = ["--all"]; + }: + with lib; let + cfg = config.tnix.desktop.hyprland; + in { + options.tnix.desktop.hyprland = { + enable = mkEnableOption "tux's Hyprland"; + + monitorConfig = mkOption { + type = types.lines; + default = ""; + description = "Hyprland monitor configuration"; + }; + }; + + config = mkIf cfg.enable { + wayland.windowManager.hyprland = { + enable = true; + package = null; + portalPackage = null; + xwayland.enable = true; + configType = "hyprlang"; + systemd.variables = ["--all"]; + }; + + home.file = { + ".config/hypr" = { + recursive = true; + source = pkgs.twm.hyprland; + }; + ".config/hypr/config/monitors.lua".text = cfg.monitorConfig; + }; + + home.packages = with pkgs; [ + ags + awww + grim + slurp + hyprshot + wl-clipboard + wl-screenrec + omasnap + (writeShellScriptBin "hypr-screenshot" '' + hyprshot -m region -r ppm - | satty --filename - + '') + + (writeShellScriptBin "hypr-screenrecord" '' + wl-screenrec -g "$(slurp)" + '') + ]; + }; }; - - home.file = { - ".config/hypr/config".source = - config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/Projects/hypr/config"; - ".config/hypr/hyprland.lua".source = - config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/Projects/hypr/hyprland.lua"; - }; - - home.packages = with pkgs; [ - ags - awww - grim - slurp - hyprshot - wl-clipboard - wl-screenrec - omasnap - (writeShellScriptBin "hypr-screenshot" '' - hyprshot -m region -r ppm - | satty --filename - - '') - - (writeShellScriptBin "hypr-screenrecord" '' - wl-screenrec -g "$(slurp)" - '') - ]; - }; } diff --git a/modules/hosts/canopus/home.nix b/modules/hosts/canopus/home.nix index faca549..0a4c7a5 100644 --- a/modules/hosts/canopus/home.nix +++ b/modules/hosts/canopus/home.nix @@ -6,6 +6,18 @@ tnix = { desktop = { + hyprland = { + enable = true; + monitorConfig = '' + hl.monitor({ + output = "eDP-1", + mode = "2560x1440@165", + position = "0x0", + scale = "1", + }) + ''; + }; + mangowm = { enable = true; monitorRule = [ diff --git a/modules/hosts/sirius/home.nix b/modules/hosts/sirius/home.nix index ac8fdf8..89107e7 100644 --- a/modules/hosts/sirius/home.nix +++ b/modules/hosts/sirius/home.nix @@ -6,6 +6,34 @@ tnix = { desktop = { + hyprland = { + enable = true; + monitorConfig = '' + hl.monitor({ + output = "DP-2", + mode = "2560x1440@144", + position = "0x0", + scale = "1", + transform = 1, + }) + + hl.monitor({ + output = "DP-3", + mode = "2560x1440@144", + position = "1440x0", + scale = "1", + }) + + hl.monitor({ + output = "DP-1", + mode = "1920x1080@144", + position = "4000x0", + scale = "1", + transform = 3, + }) + ''; + }; + mangowm = { enable = true; monitorRule = [