Compare commits

..

No commits in common. "dfd8f31f1e99a79f1b954fae1446ad50f4a0b1d9" and "6132cb3c9a905f60d88ddf705d358191db07ebf0" have entirely different histories.

2 changed files with 3 additions and 13 deletions

View File

@ -28,12 +28,10 @@ update:
| gum choose --no-limit --height=15 \ | gum choose --no-limit --height=15 \
| xargs nix flake update --commit-lock-file | xargs nix flake update --commit-lock-file
#build hostname=`if test -z "${IS_REMOTE_ENV:-}"; then just _a_host_timeout; else echo; fi`: build hostname=`if test -z "${IS_REMOTE_ENV:-}"; then just _a_host; else echo; fi`:
build hostname="":
nixos-rebuild build --accept-flake-config --show-trace --flake .#"{{hostname}}" 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_timeout; else echo; fi`: build-no-remote-builders hostname=`if test -z "$IS_REMOTE_ENV"; then just _a_host; else echo; fi`:
build-no-remote-builders hostname="":
nixos-rebuild build --accept-flake-config --show-trace --flake .#"{{hostname}}" --builders "" nixos-rebuild build --accept-flake-config --show-trace --flake .#"{{hostname}}" --builders ""
build-vm hostname=`just _a_host`: build-vm hostname=`just _a_host`:
@ -69,12 +67,6 @@ inspect-config host=`just _a_host` prefix="":
if test "$(grep <<<"$hostnames" "^$(hostname)$" | wc -l)" -eq 1; then hostnames="$(hostname; grep <<<"$hostnames" -v "^$(hostname)$")"; fi; \ if test "$(grep <<<"$hostnames" "^$(hostname)$" | wc -l)" -eq 1; then hostnames="$(hostname; grep <<<"$hostnames" -v "^$(hostname)$")"; fi; \
gum <<<"$hostnames" filter --placeholder "Pick a host..." gum <<<"$hostnames" filter --placeholder "Pick a host..."
# ctrl-c is counted as a timeout...
@_a_host_timeout:
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..." --timeout 5s || hostname
@_some_hosts: @_some_hosts:
hostnames="$(nix eval .#nixosConfigurations --apply builtins.attrNames --json 2>/dev/null | jq '.[]' -r)"; \ 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; \ if test "$(grep <<<"$hostnames" "^$(hostname)$" | wc -l)" -eq 1; then hostnames="$(hostname; grep <<<"$hostnames" -v "^$(hostname)$")"; fi; \

View File

@ -8,7 +8,7 @@
(pkgs.makeDesktopItem { (pkgs.makeDesktopItem {
desktopName = "Open Syncthing"; desktopName = "Open Syncthing";
name = "Syncthing"; name = "Syncthing";
exec = "${pkgs.xdg-utils}/bin/xdg-open http://${config.services.syncthing.guiAddress}"; exec = "${pkgs.xdg-utils}/bin/xdg-open ${config.services.syncthing.guiAddress}";
icon = "${pkgs.syncthing.src}/assets/logo-512.png"; icon = "${pkgs.syncthing.src}/assets/logo-512.png";
}) })
]; ];
@ -41,9 +41,7 @@
/* devices."bjarte".autoAcceptFolders = true; # TODO */ /* devices."bjarte".autoAcceptFolders = true; # TODO */
folders = lib.flip lib.pipe [ folders = lib.flip lib.pipe [
# add `path` default
(lib.mapAttrs (name: attrs: { path = lib.mkDefault "${config.services.syncthing.dataDir}/${name}"; } // attrs )) (lib.mapAttrs (name: attrs: { path = lib.mkDefault "${config.services.syncthing.dataDir}/${name}"; } // attrs ))
# filter folders this host does not have access to
(lib.mapAttrsToList (name: attrs: lib.mkIf (builtins.elem config.networking.hostName (attrs.devices or [])) { ${name} = attrs; } )) (lib.mapAttrsToList (name: attrs: lib.mkIf (builtins.elem config.networking.hostName (attrs.devices or [])) { ${name} = attrs; } ))
lib.mkMerge lib.mkMerge
] { ] {