From b2e9e284b7fce2e01d1f89d7d13ae3d66fc9541d Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 14 Nov 2025 19:06:59 +0100 Subject: [PATCH] ljkdasjlasdklj --- flake.nix | 4 +-- justfile | 17 +++++++++++ users/pbsds/home/minimal.nix | 2 ++ .../profiles/desktop/ghostty/ghosty.config | 1 + users/pbsds/home/profiles/shell.nix | 5 ++-- users/pbsds/home/profiles/update-diff.nix | 28 +++++++++---------- 6 files changed, 39 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index 278491b..ba08853 100644 --- a/flake.nix +++ b/flake.nix @@ -295,7 +295,7 @@ envrc-pkgs = [ self.packages.${system}.nom-nixos-rebuild self.packages.${system}.nom-nixos-rebuild-ng - self.packages.${system}.nom-home-manager + # self.packages.${system}.nom-home-manager pkgs.nix-output-monitor pkgs.age pkgs.sops @@ -315,7 +315,7 @@ remoteenv = mkShell { } [ self.packages.${system}.nom-nixos-rebuild self.packages.${system}.nom-nixos-rebuild-ng - self.packages.${system}.nom-home-manager + # self.packages.${system}.nom-home-manager pkgs.age pkgs.ssh-to-age pkgs.just diff --git a/justfile b/justfile index 8c683f5..cf5aac2 100644 --- a/justfile +++ b/justfile @@ -108,6 +108,23 @@ 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-build *_: + #!/usr/bin/env -S bash -euo pipefail + # home-manager build --flake .#nixosConfigurations.$(hostname).config.home-manager.users.$(whoami) + nix build .#nixosConfigurations."$(hostname)".config.home-manager.users."$(whoami)".home.activationPackage "${@:1}" + # TODO: fallback to .#homeConfigurations.$(whoami) ? + # TODO: alternative behaviour for system-manager and nix-darwin + +home-build-diff: home-build + #!/usr/bin/env -S bash -euo pipefail + # nvd diff /home/pbsds/.local/state/home-manager/gcroots/current-home result # python based, slow + dix /home/pbsds/.local/state/home-manager/gcroots/current-home result # rust based, fast, nixos-unstable only + +home-switch *_: + #!/usr/bin/env -S bash -euo pipefail + # home-manager switch --flake .#nixosConfigurations.$(hostname).config.home-manager.users.$(whoami) + nix run .#nixosConfigurations."$(hostname)".config.home-manager.users."$(whoami)".home.activationPackage "${@:1}" + # test-files $hostname=`just _a_host` *filenames: # #!/usr/bin/env -S bash -euo pipefail # # TODO: remember previous choices diff --git a/users/pbsds/home/minimal.nix b/users/pbsds/home/minimal.nix index 39a8fc5..3a1d43c 100644 --- a/users/pbsds/home/minimal.nix +++ b/users/pbsds/home/minimal.nix @@ -4,6 +4,8 @@ #nixpkgs.config.allowUnfree = true; home.stateVersion = "23.11"; + home.preferXdgDirectories = true; + imports = [ ./profiles/bashrc.d #./profiles/sops.nix diff --git a/users/pbsds/home/profiles/desktop/ghostty/ghosty.config b/users/pbsds/home/profiles/desktop/ghostty/ghosty.config index 945898f..2693f6a 100644 --- a/users/pbsds/home/profiles/desktop/ghostty/ghosty.config +++ b/users/pbsds/home/profiles/desktop/ghostty/ghosty.config @@ -5,6 +5,7 @@ foreground = #d3d7cf #palette = 0=#d3d7cf #window-decoration = false gtk-wide-tabs = false +#bell-features = "system,attention,title" # available from v1.2 #font-synthetic-style = true #font-style = false diff --git a/users/pbsds/home/profiles/shell.nix b/users/pbsds/home/profiles/shell.nix index 124d468..a985752 100644 --- a/users/pbsds/home/profiles/shell.nix +++ b/users/pbsds/home/profiles/shell.nix @@ -79,12 +79,13 @@ in "--bind 'end:last'" "--cycle" + # https://man.archlinux.org/man/extra/fzf/fzf.1.en#PREVIEW_WINDOW # bat is installed in bat.nix #"--preview 'head {}'" # "--preview 'bat {}'" - # "--preview 'tail -n$LINES {} | bat --file-name {} --paging never --style plain'" + # "--preview 'tail -n$FZF_LINES {} | bat --file-name {} --paging never --style plain'" # "--preview 'bat {} --paging never --style plain' --preview-window follow" - "--preview 'if [[ -f {} ]]; then tail -n$LINES {} | bat --paging=never --style=plain --color=always --file-name {} ; elif [[ -e {}/.git ]]; then git -C {} status else file {} ; fi' --preview-window follow" + "--preview 'if [[ -f {} ]]; then tail -n$FZF_LINES {} | bat --paging=never --style=plain --color=always --file-name {} ; elif [[ -e {}/.git ]]; then git -C {} status else file {} ; fi' --preview-window follow" # https://github.com/junegunn/fzf/discussions/3363#discussioncomment-6419463 "--bind 'ctrl-a:reload:eval $FZF_DEFAULT_COMMAND --no-ignore'" diff --git a/users/pbsds/home/profiles/update-diff.nix b/users/pbsds/home/profiles/update-diff.nix index b5fcf73..c8557ae 100644 --- a/users/pbsds/home/profiles/update-diff.nix +++ b/users/pbsds/home/profiles/update-diff.nix @@ -9,19 +9,19 @@ # python based # module from https://infosec.exchange/@wyndon/110662698348958506 - home.activation.show-hm-closure-diff = config.lib.dag.entryAnywhere ( - if pkgs ? dix then - '' - if [[ -v oldGenPath ]]; then - ${pkgs.dix}/bin/dix $oldGenPath $newGenPath - fi - '' - else - '' - if [[ -v oldGenPath ]]; then - ${pkgs.nvd}/bin/nvd diff $oldGenPath $newGenPath - fi - '' - ); + home.activation.show-hm-closure-diff = config.lib.dag.entryAnywhere '' + if [[ -v oldGenPath ]]; then + ${ + if pkgs ? dix then + '' + ${pkgs.dix}/bin/dix $oldGenPath $newGenPath + '' + else + '' + ${pkgs.nvd}/bin/nvd diff $oldGenPath $newGenPath + '' + } + fi + ''; }