From 117bdea98a84773265344a8c11dff4c78186af93 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Fri, 3 Jan 2025 17:24:21 +0100 Subject: [PATCH 1/5] add a criminally stupid cursed fucking template system to this config for automatically editing nix files --- build-utils/templ-edit.nu | 47 ++++++++++++++++++++++ modules/desktop-environment/home/typst.nix | 4 +- 2 files changed, 49 insertions(+), 2 deletions(-) create mode 100755 build-utils/templ-edit.nu diff --git a/build-utils/templ-edit.nu b/build-utils/templ-edit.nu new file mode 100755 index 0000000..e38fc89 --- /dev/null +++ b/build-utils/templ-edit.nu @@ -0,0 +1,47 @@ +#!/usr/bin/env nu + +def main [] {} + +def "main find" [ + file: string +] { + open $file --raw + | lines + | enumerate + | update item {|it| $it.item | parse '{current}#:{name}:-{template}-:#' } + | filter {|it| $it.item | is-not-empty} + | flatten -a + | rename -c { index: line } +} + +# TODO: support mroe then single template +def "main edit" [ + file: path + name: string + to: string + --preview +] { + let template = main find $file + | where name == $name + | first; + let new = $template.template + | str replace $"%($name)%" $to + | append $" #:($template.name):-($template.template)-:#" + | str join; + let rest = open $file --raw + | lines + | enumerate + | where index != $template.line + | append { index: $template.line, item: $new} + | sort-by index + | reject index + | get item + | append "" + | str join "\n"; + + if $preview { + print $rest + } else { + $rest | save -f $file + } +} diff --git a/modules/desktop-environment/home/typst.nix b/modules/desktop-environment/home/typst.nix index 4bf4d64..e6fc769 100644 --- a/modules/desktop-environment/home/typst.nix +++ b/modules/desktop-environment/home/typst.nix @@ -4,8 +4,8 @@ domain = "forge.katzen.cafe"; owner = "schrottkatze"; repo = "typst-configs"; - rev = "569cd8525a85878140baf5952597f27fd7ea51d3"; - sha256 = "sha256-4pAammwrFGhpSquEsh4QSd8Hw/ioHm3fMiC5oqNgbAQ="; + rev = "569cd8525a85878140baf5952597f27fd7ea51d3"; #:REV:- rev = "%REV%";-:# + sha256 = "sha256-4pAammwrFGhpSquEsh4QSd8Hw/ioHm3fMiC5oqNgbAQ="; #:SHA:- sha256 = "%SHA%";-:# }; flow = pkgs.fetchFromGitHub { owner = "MultisampledNight"; From 879c0f98233d217520935cdebdd986b9967fb5ab Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Fri, 3 Jan 2025 17:25:36 +0100 Subject: [PATCH 2/5] retheme --- .../home/panels/eww/configDir/eww.css | 5 ++++- modules/desktop-environment/home/terminal.nix | 10 +++++----- modules/shell/helix.nix | 2 +- modules/shell/nu/env.nu | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/modules/desktop-environment/home/panels/eww/configDir/eww.css b/modules/desktop-environment/home/panels/eww/configDir/eww.css index 94ff7aa..a61a23f 100644 --- a/modules/desktop-environment/home/panels/eww/configDir/eww.css +++ b/modules/desktop-environment/home/panels/eww/configDir/eww.css @@ -2,9 +2,12 @@ label { font: 14pt "Departure Mono Nerd Font"; } +.background { + background-color: #1d2021; +} + .workspaces button { border: 0px; - background-color: #282828; } .workspaces button.urgent { diff --git a/modules/desktop-environment/home/terminal.nix b/modules/desktop-environment/home/terminal.nix index c8b3b54..cfa9ac2 100644 --- a/modules/desktop-environment/home/terminal.nix +++ b/modules/desktop-environment/home/terminal.nix @@ -2,13 +2,13 @@ programs.kitty = { enable = true; font = { - name = "FiraCode Nerd Font"; - size = 11; + name = "Departure Mono Nerd Font"; + size = 12; }; keybindings = { "ctrl+shift+n" = "new_os_window_with_cwd"; }; - settings = { + settings = rec { #adjust_column_width = "70%"; color0 = "#282828"; color8 = "#928374"; @@ -26,8 +26,8 @@ color14 = "#8ec07c"; color7 = "#a89984"; color15 = "#ebdbb2"; - foreground = "#ebdbb2"; - background = "#282828"; + foreground = color15; + background = "#1d2021"; confirm_os_window_close = 0; }; }; diff --git a/modules/shell/helix.nix b/modules/shell/helix.nix index ad5b857..1f8a2f2 100644 --- a/modules/shell/helix.nix +++ b/modules/shell/helix.nix @@ -25,7 +25,7 @@ defaultEditor = true; package = helix-inline-diags.outputs.packages."x86_64-linux".default; settings = { - theme = "gruvbox"; + theme = "gruvbox_dark_hard"; editor = { line-number = "relative"; bufferline = "multiple"; diff --git a/modules/shell/nu/env.nu b/modules/shell/nu/env.nu index 908d237..5df3a55 100644 --- a/modules/shell/nu/env.nu +++ b/modules/shell/nu/env.nu @@ -35,9 +35,9 @@ $env.PROMPT_COMMAND = {|| let deco = if ($env.CMD_COUNT == 0) { flag $TRANS "=" $len } else if ($env.CMD_COUNT | is even) { - flag $LESBIAN "-" $len + flag $LESBIAN "–" $len } else { - flag $TRANS "-" $len + flag $TRANS "–" $len }; $item | append $deco | str join From 6bacec4c8484a35d34fdc594aa97ff90a6eba097 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Fri, 3 Jan 2025 17:25:53 +0100 Subject: [PATCH 3/5] fix (switch to sqlite agian) --- modules/shell/nu/config.nu | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/shell/nu/config.nu b/modules/shell/nu/config.nu index c2348f0..9a53c97 100644 --- a/modules/shell/nu/config.nu +++ b/modules/shell/nu/config.nu @@ -73,6 +73,7 @@ $env.config = { } history: { + file_format: sqlite, max_size: 1_000_000_000 # Session has to be reloaded for this to take effect isolation: false } From 141d4705fb8b1021c3b9b0c32164124f275d0ba2 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Fri, 3 Jan 2025 17:55:34 +0100 Subject: [PATCH 4/5] commit crimes to live edit nix --- justfile | 9 +++++++++ modules/desktop-environment/home/typst.nix | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 3243fda..37f346e 100644 --- a/justfile +++ b/justfile @@ -14,3 +14,12 @@ update: build-mac: sudo nixos-rebuild switch --flake . --impure --override-input mac-brcm-fw path:/home/jade/mac-brcm-fw --fast --log-format multiline + +update-typst-configs: + #!/usr/bin/env nu + let file = './modules/desktop-environment/home/typst.nix'; + let $rev = http get https://forge.katzen.cafe/schrottkatze/typst-configs/commits/branch/main | query web -mq '.commit-list tr:first-of-type a.ui.sha.label' -a href | path basename | first; + ./build-utils/templ-edit.nu edit $file REV $rev; + let $hash = nix-prefetch-url https://forge.katzen.cafe/schrottkatze/typst-configs/archive/main.tar.gz --unpack; + let $sri = nix hash to-sri --type sha256 $hash; + ./build-utils/templ-edit.nu edit $file SHA $sri; diff --git a/modules/desktop-environment/home/typst.nix b/modules/desktop-environment/home/typst.nix index e6fc769..1b7f032 100644 --- a/modules/desktop-environment/home/typst.nix +++ b/modules/desktop-environment/home/typst.nix @@ -4,8 +4,8 @@ domain = "forge.katzen.cafe"; owner = "schrottkatze"; repo = "typst-configs"; - rev = "569cd8525a85878140baf5952597f27fd7ea51d3"; #:REV:- rev = "%REV%";-:# - sha256 = "sha256-4pAammwrFGhpSquEsh4QSd8Hw/ioHm3fMiC5oqNgbAQ="; #:SHA:- sha256 = "%SHA%";-:# + rev = "7e184eecd8c6f87c08246a0bb105867423bd4fbf"; #:REV:- rev = "%REV%";-:# + sha256 = "sha256-Lv5/DxBiG7EUgcOHPL8aqztJ97s+78TXXENB7lb1olM="; #:SHA:- sha256 = "%SHA%";-:# }; flow = pkgs.fetchFromGitHub { owner = "MultisampledNight"; From c42079235f411077b0c27fe6b94f3ea94b83dd78 Mon Sep 17 00:00:00 2001 From: Schrottkatze Date: Fri, 3 Jan 2025 19:04:46 +0100 Subject: [PATCH 5/5] mreow --- justfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 37f346e..9d972c9 100644 --- a/justfile +++ b/justfile @@ -9,7 +9,7 @@ build: tbuild: sudo nixos-rebuild switch --flake . --impure --fast --log-format multiline-with-logs --show-trace -update: +update: update-typst-configs nix flake update --commit-lock-file --log-format multiline build-mac: @@ -23,3 +23,5 @@ update-typst-configs: let $hash = nix-prefetch-url https://forge.katzen.cafe/schrottkatze/typst-configs/archive/main.tar.gz --unpack; let $sri = nix hash to-sri --type sha256 $hash; ./build-utils/templ-edit.nu edit $file SHA $sri; + git add $file + git commit -m "typst-configs: Update"