diff --git a/pkgs/applications/window-managers/leftwm/leftwm-config/0001-rm-unstable-is-some-with-feature.patch b/pkgs/applications/window-managers/leftwm/leftwm-config/0001-rm-unstable-is-some-with-feature.patch new file mode 100644 index 000000000000..96e0ba20dfaf --- /dev/null +++ b/pkgs/applications/window-managers/leftwm/leftwm-config/0001-rm-unstable-is-some-with-feature.patch @@ -0,0 +1,93 @@ +diff --git a/src/main.rs b/src/main.rs +index f9ccde5..3253b17 100644 +--- a/src/main.rs ++++ b/src/main.rs +@@ -1,4 +1,3 @@ +-#![feature(is_some_with)] + #![allow( + clippy::module_name_repetitions, + clippy::too_many_lines, +diff --git a/src/tui/key_handler.rs b/src/tui/key_handler.rs +index 25cede0..cc875cc 100644 +--- a/src/tui/key_handler.rs ++++ b/src/tui/key_handler.rs +@@ -247,7 +247,7 @@ fn right(app: &mut App) -> Result { + } + } + Window::WindowRules { index, empty } => { +- if app.current_popup.is_some_and(|i| *i == 2) { ++ if app.current_popup.map(|i| i == 2).unwrap_or(false) { + if let PopupState::Int { current, min, max } = app.current_popup_state { + if current < max { + app.current_popup_state = PopupState::Int { +@@ -315,7 +315,7 @@ fn left(app: &mut App) -> Result { + } + } + Window::WindowRules { index, empty } => { +- if app.current_popup.is_some_and(|i| *i == 2) { ++ if app.current_popup.map(|i| i == 2).unwrap_or(false) { + if let PopupState::Int { current, min, max } = app.current_popup_state { + if current > min { + app.current_popup_state = PopupState::Int { +@@ -491,7 +491,8 @@ fn enter_home(app: &mut App) -> Result { + .current_config + .workspaces + .as_ref() +- .is_some_and(|v| v.is_empty()) ++ .map(|v| v.is_empty()) ++ .unwrap_or(false) + || app.current_config.workspaces.as_ref().is_none(), + }; + } +@@ -502,7 +503,8 @@ fn enter_home(app: &mut App) -> Result { + .current_config + .tags + .as_ref() +- .is_some_and(|v| v.is_empty()) ++ .map(|v| v.is_empty()) ++ .unwrap_or(false) + || app.current_config.tags.as_ref().is_none(), + } + } +@@ -513,7 +515,8 @@ fn enter_home(app: &mut App) -> Result { + .current_config + .window_rules + .as_ref() +- .is_some_and(|v| v.is_empty()) ++ .map(|v| v.is_empty()) ++ .unwrap_or(false) + || app.current_config.window_rules.as_ref().is_none(), + } + } +@@ -524,7 +527,8 @@ fn enter_home(app: &mut App) -> Result { + .current_config + .scratchpad + .as_ref() +- .is_some_and(|v| v.is_empty()) ++ .map(|v| v.is_empty()) ++ .unwrap_or(false) + || app.current_config.scratchpad.as_ref().is_none(), + } + } +@@ -1445,7 +1449,7 @@ fn enter_scratchpads(app: &mut App, index: usize, empty: bool) -> Result { + } + + fn enter_keybinds(app: &mut App, index: usize, empty: bool) -> Result { +- if empty && app.config_list_state.selected().is_some_and(|i| *i == 2) { ++ if empty && app.config_list_state.selected().map(|i| i == 2).unwrap_or(false) { + app.current_config.keybind.push(Keybind::default()); + } else { + match app.current_popup { +diff --git a/src/tui/popups.rs b/src/tui/popups.rs +index 7dddc12..c73edc5 100644 +--- a/src/tui/popups.rs ++++ b/src/tui/popups.rs +@@ -130,7 +130,7 @@ pub fn modkey( + } + + fn check_modifier(modifier: &Option, name: &str) -> bool { +- modifier.is_some_and(|m| if let Single(s) = m { *s == name } else { false }) ++ modifier.as_ref().map(|m| if let Single(s) = m { s == name } else { false }).unwrap_or(false) + } + + pub fn max_window_width( diff --git a/pkgs/applications/window-managers/leftwm/leftwm-config/default.nix b/pkgs/applications/window-managers/leftwm/leftwm-config/default.nix new file mode 100644 index 000000000000..52d3546c4549 --- /dev/null +++ b/pkgs/applications/window-managers/leftwm/leftwm-config/default.nix @@ -0,0 +1,26 @@ +{ stdenv, lib, fetchFromGitHub, rustPlatform }: + +rustPlatform.buildRustPackage rec { + pname = "leftwm-config"; + version = "0.1.0"; + + src = fetchFromGitHub { + owner = "leftwm"; + repo = pname; + rev = version; + sha256 = "sha256-hWxyzgWWh6CBxpbbXfd888Q70cCZQ9FESDijOSXtdZA="; + }; + + cargoSha256 = "sha256-NfBteoknxveIGrpSuDe70LLnGvN3nb9gvbVbbwsYD4A="; + + patches = [ ./0001-rm-unstable-is-some-with-feature.patch ]; + + meta = with lib; { + broken = (stdenv.isLinux && stdenv.isAarch64); + description = "A little satellite utility for LeftWM"; + homepage = "https://github.com/leftwm/leftwm-config"; + license = licenses.bsd3; + platforms = platforms.linux; + maintainers = with maintainers; [ yanganto ]; + }; +} diff --git a/pkgs/applications/window-managers/leftwm/default.nix b/pkgs/applications/window-managers/leftwm/leftwm/default.nix similarity index 100% rename from pkgs/applications/window-managers/leftwm/default.nix rename to pkgs/applications/window-managers/leftwm/leftwm/default.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 21ee5326b1e0..c10a49a69aa1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31561,7 +31561,9 @@ with pkgs; keylight-controller-mschneider82 = callPackage ../applications/misc/keylight-controller-mschneider82 { }; - leftwm = callPackage ../applications/window-managers/leftwm { }; + leftwm = callPackage ../applications/window-managers/leftwm/leftwm { }; + + leftwm-config = callPackage ../applications/window-managers/leftwm/leftwm-config { }; levant = callPackage ../applications/networking/cluster/levant { };