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
|
### 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))
|
`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 in a readme 🐈
|
||||||
|
|
||||||
![cat](https://cataas.com/cat)
|
![cat](https://cataas.com/cat)
|
||||||
|
|
24
switch
24
switch
|
@ -23,17 +23,25 @@ if [ "$1" == "boot" ]; then
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
flake="."
|
||||||
|
if [ ! -z ${NIX_HOSTNAME+x} ]; then
|
||||||
|
flake=".#$NIX_HOSTNAME"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$(uname)" == "Darwin" ]; then
|
if [ "$(uname)" == "Darwin" ]; then
|
||||||
git add -f hosts/teidesu-osx/arc-setup.nix
|
if [ $(hostname) == "teidesu-osx" ]; then
|
||||||
function restore {
|
git add -f hosts/teidesu-osx/arc-setup.nix
|
||||||
git restore --staged hosts/teidesu-osx/arc-setup.nix
|
function restore {
|
||||||
}
|
git restore --staged hosts/teidesu-osx/arc-setup.nix
|
||||||
trap restore EXIT
|
}
|
||||||
|
trap restore EXIT
|
||||||
|
fi
|
||||||
|
|
||||||
if command -v darwin-rebuild &> /dev/null; then
|
if command -v darwin-rebuild &> /dev/null; then
|
||||||
darwin-rebuild switch --flake . $args $@
|
darwin-rebuild switch --flake $flake $args $@
|
||||||
else
|
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
|
fi
|
||||||
else
|
else
|
||||||
sudo nixos-rebuild $cmd --flake . $args $@
|
sudo nixos-rebuild $cmd --flake $flake $args $@
|
||||||
fi
|
fi
|
Loading…
Reference in a new issue