fix homeConfiguration errors and add recipe for home-manager

This commit is contained in:
ulic-youthlic 2025-02-17 01:33:30 +08:00
parent b79c00310c
commit 66b740a123
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
7 changed files with 89 additions and 76 deletions

View file

@ -2,6 +2,9 @@
FLAKE_HOME := justfile_directory()
DEFAULT_SPECIALISATION := "default"
DEFAULT_KEEP_SINCE := "1w"
DEFAULT_USER := env('USER')
DEFAULT_HOST := shell('hostname')
default:
@just --list
@ -18,15 +21,27 @@ build specialisation=DEFAULT_SPECIALISATION:
deploy host:
deploy {{ FLAKE_HOME }}#{{ host }}
clean keep_since="1w":
nh clean all --verbose -K {{ keep_since }} -k 5
clean keepSince=DEFAULT_KEEP_SINCE:
nh clean all --verbose -K {{ keepSince }} -k 5
health:
nix --accept-flake-config run github:juspay/nix-health
switchHome host=DEFAULT_HOST $USER=DEFAULT_USER:
@echo USER: $USER
@echo HOST: {{ host }}
nh home switch -b backup {{ if host != DEFAULT_HOST { "-c \"" + USER + "@" + host + "\"" } else { "" } }} {{ FLAKE_HOME }}
buildHome host=DEFAULT_HOST $USER=DEFAULT_USER:
@echo USER: $USER
@echo HOST: {{ host }}
nh home build -b backup {{ if host != DEFAULT_HOST { "-c \"" + USER + "@" + host + "\"" } else { "" } }} {{ FLAKE_HOME }}
alias s := switch
alias u := update
alias d := deploy
alias c := clean
alias h := health
alias b := build
alias H := switchHome
alias B := buildHome