From 45d0cd8312f0de7a3482271b1ce0d5ea78340af6 Mon Sep 17 00:00:00 2001 From: RGBCube Date: Sun, 9 Feb 2025 16:15:08 +0300 Subject: [PATCH] Fix lldb for helix --- modules/common/git.nix | 2 +- modules/common/helix/default.nix | 28 +++++++++++++++------------- modules/common/nix.nix | 2 +- modules/common/ripgrep.nix | 2 +- modules/linux/firefox.nix | 2 +- modules/linux/hyprland/fuzzel.nix | 2 +- modules/linux/hyprland/waybar.nix | 2 +- modules/linux/sudo.nix | 4 ++-- 8 files changed, 23 insertions(+), 21 deletions(-) diff --git a/modules/common/git.nix b/modules/common/git.nix index 22f6aa5..3cee74a 100644 --- a/modules/common/git.nix +++ b/modules/common/git.nix @@ -81,7 +81,7 @@ in { gitUrl = "https://git.rgbcu.be/"; gitDomain = head <| match "https://(.*)/" gitUrl; in { - programs.nushell.configFile.text = mkAfter '' + programs.nushell.configFile.text = mkAfter /* nu */ '' # Sets the remote origin to the specified user and repository on my git instance def gsr [user_and_repo: string] { let user_and_repo = if ($user_and_repo | str index-of "/") != -1 { diff --git a/modules/common/helix/default.nix b/modules/common/helix/default.nix index f74d59d..7258bf3 100644 --- a/modules/common/helix/default.nix +++ b/modules/common/helix/default.nix @@ -22,7 +22,7 @@ in { })]; home-manager.sharedModules = [{ - programs.nushell.configFile.text = mkIf (config.isDesktop && config.isLinux) <| mkAfter '' + programs.nushell.configFile.text = mkIf (config.isDesktop && config.isLinux) <| mkAfter /* nu */ '' def --wrapped hx [...arguments] { if $env.TERM == "xterm-kitty" { kitty @ set-spacing padding=0 @@ -118,20 +118,22 @@ in { }]; args.program = "{0}"; - args.initCommands = [ "command script import ${pkgs.writeText "lldb_dap_rustc_primer.py" '' - import subprocess - import pathlib - import lldb + args.initCommands = let + primer = pkgs.writeTextDir "lldb_dap_rustc_primer.py" /* py */ '' + import subprocess + import pathlib + import lldb - # Not hardcoding a nix store path here on purpose. - rustlib_etc = pathlib.Path(subprocess.getoutput("rustc --print sysroot")) / "lib" / "rustlib" / "etc" - if not rustlib_etc.exists(): - raise RuntimeError("Unable to determine rustc sysroot") + # Not hardcoding a nix store path here on purpose. + rustlib_etc = pathlib.Path(subprocess.getoutput("rustc --print sysroot")) / "lib" / "rustlib" / "etc" + if not rustlib_etc.exists(): + raise RuntimeError("Unable to determine rustc sysroot") - # Load lldb_lookup.py and execute lldb_commands with the correct path - lldb.debugger.HandleCommand(f"""command script import "{rustlib_etc / 'lldb_lookup.py'}" """) - lldb.debugger.HandleCommand(f"""command source -s 0 "{rustlib_etc / 'lldb_commands'}" """) - ''}" ]; + # Load lldb_lookup.py and execute lldb_commands with the correct path + lldb.debugger.HandleCommand(f"""command script import "{rustlib_etc / 'lldb_lookup.py'}" """) + lldb.debugger.HandleCommand(f"""command source -s 0 "{rustlib_etc / 'lldb_commands'}" """) + ''; + in [ "command script import ${primer}/lldb_dab_rustc_primer.py" ]; }]; } ]; diff --git a/modules/common/nix.nix b/modules/common/nix.nix index 1d20c9d..458c514 100644 --- a/modules/common/nix.nix +++ b/modules/common/nix.nix @@ -38,7 +38,7 @@ in { ]; home-manager.sharedModules = [{ - programs.nushell.configFile.text = mkAfter '' + programs.nushell.configFile.text = mkAfter /* nu */ '' def --wrapped nr [program: string = "", ...arguments] { if ($program | str contains "#") or ($program | str contains ":") { nix run $program -- ...$arguments diff --git a/modules/common/ripgrep.nix b/modules/common/ripgrep.nix index 23f3910..f31905f 100644 --- a/modules/common/ripgrep.nix +++ b/modules/common/ripgrep.nix @@ -1,7 +1,7 @@ { lib, ... }: let inherit (lib) enabled; in { - environment.shellAliases.todo = ''rg "todo|fixme" --colors match:fg:yellow --colors match:style:bold''; + environment.shellAliases.todo = /* sh */ ''rg "todo|fixme" --colors match:fg:yellow --colors match:style:bold''; home-manager.sharedModules = [{ programs.ripgrep = enabled { diff --git a/modules/linux/firefox.nix b/modules/linux/firefox.nix index 2ba35f0..e5fe239 100644 --- a/modules/linux/firefox.nix +++ b/modules/linux/firefox.nix @@ -16,7 +16,7 @@ in merge <| mkIf config.isDesktop { "toolkit.legacyUserProfileCustomizations.stylesheets" = true; }; - userChrome = '' + userChrome = /* css */ '' #TabsToolbar { visibility: collapse; } diff --git a/modules/linux/hyprland/fuzzel.nix b/modules/linux/hyprland/fuzzel.nix index 2f9a8d8..e4f9ea8 100644 --- a/modules/linux/hyprland/fuzzel.nix +++ b/modules/linux/hyprland/fuzzel.nix @@ -3,7 +3,7 @@ in merge <| mkIf config.isDesktop { home-manager.sharedModules = [{ wayland.windowManager.hyprland.settings = { - bindl = [(replaceStrings [ "\n;" "\n" ] [ ";" "" ] '' + bindl = [(replaceStrings [ "\n;" "\n" ] [ ";" "" ] /* sh */ '' , XF86PowerOff, exec, pkill fuzzel; echo -en "Suspend\0icon\x1fsystem-suspend\nHibernate\0icon\x1fsystem-suspend-hibernate-alt2\nPower Off\0icon\x1fsystem-shutdown\nReboot\0icon\x1fsystem-reboot" diff --git a/modules/linux/hyprland/waybar.nix b/modules/linux/hyprland/waybar.nix index 5164d7b..e43a6e2 100644 --- a/modules/linux/hyprland/waybar.nix +++ b/modules/linux/hyprland/waybar.nix @@ -89,7 +89,7 @@ in merge <| mkIf config.isDesktop { clock.tooltip-format = "{:%Y %B}\n{calendar}"; }]; - style = '' + style = /* css */ '' * { border: none; border-radius: ${toString cornerRadius}px; diff --git a/modules/linux/sudo.nix b/modules/linux/sudo.nix index 7e0f9fb..c542cce 100644 --- a/modules/linux/sudo.nix +++ b/modules/linux/sudo.nix @@ -3,11 +3,11 @@ in merge { security.sudo = enabled { execWheelOnly = true; - extraConfig = '' + extraConfig = /* sudo */ '' Defaults lecture = never Defaults pwfeedback Defaults env_keep += "DISPLAY EDITOR PATH" - ${optionalString config.isServer '' + ${optionalString config.isServer /* sudo */ '' Defaults timestamp_timeout = 0 ''} '';