diff --git a/lib/starship.nix b/lib/starship.nix index 6ff6e99..99192f7 100644 --- a/lib/starship.nix +++ b/lib/starship.nix @@ -1,46 +1,63 @@ {lib}: let - inherit (lib) genAttrs hasPrefix; -in { - # Convert hex colors to starship-jj TrueColor values. - starshipJjTrueColor = value: let - hexDigits = { - "0" = 0; - "1" = 1; - "2" = 2; - "3" = 3; - "4" = 4; - "5" = 5; - "6" = 6; - "7" = 7; - "8" = 8; - "9" = 9; - A = 10; - B = 11; - C = 12; - D = 13; - E = 14; - F = 15; - a = 10; - b = 11; - c = 12; - d = 13; - e = 14; - f = 15; - }; - hex = - if hasPrefix "#" value - then builtins.substring 1 6 value - else value; - hexByte = offset: hexDigits.${builtins.substring offset 1 hex} * 16 + hexDigits.${builtins.substring (offset + 1) 1 hex}; - in { - TrueColor = { - r = hexByte 0; - g = hexByte 2; - b = hexByte 4; - }; + inherit (builtins) substring; + inherit (lib) genAttrs; + + hexDigits = { + "0" = 0; + "1" = 1; + "2" = 2; + "3" = 3; + "4" = 4; + "5" = 5; + "6" = 6; + "7" = 7; + "8" = 8; + "9" = 9; + A = 10; + B = 11; + C = 12; + D = 13; + E = 14; + F = 15; + a = 10; + b = 11; + c = 12; + d = 13; + e = 14; + f = 15; }; + hexByte = hex: offset: hexDigits.${substring offset 1 hex} * 16 + hexDigits.${substring (offset + 1) 1 hex}; + + starshipHexToAnsiRgb = value: let + hex = substring 1 6 value; + in "${toString (hexByte hex 0)};${toString (hexByte hex 2)};${toString (hexByte hex 4)}"; + + starshipAnsiBackground = background: "48;2;${starshipHexToAnsiRgb background}"; + + starshipJujutsuPrompt = pkgs: background: let + inherit (pkgs) writeShellApplication; + in + writeShellApplication { + name = "jj-starship-prompt"; + runtimeInputs = with pkgs; [ + gnused + jj-starship + ]; + text = '' + printf $'\033[${starshipAnsiBackground background}m' + jj-starship --no-symbol --no-jj-prefix --no-git-prefix prompt \ + | sed $'s/\033\\[0m/\033[0m\033[${starshipAnsiBackground background}m/g' + ''; + }; +in { # keep-sorted start block=yes newline_separated=yes + # Convert a hashtagged hex color to an ANSI truecolor RGB fragment. + inherit starshipHexToAnsiRgb; + + # Build a jj-starship prompt command that preserves the shared background. + inherit starshipJujutsuPrompt; + # Build a wrapped Starship segment that uses the shared `base01` background. starshipBase01Segment = body: fg: { format = "[ ](#00000000)[ ](bg:base01)[${body}]($style)[ ](bg:base01)"; diff --git a/modules/desktop/noctalia/wallpaper.nix b/modules/desktop/noctalia/wallpaper.nix index 1b23be2..a1f68c2 100644 --- a/modules/desktop/noctalia/wallpaper.nix +++ b/modules/desktop/noctalia/wallpaper.nix @@ -5,7 +5,7 @@ programs.noctalia-shell.settings.wallpaper = { # keep-sorted start block=yes automationEnabled = true; - directory = "${picturesDir}/Wallpapers"; + directory = "${picturesDir}/wallpapers"; hideWallpaperFilenames = true; overviewEnabled = true; panelPosition = "center"; diff --git a/modules/desktop/overzicht/default.nix b/modules/desktop/overzicht/default.nix index 8f38bad..0a42d02 100644 --- a/modules/desktop/overzicht/default.nix +++ b/modules/desktop/overzicht/default.nix @@ -1,6 +1,6 @@ {inputs, ...}: { flake-file.inputs.overzicht = { - url = "github:adam01110/overzicht"; + url = "git+https://tangled.org/adam0.dev/overzicht"; inputs = { # keep-sorted start flake-parts.follows = "flake-parts"; @@ -30,6 +30,19 @@ workspaceOpacity = 1; # keep-sorted end }; + + settings.appearance.rounding = { + # keep-sorted start + full = 0; + large = 0; + normal = 0; + screenRounding = 0; + small = 0; + unsharpen = 0; + verysmall = 0; + windowRounding = 0; + # keep-sorted end + }; }; }; } diff --git a/modules/pkgs/default.nix b/modules/pkgs/default.nix index 89bf765..1d78169 100644 --- a/modules/pkgs/default.nix +++ b/modules/pkgs/default.nix @@ -10,8 +10,8 @@ crowdsec-blocklist-import djvutorga-adapter gotify-optimize-images + jj-conflict-nvim man-preview - nocheatsheet-nvim os-age performant-mode pptx2md-adapter diff --git a/modules/pkgs/neovim/jj-conflict-nvim.nix b/modules/pkgs/neovim/jj-conflict-nvim.nix new file mode 100644 index 0000000..346046a --- /dev/null +++ b/modules/pkgs/neovim/jj-conflict-nvim.nix @@ -0,0 +1,31 @@ +{ + perSystem = { + # keep-sorted start + lib, + pkgs, + # keep-sorted end + ... + }: let + inherit (pkgs) fetchFromGitHub; + inherit (pkgs.vimUtils) buildVimPlugin; + in { + packages.jj-conflict-nvim = buildVimPlugin { + pname = "jj-conflict.nvim"; + version = "0-unstable-2026-07-05"; + + src = fetchFromGitHub { + owner = "larpios"; + repo = "jj-conflict.nvim"; + rev = "b5c7b64a35a2538a27d36d45a91154306f5fb548"; + hash = "sha256-tnOXxYlU+GetU/ns9IkZ2K+gz7PAtBhZg6dR5owZidU="; + }; + + meta = with lib; { + description = "Visualize and resolve Jujutsu merge conflicts in Neovim"; + homepage = "https://github.com/larpios/jj-conflict.nvim"; + license = licenses.mit; + platforms = platforms.all; + }; + }; + }; +} diff --git a/modules/programs/cli/starship/jujutsu.nix b/modules/programs/cli/starship/jujutsu.nix index 473124f..afafa46 100644 --- a/modules/programs/cli/starship/jujutsu.nix +++ b/modules/programs/cli/starship/jujutsu.nix @@ -7,154 +7,32 @@ # keep-sorted end ... }: let - inherit (lib) getExe; - inherit (lib.self) starshipJjTrueColor; - stylixColors = config.lib.stylix.colors.withHashtag; - - ansiColor = value: let - color = starshipJjTrueColor value; - in "${toString color.TrueColor.r};${toString color.TrueColor.g};${toString color.TrueColor.b}"; - - changeUniqueStyle = "1;48;2;${ansiColor stylixColors.base01};38;2;${ansiColor stylixColors.base0E}"; - changeRestStyle = "1;48;2;${ansiColor stylixColors.base01};38;2;${ansiColor stylixColors.base04}"; - inherit - (builtins.mapAttrs (_: starshipJjTrueColor) stylixColors) + (lib.self) # keep-sorted start - base01 - base08 - base0A - base0E + starshipBase01Segment + starshipJujutsuPrompt # keep-sorted end ; + inherit (lib) getExe; - starshipJjConfig = (pkgs.formats.toml {}).generate "starship-jj.toml" { - bookmarks = { - exclude = []; - search_depth = 100; - }; - - module_separator = " "; - reset_color = false; - - module = [ - { - type = "Bookmarks"; - separator = " "; - color = base0E; - bg_color = base01; - bold = true; - behind_symbol = "⇡"; - ignore_empty_commits = "None"; - max_bookmarks = 1; - surround_with_quotes = false; - } - - { - type = "State"; - separator = " "; - - conflict = { - text = "conflict"; - color = base0A; - bg_color = base01; - bold = true; - }; - - divergent = { - text = "divergent"; - color = base0A; - bg_color = base01; - bold = true; - }; - - empty = { - disabled = true; - text = "empty"; - color = base0A; - bg_color = base01; - bold = true; - }; - - hidden = { - disabled = true; - text = "hidden"; - color = base0A; - bg_color = base01; - bold = true; - }; - - immutable = { - disabled = true; - text = "immutable"; - color = base0A; - bg_color = base01; - bold = true; - }; - } - - { - type = "Metrics"; - color = base08; - bg_color = base01; - bold = true; - hide_if_empty = true; - template = "[{changed} {added}{removed}]"; - - changed_files = { - color = base08; - bg_color = base01; - bold = true; - }; - - added_lines = { - prefix = "+"; - color = base08; - bg_color = base01; - bold = true; - }; - - removed_lines = { - prefix = "-"; - color = base08; - bg_color = base01; - bold = true; - }; - } - ]; - }; - - starshipJjPrompt = pkgs.writeShellApplication { - name = "starship-jj-prompt"; - runtimeInputs = [ - pkgs.jujutsu - pkgs.starship-jj - ]; - text = '' - unique="$(jj log --ignore-working-copy --no-graph -r @ -T 'change_id.shortest()' 2>/dev/null)" - display="$(jj log --ignore-working-copy --no-graph -r @ -T 'change_id.shortest(8)' 2>/dev/null)" - rest="''${display#"$unique"}" - - printf '\033[${changeUniqueStyle}m%s' "$unique" - printf '\033[${changeRestStyle}m%s ' "$rest" - exec starship-jj --ignore-working-copy starship prompt --starship-config ${starshipJjConfig} - ''; - }; + stylixColors = config.lib.stylix.colors.withHashtag; + jjStarshipPrompt = starshipJujutsuPrompt pkgs stylixColors.base01; in { programs.starship.settings = { # keep-sorted start block=yes newline_separated=yes - custom.jj = { - command = getExe starshipJjPrompt; - format = "[ ](#00000000)[ ](bg:base01)[$output]($style)[ ](bg:base01)"; - ignore_timeout = true; - shell = [ - "${getExe pkgs.fish}" - "-c" - ]; - style = "bg:base01 fg:base0E bold"; - use_stdin = false; - when = "${getExe pkgs.starship-jj} root --quiet"; - }; + custom.jj = + starshipBase01Segment "$output" "base0E bold" + // { + command = getExe jjStarshipPrompt; + ignore_timeout = true; + shell = [ + (getExe pkgs.fish) + "-c" + ]; + use_stdin = false; + when = "${getExe pkgs.jj-starship} detect"; + }; fossil_branch = { format = "[$symbol$branch]($style) "; diff --git a/modules/programs/jujutsu.nix b/modules/programs/jujutsu.nix index 3d9ef76..aeb1c76 100644 --- a/modules/programs/jujutsu.nix +++ b/modules/programs/jujutsu.nix @@ -42,10 +42,14 @@ programs.jujutsu = { enable = true; - settings.signing = { - backend = "gpg"; - behavior = "own"; - key = gitSigningKey; + settings = { + signing = { + backend = "gpg"; + behavior = "own"; + key = gitSigningKey; + }; + + ui.default-command = "log"; }; }; # keep-sorted end diff --git a/modules/programs/tui/neovim/components/git.nix b/modules/programs/tui/neovim/components/git.nix index 0d2019d..414a85e 100644 --- a/modules/programs/tui/neovim/components/git.nix +++ b/modules/programs/tui/neovim/components/git.nix @@ -1,41 +1,33 @@ { flake.modules.homeManager.neovim = { - programs.nvf.settings.vim.git = { - # keep-sorted start block=yes newline_separated=yes - git-conflict.enable = true; + programs.nvf.settings.vim.git.gitsigns = { + enable = true; - gitsigns = { - enable = true; - - setupOpts = { - # keep-sorted start block=yes newline_separated=yes - signs = { - # keep-sorted start - add.text = "▎"; - change.text = "▎"; - changedelete.text = "▎"; - delete.text = ""; - topdelete.text = ""; - untracked.text = "┆"; - # keep-sorted end - }; + setupOpts = { + # keep-sorted start block=yes newline_separated=yes + signs = { + # keep-sorted start + add.text = "▎"; + change.text = "▎"; + changedelete.text = "▎"; + delete.text = ""; + topdelete.text = ""; + untracked.text = "┆"; + # keep-sorted end + }; - signs_staged = { - # keep-sorted start - add.text = "▎"; - change.text = "▎"; - changedelete.text = "▎"; - delete.text = ""; - topdelete.text = ""; - untracked.text = "┆"; - # keep-sorted end - }; + signs_staged = { + # keep-sorted start + add.text = "▎"; + change.text = "▎"; + changedelete.text = "▎"; + delete.text = ""; + topdelete.text = ""; + untracked.text = "┆"; # keep-sorted end }; + # keep-sorted end }; - - vim-fugitive.enable = true; - # keep-sorted end }; }; } diff --git a/modules/programs/tui/neovim/components/jujutsu.nix b/modules/programs/tui/neovim/components/jujutsu.nix new file mode 100644 index 0000000..05dbe8c --- /dev/null +++ b/modules/programs/tui/neovim/components/jujutsu.nix @@ -0,0 +1,42 @@ +{ + flake.modules.homeManager.neovim = {pkgs, ...}: { + programs.nvf.settings.vim.lazy.plugins = { + "jj-conflict.nvim" = { + package = pkgs.jj-conflict-nvim; + setupModule = "jj-conflict"; + + cmd = [ + # keep-sorted start + "JjConflictChooseBoth" + "JjConflictChooseNone" + "JjConflictChooseOurs" + "JjConflictChooseTheirs" + "JjConflictDiff" + "JjConflictList" + "JjConflictLog" + "JjConflictNextConflict" + "JjConflictPrevConflict" + "JjConflictResolve" + "JjConflictSquash" + "JjConflictStatus" + # keep-sorted end + ]; + event = ["BufReadPre" "BufNewFile"]; + }; + + "jj.nvim" = { + package = pkgs.vimPlugins.jj-nvim; + setupModule = "jj"; + + cmd = [ + # keep-sorted start + "J" + "Jdiff" + "Jhdiff" + "Jvdiff" + # keep-sorted end + ]; + }; + }; + }; +}