chore: improved multi-host support
This commit is contained in:
parent
65444ae475
commit
83129a7cf1
2 changed files with 26 additions and 8 deletions
10
readme.md
10
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)
|
||||
|
|
14
switch
14
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
|
||||
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
|
Loading…
Reference in a new issue