zaneyos/config/scripts/themechange.nix

15 lines
392 B
Nix

{ pkgs, host, ... }:
let
inherit (import ../../hosts/${host}/options.nix) flakeDir hostname;
in
pkgs.writeShellScriptBin "themechange" ''
if [[ ! $@ ]];then
echo "No Theme Given"
else
replacement="$1"
sed -i "/^\s*theme[[:space:]]*=[[:space:]]*\"/s/\"\(.*\)\"/\"$replacement\"/" ${flakeDir}/options.nix
kitty -e pkexec nixos-rebuild switch --flake ${flakeDir}
fi
''