Compare commits

..

No commits in common. "3f43e3c39f27087bec67dcaf0d3630fc13587366" and "db8a54305fe7c93baafb868fbde0b16dfa40e980" have entirely different histories.

8 changed files with 10 additions and 51 deletions

1
.gitignore vendored
View File

@ -5,4 +5,3 @@ result
.remote.toml
_*
/logs
mprocs.log

View File

@ -1,6 +1,5 @@
#!/usr/bin/env bash
export HOST_SHELL="$(command -v "$SHELL")"
export IS_REMOTE_ENV=1
eval "$(nix print-dev-env .#remoteenv)"
echo Entered "$(hostname --fqdn)"
df -h /nix/store

View File

@ -321,9 +321,9 @@
# TODO: get faketty to work ${expect}/bin/unbuffer is bad
nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" ''
if test -t 1 && test -z "''${NIX_NO_NOM-}"; then
exec ${lib.getExe pkgs.nixos-rebuild} -L "$@" |& ${lib.getExe pkgs.nix-output-monitor}
exec ${lib.getExe pkgs.nixos-rebuild} "$@" -L |& ${lib.getExe pkgs.nix-output-monitor}
else
exec ${lib.getExe pkgs.nixos-rebuild} -L "$@"
exec ${lib.getExe pkgs.nixos-rebuild} "$@" -L
fi
'';
@ -383,7 +383,6 @@
pkgs.ssh-to-age
pkgs.just
pkgs.gum
pkgs.mprocs
];
in {
envrc-local = mkShell envrc-pkgs;

View File

@ -44,8 +44,6 @@
#../../profiles/domeneshop-dyndns # handled by noximilien
];
nix.settings.max-jobs = 1; # this host do be stinky
networking.firewall.allowedTCPPorts = [ 57621 ]; # spotify local discovery
#networking.wireguard.interfaces."wg0".ips = [ "172.22.48.4/24" ]; # fyrkat

View File

@ -100,8 +100,6 @@
"kuklef.se"
];
nix.settings.max-jobs = 1; # this host do be stinky
networking.hostId = "e1ffd469"; # needed for zfs: head -c 8 /etc/machine-id
#networking.wireguard.interfaces."wg0".ips = [ "172.22.48.3/24" ]; # fyrkat

View File

@ -28,12 +28,9 @@ update:
| gum choose --no-limit --height=15 \
| xargs nix flake update --commit-lock-file
build hostname=`if test -z "$IS_REMOTE_ENV"; then just _a_host; else echo; fi`:
build hostname=`just _a_host`:
nixos-rebuild build --accept-flake-config --show-trace --flake .#"{{hostname}}"
build-no-remote-builders hostname=`if test -z "$IS_REMOTE_ENV"; then just _a_host; else echo; fi`:
nixos-rebuild build --accept-flake-config --show-trace --flake .#"{{hostname}}" --builders ""
build-vm hostname=`just _a_host`:
nixos-rebuild build-vm --accept-flake-config --show-trace --flake .#"{{hostname}}"
@ -67,42 +64,26 @@ inspect-config host=`just _a_host`:
if test "$(grep <<<"$hostnames" "^$(hostname)$" | wc -l)" -eq 1; then hostnames="$(hostname; grep <<<"$hostnames" -v "^$(hostname)$")"; fi; \
gum <<<"$hostnames" filter --placeholder "Pick a host..."
@_some_hosts:
hostnames="$(nix eval .#nixosConfigurations --apply builtins.attrNames --json 2>/dev/null | jq '.[]' -r)"; \
if test "$(grep <<<"$hostnames" "^$(hostname)$" | wc -l)" -eq 1; then hostnames="$(hostname; grep <<<"$hostnames" -v "^$(hostname)$")"; fi; \
gum <<<"$hostnames" filter --placeholder "Pick a host..." --no-limit
@_a_fqdn:
hostnames="$(nix eval .#nixosConfigurations --apply 'c: builtins.attrValues (builtins.mapAttrs (_: x: x.config.networking.fqdn) c)' --json 2>/dev/null | jq '.[]' -r)"; \
if test "$(grep <<<"$hostnames" "^$(hostname --fqdn)$" | wc -l)" -eq 1; then hostnames="$(hostname --fqdn; grep <<<"$hostnames" -v "^$(hostname --fqdn)$")"; fi; \
gum <<<"$hostnames" filter --placeholder "Pick a host..."
@_some_fqdns:
hostnames="$(nix eval .#nixosConfigurations --apply 'c: builtins.attrValues (builtins.mapAttrs (_: x: x.config.networking.fqdn) c)' --json 2>/dev/null | jq '.[]' -r)"; \
if test "$(grep <<<"$hostnames" "^$(hostname --fqdn)$" | wc -l)" -eq 1; then hostnames="$(hostname --fqdn; grep <<<"$hostnames" -v "^$(hostname --fqdn)$")"; fi; \
gum <<<"$hostnames" filter --placeholder "Pick a host..." --no-limit
@remote-current:
>&2 echo Current remote: $(remote-host)
@remote-list:
tomlq <.remote.toml '.hosts | to_entries[] | "remote-set \(.key+1) # -> \(.value.host)"' -r
@remote-set remote=`just remote-current && just _a_remote_label`:
@remote-set remote=`just remote-current && just _a-remote-label`:
remote-set {{remote}}
@_a_remote_label:
@_a-remote-label:
just remote-list | gum filter --placeholder "Pick a remote..." | cut -d' ' -f2
@_some_remote_labels:
just remote-list | gum filter --placeholder "Pick remotes..." --no-limit | cut -d' ' -f2
@_a_remote_fqdn:
@_a-remote-fqdn:
just remote-list | gum filter --placeholder "Pick a remote..." | cut -d' ' -f5-
@_some_remote_fqdns:
just remote-list | gum filter --placeholder "Pick remote..." --no-limit | cut -d' ' -f5-
@_remote_ensure hostname=`just _a_fqdn`:
if test ! -s .remote.toml; then remote-init "{{ hostname }}"; \
elif tomlq <.remote.toml '.hosts | to_entries[] |.value.host' -r | grep -q "{{ hostname }}"; then true; \
@ -110,17 +91,12 @@ inspect-config host=`just _a_host`:
fi
@_remote_label_from_fqdn hostname=`just _a_fqdn`:
tomlq <.remote.toml '.hosts | to_entries[] | select(.value.host == "{{ hostname }}") | .key+1' -r
tomlq <.remote.toml '.hosts | to_entries[] | select(.value.host == "{{ hostname }}") | .key' -r
@remote-mprocs +$cmd=`printf "just %s\n" $(just --summary --unsorted) | gum filter --placeholder "Pick a recipie..."`:
just _some_remote_labels | sed -E 's/(.*)/remote --label="\1" "env NIX_NO_NOM=1 $cmd"/g' | xargs -d'\n' mprocs
@remote-mprocs-new +$cmd=`printf "just %s\n" $(just --summary --unsorted) | gum filter --placeholder "Pick a recipie..."`:
just _some_fqdns | xe -s 'just _remote_ensure "$1"; just _remote_label_from_fqdn "$1"' | sed -E 's/(.*)/remote --label="\1" "env NIX_NO_NOM=1 $cmd"/g' | xargs -d'\n' mprocs
# TODO: support multiple labels, run in tmux
#remote label=`just _a_remote_label` cmd=`printf "just %s\n" $(just --summary --unsorted) | gum filter --placeholder "Pick a recipie..."`:
# remote --label={{label}} {{cmd}}
remote label=`just _a-remote-label` cmd=`printf "just %s\n" $(just --summary --unsorted) | gum filter --placeholder "Pick a recipie..."`:
remote --label={{label}} {{cmd}}
# TODO: packaged as nix-web
@gorgon:

View File

@ -8,16 +8,7 @@
system.autoUpgrade.enable = true;
#system.autoUpgrade.allowReboot = true; # reboot after a kernel (module) or initrd upgrade, consider also setting `rebootWindow`
environment.etc."current-system-flake".source = inputs.self;
# workaround for https://github.com/NixOS/nix/issues/6895
environment.etc."current-system-flake-inputs.json".source
= pkgs.writers.writeJSON "flake-inputs.json" (
lib.flip lib.mapAttrs inputs (name: input:
# inputs.*.sourceInfo sans outPath, since writeJSON will otherwise serialize sourceInfo like derivation
lib.filterAttrs (key: val: !builtins.elem key ["outPath"]) (input.sourceInfo or {})
// { store-path = input.outPath; } # comment this line if you don't want to retain a store reference to the flake inputs
)
);
environment.etc."current-system-flake".source = inputs.self; # the plan was to allow me to locate the new flake.lock, but alas https://github.com/NixOS/nix/issues/6895
#system.autoUpgrade.flake = inputs.self.outPath; # a nix store path
#system.autoUpgrade.flake = "github:pbsds/nix-config"; # TODO: use this instead?

View File

@ -21,7 +21,6 @@ with lib.hm.gvariant;
font-antialiasing = "grayscale";
font-hinting = "slight";
font-name = "Noto Sans 10";
#gtk-enable-primary-paste = false;
gtk-theme = "Colloid-Dark";
icon-theme = "Flat-Remix-Blue-Dark";
locate-pointer = false;