Compare commits

...

5 commits

Author SHA1 Message Date
Schrottkatze
c42079235f
mreow 2025-01-03 19:04:46 +01:00
Schrottkatze
141d4705fb
commit crimes to live edit nix 2025-01-03 17:55:34 +01:00
Schrottkatze
6bacec4c84
fix (switch to sqlite agian) 2025-01-03 17:25:53 +01:00
Schrottkatze
879c0f9823
retheme 2025-01-03 17:25:36 +01:00
Schrottkatze
117bdea98a
add a criminally stupid cursed fucking template system to this config for automatically editing nix files 2025-01-03 17:24:21 +01:00
8 changed files with 74 additions and 12 deletions

47
build-utils/templ-edit.nu Executable file
View file

@ -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
}
}

View file

@ -9,8 +9,19 @@ 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:
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;
git add $file
git commit -m "typst-configs: Update"

View file

@ -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 {

View file

@ -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;
};
};

View file

@ -4,8 +4,8 @@
domain = "forge.katzen.cafe";
owner = "schrottkatze";
repo = "typst-configs";
rev = "569cd8525a85878140baf5952597f27fd7ea51d3";
sha256 = "sha256-4pAammwrFGhpSquEsh4QSd8Hw/ioHm3fMiC5oqNgbAQ=";
rev = "7e184eecd8c6f87c08246a0bb105867423bd4fbf"; #:REV:- rev = "%REV%";-:#
sha256 = "sha256-Lv5/DxBiG7EUgcOHPL8aqztJ97s+78TXXENB7lb1olM="; #:SHA:- sha256 = "%SHA%";-:#
};
flow = pkgs.fetchFromGitHub {
owner = "MultisampledNight";

View file

@ -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";

View file

@ -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
}

View file

@ -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