mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
added the terminal
This commit is contained in:
parent
a170c028cf
commit
180a98fa25
5 changed files with 66 additions and 2 deletions
|
|
@ -1,9 +1,10 @@
|
||||||
# MyNix ❄️👨💻
|
# MyNix ❄️👨💻
|
||||||
|
|
||||||
My personal NixOS and config stash🔥
|
My personal NixOS stash🔥
|
||||||
|
|
||||||
The `sysConfig` directory contains subdirectories for each of my machines🖥️
|
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
|
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:
|
If you need a list of available Nix packages and options:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
myTerminal = pkgs.callPackage ./terminal/shell.nix { };
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
@ -34,5 +35,7 @@
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
defaultPackage.x86_64-linux = myTerminal;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,4 +20,4 @@ let
|
||||||
];
|
];
|
||||||
|
|
||||||
in
|
in
|
||||||
lsp ++ lsp'
|
lsp ++ lsp' ++ pkgs.lazygit
|
||||||
|
|
|
||||||
BIN
terminal/configs.tar.gz
Normal file
BIN
terminal/configs.tar.gz
Normal file
Binary file not shown.
60
terminal/shell.nix
Normal file
60
terminal/shell.nix
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
|
|
||||||
|
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."
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue