Compare commits

...

4 commits

Author SHA1 Message Date
chayleaf 7b45e070e6
"update" mobile sway (untested) 2025-01-30 17:28:53 +07:00
chayleaf 9874bbd6aa
update schlock 2025-01-30 13:35:29 +07:00
chayleaf d97ef9fa5d
update lspconfig 2025-01-30 13:35:29 +07:00
chayleaf 248516f83d
bump nix version 2025-01-30 13:35:26 +07:00
10 changed files with 108 additions and 104 deletions

View file

@ -255,7 +255,7 @@ in*/
config = (
let lsp = name: builtins.seq
# ensure an lsp exists (otherwise lspconfig will still create an empty config for some reason)
(REQ "lspconfig.server_configurations.${name}")
(REQ "lspconfig.configs.${name}")
# metatables, son! they harden in response to physical trauma
(REQ' (PROP (require "lspconfig") name));
in [
@ -364,7 +364,7 @@ in*/
} // args);
in on_attach_rust: [
# (vim.lsp.set_log_level "debug")
# see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
# see https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md
(lib.mapAttrsToList setupLsp {
bashls = { };
clangd = { };
@ -386,7 +386,7 @@ in*/
svelte = { };
html = { };
cssls = { };
tsserver = { };
ts_ls = { };
jsonls = { };
nil_ls = {
settings.nil = {

View file

@ -0,0 +1,22 @@
diff --git a/extra-builtins.cc b/extra-builtins.cc
index bae8f83..4c15c7f 100644
--- a/extra-builtins.cc
+++ b/extra-builtins.cc
@@ -39,9 +39,6 @@ static void extraBuiltins(EvalState & state, const PosIdx pos,
auto fun = state.allocValue();
state.evalFile(extraBuiltinsFile, *fun);
Value * arg;
- if (evalSettings.enableNativeCode) {
- arg = state.baseEnv.values[0];
- } else {
auto attrs = state.buildBindings(2);
auto sExec = state.symbols.create("exec");
@@ -60,7 +57,6 @@ static void extraBuiltins(EvalState & state, const PosIdx pos,
arg = state.allocValue();
arg->mkAttrs(attrs);
- }
v.mkApp(fun, arg);
state.forceValue(v, pos);
} catch (SysError & e) {

View file

@ -1,7 +1,7 @@
{ pkgs, ... }:
let
unpatchedNixForNixPlugins = pkgs.nixVersions.nix_2_18;
unpatchedNixForNixPlugins = pkgs.nixVersions.nix_2_24;
nixForNixPlugins = unpatchedNixForNixPlugins.overrideAttrs (old: {
patches = (old.patches or [ ]) ++ [ ./rename-nix-plugin-files.patch ];
# some tests fail on bcachefs due to insufficient permissions
@ -10,25 +10,27 @@ let
in {
inherit unpatchedNixForNixPlugins nixForNixPlugins;
# Various patches to change Nix version of existing packages so they don't error out because of nix-plugins in nix.conf
/*nix-plugins = (pkgs.nix-plugins.override { nix = nixForNixPlugins; }).overrideAttrs (old: {
version = "13.0.0";
nix-plugins = (pkgs.nix-plugins.override { nix = nixForNixPlugins; })
.overrideAttrs (old: {
# version = "13.0.0";
patches = [
(pkgs.fetchpatch {
/*(pkgs.fetchpatch {
# pull 16
url = "https://github.com/chayleaf/nix-plugins/commit/8f945cadad7f2e60e8f308b2f498ec5e16961ede.patch";
hash = "sha256-pOogMtjXYkSDtXW12TmBpGr/plnizJtud2nP3q2UldQ=";
})
})*/
./nix-plugins-fix.patch
];
});*/
hydra_unstable = (pkgs.hydra_unstable.override {
});
hydra = (pkgs.hydra.override {
nix = nixForNixPlugins;
}).overrideAttrs (old: {
version = "2023-12-01";
# version = "2023-12-01";
# who cares about tests amirite
doCheck = false;
src = old.src.override {
rev = "4d1c8505120961f10897b8fe9a070d4e193c9a13";
hash = "sha256-vXTuE83GL15mgZHegbllVAsVdDFcWWSayPfZxTJN5ys=";
};
# src = old.src.override {
# rev = "4d1c8505120961f10897b8fe9a070d4e193c9a13";
# hash = "sha256-vXTuE83GL15mgZHegbllVAsVdDFcWWSayPfZxTJN5ys=";
# };
});
}

View file

@ -1,13 +1,26 @@
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index dba7d78ef..f102f08f9 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -959,7 +959,7 @@ public:
"Number of seconds between checking free disk space."};
diff --git a/src/libmain/plugin.cc b/src/libmain/plugin.cc
index ccfd7f900..c1b737ad6 100644
--- a/src/libmain/plugin.cc
+++ b/src/libmain/plugin.cc
@@ -40,7 +40,7 @@ struct PluginSettings : Config
PluginFilesSetting pluginFiles{
- this, {}, "plugin-files",
+ this, {}, "plugin-files-2",
this,
{},
- "plugin-files",
+ "plugin-files-2",
R"(
A list of plugin files to be loaded by Nix. Each of these files will
be dlopened by Nix, allowing them to affect execution through static
be dlopened by Nix. If they contain the symbol `nix_plugin_entry()`,
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 555936c18..26db2b7cb 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -134,7 +134,7 @@ void RemoteStore::setOptions(Connection & conn)
overrides.erase(settings.useSubstitutes.name);
overrides.erase(loggerSettings.showTrace.name);
overrides.erase(experimentalFeatureSettings.experimentalFeatures.name);
- overrides.erase("plugin-files");
+ overrides.erase("plugin-files-2");
conn.to << overrides.size();
for (auto & i : overrides)
conn.to << i.first << i.second.value;

View file

@ -10,6 +10,7 @@
, libsodium
, libxkbcommon
, wayland
, wayland-scanner
, wayland-protocols
}:
@ -29,7 +30,7 @@ stdenv.mkDerivation {
ninja
pkg-config
scdoc
wayland
wayland-scanner
];
buildInputs = [

View file

@ -1,4 +1,4 @@
From c4690b1496ca34c416869d2932abfa112a93f188 Mon Sep 17 00:00:00 2001
From c0ee6ec0b06721c2aa4f370fc84daaa48d3a6ff3 Mon Sep 17 00:00:00 2001
From: chayleaf <chayleaf-git@pavluk.org>
Date: Wed, 14 Aug 2024 08:17:44 +0700
Subject: [PATCH 1/4] mobile: don't idle_notify for volume keys
@ -8,10 +8,10 @@ Subject: [PATCH 1/4] mobile: don't idle_notify for volume keys
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 8927287f..d42f62b0 100644
index 1a73df01..ce4137d6 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -404,7 +404,9 @@ static void handle_key_event(struct sway_keyboard *keyboard,
@@ -406,7 +406,9 @@ static void handle_key_event(struct sway_keyboard *keyboard,
keyboard->seat_device->input_device->wlr_device;
char *device_identifier = input_device_get_identifier(wlr_device);
bool exact_identifier = keyboard->wlr->group != NULL;
@ -19,9 +19,9 @@ index 8927287f..d42f62b0 100644
+ if (event->keycode != XKB_KEY_XF86AudioLowerVolume && event->keycode != XKB_KEY_XF86AudioRaiseVolume) {
+ seat_idle_notify_activity(seat, IDLE_SOURCE_KEYBOARD);
+ }
bool input_inhibited = seat->exclusive_client != NULL ||
server.session_lock.locked;
bool locked = server.session_lock.lock;
struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor =
keyboard_shortcuts_inhibitor_get_for_focused_surface(seat);
--
2.45.2

View file

@ -1,4 +1,4 @@
From ffec4e61168224d5b57241ae863a6970ce969a47 Mon Sep 17 00:00:00 2001
From ea031ced53cd3da4e4c26bc430a5cdf018826a16 Mon Sep 17 00:00:00 2001
From: chayleaf <chayleaf-git@pavluk.org>
Date: Wed, 14 Aug 2024 07:32:11 +0700
Subject: [PATCH 2/4] mobile: reverse layer order
@ -9,18 +9,18 @@ This makes exclusive anchored layers that were added first be first
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 8c6cedfe..41a638ee 100644
index 333c09b4..7c50af11 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -129,7 +129,7 @@ static void arrange_layer(struct sway_output *output, struct wl_list *list,
struct wlr_box full_area = { 0 };
wlr_output_effective_resolution(output->wlr_output,
&full_area.width, &full_area.height);
- wl_list_for_each(sway_layer, list, link) {
+ wl_list_for_each_reverse(sway_layer, list, link) {
struct wlr_layer_surface_v1 *layer = sway_layer->layer_surface;
struct wlr_layer_surface_v1_state *state = &layer->current;
if (exclusive != (state->exclusive_zone > 0)) {
@@ -56,7 +56,7 @@ struct wlr_layer_surface_v1 *toplevel_layer_surface_from_surface(
static void arrange_surface(struct sway_output *output, const struct wlr_box *full_area,
struct wlr_box *usable_area, struct wlr_scene_tree *tree, bool exclusive) {
struct wlr_scene_node *node;
- wl_list_for_each(node, &tree->children, link) {
+ wl_list_for_each_reverse(node, &tree->children, link) {
struct sway_layer_surface *surface = scene_descriptor_try_get(node,
SWAY_SCENE_DESC_LAYER_SHELL);
// surface could be null during destruction
--
2.45.2

View file

@ -1,4 +1,4 @@
From 2bc4fabd214939f24c7f980e80fe5f3f0c6ff687 Mon Sep 17 00:00:00 2001
From f61e3735f05c45b37ee2857ad42bfbe7a0a5bf88 Mon Sep 17 00:00:00 2001
From: chayleaf <chayleaf-git@pavluk.org>
Date: Fri, 23 Aug 2024 05:35:57 +0700
Subject: [PATCH 3/4] mobile: swaybar: bottom -> overlay layer
@ -8,10 +8,10 @@ Subject: [PATCH 3/4] mobile: swaybar: bottom -> overlay layer
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/swaybar/bar.c b/swaybar/bar.c
index 021fc3bd..7f44799d 100644
index 4d20f20f..7dc16b5e 100644
--- a/swaybar/bar.c
+++ b/swaybar/bar.c
@@ -103,7 +103,7 @@ static void add_layer_surface(struct swaybar_output *output) {
@@ -102,7 +102,7 @@ static void add_layer_surface(struct swaybar_output *output) {
output->layer_surface = zwlr_layer_shell_v1_get_layer_surface(
bar->layer_shell, output->surface, output->output,
hidden || overlay ? ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY :

View file

@ -1,46 +1,18 @@
From 7ce9a5b2ded14623e6ff56311f4336fba4d22c7f Mon Sep 17 00:00:00 2001
From 8ca0427a879085b3380b6ed4d50c059f4589b5c7 Mon Sep 17 00:00:00 2001
From: chayleaf <chayleaf-git@pavluk.org>
Date: Fri, 23 Aug 2024 05:34:58 +0700
Subject: [PATCH 4/4] mobile: dont occupy exclusive layers with fullscreen
---
include/sway/desktop.h | 5 ++++
sway/desktop/layer_shell.c | 2 +-
sway/tree/container.c | 4 ++--
sway/tree/view.c | 48 +++++++++++++++++++++++++++++++-------
4 files changed, 48 insertions(+), 11 deletions(-)
sway/tree/container.c | 4 ++--
sway/tree/view.c | 43 +++++++++++++++++++++++++++++++++++--------
2 files changed, 37 insertions(+), 10 deletions(-)
diff --git a/include/sway/desktop.h b/include/sway/desktop.h
index 7f2f5b3e..c20f5ee6 100644
--- a/include/sway/desktop.h
+++ b/include/sway/desktop.h
@@ -11,3 +11,8 @@ void desktop_damage_whole_container(struct sway_container *con);
void desktop_damage_box(struct wlr_box *box);
void desktop_damage_view(struct sway_view *view);
+
+void apply_exclusive(struct wlr_box *usable_area,
+ uint32_t anchor, int32_t exclusive,
+ int32_t margin_top, int32_t margin_right,
+ int32_t margin_bottom, int32_t margin_left);
diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c
index 41a638ee..79833ef3 100644
--- a/sway/desktop/layer_shell.c
+++ b/sway/desktop/layer_shell.c
@@ -50,7 +50,7 @@ struct wlr_layer_surface_v1 *toplevel_layer_surface_from_surface(
} while (true);
}
-static void apply_exclusive(struct wlr_box *usable_area,
+void apply_exclusive(struct wlr_box *usable_area,
uint32_t anchor, int32_t exclusive,
int32_t margin_top, int32_t margin_right,
int32_t margin_bottom, int32_t margin_left) {
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 8c344a6d..8034029e 100644
index 62bff1ea..6cfbc27a 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -1132,7 +1132,7 @@ static void container_fullscreen_workspace(struct sway_container *con) {
@@ -1235,7 +1235,7 @@ static void container_fullscreen_workspace(struct sway_container *con) {
con->saved_height = con->pending.height;
if (con->pending.workspace) {
@ -49,7 +21,7 @@ index 8c344a6d..8034029e 100644
struct sway_seat *seat;
struct sway_workspace *focus_ws;
wl_list_for_each(seat, &server.input->seats, link) {
@@ -1159,7 +1159,7 @@ static void container_fullscreen_global(struct sway_container *con) {
@@ -1262,7 +1262,7 @@ static void container_fullscreen_global(struct sway_container *con) {
}
set_fullscreen(con, true);
@ -59,42 +31,37 @@ index 8c344a6d..8034029e 100644
con->saved_y = con->pending.y;
con->saved_width = con->pending.width;
diff --git a/sway/tree/view.c b/sway/tree/view.c
index 65ca0c9c..032f7994 100644
index ebf98faa..85adc608 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -34,6 +34,7 @@
@@ -35,6 +35,7 @@
#include "sway/config.h"
#include "sway/xdg_decoration.h"
#include "pango.h"
#include "stringop.h"
+#include "sway/layers.h"
void view_init(struct sway_view *view, enum sway_view_type type,
bool view_init(struct sway_view *view, enum sway_view_type type,
const struct sway_view_impl *impl) {
@@ -239,6 +240,23 @@ static bool gaps_to_edge(struct sway_view *view) {
@@ -250,6 +251,18 @@ static bool gaps_to_edge(struct sway_view *view) {
return gaps.top > 0 || gaps.right > 0 || gaps.bottom > 0 || gaps.left > 0;
}
+void calculate_exclusive(struct sway_output *output, struct wlr_box *usable_area) {
+ struct sway_layer_surface *sway_layer;
+ for (int i = ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; i <= ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY; ++i) {
+ struct wl_list *list = &output->layers[i];
+ wl_list_for_each_reverse(sway_layer, list, link) {
+ struct wlr_layer_surface_v1 *layer = sway_layer->layer_surface;
+ struct wlr_layer_surface_v1_state *state = &layer->current;
+ if (state->exclusive_zone <= 0) {
+ continue;
+ }
+ apply_exclusive(usable_area, state->anchor, state->exclusive_zone,
+ state->margin.top, state->margin.right,
+ state->margin.bottom, state->margin.left);
+ }
+ }
+void calculate_exclusive(struct sway_view *view, struct wlr_box *usable_area) {
+ struct wlr_surface *surface = view->surface;
+ if (!surface) return;
+ struct wlr_layer_surface_v1 *layer_surface = wlr_layer_surface_v1_try_from_wlr_surface(surface);
+ if (!layer_surface) return;
+ struct wlr_layer_surface_v1_state *state = &layer_surface->current;
+ usable_area->y += state->margin.top;
+ usable_area->height -= state->margin.top + state->margin.bottom;
+ usable_area->x += state->margin.left;
+ usable_area->width -= state->margin.left + state->margin.right;
+}
+
void view_autoconfigure(struct sway_view *view) {
struct sway_container *con = view->container;
struct sway_workspace *ws = con->pending.workspace;
@@ -250,16 +268,30 @@ void view_autoconfigure(struct sway_view *view) {
@@ -261,16 +274,30 @@ void view_autoconfigure(struct sway_view *view) {
struct sway_output *output = ws ? ws->output : NULL;
if (con->pending.fullscreen_mode == FULLSCREEN_WORKSPACE) {
@ -108,7 +75,7 @@ index 65ca0c9c..032f7994 100644
+ .width = output->width,
+ .height = output->height,
+ };
+ calculate_exclusive(output, &box);
+ calculate_exclusive(view, &box);
+ con->pending.content_x = box.x;
+ con->pending.content_y = box.y;
+ con->pending.content_width = box.width;
@ -125,7 +92,7 @@ index 65ca0c9c..032f7994 100644
+ .width = root->width,
+ .height = root->height,
+ };
+ calculate_exclusive(output, &box);
+ calculate_exclusive(view, &box);
+ con->pending.content_x = box.x;
+ con->pending.content_y = box.y;
+ con->pending.content_width = box.width;

View file

@ -59,7 +59,6 @@ in {
"flakes"
"nix-command"
"no-url-literals"
"repl-flake"
];
};
gc = {