From 46d64063c5cf11074623f411505c5e4120c49c98 Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Tue, 30 Jul 2024 21:47:16 +0400 Subject: [PATCH] Fix the failures from the flake update Numerous changes are needed with the updated version of the nixpkgs. Signed-off-by: Brian McGillion --- modules/common/services/audio.nix | 1 - modules/common/services/yubikey.nix | 6 +- .../common/microvm-virtiofsd@.nix | 3 +- modules/desktop/graphics/labwc.nix | 2 +- .../microvm/virtualization/microvm/appvm.nix | 2 +- modules/reference/appvms/business.nix | 1 - modules/reference/appvms/chromium.nix | 1 - modules/reference/appvms/element.nix | 1 - .../element-desktop/element-main.patch | 13 +-- .../labwc/labwc-colored-borders.patch | 108 +++++++++--------- 10 files changed, 67 insertions(+), 71 deletions(-) diff --git a/modules/common/services/audio.nix b/modules/common/services/audio.nix index a7b1988450..b3e26feafe 100644 --- a/modules/common/services/audio.nix +++ b/modules/common/services/audio.nix @@ -22,7 +22,6 @@ in { config = mkIf cfg.enable { # Enable pipewire service for audioVM with pulseaudio support security.rtkit.enable = true; - sound.enable = true; hardware.firmware = [pkgs.sof-firmware]; services.pipewire = { enable = true; diff --git a/modules/common/services/yubikey.nix b/modules/common/services/yubikey.nix index ea20cb7b1e..2229c2931a 100644 --- a/modules/common/services/yubikey.nix +++ b/modules/common/services/yubikey.nix @@ -36,9 +36,11 @@ in { }; security.pam.u2f = { - authFile = "${u2f_file}"; + settings = { + authFile = "${u2f_file}"; + cue = true; + }; control = "sufficient"; - cue = true; }; # Below rule is needed for screen locker (gtklock) to work diff --git a/modules/common/systemd/hardened-configs/common/microvm-virtiofsd@.nix b/modules/common/systemd/hardened-configs/common/microvm-virtiofsd@.nix index ee27dd75c0..7951152bd4 100644 --- a/modules/common/systemd/hardened-configs/common/microvm-virtiofsd@.nix +++ b/modules/common/systemd/hardened-configs/common/microvm-virtiofsd@.nix @@ -25,7 +25,8 @@ ProtectSystem = "full"; ProtectProc = "noaccess"; # ReadWritePaths=[ "/etc"]; - PrivateTmp = true; + # TODO: change back to true when microvm catches up. + PrivateTmp = "yes"; # Not applicable for the service runs as root # PrivateMounts=true; diff --git a/modules/desktop/graphics/labwc.nix b/modules/desktop/graphics/labwc.nix index 25899b3805..cff805db7a 100644 --- a/modules/desktop/graphics/labwc.nix +++ b/modules/desktop/graphics/labwc.nix @@ -92,7 +92,7 @@ in { [ pkgs.labwc pkgs.ghaf-openbox-theme - pkgs.gnome.adwaita-icon-theme + pkgs.adwaita-icon-theme (import ./launchers.nix {inherit pkgs config;}) ] diff --git a/modules/microvm/virtualization/microvm/appvm.nix b/modules/microvm/virtualization/microvm/appvm.nix index ac46d31ff0..e857440b97 100644 --- a/modules/microvm/virtualization/microvm/appvm.nix +++ b/modules/microvm/virtualization/microvm/appvm.nix @@ -154,7 +154,7 @@ }; # Host service dependencies - after = optional configHost.sound.enable "pulseaudio.service"; + after = ["pulseaudio.service"]; requires = after; # Sleep appvms to give gui-vm time to start serviceConfig.ExecStartPre = "/bin/sh -c 'sleep 8'"; diff --git a/modules/reference/appvms/business.nix b/modules/reference/appvms/business.nix index 8cef4fcd1e..a7b5abb897 100644 --- a/modules/reference/appvms/business.nix +++ b/modules/reference/appvms/business.nix @@ -44,7 +44,6 @@ in { imports = [../programs/chromium.nix]; # Enable pulseaudio for Chromium VM security.rtkit.enable = true; - sound.enable = true; users.extraUsers.ghaf.extraGroups = ["audio" "video"]; hardware.pulseaudio = { diff --git a/modules/reference/appvms/chromium.nix b/modules/reference/appvms/chromium.nix index 0c0af8a5ec..aca2a06a71 100644 --- a/modules/reference/appvms/chromium.nix +++ b/modules/reference/appvms/chromium.nix @@ -41,7 +41,6 @@ in { imports = [../programs/chromium.nix]; # Enable pulseaudio for Chromium VM security.rtkit.enable = true; - sound.enable = true; users.extraUsers.ghaf.extraGroups = ["audio" "video"]; hardware.pulseaudio = { diff --git a/modules/reference/appvms/element.nix b/modules/reference/appvms/element.nix index 0eb06f2880..2db6b857d6 100644 --- a/modules/reference/appvms/element.nix +++ b/modules/reference/appvms/element.nix @@ -32,7 +32,6 @@ in { { # Enable pulseaudio for user ghaf to access mic security.rtkit.enable = true; - sound.enable = true; users.extraUsers.ghaf.extraGroups = ["audio" "video"]; hardware.pulseaudio = { diff --git a/overlays/custom-packages/element-desktop/element-main.patch b/overlays/custom-packages/element-desktop/element-main.patch index 54ac186800..22b9fa6da4 100644 --- a/overlays/custom-packages/element-desktop/element-main.patch +++ b/overlays/custom-packages/element-desktop/element-main.patch @@ -2,7 +2,7 @@ diff --git a/src/electron-main.ts b/src/electron-main.ts index b5d13ac..ffffb76 100644 --- a/src/electron-main.ts +++ b/src/electron-main.ts -@@ -456,11 +456,10 @@ app.on("ready", async () => { +@@ -458,11 +458,10 @@ // https://www.electronjs.org/docs/faq#the-font-looks-blurry-what-is-this-and-what-can-i-do backgroundColor: "#fff", @@ -15,16 +15,15 @@ index b5d13ac..ffffb76 100644 autoHideMenuBar: global.store.get("autoHideMenuBar", true), x: mainWindowState.x, -@@ -475,67 +474,39 @@ app.on("ready", async () => { +@@ -477,67 +476,35 @@ webgl: true, }, }); -- global.mainWindow.loadURL("vector://vector/webapp/"); +- void global.mainWindow.loadURL("vector://vector/webapp/"); - - if (process.platform === "darwin") { - setupMacosTitleBar(global.mainWindow); - } -+ // Handle spellchecker // For some reason spellCheckerEnabled isn't persisted, so we have to use the store here @@ -32,7 +31,7 @@ index b5d13ac..ffffb76 100644 - // Create trayIcon icon - if (global.store.get("minimizeToTray", true)) tray.create(global.trayConfig); - +- - global.mainWindow.once("ready-to-show", () => { + global.mainWindow.webContents.once('did-finish-load',function(){ if (!global.mainWindow) return; @@ -41,8 +40,7 @@ index b5d13ac..ffffb76 100644 if (!argv["hidden"]) { global.mainWindow.show(); + global.mainWindow.restore(); -++ global.mainWindow.focus(); -+ ++ global.mainWindow.focus(); } else { // hide here explicitly because window manage above sometimes shows it global.mainWindow.hide(); @@ -55,7 +53,6 @@ index b5d13ac..ffffb76 100644 global.mainWindow.on("closed", () => { global.mainWindow = null; }); -+ global.mainWindow.on("close", async (e) => { - // If we are not quitting and have a tray icon then minimize to tray - if (!global.appQuitting && (tray.hasTray() || process.platform === "darwin")) { diff --git a/overlays/custom-packages/labwc/labwc-colored-borders.patch b/overlays/custom-packages/labwc/labwc-colored-borders.patch index 8b90091f09..833e4e7196 100644 --- a/overlays/custom-packages/labwc/labwc-colored-borders.patch +++ b/overlays/custom-packages/labwc/labwc-colored-borders.patch @@ -1,4 +1,4 @@ -From 425746bb724e329e44ef80cec7bf1e57a0388010 Mon Sep 17 00:00:00 2001 +From a89bc92a032d6c4fc50d711de92b068a0ed0a636 Mon Sep 17 00:00:00 2001 From: Humaid Alqasimi Date: Thu, 2 May 2024 10:02:56 +0400 Subject: [PATCH] Add colored borders @@ -19,19 +19,19 @@ Signed-off-by: Humaid Alqasimi include/theme.h | 10 ++++++++++ include/window-rules.h | 17 +++++++++++++++++ src/config/rcxml.c | 12 ++++++++++++ + src/ssd/ssd-border.c | 21 ++++++++++++++++----- + src/ssd/ssd-part.c | 2 +- + src/ssd/ssd-titlebar.c | 30 ++++++++++++++++++++++++++---- src/ssd/ssd.c | 9 ++++++--- - src/ssd/ssd_border.c | 21 ++++++++++++++++----- - src/ssd/ssd_part.c | 2 +- - src/ssd/ssd_titlebar.c | 30 ++++++++++++++++++++++++++---- src/theme.c | 34 ++++++++++++++++++++++++++++++++-- src/window-rules.c | 25 +++++++++++++++++++++++++ 10 files changed, 148 insertions(+), 17 deletions(-) diff --git a/include/ssd-internal.h b/include/ssd-internal.h -index 639d143..7e09dc2 100644 +index fda196e..b0e0cac 100644 --- a/include/ssd-internal.h +++ b/include/ssd-internal.h -@@ -135,8 +135,9 @@ void add_toggled_icon(struct ssd_button *button, struct wl_list *part_list, +@@ -136,8 +136,9 @@ void add_toggled_icon(struct ssd_button *button, struct wl_list *part_list, struct ssd_part *add_scene_button_corner( struct wl_list *part_list, enum ssd_part_type type, enum ssd_part_type corner_type, struct wlr_scene_tree *parent, @@ -44,10 +44,10 @@ index 639d143..7e09dc2 100644 /* SSD internal helpers */ struct ssd_part *ssd_get_part( diff --git a/include/theme.h b/include/theme.h -index 204a978..9296dc2 100644 +index 50a69f6..7a0f976 100644 --- a/include/theme.h +++ b/include/theme.h -@@ -158,4 +158,14 @@ void theme_init(struct theme *theme, struct server *server, const char *theme_na +@@ -162,4 +162,14 @@ void theme_init(struct theme *theme, struct server *server, const char *theme_na */ void theme_finish(struct theme *theme); @@ -63,7 +63,7 @@ index 204a978..9296dc2 100644 + #endif /* LABWC_THEME_H */ diff --git a/include/window-rules.h b/include/window-rules.h -index 17c5dca..daf2648 100644 +index b93bc36..066cc7f 100644 --- a/include/window-rules.h +++ b/include/window-rules.h @@ -21,6 +21,7 @@ enum property { @@ -74,7 +74,7 @@ index 17c5dca..daf2648 100644 struct window_rule { char *identifier; char *title; -@@ -38,11 +39,27 @@ struct window_rule { +@@ -40,11 +41,27 @@ struct window_rule { enum property fixed_position; struct wl_list link; /* struct rcxml.window_rules */ @@ -103,7 +103,7 @@ index 17c5dca..daf2648 100644 + #endif /* LABWC_WINDOW_RULES_H */ diff --git a/src/config/rcxml.c b/src/config/rcxml.c -index 1e268f4..632e35a 100644 +index 84c117b..daab831 100644 --- a/src/config/rcxml.c +++ b/src/config/rcxml.c @@ -35,6 +35,7 @@ @@ -131,7 +131,7 @@ index 1e268f4..632e35a 100644 } else if (!strcmp(nodename, "title")) { free(current_window_rule->title); current_window_rule->title = xstrdup(content); -@@ -214,6 +218,14 @@ fill_window_rule(char *nodename, char *content) +@@ -220,6 +224,14 @@ fill_window_rule(char *nodename, char *content) } else if (!strcasecmp(nodename, "fixedPosition")) { set_property(content, ¤t_window_rule->fixed_position); @@ -146,30 +146,10 @@ index 1e268f4..632e35a 100644 /* Actions */ } else if (!strcmp(nodename, "name.action")) { current_window_rule_action = action_create(content); -diff --git a/src/ssd/ssd.c b/src/ssd/ssd.c -index 9c96ef7..c770cd5 100644 ---- a/src/ssd/ssd.c -+++ b/src/ssd/ssd.c -@@ -382,9 +382,12 @@ ssd_enable_keybind_inhibit_indicator(struct ssd *ssd, bool enable) - return; - } - -- float *color = enable -- ? rc.theme->window_toggled_keybinds_color -- : rc.theme->window_active_border_color; -+ float customColor[4]; -+ bool isCustomColorAvailable = window_rules_get_custom_border_color(ssd->view, customColor); -+ -+ float *color = isCustomColorAvailable ? customColor : -+ (enable ? rc.theme->window_toggled_keybinds_color -+ : rc.theme->window_active_border_color); - - struct ssd_part *part = ssd_get_part(&ssd->border.active.parts, LAB_SSD_PART_TOP); - struct wlr_scene_rect *rect = wlr_scene_rect_from_node(part->node); -diff --git a/src/ssd/ssd_border.c b/src/ssd/ssd_border.c -index 74f29ff..bf62df8 100644 ---- a/src/ssd/ssd_border.c -+++ b/src/ssd/ssd_border.c +diff --git a/src/ssd/ssd-border.c b/src/ssd/ssd-border.c +index 06ce55c..6e2fc06 100644 +--- a/src/ssd/ssd-border.c ++++ b/src/ssd/ssd-border.c @@ -6,6 +6,7 @@ #include "ssd-internal.h" #include "theme.h" @@ -206,10 +186,10 @@ index 74f29ff..bf62df8 100644 wl_list_init(&subtree->parts); add_scene_rect(&subtree->parts, LAB_SSD_PART_LEFT, parent, theme->border_width, height, 0, 0, color); -diff --git a/src/ssd/ssd_part.c b/src/ssd/ssd_part.c +diff --git a/src/ssd/ssd-part.c b/src/ssd/ssd-part.c index 3933cd1..8889c9e 100644 ---- a/src/ssd/ssd_part.c -+++ b/src/ssd/ssd_part.c +--- a/src/ssd/ssd-part.c ++++ b/src/ssd/ssd-part.c @@ -80,7 +80,7 @@ add_scene_buffer(struct wl_list *list, enum ssd_part_type type, struct ssd_part * @@ -219,10 +199,10 @@ index 3933cd1..8889c9e 100644 struct wlr_buffer *corner_buffer, struct wlr_buffer *icon_buffer, struct wlr_buffer *hover_buffer, int x, struct view *view) { -diff --git a/src/ssd/ssd_titlebar.c b/src/ssd/ssd_titlebar.c -index cde7bb7..d063989 100644 ---- a/src/ssd/ssd_titlebar.c -+++ b/src/ssd/ssd_titlebar.c +diff --git a/src/ssd/ssd-titlebar.c b/src/ssd/ssd-titlebar.c +index 32d6131..d183e52 100644 +--- a/src/ssd/ssd-titlebar.c ++++ b/src/ssd/ssd-titlebar.c @@ -26,6 +26,15 @@ ssd_titlebar_create(struct ssd *ssd) { struct view *view = ssd->view; @@ -273,7 +253,7 @@ index cde7bb7..d063989 100644 width - SSD_BUTTON_WIDTH * 1, view); } FOR_EACH_END -@@ -144,10 +155,13 @@ set_squared_corners(struct ssd *ssd, bool enable) +@@ -149,10 +160,13 @@ set_squared_corners(struct ssd *ssd, bool enable) /* Toggle background between invisible and titlebar background color */ struct wlr_scene_rect *rect = wlr_scene_rect_from_node(button->background); @@ -289,7 +269,7 @@ index cde7bb7..d063989 100644 /* Toggle rounded corner image itself */ struct wlr_scene_node *rounded_corner = -@@ -336,6 +350,14 @@ ssd_update_title(struct ssd *ssd) +@@ -348,6 +362,14 @@ ssd_update_title(struct ssd *ssd) } struct theme *theme = view->server->theme; @@ -304,11 +284,31 @@ index cde7bb7..d063989 100644 struct ssd_state_title *state = &ssd->state.title; bool title_unchanged = state->text && !strcmp(title, state->text); +diff --git a/src/ssd/ssd.c b/src/ssd/ssd.c +index 70b1b0d..9dcc797 100644 +--- a/src/ssd/ssd.c ++++ b/src/ssd/ssd.c +@@ -411,9 +411,12 @@ ssd_enable_keybind_inhibit_indicator(struct ssd *ssd, bool enable) + return; + } + +- float *color = enable +- ? rc.theme->window_toggled_keybinds_color +- : rc.theme->window_active_border_color; ++ float customColor[4]; ++ bool isCustomColorAvailable = window_rules_get_custom_border_color(ssd->view, customColor); ++ ++ float *color = isCustomColorAvailable ? customColor : ++ (enable ? rc.theme->window_toggled_keybinds_color ++ : rc.theme->window_active_border_color); + + struct ssd_part *part = ssd_get_part(&ssd->border.active.parts, LAB_SSD_PART_TOP); + struct wlr_scene_rect *rect = wlr_scene_rect_from_node(part->node); diff --git a/src/theme.c b/src/theme.c -index 2b10191..19201b6 100644 +index 248a352..6f47bba 100644 --- a/src/theme.c +++ b/src/theme.c -@@ -399,7 +399,7 @@ hex_to_dec(char c) +@@ -401,7 +401,7 @@ hex_to_dec(char c) * @hex: hex string to be parsed * @rgba: pointer to float[4] for return value */ @@ -317,7 +317,7 @@ index 2b10191..19201b6 100644 parse_hexstr(const char *hex, float *rgba) { if (!hex || hex[0] != '#' || strlen(hex) < 7) { -@@ -468,7 +468,7 @@ parse_justification(const char *str) +@@ -470,7 +470,7 @@ parse_justification(const char *str) static void theme_builtin(struct theme *theme, struct server *server) { @@ -326,7 +326,7 @@ index 2b10191..19201b6 100644 theme->padding_height = 3; theme->title_height = INT_MIN; theme->menu_overlap_x = 0; -@@ -1398,3 +1398,33 @@ theme_finish(struct theme *theme) +@@ -1433,3 +1433,33 @@ theme_finish(struct theme *theme) zdrop(&theme->shadow_corner_bottom_inactive); zdrop(&theme->shadow_edge_inactive); } @@ -361,11 +361,11 @@ index 2b10191..19201b6 100644 + load_buttons(theme); +} diff --git a/src/window-rules.c b/src/window-rules.c -index b6b2999..2ad3303 100644 +index f543f7e..5ea5d53 100644 --- a/src/window-rules.c +++ b/src/window-rules.c -@@ -60,6 +60,14 @@ view_matches_criteria(struct window_rule *rule, struct view *view) - return matches_criteria(rule, view); +@@ -43,6 +43,14 @@ view_matches_criteria(struct window_rule *rule, struct view *view) + return view_matches_query(view, &query); } +void @@ -379,7 +379,7 @@ index b6b2999..2ad3303 100644 void window_rules_apply(struct view *view, enum window_rule_event event) { -@@ -126,3 +134,20 @@ window_rules_get_property(struct view *view, const char *property) +@@ -109,3 +117,20 @@ window_rules_get_property(struct view *view, const char *property) } return LAB_PROP_UNSPECIFIED; } @@ -401,5 +401,5 @@ index b6b2999..2ad3303 100644 + return false; +} -- -2.44.0 +2.44.1