initial commit

This commit is contained in:
2025-05-12 23:25:39 -03:00
parent bf178e3caa
commit dc6f6894e6
95 changed files with 3922 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
# FIXME(starter): customize your bash preferences here
{
programs.bash = {
enable = true;
enableCompletion = true;
shellAliases = {
};
initExtra = ''
'';
};
}

View File

@@ -0,0 +1,10 @@
# Core home functionality that will only work on Darwin
{ config, ... }:
{
home.sessionPath = [ "/opt/homebrew/bin" ];
home = {
username = config.hostSpec.username;
homeDirectory = config.hostSpec.home;
};
}

View File

@@ -0,0 +1,79 @@
#FIXME: Move attrs that will only work on linux to nixos.nix
{
config,
lib,
pkgs,
hostSpec,
...
}: let
platform =
if hostSpec.isDarwin
then "darwin"
else "nixos";
in {
imports = lib.flatten [
(map lib.custom.relativeToRoot [
"modules/common/host-spec.nix"
"modules/home"
])
./${platform}.nix
# FIXME(starter): add/edit as desired
./fish.nix
./bash.nix
./direnv.nix
./fonts.nix
./kitty.nix
./git.nix
./ssh.nix
];
inherit hostSpec;
services.ssh-agent.enable = true;
home = {
username = lib.mkDefault config.hostSpec.username;
homeDirectory = lib.mkDefault config.hostSpec.home;
stateVersion = lib.mkDefault "24.11";
sessionPath = [
"$HOME/.local/bin"
];
sessionVariables = {
FLAKE = "$HOME/src/nix/nix-config";
SHELL = "bash";
};
};
home.packages = builtins.attrValues {
inherit
(pkgs)
# FIXME(starter): add/edit as desired
# Packages that don't have custom configs go here
curl
pciutils
pfetch # system info
pre-commit # git hooks
p7zip # compression & encryption
usbutils
unzip # zip extraction
unrar # rar extraction
;
};
nix = {
package = lib.mkDefault pkgs.nix;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
warn-dirty = false;
};
};
programs.home-manager.enable = true;
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
}

View File

@@ -0,0 +1,8 @@
{
programs.direnv = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
nix-direnv.enable = true; # better than native direnv nix functionality - https://github.com/nix-community/nix-direnv
};
}

View File

@@ -0,0 +1,25 @@
{pkgs, ...}: {
home.packages = builtins.attrValues {
inherit
(pkgs)
grc
;
};
programs.fish = {
enable = true;
interactiveShellInit = ''
set fish_greeting # Disable greeting
'';
plugins = [
{
name = "grc";
src = pkgs.fishPlugins.grc.src;
}
{
name = "autopair";
src = pkgs.fishPlugins.autopair.src;
}
];
};
}

View File

@@ -0,0 +1,7 @@
{ pkgs, ... }:
{
fonts.fontconfig.enable = true;
home.packages = [
pkgs.noto-fonts
];
}

View File

@@ -0,0 +1,25 @@
# git is core no matter what but additional settings may could be added made in optional/foo eg: development.nix
{
pkgs,
...
}:
{
programs.git = {
enable = true;
package = pkgs.gitAndTools.gitFull;
ignores = [
".csvignore"
# nix
"*.drv"
"result"
# python
"*.py?"
"__pycache__/"
".venv/"
# direnv
".direnv"
];
};
}

View File

@@ -0,0 +1,5 @@
{
programs.kitty = {
enable = true;
};
}

View File

@@ -0,0 +1,7 @@
# Core home functionality that will only work on Linux
{
...
}:
{
}

View File

@@ -0,0 +1,9 @@
{ pkgs, ... }:
{
home.packages = [ pkgs.screen ];
home.file.".screenrc".text = ''
startup_message off
defbce on
setenv TERM xterm-256color
'';
}

View File

@@ -0,0 +1,24 @@
# FIXME(starter): adjust to you security requirements
{
config,
...
}:
{
programs.ssh =
{
enable = true;
controlMaster = "auto";
controlPath = "${config.home.homeDirectory}/.ssh/sockets/S.%r@%h:%p";
controlPersist = "20m";
# Avoids infinite hang if control socket connection interrupted. ex: vpn goes down/up
serverAliveCountMax = 3;
serverAliveInterval = 5; # 3 * 5s
hashKnownHosts = true;
addKeysToAgent = "yes";
};
home.file = {
".ssh/config.d/.keep".text = "# Managed by Home Manager";
".ssh/sockets/.keep".text = "# Managed by Home Manager";
};
}