From b0fcf9d9e789f0b5b87d1047ef5c580b82d4f518 Mon Sep 17 00:00:00 2001 From: shelken Date: Mon, 13 May 2024 09:57:07 +0800 Subject: [PATCH] chore(Justfile): Use recipe attributes to scope commands on specific platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用 [配方属性](https://github.com/casey/just/tree/master?tab=readme-ov-file#recipe-attributes) 以限定命令使用的平台 --- Justfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Justfile b/Justfile index 9b6809a1..175d0fde 100644 --- a/Justfile +++ b/Justfile @@ -59,19 +59,23 @@ gitgc: # ############################################################################ +[linux] i3 mode="default": use utils.nu *; \ nixos-switch ai-i3 {{mode}} +[linux] hypr mode="default": use utils.nu *; \ nixos-switch ai-hyprland {{mode}} +[linux] s-i3 mode="default": use utils.nu *; \ nixos-switch shoukei-i3 {{mode}} +[linux] s-hypr mode="default": use utils.nu *; \ nixos-switch shoukei-hyprland {{mode}} @@ -82,27 +86,32 @@ s-hypr mode="default": # ############################################################################ +[macos] darwin-set-proxy: sudo python3 scripts/darwin_set_proxy.py sleep 1sec +[macos] darwin-rollback: use utils.nu *; \ darwin-rollback # Deploy to harmonica(macOS host) +[macos] ha mode="default": use utils.nu *; \ darwin-build "harmonica" {{mode}}; \ darwin-switch "harmonica" {{mode}} # Depoly to fern(macOS host) +[macos] fe mode="default": darwin-set-proxy use utils.nu *; \ darwin-build "fern" {{mode}}; \ darwin-switch "fern" {{mode}} # Reload yabai and skhd(macOS) +[macos] yabai-reload: launchctl kickstart -k "gui/502/org.nixos.yabai"; launchctl kickstart -k "gui/502/org.nixos.skhd";