diff --git a/readme.md b/readme.md index fafd46d..129c690 100755 --- a/readme.md +++ b/readme.md @@ -21,6 +21,16 @@ its likely due to docker containers not resolving yet. todo fix this ### teidesu-osx `cp /var/run/current-system/Library/Fonts/* /Library/Fonts` - copy nix-managed fonts to system fonts (waiting for [this PR](https://github.com/LnL7/nix-darwin/pull/754)) +### setting up + +macos: +```bash +curl -L https://nixos.org/nix/install | sh +git clone https://github.com/teidesu/nixos ~/nixos +cd ~/nixos +./switch +``` + ## cat in a readme 🐈 ![cat](https://cataas.com/cat) diff --git a/switch b/switch index a75eaa4..e74be43 100755 --- a/switch +++ b/switch @@ -23,17 +23,25 @@ if [ "$1" == "boot" ]; then shift fi +flake="." +if [ ! -z ${NIX_HOSTNAME+x} ]; then + flake=".#$NIX_HOSTNAME" +fi + if [ "$(uname)" == "Darwin" ]; then - git add -f hosts/teidesu-osx/arc-setup.nix - function restore { - git restore --staged hosts/teidesu-osx/arc-setup.nix - } - trap restore EXIT + if [ $(hostname) == "teidesu-osx" ]; then + git add -f hosts/teidesu-osx/arc-setup.nix + function restore { + git restore --staged hosts/teidesu-osx/arc-setup.nix + } + trap restore EXIT + fi + if command -v darwin-rebuild &> /dev/null; then - darwin-rebuild switch --flake . $args $@ + darwin-rebuild switch --flake $flake $args $@ else - nix --extra-experimental-features nix-command --extra-experimental-features flakes run nix-darwin -- switch --flake . $args $@ + nix --extra-experimental-features nix-command --extra-experimental-features flakes run nix-darwin -- switch --flake $flake $args $@ fi else - sudo nixos-rebuild $cmd --flake . $args $@ + sudo nixos-rebuild $cmd --flake $flake $args $@ fi \ No newline at end of file