mirror of
https://github.com/Cian-H/dotfiles.git
synced 2025-12-25 12:31:56 +00:00
This change allows the dotfiles to work with chezmoi (e.g: on windows) and improves grepability with neovim/telescope
11 lines
795 B
Plaintext
11 lines
795 B
Plaintext
### add to configuration.nix
|
|
|
|
nix.settings.experimental-features = ["nix-command"];
|
|
|
|
system.activationScripts.diff = ''
|
|
if [[ -e /run/current-system ]]; then
|
|
${pkgs.nushell}/bin/nu -c "let diff_closure = (${pkgs.nix}/bin/nix store diff-closures /run/current-system '$systemConfig'); let table = (\$diff_closure | lines | where \$it =~ KiB | where \$it =~ → | parse -r '^(?<Package>\S+): (?<Old>[^,]+)(?:.*) → (?<New>[^,]+)(?:.*), (?<DiffBin>.*)$' | insert Diff { get DiffBin | ansi strip | into filesize } | sort-by -r Diff | reject DiffBin); if (\$table | get Diff | is-not-empty) { print \"\"; \$table | append [[Package Old New Diff]; [\"\" \"\" \"\" \"\"]] | append [[Package Old New Diff]; [\"\" \"\" \"Total:\" (\$table | get Diff | math sum) ]] | print; print \"\" }"
|
|
fi
|
|
'';
|
|
|