Added git config and zsh p10k
Signed-off-by: Menno van Leeuwen <menno@vleeuwen.me>
This commit is contained in:
parent
c3b0297d6c
commit
6e6b402df3
@ -10,4 +10,8 @@ Tested on:
|
||||
|
||||
```
|
||||
curl -sSL https://raw.githubusercontent.com/vleeuwenmenno/dotfiles/master/setup.sh | bash -s -- "--install"
|
||||
```
|
||||
```
|
||||
|
||||
## Updating
|
||||
To update you can run the alias `update` to pull and switch.
|
||||
Afterwards you should reopen a new shell to see the applied changes.
|
26
config/gitconfig
Normal file
26
config/gitconfig
Normal file
@ -0,0 +1,26 @@
|
||||
[gpg]
|
||||
format = ssh
|
||||
[gpg "ssh"]
|
||||
program = /opt/1Password/op-ssh-sign
|
||||
[commit]
|
||||
gpgsign = true
|
||||
|
||||
[user]
|
||||
signingkey = ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM+sKpcREOUjwMMSzEWAso6830wbOi8kUxqpuXWw5gHr
|
||||
name = "Menno van Leeuwen"
|
||||
email = "menno@vleeuwen.me"
|
||||
|
||||
[includeIf "gitdir:/home/menno/Projects/Sandwave/**"]
|
||||
path = /home/menno/Projects/Sandwave/.gitconfig
|
||||
|
||||
[includeIf "gitdir:/home/menno/Projects/Personal/**"]
|
||||
path = /home/menno/Projects/Personal/.gitconfig
|
||||
|
||||
[safe]
|
||||
directory = *
|
||||
|
||||
[advice]
|
||||
detachedHead = false
|
||||
|
||||
[push]
|
||||
default = current
|
1683
config/p10k.zsh
Normal file
1683
config/p10k.zsh
Normal file
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-23.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
|
68
home.nix
68
home.nix
@ -1,14 +1,20 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home = {
|
||||
username = "menno";
|
||||
homeDirectory = "/home/menno";
|
||||
stateVersion = "23.11";
|
||||
|
||||
packages = [
|
||||
pkgs.gnumake
|
||||
pkgs.btop
|
||||
pkgs.go
|
||||
packages = with pkgs; [
|
||||
gnumake
|
||||
btop
|
||||
go
|
||||
fortune
|
||||
lsd
|
||||
zsh
|
||||
zsh-powerlevel10k
|
||||
];
|
||||
};
|
||||
|
||||
@ -26,7 +32,57 @@
|
||||
enable = true;
|
||||
userName = "Menno van Leeuwen";
|
||||
userEmail = "menno@vleeuwen.me";
|
||||
includes = [ { path = "~/.dotfiles/config/gitconfig"; } ];
|
||||
};
|
||||
|
||||
zsh = {
|
||||
enable = true;
|
||||
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"git"
|
||||
"docker"
|
||||
"1password"
|
||||
"ubuntu"
|
||||
"tmux"
|
||||
"sudo"
|
||||
"screen"
|
||||
"adb"
|
||||
"brew"
|
||||
"ufw"
|
||||
"zsh-interactive-cd"
|
||||
"zsh-navigation-tools"
|
||||
"yarn"
|
||||
"vscode"
|
||||
"composer"
|
||||
"laravel"
|
||||
"golang"
|
||||
"httpie"
|
||||
];
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
l = "lsd -Sl --reverse --human-readable --group-directories-first";
|
||||
update = "git -C ~/.dotfiles pull && home-manager switch --flake ~/.dotfiles";
|
||||
docker-compose = "docker compose";
|
||||
gg = "git pull";
|
||||
gl = "git log --stat";
|
||||
};
|
||||
|
||||
initExtra = "source ~/.dotfiles/config/p10k.zsh";
|
||||
|
||||
syntaxHighlighting = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
plugins = with pkgs; [
|
||||
{
|
||||
name = "powerlevel10k";
|
||||
src = zsh-powerlevel10k;
|
||||
file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";
|
||||
}
|
||||
];
|
||||
};
|
||||
# nushell.enable = true;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
24
setup.sh
24
setup.sh
@ -42,7 +42,7 @@ hush_login() {
|
||||
}
|
||||
|
||||
nix_experimental() {
|
||||
if command -v nix > /dev/null; then
|
||||
if command -v nix > /dev/null; then
|
||||
echo 'NIX is already installed.'
|
||||
else
|
||||
install_nix
|
||||
@ -57,7 +57,7 @@ nix_config_import() {
|
||||
if [ -f ~/.config/nix/nix.conf ]; then
|
||||
echo "Nix configuration is already inserted."
|
||||
exit 1
|
||||
else
|
||||
else
|
||||
echo "Inserting nix configuration..."
|
||||
mkdir -p ~/.config/nix
|
||||
curl -s $NIX_CONFIG_URL -o ~/.config/nix/nix.conf
|
||||
@ -90,6 +90,18 @@ switch_to_home_manager() {
|
||||
home-manager switch --flake ~/.dotfiles
|
||||
}
|
||||
|
||||
continue_install() {
|
||||
echo 'Nix and dotfiles are installed'
|
||||
source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
chmod +x ~/.dotfiles/setup.sh
|
||||
bash -c "~/.dotfiles/setup.sh -c"
|
||||
}
|
||||
|
||||
add_exec_zsh() {
|
||||
echo 'Adding `exec zsh` to `~/.bashrc`...'
|
||||
grep -qxF 'exec zsh' ~/.bashrc || echo "exec zsh" | tee -a ~/.bashrc
|
||||
}
|
||||
|
||||
# Check if parameter is help, continue or initial
|
||||
if [ "$1" == "-i" ] || [ "$1" == "--install" ]; then
|
||||
# Check if .dotfiles exists, if so stop
|
||||
@ -110,10 +122,7 @@ if [ "$1" == "-i" ] || [ "$1" == "--install" ]; then
|
||||
# Clone dotfiles
|
||||
clone_dotfiles
|
||||
|
||||
echo 'Nix and dotfiles are installed'
|
||||
source /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
||||
chmod +x ~/.dotfiles/setup.sh
|
||||
bash -c "~/.dotfiles/setup.sh -c"
|
||||
continue_install
|
||||
elif [ "$1" == "-c" ] || [ "$1" == "--continue" ]; then
|
||||
# Run initial home-manager setup
|
||||
home_manager_setup
|
||||
@ -121,6 +130,9 @@ elif [ "$1" == "-c" ] || [ "$1" == "--continue" ]; then
|
||||
# Run initial home-manager switch
|
||||
switch_to_home_manager
|
||||
|
||||
# Add `exec zsh` to bashrc
|
||||
add_exec_zsh
|
||||
|
||||
# We're done here!
|
||||
echo 'Installation complete! Please restart your shell and enjoy!'
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user