feat(home structure): Adding users + structuring common dir for them

This commit is contained in:
madmin 2024-06-19 15:10:33 +02:00
parent d934c9ac18
commit da5147903b
19 changed files with 475 additions and 0 deletions

View File

@ -0,0 +1,20 @@
# https://github.com/sharkdp/bat
# https://github.com/eth-p/bat-extras
{ pkgs, ... }: {
programs.bat = {
enable = true;
config = {
# Show line numbers, Git modifications and file header (but no grid)
style = "numbers,changes,header";
theme = "gruvbox-dark";
};
extraPackages = builtins.attrValues {
inherit (pkgs.bat-extras)
batgrep# search through and highlight files using ripgrep
batdiff# Diff a file against the current git index, or display the diff between to files
batman; # read manpages using bat as the formatter
};
};
}

View File

@ -0,0 +1,89 @@
{ config, lib, pkgs, outputs, configLib, ... }:
{
imports = (configLib.scanPaths ./.)
++ (builtins.attrValues outputs.homeManagerModules);
services.ssh-agent.enable = true;
home = {
username = lib.mkDefault "laozi";
homeDirectory = lib.mkDefault "/home/${config.home.username}";
stateVersion = lib.mkDefault "24.05";
sessionPath = [
"$HOME/.local/bin"
"$HOME/scripts/talon_scripts"
];
sessionVariables = {
FLAKE = "$HOME/dotfiles/nix-config";
SHELL = "zsh";
TERM = "foot";
TERMINAL = "foot";
EDITOR = "nvim";
MANPAGER = "batman"; # see ./cli/bat.nix
};
};
home.packages = builtins.attrValues {
inherit (pkgs)
# Packages that don't have custom configs go here
# TODO: spaces before comment are removed by nixpkgs-fmt
# See: https://github.com/nix-community/nixpkgs-fmt/issues/305
borgbackup# backups
ncdu# TUI disk usage
btop# resource monitor
pfetch# system info
pciutils# pci bus info + conns. to them
coreutils# basic gnu utils
usbutils
mosh# mobile shell
# curl
ripgrep# better grep
wget# downloader
eza# ls replacement
fd# tree style ls
findutils# find gnu.org/software/findutils/
fzf# fuzzy search
nix-tree# nix package tree viewer
jq# JSON pretty printer and manipulator
fx# Terminal JSON viewer & processor ~> fx.wtf
tree# cli dir tree viewer
pre-commit# git hooks
koji# conventional commits ~> https://github.com/its-danny/koji
p7zip# compression & encryption
unzip# zip extraction
unrar# rar extraction
zstd# zstd compression
zip; # zip compression
};
nixpkgs = {
overlays = builtins.attrValues outputs.overlays;
config = {
allowUnfree = true;
# Workaround for https://github.com/nix-community/home-manager/issues/2942
allowUnfreePredicate = (_: true);
};
};
nix = {
package = lib.mkDefault pkgs.nix;
settings = {
experimental-features = [ "nix-command" "flakes" "repl-flake" ];
warn-dirty = true;
};
};
programs = {
home-manager.enable = true;
};
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
}

View File

@ -0,0 +1,10 @@
{ pkgs, ... }:
{
fonts.fontconfig.enable = true; # required to autoload fonts from packages
home.packages = [
pkgs.noto-fonts
# pkgs.nerdfonts # => loads the complete collection.
(nerdfonts.override { fonts = [ "FiraCode" "GeistMono" "DroidSansMono" "FontAwesome" "MaterialDesignIcons"]; })
];
}

View File

@ -0,0 +1,36 @@
{ pkgs, lib, config, ... }:
{
programs.git = {
enable = true;
package = pkgs.gitAndTools.gitFull.overrideAttrs = (old: {
postInstall = old.postInstall + ''
cp ${./includes/git-aliases/docs}* $Doc/share/doc/git
''
});
userName = "madmin";
userEmail = "madmin@noreply.codeberg.com";
aliases = {
gs = "status";
lg = "!git log --graph --oneline --decorate --all";
};
extraConfig = {
init.defaultBranch = "master";
url = {
"ssh://git@github.com" = {
insteadOf = "https://github.com";
};
"ssh://git@gitlab.com" = {
insteadOf = "https://gitlab.com";
};
};
# user.signing.key = "";
#TODO sops - Re-enable once sops setup complete
commit.gpgSign = false;
gpg.program = "${config.programs.gpg.package}/bin/gpg2";
};
# enable git Large File Storage: https://git-lfs.com/
# lfs.enable = true;
ignores = [ ".direnv" "result" ];
};
}

View File

@ -0,0 +1,31 @@
{
programs.gitui = {
enable = true;
# Config and theme must be in RON file format
# keyConfig = '' '';
package = "pkgs.gitui";
theme = ''(
selected_tab: Reset,
command_fg: White,
selection_bg: Blue,
selection_fg: White,
cmdbar_bg: Blue,
cmdbar_extra_lines_bg: Blue,
disabled_fg: DarkGray,
diff_line_add: Green,
diff_line_delete: Red,
diff_file_added: LightGreen,
diff_file_removed: LightRed,
diff_file_moved: LightMagenta,
diff_file_modified: Yellow,
commit_hash: Magenta,
commit_time: LightCyan,
commit_author: Green,
danger_fg: Red,
push_gauge_bg: Blue,
push_gauge_fg: Reset,
tag_fg: LightMagenta,
branch_fg: LightYellow,
) '';
}
}

View File

@ -0,0 +1,32 @@
{ inputs, pkgs, ... }: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
];
programs.nixvim = {
enable = true;
enableMan = true; # install man pages for nixvim options
clipboard.register = "unnamedplus"; # use system clipboard instead of internal registers
colorschemes = {
gruvbox = {
enable = true;
settings = {
contrastDark = true;
transparentBg = true;
};
};
};
extraConfigVim = ''
" ================ Persistent Undo ==================
" Keep undo history across sessions, by storing in file.
" Only works all the time.
if has('persistent_undo')
silent !mkdir ~/.vim/backups > /dev/null 2>&1
set undodir=~/.vim/backups
set undofile
endif
'';
};
}

View File

@ -0,0 +1,10 @@
{
programs.zoxide = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
options = [
"--cmd cd" #replace cd with z and zi (via cdi)
];
};
}

View File

@ -0,0 +1,14 @@
{ config, lib, pkgs, outputs, configLib, ... }:
{
imports = (configLib.scanPaths ./.)
++ (builtins.attrValues outputs.homeManagerModules);
home.packages = builtins.attrValues {
inherit (pkgs)
# Here go packages without my configs
#!Remember to comment without space after package
signal-desktop# there are also clis and other sw for interaction with signal on desktop
element-desktop# should be usable on wayland
}
}

View File

@ -0,0 +1,10 @@
{ config, lib, pkgs, outputs, configLib, ... }:
{
imports = (configLib.scanPaths ./.)
++ (builtins.attrValues outputs.homeManagerModules);
home.packages = builtins.attrValues {
inherit (pkgs)
# Here go packages without my configs
#!Remember to comment without space after package
}
}

View File

@ -0,0 +1,97 @@
{
pkgs,
theme,
...
}: {
home.packages = with pkgs; [
libsixel
# for displaying images
];
programs.foot = {
enable = true;
server.enable = false;
settings = {
main = {
app-id = "foot";
title = "foot";
locked-title = "no";
term = "xterm-256color";
font = "monospace:size=10.5";
vertical-letter-offset = "-0.75";
pad = "12x21 center";
resize-delay-ms = 100;
notify = "notify-send -a \${app-id} -i \${app-id} \${title} \${body}";
selection-target = "primary";
# box-drawings-uses-font-glyphs = "yes";
dpi-aware = "yes";
bold-text-in-bright = "no";
word-delimiters = ",`|:\"'()[]{}<>";
};
cursor = {
style = "beam";
beam-thickness = 2;
};
scrollback = {
lines = 10000;
multiplier = 3;
};
bell = {
urgent = "yes";
notify = "yes";
command = "notify-send bell";
command-focused = "no";
};
url = {
launch = "xdg-open \${url}";
label-letters = "sadfjklewcmpgh";
osc8-underline = "url-mode";
protocols = "http, https, ftp, ftps, file, gemini, gopher, irc, ircs";
uri-characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.,~:;/?#@!$&%*+=\"'()[]";
};
colors = with theme.colors; {
alpha = "0.75";
foreground = text;
background = base;
regular0 = surface1;
regular1 = red;
regular2 = green;
regular3 = yellow;
regular4 = blue;
regular5 = pink;
regular6 = teal;
regular7 = subtext1;
bright0 = surface2;
bright1 = red;
bright2 = green;
bright3 = yellow;
bright4 = blue;
bright5 = pink;
bright6 = teal;
bright7 = subtext0;
};
mouse = {
hide-when-typing = "yes";
};
key-bindings = {
show-urls-launch = "Control+Shift+u";
unicode-input = "Control+Shift+i";
};
mouse-bindings = {
selection-override-modifiers = "Shift";
primary-paste = "BTN_MIDDLE";
select-begin = "BTN_LEFT";
select-begin-block = "Control+BTN_LEFT";
select-extend = "BTN_RIGHT";
select-extend-character-wise = "Control+BTN_RIGHT";
select-word = "BTN_LEFT-2";
select-word-whitespace = "Control+BTN_LEFT-2";
#select-row = "BTN_LEFT-3";
};
};
};
}

View File

@ -0,0 +1,10 @@
{ config, lib, pkgs, outputs, configLib, ... }:
{
imports = (configLib.scanPaths ./.)
++ (builtins.attrValues outputs.homeManagerModules);
home.packages = builtins.attrValues {
inherit (pkgs)
# Here go packages without my configs
#!Remember to comment without space after package
}
}

View File

@ -0,0 +1,10 @@
{ config, lib, pkgs, outputs, configLib, ... }:
{
imports = (configLib.scanPaths ./.)
++ (builtins.attrValues outputs.homeManagerModules);
home.packages = builtins.attrValues {
inherit (pkgs)
# Here go packages without my configs
#!Remember to comment without space after package
}
}

View File

@ -0,0 +1,25 @@
{
programs.firefox = {
enable = true;
commandLineArgs = [
"--no-default-browser-check"
"--restore-last-sesion"
];
arkenfox = {
enable = true;
version = "103.0";
};
profiles.Default.arkenfox = {
enable = true;
"0000".enable = true;
"0001" = {
enable = true;
"0101"."browser.shell.checkDefaultBrowser".value = true;
};
"0002" = {
enable = true;
"0204"."browser.search.region".enable = true;
};
};
};
}

View File

@ -0,0 +1,10 @@
{ config, lib, pkgs, outputs, configLib, ... }:
{
imports = (configLib.scanPaths ./.)
++ (builtins.attrValues outputs.homeManagerModules);
home.packages = builtins.attrValues {
inherit (pkgs)
# Here go packages without my configs
#!Remember to comment without space after package
}
}

View File

@ -0,0 +1,11 @@
{ config, lib, pkgs, outputs, configLib, ... }:
{
imports = (configLib.scanPaths ./.)
++ (builtins.attrValues outputs.homeManagerModules);
home.packages = builtins.attrValues {
inherit (pkgs)
# Here go packages without my configs
#!Remember to comment without space after package
libreoffice# TODO: will it work on wayland?
}
}

View File

@ -0,0 +1,10 @@
{ config, lib, pkgs, outputs, configLib, ... }:
{
imports = (configLib.scanPaths ./.)
++ (builtins.attrValues outputs.homeManagerModules);
home.packages = builtins.attrValues {
inherit (pkgs)
# Here go packages without my configs
#!Remember to comment without space after package
}
}

View File

@ -0,0 +1,11 @@
{ config, lib, pkgs, outputs, configLib, ... }:
{
imports = (configLib.scanPaths ./.)
++ (builtins.attrValues outputs.homeManagerModules);
home.packages = builtins.attrValues {
inherit (pkgs)
# Here go packages without my configs
#!Remember to comment without space after package
fwupd# firmware updater default on KDE
}
}

20
home/laozi/jeroboam.nix Normal file
View File

@ -0,0 +1,20 @@
{ configVars, ... }:
{
imports = [
# ======================= Hardware Configs ========================= #
# ======================= Required Configs ========================= #
/core
# ================ Host-specific Optional Configs ================== #
common/optional/utilities
common/optional/dev/foot.nix
common/optional/office
];
home = {
username = configVars.username;
homeDirectory = "/home/${configVars.username}";
};
}

View File

@ -0,0 +1,19 @@
{ configVars, ... }:
{
imports = [
# ======================= Hardware Configs ========================= #
# ======================= Required Configs ========================= #
/core
# ================ Host-specific Optional Configs ================== #
common/optional/desktop
common/optional/dev
];
home = {
username = configVars.username;
homeDirectory = "/home/${configVars.username}";
};
}