add location and do not disturb toggles
This commit is contained in:
parent
b5e5ecf2f3
commit
518ffa31b4
1 changed files with 263 additions and 3 deletions
13
flake.nix
13
flake.nix
|
|
@ -26,6 +26,11 @@
|
|||
quickshell = builtins.unsafeDiscardStringContext (
|
||||
nixpkgs.lib.getExe nixpkgs.legacyPackages.aarch64-linux.quickshell
|
||||
);
|
||||
# This one isn't in the cache, so its derivation is copied over and the phone builds it
|
||||
locationAgent =
|
||||
(nixpkgs.legacyPackages.aarch64-linux.extend self.overlays.default).quadshell.locationAgent;
|
||||
agentDrv = builtins.unsafeDiscardOutputDependency locationAgent.drvPath;
|
||||
agentBin = "${builtins.unsafeDiscardStringContext locationAgent.outPath}/bin";
|
||||
in
|
||||
{
|
||||
# nix run .#phone [host]: runs the shell on the phone until Ctrl+C.
|
||||
|
|
@ -42,6 +47,11 @@
|
|||
host=''${1:-phone}
|
||||
dest=.cache/quadshell-dev
|
||||
|
||||
mapfile -t inputs < <(nix-store --query --references ${agentDrv} | grep '\.drv$')
|
||||
nix-store --realise "''${inputs[@]}" >/dev/null
|
||||
nix copy --derivation --to "ssh-ng://$host" ${agentDrv}
|
||||
nix copy --to "ssh-ng://$host" "''${inputs[@]/%/^*}"
|
||||
|
||||
# The store's files are read-only, which would stop the next run replacing them
|
||||
# shellcheck disable=SC2029
|
||||
tar -C ${self}/src --mode=u+w -c . | ssh "$host" "rm -rf $dest; mkdir -p $dest; tar -C $dest -x"
|
||||
|
|
@ -49,8 +59,9 @@
|
|||
# shellcheck disable=SC2029
|
||||
exec ssh -t "$host" "
|
||||
nix-store --realise ${builtins.dirOf (builtins.dirOf quickshell)} >/dev/null;
|
||||
nix-store --realise --option substitute false ${agentDrv} >/dev/null;
|
||||
pkill -f '^/nix/store/[^ ]*/bin/quickshell ';
|
||||
exec systemd-run --user --pty --quiet --collect ${quickshell} --path ~/$dest
|
||||
exec systemd-run --user --pty --quiet --collect --setenv=PATH=${agentBin}:\"\$PATH\" ${quickshell} --path ~/$dest
|
||||
"
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue