From 99d7f5df02444e0c85be643115fe033981bad7d8 Mon Sep 17 00:00:00 2001 From: Stephen Parkinson Date: Wed, 4 Dec 2024 09:27:39 -0800 Subject: [PATCH] Add work config --- nix/flake.nix | 5 ++++- nix/work.nix | 33 +++++++++++++++++++++++++++++++++ setup.sh | 28 ++++------------------------ 3 files changed, 41 insertions(+), 25 deletions(-) create mode 100644 nix/work.nix diff --git a/nix/flake.nix b/nix/flake.nix index 0496800..bdb61fe 100644 --- a/nix/flake.nix +++ b/nix/flake.nix @@ -114,7 +114,10 @@ programs.zsh.enable = true; # Home Manager - users.users.smparkin.home = "/Users/smparkin"; + users.users = { + smparkin.home = "/Users/smparkin"; + parkist.home = "/Users/parkist"; + }; nix.configureBuildUsers = true; nix.useDaemon = true; }; diff --git a/nix/work.nix b/nix/work.nix new file mode 100644 index 0000000..2a6abf8 --- /dev/null +++ b/nix/work.nix @@ -0,0 +1,33 @@ +{ config, pkgs, ... }: + +{ + # Home Manager needs a bit of information about you and the + # paths it should manage. + home.username = "parkist"; + home.homeDirectory = "/Users/parkist"; + + # This value determines the Home Manager release that your + # configuration is compatible with. This helps avoid breakage + # when a new Home Manager release introduces backwards + # incompatible changes. + # + # You can update Home Manager without changing this value. See + # the Home Manager release notes for a list of state version + # changes in each release. + home.stateVersion = "24.11"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + # Home dir + home.file = { + ".zshrc".source = ../zsh/zshrc; + ".zsh.d/aliases".source = ../zsh/aliases; + ".zsh.d/functions".source = ../zsh/functions; + ".zsh.d/theme".source = ../zsh/theme; + ".gitconfig".source = ../git/gitconfig; + ".gitignore_global".source = ../git/gitignore_global; + ".tmux.conf".source = ../tmux/tmux.conf; + ".vimrc".source = ../vim/vimrc; + }; +} diff --git a/setup.sh b/setup.sh index da0c875..146f23e 100755 --- a/setup.sh +++ b/setup.sh @@ -14,37 +14,17 @@ if [ "$OSTYPE" = "Linux" ]; then sudo pacman -Sy coreutils vim zsh jq python3 fi elif [ "$OSTYPE" = "Darwin" ]; then - echo "Install Homebrew? [y/n]" - read homebrew - if [ "$homebrew" = "y" ]; then - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - echo "Restore from Brewfile? [y/n]" - read bundle - if [ "$bundle" = "y" ]; then - brew bundle install --file=Brewfile - else - brew install coreutils neofetch vim zsh jq python3 - fi - fi + echo "Install Nix? [y/n]" + read install_nix + if [ "$install_nix" = "y" ]; then + sh <(curl -L https://nixos.org/nix/install) fi # silence login message touch ~/.hushlogin -# get ohmyzsh setup -git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh/ - # remove common files and symlink new files rm ~/.zshrc ~/.vimrc ~/.tmux.conf -mkdir ~/.zsh.d -ln -s ~/dotfiles/aliases ~/.zsh.d/aliases -ln -s ~/dotfiles/functions ~/.zsh.d/functions -ln -s ~/dotfiles/zshrc ~/.zshrc -ln -s ~/dotfiles/gitconfig ~/.gitconfig -ln -s ~/dotfiles/gitignore_global ~/.gitignore_global -ln -s ~/dotfiles/newstephen.zsh-theme ~/.oh-my-zsh/custom/themes/newstephen.zsh-theme -ln -s ~/dotfiles/tmux.conf ~/.tmux.conf -ln -s ~/dotfiles/vimrc ~/.vimrc mkdir ~/Developer