From 78376739d59f8d224c71a8b076719a102d2bcd7d Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Wed, 19 Nov 2025 20:29:29 +0100 Subject: [PATCH] lasdljkasdjkl --- justfile | 45 ++++++++++++++++--- profiles/desktop/gnome/default.nix | 2 + users/pbsds/home/profiles/desktop/default.nix | 1 + .../home/profiles/desktop/ghostty/default.nix | 25 +++++++++-- .../profiles/desktop/ghostty/ghosty.config | 2 +- .../home/profiles/desktop/gnome/default.nix | 1 + .../home/profiles/desktop/zed/remote.nix | 2 +- 7 files changed, 66 insertions(+), 12 deletions(-) diff --git a/justfile b/justfile index 64061bf..51645ff 100644 --- a/justfile +++ b/justfile @@ -53,11 +53,6 @@ pull-dconf: -gum confirm "git checkout --path?" --default=no \ && git checkout --patch ./users/pbsds/home/profiles/desktop/gnome/ -# compares new closure against /run/current-system -@build-diff: build - # nvd diff /run/current-system ./result # python based, slow - dix /run/current-system ./result # rust based, fast, nixos-unstable only - # todo: support system-manager # todo: support home-manager? build hostname="" *_: @@ -73,8 +68,21 @@ build-vm-and-run $hostname=`just _a_host` *_: @just build-vm "$hostname" "${@:2}" ./result/bin/run-"$hostname"-vm -# build-home $user=`whoami`: -# #!/usr/bin/env -S bash -euo pipefail +# compares new closure against /run/current-system +build-diff $hostname="" *_: + #!/usr/bin/env -S bash -euo pipefail + current_system="/run/current-system" + new_system="$(just build "$hostname" "${@:2}")" + echo; set -x + # nvd diff "$current_system" "$new_system" # python based, slow + dix "$current_system" "$new_system" # rust based, fast, nixos-unstable only + +build-closure-size $hostname="" *_: + #!/usr/bin/env -S bash -euo pipefail + new_system="$(just build "$hostname" "${@:2}")" + echo; set -x + # nix path-info --recursive --size --closure-size --human-readable "$new_system" | sort -nk3 # broki + nix path-info --recursive --size --closure-size "$new_system" | sort -nk3 | numfmt --field=2,3 --to iec test *_: sudo nixos-rebuild-ng test --accept-flake-config --show-trace --flake . "$@" @@ -108,6 +116,16 @@ push $hostname=`just _a_host` cmd=`gum choose test switch boot --header "Select set -x; NIX_NO_NOM=1 nixos-rebuild {{cmd}} --flake .#"$hostname" --target-host "root@$target_host" --use-substitutes fi +home-why-depends $attrpath: + #!/usr/bin/env -S bash -euo pipefail + hostname="$(hostname)" + username="$(whoami)" + set -x + # assumes useGlobalPkgs + nix why-depends \ + .#nixosConfigurations."${hostname}".config.home-manager.users."${username}".home.activationPackage \ + .#nixosConfigurations."${hostname}".pkgs."$attrpath" + home-eval: #!/usr/bin/env -S bash -euo pipefail hostname="$(hostname)" @@ -136,6 +154,13 @@ home-build-diff *_: home-build # nvd diff "$current_home" "$new_home" # python based, slow dix "$current_home" "$new_home" # rust based, fast, nixos-unstable only +home-build-closure-size *_: + #!/usr/bin/env -S bash -euo pipefail + new_home="$(just home-build --print-out-paths "${@:1}")" + set -x + # nix path-info --recursive --size --closure-size --human-readable "$new_home" | sort -nk3 # broki + nix path-info --recursive --size --closure-size "$new_home" | sort -nk3 | numfmt --field=2,3 --to iec + home-switch *_: #!/usr/bin/env -S bash -euo pipefail new_home="$(just home-build --print-out-paths "${@:1}")" @@ -143,6 +168,12 @@ home-switch *_: # ./result/activate "$new_home"/activate +# QoL +alias build-home := home-build +alias build-diff-home := home-build-diff +alias build-closure-size-home := home-build-closure-size +alias switch-home := home-switch + # test-files $hostname=`just _a_host` *filenames: # #!/usr/bin/env -S bash -euo pipefail # # TODO: remember previous choices diff --git a/profiles/desktop/gnome/default.nix b/profiles/desktop/gnome/default.nix index 3a54bec..3795d45 100644 --- a/profiles/desktop/gnome/default.nix +++ b/profiles/desktop/gnome/default.nix @@ -92,6 +92,8 @@ https://wiki.nixos.org/wiki/GNOME # or https://github.com/fsnotify/fsnotify environment.gnome.excludePackages = [ + pkgs.gnome-console + pkgs.gnome-terminal pkgs.gnome-photos pkgs.gnome-tour pkgs.gnome-maps diff --git a/users/pbsds/home/profiles/desktop/default.nix b/users/pbsds/home/profiles/desktop/default.nix index 368a635..e7556ea 100644 --- a/users/pbsds/home/profiles/desktop/default.nix +++ b/users/pbsds/home/profiles/desktop/default.nix @@ -57,6 +57,7 @@ gitg imhex + xdot remote-exec diff --git a/users/pbsds/home/profiles/desktop/ghostty/default.nix b/users/pbsds/home/profiles/desktop/ghostty/default.nix index 5e36b37..ac8f1ee 100644 --- a/users/pbsds/home/profiles/desktop/ghostty/default.nix +++ b/users/pbsds/home/profiles/desktop/ghostty/default.nix @@ -1,8 +1,27 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: { + # this predates the home-manager module, and that kinda sucks anyway due to repeated keys in the config file home.packages = [ pkgs.ghostty ]; - home.file.".config/ghostty/config".source = ./ghosty.config; - home.file.".config/ghostty/config".force = true; + home.file.".config/ghostty/config" = { + source = ./ghosty.config; + force = true; + onChange = '' + ${lib.getExe pkgs.ghostty} +validate-config --config-file=${./ghosty.config} + ''; + }; + + # bash integration, optional + # https://ghostty.org/docs/features/shell-integration#manual-shell-integration-setup + + # # Make order 101 to be placed exactly after bash completions, as Ghostty + # # documentation suggests sourcing the script as soon as possible + # programs.bash.initExtra = lib.mkOrder 101 '' + # if [[ -n "''${GHOSTTY_RESOURCES_DIR}" ]]; then + # builtin source "''${GHOSTTY_RESOURCES_DIR}/shell-integration/bash/ghostty.bash" + # fi + # ''; + + # try to make nautilus use this as the default gnome-console/gnome-terminal # dconf.settings."org/gnome/desktop/default-applications/terminal" = { dconf.settings."org/gnome/desktop/default/applications/terminal" = { diff --git a/users/pbsds/home/profiles/desktop/ghostty/ghosty.config b/users/pbsds/home/profiles/desktop/ghostty/ghosty.config index 2693f6a..2a15c5f 100644 --- a/users/pbsds/home/profiles/desktop/ghostty/ghosty.config +++ b/users/pbsds/home/profiles/desktop/ghostty/ghosty.config @@ -5,7 +5,7 @@ foreground = #d3d7cf #palette = 0=#d3d7cf #window-decoration = false gtk-wide-tabs = false -#bell-features = "system,attention,title" # available from v1.2 +#bell-features = "system,attention,title" # available from v1.2, i.e. nixos 25.11 #font-synthetic-style = true #font-style = false diff --git a/users/pbsds/home/profiles/desktop/gnome/default.nix b/users/pbsds/home/profiles/desktop/gnome/default.nix index 65b63d5..ed5b594 100644 --- a/users/pbsds/home/profiles/desktop/gnome/default.nix +++ b/users/pbsds/home/profiles/desktop/gnome/default.nix @@ -15,6 +15,7 @@ let removable-drive-menu always-show-titles-in-overview vitals + pip-on-top /* TODO: night-light-slider tray-icons-reloaded diff --git a/users/pbsds/home/profiles/desktop/zed/remote.nix b/users/pbsds/home/profiles/desktop/zed/remote.nix index eee07a2..0853700 100644 --- a/users/pbsds/home/profiles/desktop/zed/remote.nix +++ b/users/pbsds/home/profiles/desktop/zed/remote.nix @@ -25,7 +25,7 @@ nil # nix unstable.nixfmt-rfc-style # nix harper # harper - vale-ls vale # vale + # vale-ls vale # vale, will nag a lot if no vale config present in project typos-lsp # typos tinymist # typst zls # zig