From 6ba57305fe6e148ff4e4c793bdaa8eba02f427d2 Mon Sep 17 00:00:00 2001 From: Nathan Gill Date: Sat, 29 Aug 2026 22:41:43 +0100 Subject: [PATCH] try switch to mangowm? --- .tack/pins.lock.json | 20 +- .tack/pins.toml | 3 + modules/home/natha/alacritty/default.nix | 12 ++ modules/home/natha/default.nix | 30 +-- modules/home/natha/mango/default.nix | 234 ++++++++++++++++++++++ modules/home/natha/modules.nix | 1 + modules/home/natha/sway/default.nix | 2 +- modules/home/natha/wl-overlay/default.nix | 16 ++ modules/system/default.nix | 1 + modules/system/mango/default.nix | 25 +++ systems/natha-76k4epg/default.nix | 4 +- systems/natha-e2hyref/default.nix | 4 +- 12 files changed, 324 insertions(+), 28 deletions(-) create mode 100644 modules/home/natha/mango/default.nix create mode 100644 modules/system/mango/default.nix diff --git a/.tack/pins.lock.json b/.tack/pins.lock.json index 7ae1280..34e4fef 100644 --- a/.tack/pins.lock.json +++ b/.tack/pins.lock.json @@ -39,13 +39,21 @@ "narHash": "sha256-emjLIjCoIo0ldFx9BXXGVXeVrxuCA4UDhwyfqCpvZ3M=", "lastModified": 1777158583 }, + "mango": { + "type": "github", + "owner": "mangowm", + "repo": "mango", + "rev": "641c36fcbbe508c46f27b435d5a68d4e9b32f59f", + "narHash": "sha256-od6lK1KOquakP/GD17fGEm1ck5EMZa/s+jhmvGrRFzk=", + "lastModified": 1787813077 + }, "nixpkgs": { "type": "github", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c27cdad491a991b11ed731760aa2ef8db0cb0410", - "narHash": "sha256-PYZq1qzCJXC2zGI0mH07vrZBsw6DRBAOX0jN1pPtqOQ=", - "lastModified": 1787814960 + "rev": "7d1a7c21a4c00ea653fc7ed5c083d261340f185f", + "narHash": "sha256-ubWQiwkhIql/lYwnfK55yKHfAkTBXie2L4iChGNHfI0=", + "lastModified": 1787874478 }, "nlock": { "type": "github", @@ -91,8 +99,8 @@ "type": "git", "url": "https://git.ngill.net/git/wl-overlay.git", "ref": "HEAD", - "rev": "195390e5ddee7e60ba5d94e24ceb4feeb2a2201d", - "narHash": "sha256-T+H2sNNqREPqZXAAagHrGQR5f6Aex+e3XcDj+bc1F1U=", - "lastModified": 1787954147 + "rev": "a3894904f7cbf0e7a515a17502ae81babcece0ed", + "narHash": "sha256-18lJgm7h0Q+v7W89wAw89VXG5wlSEFK1xQEDJxVJi1c=", + "lastModified": 1788034583 } } diff --git a/.tack/pins.toml b/.tack/pins.toml index 97b9e14..3da14e3 100644 --- a/.tack/pins.toml +++ b/.tack/pins.toml @@ -36,6 +36,9 @@ url = "ngill:wl-overlay" url = "gh:way-edges/way-edges/0.12.1" exclude_follow = ["nixpkgs"] +[inputs.mango] +url = "gh:mangowm/mango/0.16.2" + [inputs.git-hooks] url = "gh:cachix/git-hooks.nix" diff --git a/modules/home/natha/alacritty/default.nix b/modules/home/natha/alacritty/default.nix index 6e59283..b3bb66c 100644 --- a/modules/home/natha/alacritty/default.nix +++ b/modules/home/natha/alacritty/default.nix @@ -16,9 +16,21 @@ in default = true; description = "Enable alacritty configuration"; }; + + mango = mkOption { + type = types.bool; + default = config.olduser101.mango.enable; + description = "Enable Mango integration"; + }; }; config = mkIf cfg.enable { + olduser101.mango = mkIf cfg.mango { + autoStart = [ + "${pkgs.alacritty}/bin/alacritty" + ]; + }; + programs.alacritty = { enable = true; theme = "catppuccin_mocha"; diff --git a/modules/home/natha/default.nix b/modules/home/natha/default.nix index aa4b4d8..b56fe34 100644 --- a/modules/home/natha/default.nix +++ b/modules/home/natha/default.nix @@ -29,16 +29,9 @@ let packages.type = "full"; - sway.outputs = - let - bg = "${assets}/wallpapers/bars.jpg"; - in - { - eDP-1 = { - position = "0 0"; - bg = "${bg} fill"; - }; - }; + mango.autoStart = [ + "${pkgs.swaybg}/bin/swaybg -i ${assets}/wallpapers/bars.jpg -m fill" + ]; }; }; @@ -61,19 +54,15 @@ let packages.type = "full"; - sway.outputs = - let - bg = "${assets}/wallpapers/bars.jpg"; - in - { - "*" = { - bg = "${bg} fill"; - }; - }; + mango.autoStart = [ + "${pkgs.swaybg}/bin/swaybg -i ${assets}/wallpapers/bars.jpg -m fill" + ]; }; }; "natha-vrdhq85".olduser101 = { + sway.enable = true; + mango.enable = false; nlock.enable = false; swaylock.enable = true; waybar.enable = true; @@ -83,6 +72,9 @@ let }; "natha-5334qwx" = { + sway.enable = true; + mango.enable = false; + home.packages = with pkgs; [ sonobus ]; diff --git a/modules/home/natha/mango/default.nix b/modules/home/natha/mango/default.nix new file mode 100644 index 0000000..140c5be --- /dev/null +++ b/modules/home/natha/mango/default.nix @@ -0,0 +1,234 @@ +{ + pkgs, + config, + lib, + ... +}: + +with lib; +let + cfg = config.olduser101.mango; + + grim = "${pkgs.grim}/bin/grim"; + slurp = "${pkgs.slurp}/bin/slurp"; + wl-copy = "${pkgs.wl-clipboard}/bin/wl-copy"; + wofi = "${pkgs.wofi}/bin/wofi"; + brightnessctl = "${pkgs.brightnessctl}/bin/brightnessctl"; + wpctl = "${pkgs.wireplumber}/bin/wpctl"; + src = ./.; +in +{ + options.olduser101.mango = { + enable = mkOption { + type = types.bool; + default = true; + description = "Enable mangowm configuration"; + }; + + terminal = mkOption { + type = types.nullOr types.str; + default = "${pkgs.alacritty}/bin/alacritty"; + description = "Terminal to use"; + }; + + screenLocker = mkOption { + type = types.nullOr types.str; + default = "${pkgs.nlock}/bin/nlock"; + description = "Screen locker to use"; + }; + + autoStart = mkOption { + type = types.listOf types.str; + default = [ ]; + description = "Commands to run on startup"; + }; + + screenshotDirectory = mkOption { + type = types.externalPath; + default = "${config.home.homeDirectory}/pictures"; + description = "Screenshot directory"; + }; + + recordingsDirectory = mkOption { + type = types.externalPath; + default = "${config.home.homeDirectory}/videos"; + description = "Recordings directory"; + }; + + extraConfig = mkOption { + type = types.str; + default = ""; + description = "Extra configuration lines"; + }; + }; + + config = mkIf cfg.enable { + wayland.windowManager.mango = { + inherit (cfg) extraConfig; + + enable = true; + + autostart_sh = strings.join "\n" (map (c: "${c} &") cfg.autoStart); + + settings = { + scroller = { + structs = 20; + default_proportion = 0.9; + focus_center = 0; + prefer_center = 1; + default_proportion_single = 1.0; + proportion_preset = [ + 0.5 + 0.8 + 1.0 + ]; + }; + + edge_scroller = { + pointer_focus = 1; + focus_allow_speed = 0.0; + }; + + focus = { + on_activate = 0; + cross_monitor = 0; + cross_tag = 0; + }; + + no_border_when_single = 0; + sloppyfocus = 1; + warpcursor = 1; + enable_floating_snap = 0; + cursor_size = 24; + tag_gather = 1; + + repeat_rate = 25; + repeat_delay = 600; + numlockon = 0; + xkb_rules = { + layout = "gb"; + options = "compose:ralt"; + }; + + trackpad_natural_scrolling = 1; + swipe_min_threshold = 1; + + border_radius = 0; + focused_opacity = 1.0; + unfocused_opacity = 1.0; + + animations = 0; + layer_animations = 0; + animation_fade_in = 0; + animation_fade_out = 0; + + gappih = 15; + gappiv = 15; + gappoh = 15; + gappov = 15; + + borderpx = 2; + rootcolor = "0x00000000"; + bordercolor = "0x00000000"; + dropcolor = "0x00000000"; + splitcolor = "0x00000000"; + focuscolor = "0xcba6f7ff"; + globalcolor = "0x00000000"; + urgentcolor = "0xf38ba800"; + scratchpadcolor = "0x00000000"; + overlaycolor = "0x00000000"; + + tagrule = [ + "id:*,layout_name:scroller" + ]; + + circle_layout = [ + "scroller" + "tile" + ]; + + bind = [ + "SUPER,r,reload_config" + + "SUPER,Space,spawn,${wofi} --show drun" + "SUPER,Return,spawn,${cfg.terminal}" + "SUPER,Comma,spawn,${cfg.screenLocker}" + "SUPER,f,spawn,${pkgs.firefox}/bin/firefox" + + "SUPER+SHIFT,e,quit" + "SUPER,q,killclient" + + "ALT,Tab,focusstack,next" + "SUPER,Left,focusdir,left" + "SUPER,Right,focusdir,right" + "SUPER,Up,focusdir,up" + "SUPER,Down,focusdir,down" + + "SUPER+SHIFT,Up,exchange_client,up" + "SUPER+SHIFT,Down,exchange_client,down" + "SUPER+SHIFT,Left,exchange_client,left" + "SUPER+SHIFT,Right,exchange_client,right" + + "ALT,backslash,togglefloating" + "ALT,a,togglemaximizescreen" + "ALT,f,togglefullscreen" + + "ALT,e,set_proportion,1.0" + "ALT,x,switch_proportion_preset" + "ALT+SUPER+CTRL,Left,scroller_stack,left" + "ALT+SUPER+CTRL,Right,scroller_stack,right" + "ALT+SUPER+CTRL,Up,scroller_stack,up" + "ALT+SUPER+CTRL,Down,scroller_stack,down" + + "SUPER,n,switch_layout" + + "ALT+SHIFT,Left,focusmon,left" + "ALT+SHIFT,Right,focusmon,right" + + "CTRL+SHIFT,Up,movewin,+0,-50" + "CTRL+SHIFT,Down,movewin,+0,+50" + "CTRL+SHIFT,Left,movewin,-50,+0" + "CTRL+SHIFT,Right,movewin,+50,+0" + + "CTRL+ALT,Up,resizewin,+0,-50" + "CTRL+ALT,Down,resizewin,+0,+50" + "CTRL+ALT,Left,resizewin,-50,+0" + "CTRL+ALT,Right,resizewin,+50,+0" + + "ALT,Up,viewtoleft,0" + "ALT,Down,viewtoright,0" + + "SUPER,c,spawn,/usr/bin/env OUT_DIR=${cfg.recordingsDirectory} ${src}/../sway/helpers/record-output.sh" + "SUPER,s,spawn,${grim} -g \"$(${slurp})\" ${cfg.screenshotDirectory}/Screenshot_$(date +%F_%T).png" + "SUPER+SHIFT,s,spawn,${grim} -g \"$(${slurp})\" - | ${wl-copy}" + + "NONE,XF86AudioLowerVolume,spawn,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-" + "NONE,XF86AudioRaiseVolume,spawn,${wpctl} set-volume @DEFAULT_AUDIO_SINK@ 5%-" + "NONE,XF86AudioMute,spawn,${wpctl} set-mute @DEFAULT_AUDIO_SINK@ toggle" + + "NONE,XF86MonBrightnessDown,spawn,${brightnessctl} set 5%-" + "NONE,XF86MonBrightnessUp,spawn,${brightnessctl} set 5%-" + ]; + }; + }; + + home.packages = with pkgs; [ + jq + wf-recorder + ]; + + home.pointerCursor = { + enable = true; + gtk.enable = true; + package = pkgs.adwaita-icon-theme; + name = "Adwaita"; + size = 24; + }; + + home.file.".XCompose".source = ../sway/xcompose; + + home.sessionVariables = { + _JAVA_AWT_WM_NONREPARENTING = 1; + }; + }; +} diff --git a/modules/home/natha/modules.nix b/modules/home/natha/modules.nix index 1c5c18b..60d9d2b 100644 --- a/modules/home/natha/modules.nix +++ b/modules/home/natha/modules.nix @@ -15,6 +15,7 @@ ./irssi ./kak ./kitty + ./mango ./nlock ./oh-my-zsh ./packages diff --git a/modules/home/natha/sway/default.nix b/modules/home/natha/sway/default.nix index fde2dc1..599b95e 100644 --- a/modules/home/natha/sway/default.nix +++ b/modules/home/natha/sway/default.nix @@ -20,7 +20,7 @@ in options.olduser101.sway = { enable = mkOption { type = types.bool; - default = true; + default = false; description = "Enable sway"; }; diff --git a/modules/home/natha/wl-overlay/default.nix b/modules/home/natha/wl-overlay/default.nix index d31a8d9..3a47843 100644 --- a/modules/home/natha/wl-overlay/default.nix +++ b/modules/home/natha/wl-overlay/default.nix @@ -22,9 +22,25 @@ in default = false; description = "Enable wl-overlay battery widget"; }; + + mango = mkOption { + type = types.bool; + default = config.olduser101.mango.enable; + description = "Enable Mango integration"; + }; }; config = mkIf cfg.enable { + olduser101.mango = mkIf cfg.mango { + autoStart = [ + "${pkgs.wl-overlay}/bin/wl-overlay" + ]; + extraConfig = '' + bind=SUPER,Tab,spawn,${pkgs.wl-overlay}/bin/wl-overlayctl overlay show + bindr=SUPER,Tab,spawn,${pkgs.wl-overlay}/bin/wl-overlayctl overlay hide + ''; + }; + programs.wl-overlay = { enable = true; layers = [ diff --git a/modules/system/default.nix b/modules/system/default.nix index 7ac082a..564ad68 100644 --- a/modules/system/default.nix +++ b/modules/system/default.nix @@ -12,6 +12,7 @@ ./core ./fs ./hardware + ./mango ./power ./print ./programs diff --git a/modules/system/mango/default.nix b/modules/system/mango/default.nix new file mode 100644 index 0000000..e25a1f5 --- /dev/null +++ b/modules/system/mango/default.nix @@ -0,0 +1,25 @@ +{ + pkgs, + config, + lib, + ... +}: + +with lib; +let + cfg = config.olduser101.mango; +in +{ + options.olduser101.mango = { + enable = mkOption { + type = types.bool; + default = false; + description = "Enable the Mango window manager"; + }; + }; + + config = mkIf cfg.enable { + security.polkit.enable = true; + programs.mango.enable = true; + }; +} diff --git a/systems/natha-76k4epg/default.nix b/systems/natha-76k4epg/default.nix index 47b461a..10e6e93 100644 --- a/systems/natha-76k4epg/default.nix +++ b/systems/natha-76k4epg/default.nix @@ -38,6 +38,7 @@ type = "amd"; lact = true; }; + mango.enable = true; sddm.enable = true; security.pam = { services = [ @@ -46,7 +47,6 @@ ]; keyring = true; }; - sway.enable = true; update.enable = true; }; hostMeta.localDotfiles = "/home/natha/.config/olduser101"; @@ -71,11 +71,13 @@ inputs.nlock.nixosModules.default inputs.agenix.nixosModules.default inputs.lanzaboote.nixosModules.lanzaboote + inputs.mango.nixosModules.mango ]; extraHomeManagerModules = [ inputs.nlock.homeManagerModules.default inputs.way-edges.homeManagerModules.default inputs.agenix.homeManagerModules.default inputs.wl-overlay.homeManagerModules.wl-overlay + inputs.mango.hmModules.mango ]; } diff --git a/systems/natha-e2hyref/default.nix b/systems/natha-e2hyref/default.nix index 7a9a679..aa5901f 100644 --- a/systems/natha-e2hyref/default.nix +++ b/systems/natha-e2hyref/default.nix @@ -37,6 +37,7 @@ enable = true; type = "intel"; }; + mango.enable = true; sddm.enable = true; security.pam = { services = [ @@ -45,7 +46,6 @@ ]; keyring = true; }; - sway.enable = true; update.enable = true; }; hostMeta.localDotfiles = "/home/natha/.config/olduser101"; @@ -70,11 +70,13 @@ inputs.nlock.nixosModules.default inputs.agenix.nixosModules.default inputs.lanzaboote.nixosModules.lanzaboote + inputs.mango.nixosModules.mango ]; extraHomeManagerModules = [ inputs.nlock.homeManagerModules.default inputs.way-edges.homeManagerModules.default inputs.agenix.homeManagerModules.default inputs.wl-overlay.homeManagerModules.wl-overlay + inputs.mango.hmModules.mango ]; } -- 2.51.2