312 current 1970-01-01 01:00:00 23.11.20240514.9ddcaff 6.1.90 *

This commit is contained in:
Max Känner 2024-05-18 20:22:28 +02:00
parent bcc917a2da
commit f3d2da344f
4 changed files with 54 additions and 60 deletions

View File

@ -11,6 +11,7 @@
sway.laptop = true; sway.laptop = true;
shell.enable = true; shell.enable = true;
git.enable = true;
# Home Manager needs a bit of information about you and the paths it should # Home Manager needs a bit of information about you and the paths it should
# manage. # manage.

View File

@ -1,26 +1,40 @@
{...}: { {
lib,
config,
...
}: let
cfg = config.git;
in {
imports = [./lazygit.nix]; imports = [./lazygit.nix];
programs.git = { options = {
enable = true; git.enable = lib.mkEnableOption "git";
extraConfig = { };
fetch.parallel = 0;
init.defaultBranch = "main"; config = lib.mkIf cfg.enable {
pull.rebase = true; git.lazygit.enable = lib.mkDefault true;
};
delta = { programs.git = {
enable = true; enable = true;
options = { extraConfig = {
decorations = { fetch.parallel = 0;
commit-decoration-style = "bold yellow box ul"; init.defaultBranch = "main";
file-decoration-style = "none"; pull.rebase = true;
file-style = "bold yellow ul";
};
features = "decorations";
whitespace-error-style = "22 reverse";
}; };
delta = {
enable = true;
options = {
decorations = {
commit-decoration-style = "bold yellow box ul";
file-decoration-style = "none";
file-style = "bold yellow ul";
};
features = "decorations";
whitespace-error-style = "22 reverse";
};
};
userEmail = "max.kaenner@gmail.com";
userName = "Max Känner";
}; };
userEmail = "max.kaenner@gmail.com";
userName = "Max Känner";
}; };
} }

View File

@ -1,11 +1,23 @@
{...}: { {
programs.lazygit = { lib,
enable = true; config,
settings = { ...
gui = { }: let
shwoRandomTip = false; cfg = config.git.lazygit;
nerdFontsVersion = "3"; in {
border = "rounded"; options = {
git.lazygit.enable = lib.mkEnableOption "lazygit, a git tui";
};
config = lib.mkIf cfg.enable {
programs.lazygit = {
enable = true;
settings = {
gui = {
shwoRandomTip = false;
nerdFontsVersion = "3";
border = "rounded";
};
}; };
}; };
}; };

View File

@ -1,33 +0,0 @@
#!/usr/bin/env bash
# A rebuild script that commits on a successful build
set -e
# cd to your config dir
pushd ~/dotfiles/nixos/
# Edit your config
$EDITOR
# Autoformat your nix files
alejandra . #&>/dev/null
# Shows your changes
git diff -U0 *.nix
echo "NixOS Rebuilding..."
# Rebuild, output simplified errors, log trackebacks
sudo nixos-rebuild switch &>nixos-switch.log || (cat nixos-switch.log | grep --color error && false)
# Get current generation metadata
current=$(nixos-rebuild list-generations | grep current)
# Commit all changes with the gereation metadata
git commit -am "$current"
# Back to where you were
popd
# Notify all OK!
notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available