mirror of
https://github.com/mentos1386/dotfiles.git
synced 2024-11-25 16:55:43 +00:00
Compare commits
2 commits
34a74bfb1d
...
6a45865a78
Author | SHA1 | Date | |
---|---|---|---|
6a45865a78 | |||
2c8dca6d5c |
8 changed files with 229 additions and 178 deletions
|
@ -1,9 +1,16 @@
|
|||
# My dotfiles configuration
|
||||
|
||||
Expected configuration:
|
||||
* Fedora Silverblue as host
|
||||
* Fedora Silverblue or ubuntu as host
|
||||
* Nix with home-manager for tools and software.
|
||||
|
||||
```bash
|
||||
# Install GUI tools with personal specialization
|
||||
./install --gui --env personal
|
||||
# Skip GUI tools and only apply work specialization
|
||||
./install --env work
|
||||
```
|
||||
|
||||
## Dark and Light themes
|
||||
|
||||
Neovim and Kitty are configured to follow Gnome's dark and light theme
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
--italic-text='always'
|
||||
--theme=OneHalfLight
|
||||
--theme=OneHalfDark
|
||||
|
|
25
install.sh
25
install.sh
|
@ -1,4 +1,4 @@
|
|||
#/bin/env bash
|
||||
#!/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO_DIR=$(dirname $(readlink -f $0))
|
||||
|
@ -19,8 +19,18 @@ workspace_link() {
|
|||
}
|
||||
|
||||
GUI=NO
|
||||
ENVIRONMENT=personal
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
--env)
|
||||
ENVIRONMENT=$2
|
||||
if [ "$ENVIRONMENT" != "personal" ] && [ "$ENVIRONMENT" != "work" ]; then
|
||||
echo "Unknown environment $ENVIRONMENT"
|
||||
exit 1
|
||||
fi
|
||||
shift # past argument
|
||||
shift # past value
|
||||
;;
|
||||
--gui)
|
||||
GUI=YES
|
||||
shift # past argument
|
||||
|
@ -35,6 +45,7 @@ while [[ $# -gt 0 ]]; do
|
|||
;;
|
||||
esac
|
||||
done
|
||||
echo_header "== DotFiles with GUI: $GUI and ENV: $ENVIRONMENT"
|
||||
|
||||
# Install basic packages.
|
||||
# Most other packages are installed via Home Manager.
|
||||
|
@ -133,11 +144,14 @@ fi
|
|||
echo_header "==[host] Installing Home Manager"
|
||||
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
|
||||
nix-channel --update
|
||||
nix-shell '<home-manager>' -A install
|
||||
NIXPKGS_ALLOW_UNFREE=1 ENVIRONMENT=$ENVIRONMENT nix-shell '<home-manager>' -A install
|
||||
|
||||
echo_header "==[host] Installing Home Manager packages"
|
||||
workspace_link nix/home.nix .config/home-manager/home.nix
|
||||
./switch.sh
|
||||
workspace_link nix/core.nix .config/home-manager/core.nix
|
||||
workspace_link nix/personal.nix .config/home-manager/personal.nix
|
||||
workspace_link nix/work.nix .config/home-manager/work.nix
|
||||
NIXPKGS_ALLOW_UNFREE=1 ENVIRONMENT=$ENVIRONMENT home-manager switch
|
||||
|
||||
echo_header "==[host] Use zsh as default shell"
|
||||
sudo chsh $USER --shell=/bin/zsh
|
||||
|
@ -145,5 +159,6 @@ sudo chsh $USER --shell=/bin/zsh
|
|||
echo_header "==[host] Plug for neovim"
|
||||
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
|
||||
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
nvim --headless +'PlugInstall --sync' +qa
|
||||
nvim --headless +UpdateRemotePlugins +qa
|
||||
nvim --headless +PlugInstall +qa
|
||||
nvim --headless +PlugUpdate +qa
|
||||
nvim --headless +PlugUpgrade +qa
|
||||
|
|
178
nix/core.nix
Normal file
178
nix/core.nix
Normal file
|
@ -0,0 +1,178 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# 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 should not change this value, even if you update Home Manager. If you do
|
||||
# want to update the value, then make sure to first check the Home Manager
|
||||
# release notes.
|
||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
||||
|
||||
# The home.packages option allows you to install Nix packages into your
|
||||
# environment.
|
||||
home.packages = with pkgs; [
|
||||
git
|
||||
git-lfs
|
||||
difftastic
|
||||
|
||||
# Tools
|
||||
ripgrep
|
||||
bat
|
||||
tmux
|
||||
jq
|
||||
fd
|
||||
fzf
|
||||
gnumake
|
||||
age
|
||||
sops
|
||||
jq
|
||||
yq
|
||||
http-prompt
|
||||
watchexec
|
||||
devbox
|
||||
nodePackages.prettier
|
||||
direnv
|
||||
sqlfluff
|
||||
|
||||
# Nodejs
|
||||
nodejs_20
|
||||
|
||||
# Golang
|
||||
go
|
||||
gopls
|
||||
golangci-lint
|
||||
|
||||
# C & CPP
|
||||
gcc
|
||||
|
||||
# Rust
|
||||
cargo
|
||||
|
||||
# Shell
|
||||
zsh
|
||||
shfmt
|
||||
|
||||
# Lua
|
||||
stylua
|
||||
|
||||
# Services
|
||||
terraform
|
||||
opentofu
|
||||
flyctl
|
||||
awscli2
|
||||
|
||||
# Kubernetes
|
||||
k9s
|
||||
kubectl
|
||||
|
||||
# Gnome
|
||||
gnomeExtensions.pop-shell
|
||||
];
|
||||
|
||||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||||
# plain files is through 'home.file'.
|
||||
home.file = {
|
||||
"~/.tmux.conf".source = ../tmux/tmux.conf;
|
||||
"~/.ssh/authorized_keys".source = ../ssh/authorized_keys;
|
||||
"${config.xdg.configHome}/starship.toml".source = ../starship/starship.toml;
|
||||
"${config.xdg.configHome}/bat" = {
|
||||
recursive = true;
|
||||
source = ../bat;
|
||||
};
|
||||
"${config.xdg.configHome}/kitty" = {
|
||||
recursive = true;
|
||||
source = ../kitty;
|
||||
};
|
||||
"${config.xdg.configHome}/nvim" = {
|
||||
recursive = true;
|
||||
source = ../nvim;
|
||||
};
|
||||
};
|
||||
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
gitCredentialHelper.enable = true;
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Tine";
|
||||
userEmail = "tine@tjo.space";
|
||||
|
||||
difftastic.enable = true;
|
||||
lfs.enable = true;
|
||||
|
||||
includes = [
|
||||
{ path = "~/.gitconfig.local"; }
|
||||
];
|
||||
|
||||
extraConfig = {
|
||||
user = {
|
||||
signingkey = "~/.ssh/id_ed25519";
|
||||
};
|
||||
|
||||
commit = {
|
||||
gpgsign = true;
|
||||
};
|
||||
|
||||
gpg = {
|
||||
format = "ssh";
|
||||
};
|
||||
|
||||
credential = {
|
||||
helper = "secretservice";
|
||||
};
|
||||
|
||||
init = {
|
||||
defaultBranch = "main";
|
||||
};
|
||||
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
|
||||
pull = {
|
||||
ff = "only";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
history = {
|
||||
size = 10000000;
|
||||
save = 10000000;
|
||||
ignoreAllDups = true;
|
||||
path = "${config.xdg.dataHome}/zsh/history";
|
||||
};
|
||||
autosuggestion.enable = true;
|
||||
enableCompletion = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
shellAliases = {
|
||||
"ll" = "ls -l";
|
||||
"gicm" = "(git checkout main || git checkout master) && git pull";
|
||||
"gic" = "git checkout";
|
||||
"gip" = "git pull";
|
||||
};
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
}
|
176
nix/home.nix
176
nix/home.nix
|
@ -1,171 +1,11 @@
|
|||
{ config, pkgs, ... }:
|
||||
{ config, pkgs, home, ... }:
|
||||
|
||||
let
|
||||
environment = builtins.getEnv "ENVIRONMENT";
|
||||
in
|
||||
{
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
# manage.
|
||||
home.username = "tine";
|
||||
home.homeDirectory = "/var/home/tine";
|
||||
|
||||
# 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 should not change this value, even if you update Home Manager. If you do
|
||||
# want to update the value, then make sure to first check the Home Manager
|
||||
# release notes.
|
||||
home.stateVersion = "23.11"; # Please read the comment before changing.
|
||||
|
||||
# The home.packages option allows you to install Nix packages into your
|
||||
# environment.
|
||||
home.packages = with pkgs; [
|
||||
git
|
||||
git-lfs
|
||||
difftastic
|
||||
|
||||
# Tools
|
||||
ripgrep
|
||||
bat
|
||||
tmux
|
||||
jq
|
||||
fd
|
||||
fzf
|
||||
gnumake
|
||||
age
|
||||
sops
|
||||
jq
|
||||
yq
|
||||
http-prompt
|
||||
watchexec
|
||||
devbox
|
||||
nodePackages.prettier
|
||||
direnv
|
||||
sqlfluff
|
||||
|
||||
# Nodejs
|
||||
nodejs_20
|
||||
|
||||
# Golang
|
||||
go
|
||||
gopls
|
||||
golangci-lint
|
||||
|
||||
# C & CPP
|
||||
gcc
|
||||
|
||||
# Rust
|
||||
cargo
|
||||
|
||||
# Shell
|
||||
zsh
|
||||
shfmt
|
||||
|
||||
# Lua
|
||||
stylua
|
||||
|
||||
# Services
|
||||
terraform
|
||||
opentofu
|
||||
flyctl
|
||||
awscli2
|
||||
|
||||
# Kubernetes
|
||||
k9s
|
||||
kubectl
|
||||
];
|
||||
|
||||
# Home Manager is pretty good at managing dotfiles. The primary way to manage
|
||||
# plain files is through 'home.file'.
|
||||
home.file = {
|
||||
"~/.tmux.conf".source = ../tmux/tmux.conf;
|
||||
"~/.ssh/authorized_keys".source = ../ssh/authorized_keys;
|
||||
"${config.xdg.configHome}/starship.toml".source = ../starship/starship.toml;
|
||||
"${config.xdg.configHome}/bat" = {
|
||||
recursive = true;
|
||||
source = ../bat;
|
||||
};
|
||||
"${config.xdg.configHome}/kitty" = {
|
||||
recursive = true;
|
||||
source = ../kitty;
|
||||
};
|
||||
"${config.xdg.configHome}/nvim" = {
|
||||
recursive = true;
|
||||
source = ../nvim;
|
||||
};
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Tine";
|
||||
userEmail = "tine@tjo.space";
|
||||
|
||||
difftastic.enable = true;
|
||||
lfs.enable = true;
|
||||
|
||||
extraConfig = {
|
||||
user = {
|
||||
signingkey = "~/.ssh/id_ed25519";
|
||||
};
|
||||
|
||||
commit = {
|
||||
gpgsign = true;
|
||||
};
|
||||
|
||||
gpg = {
|
||||
format = "ssh";
|
||||
};
|
||||
|
||||
credentials = {
|
||||
helper = "libsecret";
|
||||
};
|
||||
|
||||
init = {
|
||||
defaultBranch = "main";
|
||||
};
|
||||
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
|
||||
pull = {
|
||||
ff = "only";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
history = {
|
||||
size = 10000000;
|
||||
save = 10000000;
|
||||
ignoreAllDups = true;
|
||||
path = "${config.xdg.dataHome}/zsh/history";
|
||||
};
|
||||
autosuggestion.enable = true;
|
||||
enableCompletion = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
shellAliases = {
|
||||
"ll" = "ls -l";
|
||||
"gicm" = "(git checkout main || git checkout master) && git pull";
|
||||
"gic" = "git checkout";
|
||||
"gip" = "git pull";
|
||||
};
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
imports =
|
||||
if environment == "work"
|
||||
then [ ./core.nix ./work.nix ]
|
||||
else [ ./core.nix ./personal.nix ];
|
||||
}
|
||||
|
|
6
nix/personal.nix
Normal file
6
nix/personal.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.username = "tine";
|
||||
home.homeDirectory = "/var/home/tine";
|
||||
}
|
8
nix/work.nix
Normal file
8
nix/work.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ lib, config, pkgs, ... }:
|
||||
|
||||
{
|
||||
home.username = "tine";
|
||||
home.homeDirectory = "/home/tine";
|
||||
|
||||
programs.git.extraConfig.user.signingkey = lib.mkForce "~/.ssh/id_rsa";
|
||||
}
|
|
@ -1,4 +1 @@
|
|||
#!/bin/env bash
|
||||
export NIXPKGS_ALLOW_UNFREE=1
|
||||
|
||||
home-manager switch
|
||||
|
|
Loading…
Reference in a new issue