diff --git a/nix/README.md b/nix/README.md index 4342780..6fb8868 100644 --- a/nix/README.md +++ b/nix/README.md @@ -1,5 +1,8 @@ The install script is only for linux machines at the moment. -For Apple machines, [install nix-darwin](https://github.com/LnL7/nix-darwin#install) and symlink the `darwin-configuration.nix` file to `~/.nixpkgs/darwin-configuration.nix`. +For Apple machines, [install +nix-darwin](https://github.com/LnL7/nix-darwin#install) and symlink the +`darwin-configuration.nix` file (probably in `worktop`? why else would you have +an OSX machine?) to wherever it needs to go for that version of nix-darwin. -Home-manager is installed separately and not currently managed by the nix configurations. +Home-manager is installed separately and not currently managed by any of the nix configurations. diff --git a/nix/build.sh b/nix/build.sh index aee0bb9..5aa2810 100644 --- a/nix/build.sh +++ b/nix/build.sh @@ -6,11 +6,23 @@ install_home_manager() { export NIX_PATH=$HOME/.nix-defexpr/channels${NIX_PATH:+:}$NIX_PATH nix-shell '' -A install + mkdir -p ~/.config/home-manager + + parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) + cd "$parent_path" + [ -f ~/.config/home-manager/home.nix ] && mv ~/.config/home-manager/home.nix ~/.config/home-manager/home.nix.orig + ln -s ./home/commandline.nix ~/.config/home-manager/home.nix + home-manager switch } build_system() { + parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) + sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos - sudo cp system/configuration.nix /etc/nixos/ + sudo ln -s "$parent_path/system/framework/configuration.nix" /etc/nixos/configuration.nix sudo nixos-rebuild switch --upgrade } + +build_system +install_home_manager