systemctl --user stop emacs.{service,socket}
systemctl --user start emacs.socket~/.emacs.d/bin/doom syncnix eval --json -f '<nixpkgs>' --apply 'pkgs: builtins.attrNames (pkgs {})' \
| jq -r .[]nix run "nixpkgs#$1"nix flake show --json | jq -r '.nixosConfigurations | keys[]'nixos-rebuild test --sudo --flake .nixos-rebuild "$1" --sudo --flake ".#$2"build
test
switch
nixos-rebuild switch --sudo --flake .nix-env --profile $HOME/.local/state/nix/profiles/home-manager --list-generationsnix-env --profile $HOME/.local/state/nix/profiles/home-manager --delete-generations "$@"Activate a Home Manager profile without doing a full nixos-rebuild.
hm activateList Home Manager profiles.
nix eval .#homeConfigurations --apply builtins.attrNames --json | jq -r .[]sudo nix-env --profile /nix/var/nix/profiles/system --list-generationssudo nix-env --profile /nix/var/nix/profiles/system --delete-generations "$@"WSL struggles with a startup delay for SystemD where it's not immediately ready when the WSL distro boots up. Consequently, the user services are not started at all automatically when starting the login shell.
See: nix-community/NixOS-WSL#375 (comment)
echo "Waiting for systemd..."
until systemctl &>/dev/null; do sleep 1; done
if ! systemctl --user &>/dev/null; then
echo "Restarting user services..."
sudo systemctl restart "user@$(id -u)"
fi
echo "Propagate WSLENV..."
systemctl --user set-environment WSLENV="$WSLENV"