diff --git a/README.md b/README.md index f3a406f..ad1e67c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # MyNix ❄️👨‍💻 -My personal NixOS and config stash🔥 +My personal NixOS stash🔥 The `sysConfig` directory contains subdirectories for each of my machines🖥️ In the `homeConfig`🏠️ directory, you'll find various dotfiles and config files that make my home directory extra nixy +`terminal` contains a config with my IDE📝 and configs by calling `nix build` against this flake. If you need a list of available Nix packages and options: diff --git a/flake.nix b/flake.nix index 7a408e5..0c462e5 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,7 @@ allowUnfree = true; }; }; + myTerminal = pkgs.callPackage ./terminal/shell.nix { }; in { @@ -34,5 +35,7 @@ } ]; }; + + defaultPackage.x86_64-linux = myTerminal; }; } diff --git a/homeConfig/modules/neovim/config/servers.nix b/homeConfig/modules/neovim/config/servers.nix index 3488b60..9a1d4c2 100644 --- a/homeConfig/modules/neovim/config/servers.nix +++ b/homeConfig/modules/neovim/config/servers.nix @@ -20,4 +20,4 @@ let ]; in - lsp ++ lsp' + lsp ++ lsp' ++ pkgs.lazygit diff --git a/terminal/configs.tar.gz b/terminal/configs.tar.gz new file mode 100644 index 0000000..82b363c Binary files /dev/null and b/terminal/configs.tar.gz differ diff --git a/terminal/shell.nix b/terminal/shell.nix new file mode 100644 index 0000000..a29d621 --- /dev/null +++ b/terminal/shell.nix @@ -0,0 +1,60 @@ +{ pkgs ? import {} }: + + +with pkgs; +mkShell { + buildInputs = [ + bash neovim alacritty + terminus-nerdfont noto-fonts-emoji + direnv nix-direnv + lsd git gnupg lazygit + ]; + + shellHook = '' + echo "Preparing your environment, Bryan..." + + wget https://github.com/itme-brain/nixos/tree/yolo-allin/terminal/configs.tar.gz + + tar -xzvf configs.tar.gz -C . + + if [ -f ~/.bashrc ] || [ -f ~/.config/alacritty/alacritty.yml ] || [ -d ~/.config/nvim ] || [ -f ~/.gitconfig ]; then + echo "Backing up existing config files..." + echo "You can find them at ~/your_configs.bak" + mkdir -p ~/your_configs.bak + fi + + [ -f ~/.bashrc ] && mv ~/.bashrc ~/your_configs.bak/bashrc.bak + mv configs/bashrc ~/.bashrc + + [ -f ~/.config/alacritty/alacritty.yml ] && mv ~/.config/alacritty ~/your_configs.bak/alacritty.bak + mv configs/alacritty ~/.config/alacritty + + [ -d ~/.config/nvim ] && mv ~/.config/nvim ~/your_configs.bak/nvim.bak + mv configs/nvim ~/.config/nvim + + [ -f ~/.gitconfig ] && mv ~/.gitconfig ~/your_configs.bak/gitconfig.bak + mv configs/gitconfig ~/.gitconfig + + gpg --import configs/pub.key + + rm configs.tar.gz + rm configs + find . -type d -empty -delete + + if [ -d ~/your_configs.bak ]; then + echo "Restore script has been created..." + cat > ~/your_configs.bak/restore.sh << EOF + #!/bin/sh + # To restore the original config, run the script using './restore.sh' + [ -f bashrc.bak ] && mv bashrc.bak ~/.bashrc + [ -d alacritty.bak ] && mv alacritty.bak ~/.config/alacritty + [ -d nvim.bak ] && mv nvim.bak ~/.config/nvim + [ -f gitconfig.bak ] && mv gitconfig.bak ~/.gitconfig + EOF + chmod +x ~/your_configs.bak/restore.sh + fi + + echo "Terminal ready." + echp "Run `ldv` to get some existing environments." + ''; +}