setup-home.sh 746 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. [ -e ~/dotfiles ] || git clone git@codeberg.org:djm/dotfiles.git
  3. nix-channel --add https://github.com/nix-community/home-manager/archive/release-$(nixos-version | cut -d. -f1-2).tar.gz home-manager
  4. nix-channel --update
  5. export NIX_PATH=$HOME/.nix-defexpr/channels:/nix/var/nix/profiles/per-user/root/channels${NIX_PATH:+:$NIX_PATH}
  6. nix-shell '<home-manager>' -A install
  7. HOME_CONF="$HOME/dotfiles/nix-conf/home/${CONF:-${HOST}}.nix"
  8. [ -f $HOME_CONF ] && ln -sf $HOME_CONF ~/.config/nixpkgs/home.nix
  9. ln -sf ~/dotfiles/.p10k.zsh ~/
  10. ln -sf ~/dotfiles/.emacs.d ~/
  11. mkdir ~/.config/nix
  12. echo "extra-experimental-features = nix-command flakes
  13. allow-unsafe-native-code-during-evaluation = true" > ~/.config/nix/nix.conf
  14. home-manager switch