Compare commits

...

9 Commits

Author SHA1 Message Date
712d10cef3 basic vmware gen 2025-03-31 20:37:44 -04:00
dccbb234f2 again 2025-03-31 19:37:43 -04:00
6cfbc68c8b waybar 2025-03-29 20:53:24 -04:00
f06bbcbdad yay 2025-03-28 22:46:22 -04:00
Evan Reichard
a78b85b344 almost 2025-03-28 13:52:51 -04:00
23fb30893d ugh 2025-03-27 20:45:50 -04:00
4e82b684e5 hm 2025-03-27 20:27:58 -04:00
e354c4e194 wip 2025-03-27 12:46:52 -04:00
b956c8da1e wip 2025-03-27 10:11:28 -04:00
100 changed files with 2533 additions and 986 deletions

1
.gitignore vendored Normal file → Executable file
View File

@ -1,3 +1,4 @@
.DS_Store
_scratch
result
._*

7
.sops.yaml Normal file
View File

@ -0,0 +1,7 @@
keys:
- &admin_reichard age1sac93wpnjcv62s7583jv6a4yspndh6k0r25g3qx3k7gq748uvafst6nz4w
creation_rules:
- path_regex: secrets/[^/]+\.(yaml|json|env|ini)$
key_groups:
- age:
- *admin_reichard

15
README.md Normal file → Executable file
View File

@ -1,17 +1,24 @@
# Description
This repository contains the configuration for multiple machines, as well as my home / IDE config (home-manager).
It takes heavy inspiration from [khaneliman/khanelinix](https://github.com/khaneliman/khanelinix).
## Home Manager
### NixOS
Utilizing [Home Manager](https://nix-community.github.io/home-manager/). Check out the [README.md](./home-manager/README.md).
```bash
## NixOS
```
### NixOS Generators
```bash
nix build .#packages.x86_64-linux.rke2-image
nix build .#vmwareConfigurations.rke2-node
```
### Home Manager
```bash
home-manager switch --flake .#evanreichard@MBP-Personal
```
### NixOS Hosts

8
TODO.md Normal file
View File

@ -0,0 +1,8 @@
- Nix Builder
- Keys
- User
- Etc
- SSH
- Known Hosts

254
flake.lock generated Normal file → Executable file
View File

@ -1,15 +1,38 @@
{
"nodes": {
"apple-silicon": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixpkgs"
],
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1738646032,
"narHash": "sha256-57BdBE9anNpIpf48EiTVLGxg4mOQ04XjHCEP0gLTsFA=",
"owner": "tpwrules",
"repo": "nixos-apple-silicon",
"rev": "e77031211944723a38bebc043e48847c36e43668",
"type": "github"
},
"original": {
"owner": "tpwrules",
"ref": "releasep2-2024-12-25",
"repo": "nixos-apple-silicon",
"type": "github"
}
},
"disko": {
"inputs": {
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1739841949,
"narHash": "sha256-lSOXdgW/1zi/SSu7xp71v+55D5Egz8ACv0STkj7fhbs=",
"lastModified": 1741786315,
"narHash": "sha256-VT65AE2syHVj6v/DGB496bqBnu1PXrrzwlw07/Zpllc=",
"owner": "nix-community",
"repo": "disko",
"rev": "15dbf8cebd8e2655a883b74547108e089f051bf0",
"rev": "0d8c6ad4a43906d14abd5c60e0ffe7b587b213de",
"type": "github"
},
"original": {
@ -18,6 +41,133 @@
"type": "github"
}
},
"firefox-addons": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1743119709,
"narHash": "sha256-tlJY7MfAena/yi3lmd7y7vQGpLma4Q1BLtO4dvzF/Vs=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "f8861a4b09a181dd88f6626d0202d9225ae85d65",
"type": "gitlab"
},
"original": {
"dir": "pkgs/firefox-addons",
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"flake-compat": {
"locked": {
"lastModified": 1688025799,
"narHash": "sha256-ktpB4dRtnksm9F5WawoIkEneh1nrEvuxb5lJFt1iOyw=",
"owner": "nix-community",
"repo": "flake-compat",
"rev": "8bf105319d44f6b9f0d764efa4fdef9f1cc9ba1c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils-plus": {
"inputs": {
"flake-utils": "flake-utils_2"
},
"locked": {
"lastModified": 1715533576,
"narHash": "sha256-fT4ppWeCJ0uR300EH3i7kmgRZnAVxrH+XtK09jQWihk=",
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
},
"original": {
"owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus",
"rev": "3542fe9126dc492e53ddd252bb0260fe035f2c0f",
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1742655702,
"narHash": "sha256-jbqlw4sPArFtNtA1s3kLg7/A4fzP4GLk9bGbtUJg0JQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "0948aeedc296f964140d9429223c7e4a0702a1ff",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-24.11",
"repo": "home-manager",
"type": "github"
}
},
"nixlib": {
"locked": {
"lastModified": 1736643958,
@ -41,11 +191,11 @@
]
},
"locked": {
"lastModified": 1737057290,
"narHash": "sha256-3Pe0yKlCc7EOeq1X/aJVDH0CtNL+tIBm49vpepwL1MQ=",
"lastModified": 1742568034,
"narHash": "sha256-QaMEhcnscfF2MqB7flZr+sLJMMYZPnvqO4NYf9B4G38=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "d002ce9b6e7eb467cd1c6bb9aef9c35d191b5453",
"rev": "42ee229088490e3777ed7d1162cb9e9d8c3dbb11",
"type": "github"
},
"original": {
@ -56,11 +206,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1738136902,
"narHash": "sha256-pUvLijVGARw4u793APze3j6mU1Zwdtz7hGkGGkD87qw=",
"lastModified": 1741402956,
"narHash": "sha256-y2hByvBM03s9T2fpeLjW6iprbxnhV9mJMmSwCHc41ZQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9a5db3142ce450045840cc8d832b13b8a2018e0c",
"rev": "ed0b1881565c1ffef490c10d663d4f542031dad3",
"type": "github"
},
"original": {
@ -72,11 +222,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1739758141,
"narHash": "sha256-uq6A2L7o1/tR6VfmYhZWoVAwb3gTy7j4Jx30MIrH0rE=",
"lastModified": 1742937945,
"narHash": "sha256-lWc+79eZRyvHp/SqMhHTMzZVhpxkRvthsP1Qx6UCq0E=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c618e28f70257593de75a7044438efc1c1fc0791",
"rev": "d02d88f8de5b882ccdde0465d8fa2db3aa1169f7",
"type": "github"
},
"original": {
@ -88,9 +238,87 @@
},
"root": {
"inputs": {
"apple-silicon": "apple-silicon",
"disko": "disko",
"firefox-addons": "firefox-addons",
"home-manager": "home-manager",
"nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_2",
"snowfall-lib": "snowfall-lib",
"sops-nix": "sops-nix"
}
},
"rust-overlay": {
"flake": false,
"locked": {
"lastModified": 1686795910,
"narHash": "sha256-jDa40qRZ0GRQtP9EMZdf+uCbvzuLnJglTUI2JoHfWDc=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "5c2b97c0a9bc5217fc3dfb1555aae0fb756d99f9",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"snowfall-lib": {
"inputs": {
"flake-compat": "flake-compat_2",
"flake-utils-plus": "flake-utils-plus",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1736130495,
"narHash": "sha256-4i9nAJEZFv7vZMmrE0YG55I3Ggrtfo5/T07JEpEZ/RM=",
"owner": "snowfallorg",
"repo": "lib",
"rev": "02d941739f98a09e81f3d2d9b3ab08918958beac",
"type": "github"
},
"original": {
"owner": "snowfallorg",
"repo": "lib",
"type": "github"
}
},
"sops-nix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1743305778,
"narHash": "sha256-Ux/UohNtnM5mn9SFjaHp6IZe2aAnUCzklMluNtV6zFo=",
"owner": "Mic92",
"repo": "sops-nix",
"rev": "8e873886bbfc32163fe027b8676c75637b7da114",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "sops-nix",
"type": "github"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},

120
flake.nix Normal file → Executable file
View File

@ -4,93 +4,53 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
disko.url = "github:nix-community/disko";
snowfall-lib = {
url = "github:snowfallorg/lib";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
apple-silicon = {
url = "github:tpwrules/nixos-apple-silicon/releasep2-2024-12-25";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, disko, nixos-generators }:
let
mkSystem = { systemConfig ? { }, moduleConfig }: nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
disko.nixosModules.disko
./lib/disk-config.nix
./lib/common-system.nix
systemConfig
({ ... }: moduleConfig)
outputs = inputs:
inputs.snowfall-lib.mkFlake {
inherit inputs;
src = ./.;
snowfall = {
namespace = "reichard";
meta = {
title = "Reichard";
name = "reichard";
};
};
homes.modules = with inputs; [
sops-nix.homeManagerModules.sops
];
systems.modules = {
nixos = with inputs; [
sops-nix.nixosModules.sops
];
};
in
{
# NixOS Generators
packages.x86_64-linux = {
# RKE2
rke2-image = nixos-generators.nixosGenerate {
system = "x86_64-linux";
format = "vmware";
modules = [
./hosts/rke2-image.nix
];
};
usb-image = nixos-generators.nixosGenerate {
system = "x86_64-linux";
format = "raw-efi";
modules = [
./hosts/usb-image.nix
];
};
};
# NixOS Configurations
nixosConfigurations = {
# Office Server (LLaMA / ADS-B)
lin-va-office = mkSystem {
systemConfig = ./hosts/office-server.nix;
moduleConfig = {
hostName = "lin-va-office";
mainDiskID = "/dev/disk/by-id/ata-MTFDDAK512MBF-1AN1ZABHA_161212233628";
network = {
interface = "enp5s0";
address = "10.0.50.120";
defaultGateway = "10.0.50.254";
nameservers = [ "10.0.50.254" ];
};
};
};
# Utility Room Desktop
lin-va-utility = mkSystem {
systemConfig = ./hosts/utility-desktop.nix;
moduleConfig = {
hostName = "lin-va-utility";
mainDiskID = "/dev/disk/by-id/nvme-eui.0026b768429d3eb5";
network = {
interface = "eno1";
address = "10.0.20.50";
defaultGateway = "10.0.20.254";
nameservers = [ "10.0.20.254" ];
};
};
};
# Nix Builder
lin-va-nix-builder = mkSystem {
systemConfig = ./hosts/builder.nix;
moduleConfig = {
hostName = "lin-va-nix-builder";
mainDiskID = "/dev/xvda";
enableXenGuest = true;
network = {
interface = "enX0";
address = "10.0.50.130";
defaultGateway = "10.0.50.254";
nameservers = [ "10.0.50.254" ];
};
};
};
};
};
}

View File

@ -1,18 +0,0 @@
{
programs.bash = {
enable = true;
shellAliases = {
grep = "grep --color";
ssh = "TERM=xterm-256color ssh";
flush_dns = "sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder";
};
profileExtra = ''
SHELL="$BASH"
PATH=~/.bin:$PATH
eval "$(thefuck --alias)"
set -o vi
bind "set show-mode-in-prompt on"
fastfetch
'';
};
}

View File

@ -1,10 +0,0 @@
{
programs.btop = {
enable = true;
};
home.file.".config/btop/btop.conf".text =
builtins.readFile ./config/btop.conf;
home.file.".config/btop/themes/catppuccin_mocha.theme".text =
builtins.readFile ./config/catppuccin_mocha.theme;
}

View File

@ -1,6 +0,0 @@
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

View File

@ -1,7 +0,0 @@
{
xdg.configFile = {
"fastfetch/config.jsonc" = {
source = ./config/config.jsonc;
};
};
}

View File

@ -1,26 +0,0 @@
command = bash --login
macos-titlebar-style = tabs
auto-update = off
font-family = "MesloLGM Nerd Font Mono"
# Melange Dark - Adapted From: https://github.com/savq/melange-nvim/blob/master/term/kitty/melange_dark.conf
palette = 0=#34302C
palette = 1=#BD8183
palette = 2=#78997A
palette = 3=#E49B5D
palette = 4=#7F91B2
palette = 5=#B380B0
palette = 6=#7B9695
palette = 7=#C1A78E
palette = 8=#867462
palette = 9=#D47766
palette = 10=#85B695
palette = 11=#EBC06D
palette = 12=#A3A9CE
palette = 13=#CF9BC2
palette = 14=#89B3B6
palette = 15=#ECE1D7
background = 292522
foreground = ECE1D7
selection-background = 403A36
selection-foreground = ECE1D7

View File

@ -1,7 +0,0 @@
{
xdg.configFile = {
"ghostty/config" = {
source = ./config/ghostty.conf;
};
};
}

View File

@ -1,72 +0,0 @@
{
programs.git = {
enable = true;
userName = "Evan Reichard";
aliases = {
lg = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all -n 15";
};
includes = [
{
path = "~/.config/git/work";
condition = "gitdir:~/Development/git/work/";
}
{
path = "~/.config/git/personal";
condition = "gitdir:~/Development/git/personal/";
}
];
extraConfig = {
core = {
autocrlf = "input";
safecrlf = "true";
excludesFile = "~/.config/git/.gitignore";
};
column = {
ui = "auto";
};
fetch = {
prune = true;
pruneTags = true;
all = true;
};
help = {
autocorrect = true;
};
diff = {
algorithm = "histogram";
colorMoved = "plain";
mnemonicPrefix = true;
renames = true;
};
rebase = {
autoSquash = true;
autoStash = true;
updateRefs = true;
};
rerere = {
enabled = true;
autoupdate = true;
};
commit = {
verbose = true;
};
branch = {
sort = "-committerdate";
};
merge = {
conflictstyle = "zdiff3";
};
push = {
autoSetupRemote = true;
};
};
};
# Copy Configuration
xdg.configFile = {
git = {
source = ./config;
recursive = true;
};
};
}

View File

@ -1,86 +0,0 @@
{ pkgs, ... }:
let
inherit (pkgs.lib) optionals mkForce;
inherit (pkgs.stdenv) isLinux isDarwin;
in
{
imports = [
./bash
./btop
./direnv
./fastfetch
./ghostty
./git
./nvim
./powerline
./readline
./hyprland
./waybar
];
# Home Manager Config
home.stateVersion = "24.11";
home.username = "evanreichard";
home.homeDirectory = mkForce (if isLinux then "/home/evanreichard" else "/Users/evanreichard");
programs.home-manager.enable = true;
# Global Packages
home.packages = with pkgs; [
(nerdfonts.override { fonts = [ "Meslo" ]; })
# ghostty - Pending Darwin @ https://github.com/NixOS/nixpkgs/pull/369788
android-tools
awscli2
bashInteractive
cw
fastfetch
gitAndTools.gh
google-cloud-sdk
imagemagick
kubectl
kubernetes-helm
mosh
pre-commit
python311
ssm-session-manager-plugin
texliveSmall # Pandoc PDF Dep
thefuck
tldr
]
++ optionals isLinux [
ghostty
hyprpaper
firefox
]
++ optionals isDarwin [ ];
# GitHub CLI
programs.gh = {
enable = true;
settings = {
git_protocol = "ssh";
};
};
# Misc Programs
programs.jq.enable = true;
programs.k9s.enable = true;
programs.pandoc.enable = true;
# Enable Flakes & Commands
nix = {
package = mkForce pkgs.nix;
settings = {
experimental-features = "nix-command flakes";
};
};
# SQLite Configuration
home.file.".sqliterc".text = ''
.headers on
.mode column
'';
# Darwin Spotlight Indexing Hack
disabledModules = [ "targets/darwin/linkapps.nix" ];
}

View File

@ -1,8 +0,0 @@
{ pkgs, lib, ... }:
lib.mkIf pkgs.stdenv.isLinux {
wayland.windowManager.hyprland = {
enable = true;
extraConfig = builtins.readFile ./config/hyprland.conf;
};
}

View File

@ -1,194 +0,0 @@
{ pkgs, ... }:
{
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
withNodeJs = true;
withPython3 = true;
plugins = with pkgs.vimPlugins; [
# ------------------
# --- Completion ---
# ------------------
cmp-buffer # Buffer Word Completion
cmp-cmdline # Command Line Completion
cmp-nvim-lsp # Main LSP
cmp-path # Path Completion
cmp_luasnip # Snippets Completion
friendly-snippets # Snippets
lsp_lines-nvim # Inline Diagnostics
luasnip # Snippets
nvim-cmp # Completions
nvim-lspconfig # LSP Config
# -------------------
# ----- Helpers -----
# -------------------
aerial-nvim # Code Outline
comment-nvim # Code Comments
diffview-nvim # Diff View
gitsigns-nvim # Git Blame
leap-nvim # Quick Movement
markdown-preview-nvim # Markdown Preview
neo-tree-nvim # File Explorer
none-ls-nvim # Formatters
numb-nvim # Peek / Jump to Lines
nvim-autopairs # Automatically Close Pairs (),[],{}
telescope-fzf-native-nvim # Faster Telescope
telescope-nvim # Fuzzy Finder
telescope-ui-select-nvim # UI
toggleterm-nvim # Terminal Helper
vim-nix # Nix Helpers
which-key-nvim # Shortcut Helper
# ------------------
# --- Theme / UI ---
# ------------------
lualine-nvim # Bottom Line
noice-nvim # UI Tweaks
# nord-nvim # Theme
melange-nvim # Theme
nvim-notify # Noice Dependency
nvim-web-devicons # Dev Icons
# ------------------
# --- Treesitter ---
# ------------------
nvim-treesitter-context
nvim-treesitter.withAllGrammars
# -------------------
# ------- DAP -------
# -------------------
nvim-dap
nvim-dap-go
nvim-dap-ui
# --------------------
# -- NONE-LS EXTRAS --
# --------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "none-ls-extras.nvim";
version = "2024-06-11";
src = pkgs.fetchFromGitHub {
owner = "nvimtools";
repo = "none-ls-extras.nvim";
rev = "336e84b9e43c0effb735b08798ffac382920053b";
sha256 = "sha256-UtU4oWSRTKdEoMz3w8Pk95sROuo3LEwxSDAm169wxwk=";
};
meta.homepage = "https://github.com/nvimtools/none-ls-extras.nvim/";
}
)
# -------------------
# ----- Silicon -----
# -------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "silicon.lua";
version = "2022-12-03";
src = pkgs.fetchFromGitHub {
owner = "mhanberg";
repo = "silicon.lua";
rev = "5ca462bee0a39b058786bc7fbeb5d16ea49f3a23";
sha256 = "0vlp645d5mmii513v72jca931miyrhkvhwb9bfzhix1199zx7vi2";
};
meta.homepage = "https://github.com/mhanberg/silicon.lua/";
}
)
# -------------------
# ------- LLM -------
# -------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "llm.nvim";
version = "2024-05-25";
src = pkgs.fetchFromGitHub {
owner = "David-Kunz";
repo = "gen.nvim";
rev = "bd19cf584b5b82123de977b44105e855e61e5f39";
sha256 = "sha256-0AEB6im8Jz5foYzmL6KEGSAYo48g1bkFpjlCSWT6JeE=";
};
meta.homepage = "https://github.com/David-Kunz/gen.nvim/";
}
)
# -------------------
# ---- LLAMA.VIM ----
# -------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "llama.vim";
version = "2025-01-23";
src = pkgs.fetchFromGitHub {
owner = "ggml-org";
repo = "llama.vim";
rev = "143fe910b8d47a054ed464c38d8b7c17d5354468";
sha256 = "sha256-PW0HKzhSxcZiWzpDOuy98rl/X0o2nE7tMjZjwwh0qLE=";
};
meta.homepage = "https://github.com/ggml-org/llama.vim/";
}
)
];
extraPackages = with pkgs; [
# Telescope Dependencies
fd
ripgrep
tree-sitter
# LSP Dependencies
go
golangci-lint
golangci-lint-langserver
gopls
lua-language-server
nil
nodePackages.eslint
nodePackages.svelte-language-server
nodePackages.typescript
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
pyright
eslint_d
# Formatters
luaformatter
nixpkgs-fmt
nodePackages.prettier
sqlfluff
stylua
# Silicon
silicon
];
extraConfig = ":luafile ~/.config/nvim/lua/init.lua";
};
xdg.configFile = {
# Copy Configuration
nvim = {
source = ./config;
recursive = true;
};
# Generate Nix Vars
"nvim/lua/nix-vars.lua".text = ''
local nix_vars = {
gopls = "${pkgs.gopls}/bin/gopls",
luals = "${pkgs.lua-language-server}/bin/lua-language-server",
sveltels = "${pkgs.nodePackages.svelte-language-server}/bin/svelteserver",
tsls = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server",
golintls = "${pkgs.golangci-lint-langserver}/bin/golangci-lint-langserver",
vscls = "${pkgs.nodePackages.vscode-langservers-extracted}",
}
return nix_vars
'';
};
}

View File

@ -1,16 +0,0 @@
{
programs.powerline-go = {
enable = true;
settings = {
git-mode = "compact";
theme = "gruvbox";
};
modules = [
"host"
"cwd"
"git"
"docker"
"venv"
];
};
}

View File

@ -1,10 +0,0 @@
{
programs.readline = {
enable = true;
extraConfig = ''
# Approximate VIM Dracula Colors
set vi-ins-mode-string \1\e[01;38;5;23;48;5;231m\2 I \1\e[38;5;231;48;5;238m\2\1\e[0m\2
set vi-cmd-mode-string \1\e[01;38;5;22;48;5;148m\2 C \1\e[38;5;148;48;5;238m\2\1\e[0m\2
'';
};
}

View File

@ -1,88 +0,0 @@
* {
border: none;
border-radius: 0;
font-family:
Cartograph CF Nerd Font,
monospace;
font-weight: bold;
font-size: 14px;
min-height: 0;
}
window#waybar {
background: rgba(21, 18, 27, 0);
color: #cdd6f4;
}
tooltip {
}
#workspaces button {
}
#workspaces button.active {
color: #9ccfd8;
}
#workspaces button.focused {
color: #9ccfd8;
}
#workspaces button.urgent {
}
#workspaces button:hover {
}
#custom-language,
#custom-updates,
#custom-caffeine,
#custom-weather,
#window,
#clock,
#battery,
#pulseaudio,
#network,
#workspaces,
#tray,
#backlight {
}
#tray {
}
#workspaces {
}
#custom-caffeine {
}
#custom-language {
}
#custom-updates {
}
#window {
}
#clock {
}
#network {
}
#pulseaudio {
}
#pulseaudio.microphone {
}
#battery {
}
#custom-weather {
}
#custom-endright {
}

View File

@ -1,114 +0,0 @@
{ lib, pkgs, ... }:
lib.mkIf pkgs.stdenv.isLinux {
programs.waybar = {
enable = true;
style = builtins.readFile ./config/style.css;
settings = [{
layer = "top";
position = "top";
mod = "dock";
exclusive = true;
passtrough = false;
gtk-layer-shell = true;
height = 0;
modules-left = [
"hyprland/workspaces"
"custom/divider"
"custom/divider"
"cpu"
"custom/divider"
"memory"
];
modules-center = [ "hyprland/window" ];
modules-right = [
"tray"
"network"
"custom/divider"
"backlight"
"custom/divider"
"pulseaudio"
"custom/divider"
"battery"
"custom/divider"
"clock"
];
"hyprland/window" = { format = "{}"; };
"wlr/workspaces" = {
on-scroll-up = "hyprctl dispatch workspace e+1";
on-scroll-down = "hyprctl dispatch workspace e-1";
all-outputs = true;
on-click = "activate";
};
battery = { format = "󰁹 {}%"; };
cpu = {
interval = 10;
format = "󰻠 {}%";
max-length = 10;
on-click = "";
};
memory = {
interval = 30;
format = " {}%";
format-alt = " {used:0.1f}G";
max-length = 10;
};
backlight = {
format = "󰖨 {}";
device = "acpi_video0";
};
tray = {
icon-size = 13;
tooltip = false;
spacing = 10;
};
network = {
format = "󰖩 {essid}";
format-disconnected = "󰖪 disconnected";
};
clock = {
format = " {:%I:%M %p %m/%d} ";
tooltip-format = ''
<big>{:%Y %B}</big>
<tt><small>{calendar}</small></tt>'';
};
pulseaudio = {
format = "{icon} {volume}%";
tooltip = false;
format-muted = " Muted";
on-click = "pamixer -t";
on-scroll-up = "pamixer -i 5";
on-scroll-down = "pamixer -d 5";
scroll-step = 5;
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [ "" "" "" ];
};
};
"pulseaudio#microphone" = {
format = "{format_source}";
tooltip = false;
format-source = " {volume}%";
format-source-muted = " Muted";
on-click = "pamixer --default-source -t";
on-scroll-up = "pamixer --default-source -i 5";
on-scroll-down = "pamixer --default-source -d 5";
scroll-step = 5;
};
"custom/divider" = {
format = " | ";
interval = "once";
tooltip = false;
};
"custom/endright" = {
format = "_";
interval = "once";
tooltip = false;
};
}];
};
}

View File

@ -0,0 +1,51 @@
{ pkgs, lib, config, namespace, ... }:
let
inherit (lib.${namespace}) enabled;
in
{
reichard = {
user = {
enable = true;
inherit (config.snowfallorg.user) name;
};
services = {
ssh-agent = enabled;
};
programs = {
graphical = {
ghostty = enabled;
};
terminal = {
btop = enabled;
direnv = enabled;
git = enabled;
k9s = enabled;
nvim = enabled;
};
};
};
# Global Packages
programs.jq = enabled;
programs.pandoc = enabled;
home.packages = with pkgs; [
android-tools
imagemagick
mosh
python311
texliveSmall # Pandoc PDF Dep
google-cloud-sdk
tldr
];
# SQLite Configuration
home.file.".sqliterc".text = ''
.headers on
.mode column
'';
home.stateVersion = "24.11";
}

View File

@ -0,0 +1,52 @@
{ pkgs, lib, config, namespace, ... }:
let
inherit (lib.${namespace}) enabled;
in
{
reichard = {
user = {
enable = true;
inherit (config.snowfallorg.user) name;
};
services = {
ssh-agent = enabled;
};
programs = {
graphical = {
ghostty = enabled;
};
terminal = {
btop = enabled;
direnv = enabled;
git = enabled;
k9s = enabled;
nvim = enabled;
aws = enabled;
};
};
};
# Global Packages
programs.jq = enabled;
programs.pandoc = enabled;
home.packages = with pkgs; [
android-tools
imagemagick
mosh
python311
texliveSmall # Pandoc PDF Dep
google-cloud-sdk
tldr
];
# SQLite Configuration
home.file.".sqliterc".text = ''
.headers on
.mode column
'';
home.stateVersion = "24.11";
}

View File

@ -0,0 +1,40 @@
# Nix Home Manager Configuration
## Upgrade
```bash
# Update System Channels
sudo nix-channel --add https://nixos.org/channels/nixpkgs-24.11-darwin nixpkgs
sudo nix-channel --update
# Update Home Manager
nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz home-manager
nix-channel --update
# Link Repo
ln -s /Users/evanreichard/Development/git/personal/nix/home-manager ~/.config/home-manager
# Build Home Manager
home-manager switch
```
## Clean Garbage
NOTE: This will remove previous generations
```bash
sudo nix-collect-garbage --delete-old
nix-collect-garbage --delete-old
```
## OS Update
`/etc/bashrc` may get overridden. To properly load Nix, prepend the following:
```bash
# Nix
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix
```

View File

@ -0,0 +1,62 @@
{ pkgs, lib, config, namespace, ... }:
let
inherit (lib.${namespace}) enabled;
in
{
reichard = {
user = {
enable = true;
inherit (config.snowfallorg.user) name;
};
services = {
ssh-agent = enabled;
sops = {
enable = true;
defaultSopsFile = lib.snowfall.fs.get-file "secrets/mbp-nixos/default.yaml";
sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ];
};
};
programs = {
graphical = {
wms.hyprland = enabled;
ghostty = enabled;
browsers.firefox = {
enable = true;
gpuAcceleration = true;
hardwareDecoding = true;
};
};
terminal = {
btop = enabled;
direnv = enabled;
git = enabled;
k9s = enabled;
nvim = enabled;
};
};
};
# Global Packages
programs.jq = enabled;
programs.pandoc = enabled;
home.packages = with pkgs; [
android-tools
imagemagick
mosh
python311
texliveSmall # Pandoc PDF Dep
google-cloud-sdk
tldr
];
# SQLite Configuration
home.file.".sqliterc".text = ''
.headers on
.mode column
'';
home.stateVersion = "24.11";
}

View File

@ -1,46 +0,0 @@
{ pkgs, ... }:
{
# Basic System
system.stateVersion = "24.11";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
time.timeZone = "UTC";
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
};
# SSH
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "prohibit-password";
};
};
# Firewall Configuration
networking.firewall = {
enable = true;
allowedTCPPorts = [
22
];
};
# User Authorized Keys
users.users.root = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIe1n9l9pVF5+kjWJCOt3AvBVf1HOSZkEDZxCWVPSIkr evan@reichard"
];
hashedPassword = null;
};
# System Packages
environment.systemPackages = with pkgs; [
htop
tmux
vim
];
}

View File

@ -1,103 +0,0 @@
{ config, lib, ... }:
{
# NixOS Config
options = {
hostName = lib.mkOption {
type = lib.types.str;
description = "The node hostname";
};
enableXenGuest = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Whether to enable Xen guest support";
};
network = lib.mkOption {
type = lib.types.submodule {
options = {
interface = lib.mkOption {
type = lib.types.str;
description = "Network interface name";
example = "enp0s3";
};
address = lib.mkOption {
type = lib.types.str;
description = "Static IP address";
example = "10.0.20.200";
};
defaultGateway = lib.mkOption {
type = lib.types.str;
description = "Default gateway IP";
example = "10.0.20.254";
};
nameservers = lib.mkOption {
type = lib.types.listOf lib.types.str;
description = "List of DNS servers";
example = [ "10.0.20.254" "8.8.8.8" ];
default = [ "8.8.8.8" "8.8.4.4" ];
};
};
};
default = null;
description = "Network configuration";
};
};
config = lib.mkMerge [
{
# Basic System
system.stateVersion = "24.11";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
networking.hostName = config.hostName;
# Boot Loader Options
boot.loader = {
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
};
# Enable SSH
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "prohibit-password";
};
};
# User Authorized Keys
users.users.root = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIe1n9l9pVF5+kjWJCOt3AvBVf1HOSZkEDZxCWVPSIkr evan@reichard"
];
hashedPassword = null;
};
}
# Network Configuration
(lib.mkIf (config.network != null) {
networking = {
inherit (config.network) defaultGateway nameservers;
interfaces.${config.network.interface}.ipv4.addresses = [{
inherit (config.network) address;
prefixLength = 24;
}];
};
})
# Xen Guest Configuration
(lib.mkIf config.enableXenGuest {
services.xe-guest-utilities.enable = true;
boot.initrd = {
availableKernelModules = [ "xen_blkfront" "xen_netfront" ];
kernelModules = [ "xen_netfront" "xen_blkfront" ];
supportedFilesystems = [ "ext4" "xenfs" ];
};
boot.kernelModules = [ "xen_netfront" "xen_blkfront" "xenfs" ];
})
];
}

View File

@ -1,43 +0,0 @@
{ config, lib, ... }: {
options = {
mainDiskID = lib.mkOption {
type = lib.types.str;
description = "Device path for the main disk";
example = "/dev/disk/by-id/ata-VBOX_HARDDISK_VBcd9425b8-d666f9b8";
};
};
config = {
disko.devices = {
disk = {
main = {
type = "disk";
device = config.mainDiskID;
content = {
type = "gpt";
partitions = {
boot = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
};
}

19
lib/module/default.nix Normal file
View File

@ -0,0 +1,19 @@
{ lib, ... }:
let
inherit (lib) mkOption types;
in
rec {
mkOpt =
type: default: description:
mkOption { inherit type default description; };
mkBoolOpt = mkOpt types.bool;
enabled = {
enable = true;
};
disabled = {
enable = false;
};
}

View File

@ -0,0 +1,119 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib)
types
mkIf
mkMerge
optionalAttrs
;
inherit (lib.${namespace}) mkBoolOpt mkOpt;
cfg = config.${namespace}.programs.graphical.browsers.firefox;
in
{
imports = lib.snowfall.fs.get-non-default-nix-files ./.;
options.${namespace}.programs.graphical.browsers.firefox = with types; {
enable = lib.mkEnableOption "Firefox";
extraConfig = mkOpt str "" "Extra configuration for the user profile JS file.";
gpuAcceleration = mkBoolOpt false "Enable GPU acceleration.";
hardwareDecoding = mkBoolOpt false "Enable hardware video decoding.";
policies = mkOpt attrs
{
CaptivePortal = false;
DisableFirefoxStudies = true;
DisableFormHistory = true;
DisablePocket = true;
DisableTelemetry = true;
DisplayBookmarksToolbar = false;
DontCheckDefaultBrowser = true;
FirefoxHome = {
Pocket = false;
Snippets = false;
};
PasswordManagerEnabled = false;
UserMessaging = {
ExtensionRecommendations = false;
SkipOnboarding = true;
};
ExtensionSettings = {
# Block All
# "*".installation_mode = "blocked";
# Bypass Paywalls
"magnolia@12.34" = {
install_url = "https://gitflic.ru/project/magnolia1234/bpc_uploads/blob/raw?file=bypass_paywalls_clean-latest.xpi";
installation_mode = "force_installed";
};
# Ctrl+Number Tabs
"{84601290-bec9-494a-b11c-1baa897a9683}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ctrl-number-to-switch-tabs/latest.xpi";
installation_mode = "force_installed";
};
};
Preferences = { };
} "Policies to apply to firefox";
settings = mkOpt attrs { } "Settings to apply to the profile.";
extensions = mkOpt (with lib.types; listOf package)
(with pkgs.firefox-addons; [
bitwarden
darkreader
gruvbox-dark-theme
kagi-search
sponsorblock
ublock-origin
# bypass-paywalls-clean
]) "Extensions to install";
};
config = mkIf cfg.enable {
programs.firefox = {
enable = true;
inherit (cfg) policies;
profiles = {
${config.${namespace}.user.name} = {
inherit (cfg) extraConfig extensions;
inherit (config.${namespace}.user) name;
id = 0;
settings = mkMerge [
cfg.settings
{
"browser.aboutConfig.showWarning" = false;
"browser.aboutwelcome.enabled" = false;
"browser.sessionstore.warnOnQuit" = true;
"browser.shell.checkDefaultBrowser" = false;
"general.smoothScroll.msdPhysics.enabled" = true;
"intl.accept_languages" = "en-US,en";
# "devtools.chrome.enabled" = true;
# "xpinstall.signatures.required" = false;
}
(optionalAttrs cfg.gpuAcceleration {
"dom.webgpu.enabled" = true;
"gfx.webrender.all" = true;
"layers.gpu-process.enabled" = true;
"layers.mlgpu.enabled" = true;
})
(optionalAttrs cfg.hardwareDecoding {
"media.ffmpeg.vaapi.enabled" = true;
"media.gpu-process-decoder" = true;
"media.hardware-video-decoding.enabled" = true;
})
];
# userChrome = ./chrome/userChrome.css;
};
};
};
};
}

View File

@ -0,0 +1,51 @@
command = @BASH_PATH@ --login
macos-titlebar-style = tabs
auto-update = off
font-family = "MesloLGM Nerd Font Mono"
confirm-close-surface = true
# Keybindings - Tabs & Splits
keybind = ctrl+t=new_tab
keybind = ctrl+w=close_surface
keybind = ctrl+d=new_split:right
keybind = ctrl+shift+d=new_split:down
keybind = ctrl+enter=toggle_split_zoom
# Keybindings - Navigation - Splits
keybind = ctrl+left=goto_split:left
keybind = ctrl+right=goto_split:right
keybind = ctrl+up=goto_split:up
keybind = ctrl+down=goto_split:down
# Keybindings - Navigation - Tabs
keybind = ctrl+1=goto_tab:1
keybind = ctrl+2=goto_tab:2
keybind = ctrl+3=goto_tab:3
keybind = ctrl+4=goto_tab:4
keybind = ctrl+5=goto_tab:5
keybind = ctrl+6=goto_tab:6
keybind = ctrl+7=goto_tab:7
keybind = ctrl+8=goto_tab:8
keybind = ctrl+9=goto_tab:9
# Melange Dark - Adapted From: https://github.com/savq/melange-nvim/blob/master/term/kitty/melange_dark.conf
palette = 0=#34302C
palette = 1=#BD8183
palette = 2=#78997A
palette = 3=#E49B5D
palette = 4=#7F91B2
palette = 5=#B380B0
palette = 6=#7B9695
palette = 7=#C1A78E
palette = 8=#867462
palette = 9=#D47766
palette = 10=#85B695
palette = 11=#EBC06D
palette = 12=#A3A9CE
palette = 13=#CF9BC2
palette = 14=#89B3B6
palette = 15=#ECE1D7
background = 292522
foreground = ECE1D7
selection-background = 403A36
selection-foreground = ECE1D7

View File

@ -0,0 +1,77 @@
{ pkgs, lib, config, namespace, ... }:
let
inherit (pkgs.stdenv) isLinux;
inherit (lib) mkIf mkEnableOption optionals;
cfg = config.${namespace}.programs.graphical.ghostty;
in
{
options.${namespace}.programs.graphical.ghostty = {
enable = mkEnableOption "Ghostty";
};
config = mkIf cfg.enable {
programs.bash = {
enable = true;
shellAliases = {
grep = "grep --color";
ssh = "TERM=xterm-256color ssh";
flush_dns = "sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder";
};
profileExtra = ''
SHELL="$BASH"
PATH=~/.bin:$PATH
VISUAL=vim
EDITOR="$VISUAL"
eval "$(thefuck --alias)"
set -o vi || true
bind "set show-mode-in-prompt on"
fastfetch
'';
};
programs.powerline-go = {
enable = true;
settings = {
git-mode = "compact";
theme = "gruvbox";
};
modules = [
"host"
"cwd"
"git"
"docker"
"venv"
];
};
programs.readline = {
enable = true;
extraConfig = ''
# Approximate VIM Dracula Colors
set vi-ins-mode-string \1\e[01;38;5;23;48;5;231m\2 I \1\e[38;5;231;48;5;238m\2\1\e[0m\2
set vi-cmd-mode-string \1\e[01;38;5;22;48;5;148m\2 C \1\e[38;5;148;48;5;238m\2\1\e[0m\2
'';
};
home.packages = with pkgs; [
thefuck
fastfetch
bashInteractive
(nerdfonts.override { fonts = [ "Meslo" ]; })
] ++ optionals isLinux [
# Pending Darwin @ https://github.com/NixOS/nixpkgs/pull/369788
ghostty
];
home.file.".config/fastfetch/config.jsonc".text = builtins.readFile ./config/fastfetch.jsonc;
home.file.".config/ghostty/config".text =
let
bashPath = "${pkgs.bashInteractive}/bin/bash";
in
builtins.replaceStrings
[ "@BASH_PATH@" ]
[ bashPath ]
(builtins.readFile ./config/ghostty.conf);
};
}

View File

@ -1,30 +1,10 @@
# #######################################################################################
# AUTOGENERATED HYPR CONFIG.
# PLEASE USE THE CONFIG PROVIDED IN THE GIT REPO /examples/hypr.conf AND EDIT IT,
# OR EDIT THIS ONE ACCORDING TO THE WIKI INSTRUCTIONS.
# #######################################################################################
# This is an example Hyprland config file.
# Refer to the wiki for more information.
# https://wiki.hyprland.org/Configuring/
# Please note not all available settings / options are set here.
# For a full list, see the wiki
# You can split this configuration into multiple files
# Create your files separately and then link them to this file like this:
# source = ~/.config/hypr/myColors.conf
################
### MONITORS ###
################
# See https://wiki.hyprland.org/Configuring/Monitors/
monitor=,preferred,auto,1.0
# monitor=HDMI-A-1,1920x1080,0x0,1
monitor=,highres,auto,1.68 # 2
debug:disable_scale_checks = true
###################
### MY PROGRAMS ###
@ -69,7 +49,7 @@ env = HYPRCURSOR_SIZE,24
# https://wiki.hyprland.org/Configuring/Variables/#general
general {
gaps_in = 5
gaps_out = 20
gaps_out = 12
border_size = 2
@ -90,7 +70,6 @@ general {
decoration {
rounding = 10
# Change transparency of focused and unfocused windows
active_opacity = 1.0
inactive_opacity = 1.0
@ -101,21 +80,19 @@ decoration {
color = rgba(1a1a1aee)
}
# https://wiki.hyprland.org/Configuring/Variables/#blur
blur {
enabled = true
size = 3
passes = 1
vibrancy = 0.1696
}
}
# https://wiki.hyprland.org/Configuring/Variables/#animations
#https://wiki.hyprland.org/Configuring/Animations/
animations {
enabled = yes, please :)
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
bezier = easeOutQuint,0.23,1,0.32,1
bezier = easeInOutCubic,0.65,0.05,0.36,1
@ -186,21 +163,26 @@ input {
sensitivity = 0 # -1.0 - 1.0, 0 means no modification.
touchpad {
natural_scroll = false
scroll_factor = 0.2
disable_while_typing = true
natural_scroll = true
clickfinger_behavior = true
}
}
# https://wiki.hyprland.org/Configuring/Variables/#gestures
gestures {
workspace_swipe = false
workspace_swipe = true
workspace_swipe_fingers = 4
workspace_swipe_invert = true
}
# Example per-device config
# See https://wiki.hyprland.org/Configuring/Keywords/#per-device-input-configs for more
device {
name = epic-mouse-v1
sensitivity = -0.5
}
# device {
# name = epic-mouse-v1
# sensitivity = -0.5
# }
###################
@ -212,11 +194,11 @@ $mainMod = SUPER # Sets "Windows" key as main modifier
# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more
bind = $mainMod, Q, exec, $terminal
bind = $mainMod, C, killactive,
bind = $mainMod, W, killactive,
bind = $mainMod, M, exit,
bind = $mainMod, E, exec, $fileManager
bind = $mainMod, V, togglefloating,
bind = $mainMod, R, exec, $menu
bind = $mainMod, SPACE, exec, $menu
bind = $mainMod, P, pseudo, # dwindle
bind = $mainMod, J, togglesplit, # dwindle

View File

@ -0,0 +1,141 @@
@define-color rosewater #f5e0dc;
@define-color flamingo #f2cdcd;
@define-color pink #f5c2e7;
@define-color mauve #cba6f7;
@define-color red #f38ba8;
@define-color maroon #eba0ac;
@define-color peach #fab387;
@define-color yellow #f9e2af;
@define-color green #a6e3a1;
@define-color teal #94e2d5;
@define-color sky #89dceb;
@define-color sapphire #74c7ec;
@define-color blue #89b4fa;
@define-color lavender #b4befe;
@define-color text #cdd6f4;
@define-color subtext1 #bac2de;
@define-color subtext0 #a6adc8;
@define-color overlay2 #9399b2;
@define-color overlay1 #7f849c;
@define-color overlay0 #6c7086;
@define-color surface2 #585b70;
@define-color surface1 #45475a;
@define-color surface0 #313244;
@define-color base #1e1e2e;
@define-color mantle #181825;
@define-color crust #11111b;
/* Common Styles */
* {
font-family: FantasqueSansMono Nerd Font;
font-size: 14px;
min-height: 0;
}
/* Primary Waybar */
#waybar {
background: transparent;
color: @text;
}
/* Icon Only Sizes */
#network,
#backlight,
#battery {
font-size: 18px;
}
/* Node Styles */
#workspaces,
#window,
#cpu,
#memory,
#pulseaudio,
#network,
#backlight,
#battery,
#clock {
margin-top: 1rem;
padding: 0.2px 1rem;
background-color: @surface0;
}
#workspaces {
padding: 0px;
margin-left: 1rem;
}
#workspaces button {
color: @lavender;
border-radius: 1rem;
}
#workspaces button.active {
color: @sky;
background-color: @surface2;
}
#workspaces button:hover {
color: @sapphire;
}
#window {
background: transparent;
margin-left: 0.5rem;
margin-right: 8rem; /* Notch */
}
#memory {
color: @blue;
}
#pulseaudio {
color: @maroon;
}
#network {
color: @mauve;
}
#cpu {
color: @peach;
}
#backlight {
color: @yellow;
}
#battery {
color: @green;
}
#battery.charging {
color: @green;
}
#battery.warning:not(.charging) {
color: @red;
}
#clock {
color: @blue;
margin-right: 1rem;
}
/* Left Border Radius */
#clock,
#network,
#cpu,
#workspaces {
border-top-left-radius: 1rem;
border-bottom-left-radius: 1rem;
}
/* Right Border Radius */
#pulseaudio,
#clock,
#battery,
#workspaces {
border-top-right-radius: 1rem;
border-bottom-right-radius: 1rem;
}

View File

@ -0,0 +1,127 @@
window {
font-family: "Hack Nerd Font";
background: transparent;
}
#outer-box {
padding: 10px;
border-radius: 8px;
background: #2e3440;
}
#scroll {
/* The Nordic gtk theme adds an outline to show scroll areas... */
outline-color: transparent;
}
#input {
color: #e5e9f0;
caret-color: #e5e9f0;
background: #3b4252;
border-top-color: #3b4252;
border-left-color: #3b4252;
border-right-color: #3b4252;
border-bottom-color: #3b4252;
box-shadow: 0 0 0 1px transparent inset;
outline-color: transparent !important;
}
#input:focus {
background: #3b4252;
border-color: #3b4252 !important;
box-shadow: 0 0 0 1px transparent inset;
border-top-color: #3b4252 !important;
border-left-color: #3b4252 !important;
border-right-color: #3b4252 !important;
border-bottom-color: #3b4252 !important;
box-shadow: none !important;
outline-color: transparent !important;
}
#input image.left {
color: #d8dee9;
}
#input:focus image.left {
color: #e5e9f0;
}
#input image.right {
color: #d8dee9;
}
#input:focus image.right {
color: #e5e9f0;
}
label {
/* We set backgrounds on the block level. */
background: transparent;
}
#scroll {
padding-top: 6px;
}
#entry {
color: #4c566a;
padding: 8px 8px;
border-radius: 4px;
background: transparent;
}
#entry:selected {
color: #eceff4;
background: #8fbcbb;
font-weight: bold;
}
expander arrow {
margin-right: 8px;
}
#entry #selected #text {
color: #eceff4;
}
expander list {
margin-top: 8px;
/* background: #8fbcbb; */
background: transparent;
padding-left: 16px;
}
expander list #entry {
transition: none;
background: transparent;
}
expander list #entry:hover,
expander list #entry:active {
/* color: #8fbcbb;
background: #e5e9f0; */
}
expander list #entry #selected {
background: #8fbcbb;
}
expander list #entry #selected label {
color: #eceff4;
font-weight: bold;
}
expander list #entry:hover,
expander list #entry:active {
background: #8fbcbb;
}
expander list #entry:hover label,
expander list #entry:active label {
color: #eceff4;
font-weight: bold;
}
expander list label {
color: #d8dee9;
}

View File

@ -0,0 +1,3 @@
stylesheet=./style.css
term=foot
insensitive=true

View File

@ -0,0 +1,185 @@
{ lib, pkgs, config, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.graphical.wms.hyprland;
in
{
options.${namespace}.programs.graphical.wms.hyprland = {
enable = lib.mkEnableOption "Hyprland";
};
config = mkIf cfg.enable {
wayland.windowManager.hyprland = {
enable = true;
extraConfig = builtins.readFile ./config/hyprland.conf;
};
programs.waybar = {
enable = true;
style = builtins.readFile ./config/waybar-style.css;
settings = [{
layer = "top";
position = "top";
mod = "dock";
exclusive = true;
passtrough = false;
gtk-layer-shell = true;
height = 0;
modules-left = [
"hyprland/workspaces"
"hyprland/window"
];
# modules-center = [ "hyprland/window" ];
modules-right = [
"cpu"
"memory"
"tray"
"pulseaudio"
"network"
"backlight"
"battery"
"clock"
];
"hyprland/window" = { format = "{}"; };
"wlr/workspaces" = {
on-scroll-up = "hyprctl dispatch workspace e+1";
on-scroll-down = "hyprctl dispatch workspace e-1";
all-outputs = true;
on-click = "activate";
};
battery = {
states = {
warning = 30;
critical = 15;
};
format = "{icon}";
format-charging = "󰂄";
format-plugged = "󰂄";
format-alt = "{icon}";
format-icons = [
"󰂃"
"󰁺"
"󰁻"
"󰁼"
"󰁽"
"󰁾"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
];
};
cpu = {
interval = 10;
format = " {}%";
max-length = 10;
on-click = "";
};
memory = {
interval = 30;
format = " {}%";
format-alt = " {used:0.1f}G";
max-length = 10;
};
# backlight = {
# format = "󰖨 {}%";
# device = "acpi_video0";
# };
backlight = {
format = "{icon}";
format-icons = [
"󰋙"
"󰫃"
"󰫄"
"󰫅"
"󰫆"
"󰫇"
"󰫈"
];
on-scroll-up = "brightnessctl s 1%-";
on-scroll-down = "brightnessctl s +1%";
};
tray = {
icon-size = 13;
tooltip = false;
spacing = 10;
};
network = {
interval = 1;
format-wifi = "󰖩";
format-ethernet = "󰈀";
format-linked = "󰈁";
format-disconnected = "";
on-click-right = "${pkgs.networkmanagerapplet}/bin/nm-connection-editor";
# tooltip-format = ''
# <big>Network Details</big>
# <tt><small>Interface: {ifname}</small></tt>
# <tt><small>IP: {ipaddr}/{cidr}</small></tt>
# <tt><small>Gateway: {gwaddr}</small></tt>
# <tt><small>󰜷 {bandwidthUpBytes}\n󰜮 {bandwidthDownBytes}</small></tt>'';
tooltip-format = ''
<big>Network Details</big>
<small>
Interface: {ifname}
SSID: {essid}
IP Address: {ipaddr}/{cidr}
Gateway: {gwaddr}
󰜷 {bandwidthUpBytes} / 󰜮 {bandwidthDownBytes}
</small>'';
};
clock = {
format = " {:%Y-%m-%d %H:%M:%S}";
interval = 1;
tooltip-format = ''
<big>{:%Y %B}</big>
<tt><small>{calendar}</small></tt>'';
};
pulseaudio = {
format = "{icon} {volume}%";
tooltip = false;
format-muted = " Muted";
on-click = "pamixer -t";
on-scroll-up = "pamixer -i 5";
on-scroll-down = "pamixer -d 5";
scroll-step = 5;
format-icons = {
headphone = "";
hands-free = "";
headset = "";
phone = "";
portable = "";
car = "";
default = [ "" "" "" ];
};
};
"pulseaudio#microphone" = {
format = "{format_source}";
tooltip = false;
format-source = " {volume}%";
format-source-muted = " Muted";
on-click = "pamixer --default-source -t";
on-scroll-up = "pamixer --default-source -i 5";
on-scroll-down = "pamixer --default-source -d 5";
scroll-step = 5;
};
}];
};
home.packages = with pkgs; [
hyprshot
wofi
wofi-emoji
brightnessctl
];
xdg.configFile = {
"wofi/config".source = ./config/wofi.conf;
"wofi/style.css".source = ./config/wofi-style.css;
};
};
}

View File

@ -0,0 +1,18 @@
{ lib, pkgs, config, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.aws;
in
{
options.${namespace}.programs.terminal.aws = {
enable = lib.mkEnableOption "AWS";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
cw
awscli2
ssm-session-manager-plugin
];
};
}

View File

@ -0,0 +1,19 @@
{ lib, config, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.btop;
in
{
options.${namespace}.programs.terminal.btop = {
enable = lib.mkEnableOption "btop";
};
config = mkIf cfg.enable {
programs.btop.enable = true;
home.file.".config/btop/btop.conf".text =
builtins.readFile ./config/btop.conf;
home.file.".config/btop/themes/catppuccin_mocha.theme".text =
builtins.readFile ./config/catppuccin_mocha.theme;
};
}

View File

@ -0,0 +1,17 @@
{ lib, config, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.direnv;
in
{
options.${namespace}.programs.terminal.direnv = {
enable = lib.mkEnableOption "direnv";
};
config = mkIf cfg.enable {
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
};
}

View File

@ -0,0 +1,98 @@
{ pkgs, lib, config, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.git;
in
{
options.${namespace}.programs.terminal.git = {
enable = lib.mkEnableOption "Git";
};
config = mkIf cfg.enable {
programs.git = {
enable = true;
userName = "Evan Reichard";
aliases = {
lg = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all -n 15";
};
includes = [
{
path = "~/.config/git/work";
condition = "gitdir:~/Development/git/work/";
}
{
path = "~/.config/git/personal";
condition = "gitdir:~/Development/git/personal/";
}
];
extraConfig = {
user = {
email = "evan@reichard.io";
};
core = {
autocrlf = "input";
safecrlf = "true";
excludesFile = "~/.config/git/.gitignore";
};
column = {
ui = "auto";
};
fetch = {
prune = true;
pruneTags = true;
all = true;
};
help = {
autocorrect = true;
};
diff = {
algorithm = "histogram";
colorMoved = "plain";
mnemonicPrefix = true;
renames = true;
};
rebase = {
autoSquash = true;
autoStash = true;
updateRefs = true;
};
rerere = {
enabled = true;
autoupdate = true;
};
commit = {
verbose = true;
};
branch = {
sort = "-committerdate";
};
merge = {
conflictstyle = "zdiff3";
};
push = {
autoSetupRemote = true;
};
};
};
programs.gh = {
enable = true;
settings = {
git_protocol = "ssh";
};
};
home.packages = with pkgs; [
gitAndTools.gh
pre-commit
];
# Copy Configuration
xdg.configFile = {
git = {
source = ./config;
recursive = true;
};
};
};
}

View File

@ -0,0 +1,19 @@
{ lib, pkgs, config, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.k9s;
in
{
options.${namespace}.programs.terminal.k9s = {
enable = lib.mkEnableOption "k9s";
};
config = mkIf cfg.enable {
programs.k9s.enable = true;
home.packages = with pkgs; [
kubectl
kubernetes-helm
];
};
}

View File

@ -0,0 +1,203 @@
{ pkgs, lib, config, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.terminal.nvim;
in
{
options.${namespace}.programs.terminal.nvim = {
enable = lib.mkEnableOption "NeoVim";
};
config = mkIf cfg.enable {
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
withNodeJs = true;
withPython3 = true;
plugins = with pkgs.vimPlugins; [
# ------------------
# --- Completion ---
# ------------------
cmp-buffer # Buffer Word Completion
cmp-cmdline # Command Line Completion
cmp-nvim-lsp # Main LSP
cmp-path # Path Completion
cmp_luasnip # Snippets Completion
friendly-snippets # Snippets
lsp_lines-nvim # Inline Diagnostics
luasnip # Snippets
nvim-cmp # Completions
nvim-lspconfig # LSP Config
# -------------------
# ----- Helpers -----
# -------------------
aerial-nvim # Code Outline
comment-nvim # Code Comments
diffview-nvim # Diff View
gitsigns-nvim # Git Blame
leap-nvim # Quick Movement
markdown-preview-nvim # Markdown Preview
neo-tree-nvim # File Explorer
none-ls-nvim # Formatters
numb-nvim # Peek / Jump to Lines
nvim-autopairs # Automatically Close Pairs (),[],{}
telescope-fzf-native-nvim # Faster Telescope
telescope-nvim # Fuzzy Finder
telescope-ui-select-nvim # UI
toggleterm-nvim # Terminal Helper
vim-nix # Nix Helpers
which-key-nvim # Shortcut Helper
# ------------------
# --- Theme / UI ---
# ------------------
lualine-nvim # Bottom Line
noice-nvim # UI Tweaks
# nord-nvim # Theme
melange-nvim # Theme
nvim-notify # Noice Dependency
nvim-web-devicons # Dev Icons
# ------------------
# --- Treesitter ---
# ------------------
nvim-treesitter-context
nvim-treesitter.withAllGrammars
# -------------------
# ------- DAP -------
# -------------------
nvim-dap
nvim-dap-go
nvim-dap-ui
# --------------------
# -- NONE-LS EXTRAS --
# --------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "none-ls-extras.nvim";
version = "2024-06-11";
src = pkgs.fetchFromGitHub {
owner = "nvimtools";
repo = "none-ls-extras.nvim";
rev = "336e84b9e43c0effb735b08798ffac382920053b";
sha256 = "sha256-UtU4oWSRTKdEoMz3w8Pk95sROuo3LEwxSDAm169wxwk=";
};
meta.homepage = "https://github.com/nvimtools/none-ls-extras.nvim/";
}
)
# -------------------
# ----- Silicon -----
# -------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "silicon.lua";
version = "2022-12-03";
src = pkgs.fetchFromGitHub {
owner = "mhanberg";
repo = "silicon.lua";
rev = "5ca462bee0a39b058786bc7fbeb5d16ea49f3a23";
sha256 = "0vlp645d5mmii513v72jca931miyrhkvhwb9bfzhix1199zx7vi2";
};
meta.homepage = "https://github.com/mhanberg/silicon.lua/";
}
)
# -------------------
# ------- LLM -------
# -------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "llm.nvim";
version = "2024-05-25";
src = pkgs.fetchFromGitHub {
owner = "David-Kunz";
repo = "gen.nvim";
rev = "bd19cf584b5b82123de977b44105e855e61e5f39";
sha256 = "sha256-0AEB6im8Jz5foYzmL6KEGSAYo48g1bkFpjlCSWT6JeE=";
};
meta.homepage = "https://github.com/David-Kunz/gen.nvim/";
}
)
# -------------------
# ---- LLAMA.VIM ----
# -------------------
(
pkgs.vimUtils.buildVimPlugin {
pname = "llama.vim";
version = "2025-01-23";
src = pkgs.fetchFromGitHub {
owner = "ggml-org";
repo = "llama.vim";
rev = "143fe910b8d47a054ed464c38d8b7c17d5354468";
sha256 = "sha256-PW0HKzhSxcZiWzpDOuy98rl/X0o2nE7tMjZjwwh0qLE=";
};
meta.homepage = "https://github.com/ggml-org/llama.vim/";
}
)
];
extraPackages = with pkgs; [
# Telescope Dependencies
fd
ripgrep
tree-sitter
# LSP Dependencies
go
golangci-lint
golangci-lint-langserver
gopls
lua-language-server
nil
nodePackages.eslint
nodePackages.svelte-language-server
nodePackages.typescript
nodePackages.typescript-language-server
nodePackages.vscode-langservers-extracted
pyright
eslint_d
# Formatters
luaformatter
nixpkgs-fmt
nodePackages.prettier
sqlfluff
stylua
# Silicon
silicon
];
extraConfig = ":luafile ~/.config/nvim/lua/init.lua";
};
xdg.configFile = {
# Copy Configuration
nvim = {
source = ./config;
recursive = true;
};
# Generate Nix Vars
"nvim/lua/nix-vars.lua".text = ''
local nix_vars = {
gopls = "${pkgs.gopls}/bin/gopls",
luals = "${pkgs.lua-language-server}/bin/lua-language-server",
sveltels = "${pkgs.nodePackages.svelte-language-server}/bin/svelteserver",
tsls = "${pkgs.nodePackages.typescript-language-server}/bin/typescript-language-server",
golintls = "${pkgs.golangci-lint-langserver}/bin/golangci-lint-langserver",
vscls = "${pkgs.nodePackages.vscode-langservers-extracted}",
}
return nix_vars
'';
};
};
}

View File

@ -0,0 +1,41 @@
{ config, lib, namespace, pkgs, ... }:
let
inherit (lib) mkIf types;
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.services.sops;
in
{
options.${namespace}.services.sops = with types; {
enable = lib.mkEnableOption "sops";
defaultSopsFile = mkOpt path null "Default sops file.";
sshKeyPaths = mkOpt (listOf path) [ ] "SSH Key paths to use.";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
age
sops
ssh-to-age
];
sops = {
inherit (cfg) defaultSopsFile;
defaultSopsFormat = "yaml";
age = {
generateKey = true;
keyFile = "${config.home.homeDirectory}/.config/sops/age/keys.txt";
sshKeyPaths = [ "${config.home.homeDirectory}/.ssh/id_ed25519" ] ++ cfg.sshKeyPaths;
};
# TODO
# secrets = {
# nix = {
# sopsFile = lib.snowfall.fs.get-file "secrets/default.yaml";
# path = "${config.home.homeDirectory}/.config/nix/nix.conf";
# };
# };
};
};
}

View File

@ -0,0 +1,15 @@
{ config, lib, namespace, ... }:
let
cfg = config.${namespace}.services.ssh-agent;
in
{
options.${namespace}.services.ssh-agent = {
enable = lib.mkEnableOption "ssh-agent service";
};
config = lib.mkIf cfg.enable {
services.ssh-agent = {
enable = true;
};
};
}

View File

@ -0,0 +1,51 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib)
types
mkIf
mkDefault
mkMerge
;
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.user;
home-directory =
if cfg.name == null then
null
else if pkgs.stdenv.hostPlatform.isDarwin then
"/Users/${cfg.name}"
else
"/home/${cfg.name}";
in
{
options.${namespace}.user = {
enable = mkOpt types.bool false "Whether to configure the user account.";
email = mkOpt types.str "evan@reichard.io" "The email of the user.";
fullName = mkOpt types.str "Evan Reichard" "The full name of the user.";
home = mkOpt (types.nullOr types.str) home-directory "The user's home directory.";
name = mkOpt (types.nullOr types.str) config.snowfallorg.user.name "The user account.";
};
config = mkIf cfg.enable (mkMerge [
{
assertions = [
{
assertion = cfg.name != null;
message = "${namespace}.user.name must be set";
}
{
assertion = cfg.home != null;
message = "${namespace}.user.home must be set";
}
];
home = {
homeDirectory = mkDefault cfg.home;
username = mkDefault cfg.name;
};
programs.home-manager.enable = true;
}
]);
}

View File

@ -0,0 +1,33 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.display-managers.sddm;
in
{
options.${namespace}.display-managers.sddm = {
enable = lib.mkEnableOption "sddm";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
catppuccin-sddm
];
environment.sessionVariables = {
QT_SCREEN_SCALE_FACTORS = "2";
QT_FONT_DPI = "192";
};
services = {
displayManager = {
sddm = {
inherit (cfg) enable;
package = pkgs.kdePackages.sddm;
theme = "catppuccin-mocha";
wayland.enable = true;
};
};
};
};
}

View File

@ -0,0 +1,27 @@
{ config, lib, inputs, namespace, ... }:
let
inherit (lib) types optionalAttrs;
inherit (lib.${namespace}) mkOpt mkBoolOpt;
cfg = config.${namespace}.hardware.asahi;
in
{
imports = [
inputs.apple-silicon.nixosModules.default
];
options.${namespace}.hardware.asahi = {
enable = lib.mkEnableOption "support for asahi linux";
enableGPU = mkBoolOpt false "enable gpu driver";
firmwareDirectory = mkOpt types.path null "firmware directory";
};
config = {
hardware.asahi = {
enable = cfg.enable;
} // optionalAttrs cfg.enable {
peripheralFirmwareDirectory = cfg.firmwareDirectory;
useExperimentalGPUDriver = cfg.enableGPU;
};
};
}

View File

@ -0,0 +1,40 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.hardware.opengl;
in
{
options.${namespace}.hardware.opengl = {
enable = lib.mkEnableOption "support for opengl";
enable32Bit = mkBoolOpt false "enabel 32-bit";
enableIntel = mkBoolOpt false "support for intel";
enableNvidia = mkBoolOpt false "support for nvidia";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
libva-utils
vdpauinfo
] ++ lib.optionals cfg.enableNvidia [
nvtopPackages.full
];
hardware.graphics = {
enable = true;
enable32Bit = cfg.enable32Bit;
extraPackages = with pkgs;
lib.optionals cfg.enableIntel [
libvdpau-va-gl
intel-vaapi-driver
intel-media-driver
intel-compute-runtime
intel-ocl
] ++ lib.optionals cfg.enableNvidia [
cudatoolkit
];
};
};
}

View File

@ -0,0 +1,76 @@
{ config, lib, pkgs, namespace, host, ... }:
let
inherit (lib.${namespace}) mkBoolOpt mkOpt;
cfg = config.${namespace}.nix;
in
{
options.${namespace}.nix = {
enable = mkBoolOpt true "Whether or not to manage nix configuration.";
package = mkOpt lib.types.package pkgs.nixVersions.latest "Which nix package to use.";
};
config = lib.mkIf cfg.enable {
nix =
let
users = [
"root"
"@wheel"
"nix-builder"
"evanreichard"
];
in
{
inherit (cfg) package;
buildMachines = lib.optional (host != "nixos-builder") {
hostName = "10.0.50.130";
systems = [ "x86_64-linux" ];
sshUser = "root";
speedFactor = 1;
protocol = "ssh";
sshKey = config.sops.secrets.reichard_ssh_key.path;
supportedFeatures = [
"benchmark"
"big-parallel"
"nixos-test"
"kvm"
];
};
checkConfig = true;
distributedBuilds = true;
gc = {
automatic = true;
options = "--delete-older-than 7d";
};
# This will additionally add your inputs to the system's legacy channels
# # Making legacy nix commands consistent as well
nixPath = lib.mapAttrsToList (key: _: "${key}=flake:${key}") config.nix.registry;
optimise.automatic = true;
settings = {
allowed-users = users;
auto-optimise-store = pkgs.stdenv.hostPlatform.isLinux;
builders-use-substitutes = true;
experimental-features = [
"nix-command"
"flakes "
];
flake-registry = "/etc/nix/registry.json";
http-connections = 50;
keep-derivations = true;
keep-going = true;
keep-outputs = true;
log-lines = 50;
sandbox = true;
trusted-users = users;
warn-dirty = false;
use-xdg-base-directories = true;
};
};
};
}

View File

@ -0,0 +1,28 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.programs.graphical.wms.hyprland;
in
{
options.${namespace}.programs.graphical.wms.hyprland = {
enable = lib.mkEnableOption "Hyprland";
};
config = mkIf cfg.enable {
programs = {
hyprland = {
enable = true;
withUWSM = true;
};
};
reichard = {
display-managers = {
sddm = {
enable = true;
};
};
};
};
}

View File

@ -0,0 +1,33 @@
{ config, lib, namespace, ... }:
let
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.security.sops;
in
{
options.${namespace}.security.sops = {
enable = lib.mkEnableOption "sops";
defaultSopsFile = mkOpt lib.types.path null "Default sops file.";
sshKeyPaths = mkOpt (with lib.types; listOf path) [
"/etc/ssh/ssh_host_ed25519_key"
] "SSH Key paths to use.";
};
config = lib.mkIf cfg.enable {
sops = {
inherit (cfg) defaultSopsFile;
age = {
inherit (cfg) sshKeyPaths;
keyFile = "${config.users.users.${config.${namespace}.user.name}.home}/.config/sops/age/keys.txt";
};
};
sops.secrets = {
"reichard_ssh_key" = {
sopsFile = lib.snowfall.fs.get-file "secrets/default.yaml";
};
};
};
}

View File

@ -0,0 +1,78 @@
{ config, format, lib, namespace, ... }:
let
inherit (lib)
types
mkDefault
mkIf
;
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.services.openssh;
authorizedKeys = [
# MBP-Personal NixOS
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIe1n9l9pVF5+kjWJCOt3AvBVf1HOSZkEDZxCWVPSIkr"
];
in
{
options.${namespace}.services.openssh = with types; {
enable = lib.mkEnableOption "OpenSSH support";
authorizedKeys = mkOpt (listOf str) authorizedKeys "The public keys to apply.";
extraConfig = mkOpt str "" "Extra configuration to apply.";
};
config = mkIf cfg.enable {
services.openssh = {
enable = true;
hostKeys = mkDefault [
{
bits = 4096;
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
];
openFirewall = true;
ports = [ 22 ];
settings = {
AuthenticationMethods = "publickey";
ChallengeResponseAuthentication = "no";
PasswordAuthentication = false;
PermitRootLogin = if format == "install-iso" then "yes" else "no";
PubkeyAuthentication = "yes";
StreamLocalBindUnlink = "yes";
UseDns = false;
UsePAM = true;
X11Forwarding = false;
KexAlgorithms = [
"curve25519-sha256"
"curve25519-sha256@libssh.org"
"diffie-hellman-group16-sha512"
"diffie-hellman-group18-sha512"
"diffie-hellman-group-exchange-sha256"
"sntrup761x25519-sha512@openssh.com"
];
Macs = [
"hmac-sha2-512-etm@openssh.com"
"hmac-sha2-256-etm@openssh.com"
"umac-128-etm@openssh.com"
];
};
startWhenNeeded = true;
};
programs.ssh = {
startAgent = lib.mkDefault true;
inherit (cfg) extraConfig;
};
reichard = {
user.extraOptions.openssh.authorizedKeys.keys = cfg.authorizedKeys;
};
};
}

View File

@ -0,0 +1,43 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.system.boot;
in
{
options.${namespace}.system.boot = {
enable = lib.mkEnableOption "booting";
silentBoot = lib.mkEnableOption "silent boot";
showNotch = lib.mkEnableOption "show macOS notch";
};
config = mkIf cfg.enable {
boot = {
kernelParams = lib.optionals cfg.silentBoot [
"quiet"
"loglevel=3"
"udev.log_level=3"
"rd.udev.log_level=3"
"systemd.show_status=auto"
"rd.systemd.show_status=auto"
"vt.global_cursor_default=0"
] ++ lib.optionals cfg.showNotch [
"apple_dcp.show_notch=1"
];
loader = {
efi = {
canTouchEfiVariables = false;
};
systemd-boot = {
enable = true;
configurationLimit = 20;
editor = false;
};
timeout = 1;
};
};
};
}

View File

@ -0,0 +1,33 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf mkForce;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.system.networking;
in
{
options.${namespace}.system.networking = {
enable = lib.mkEnableOption "networking support";
enableIWD = mkBoolOpt false "enable iwd";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
mtr
tcpdump
traceroute
];
reichard.user.extraGroups = [ "network" ];
networking = {
firewall.enable = true;
usePredictableInterfaceNames = mkForce true;
} // (lib.optionalAttrs cfg.enableIWD) {
wireless.iwd = {
enable = true;
settings.General.EnableNetworkConfiguration = true;
};
};
};
}

View File

@ -0,0 +1,26 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.system.networking;
in
{
config = mkIf cfg.enable {
reichard.user.extraGroups = [ "networkmanager" ];
networking.networkmanager = {
enable = true;
connectionConfig = {
"connection.mdns" = "2";
};
# unmanaged = [
# "interface-name:br-*"
# "interface-name:rndis*"
# ]
# ++ lib.optionals config.${namespace}.virtualisation.podman.enable [ "interface-name:docker*" ]
# ++ lib.optionals config.${namespace}.virtualisation.kvm.enable [ "interface-name:virbr*" ];
};
};
}

View File

@ -0,0 +1,32 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.system.time;
in
{
options.${namespace}.system.time = {
enable = lib.mkEnableOption "time related settings";
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.openntpd ];
networking.timeServers = [
"0.nixos.pool.ntp.org"
"1.nixos.pool.ntp.org"
"2.nixos.pool.ntp.org"
"3.nixos.pool.ntp.org"
];
services.openntpd = {
enable = true;
extraConfig = ''
listen on 127.0.0.1
listen on ::1
'';
};
time.timeZone = "America/New_York";
};
}

View File

@ -0,0 +1,35 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) types;
inherit (lib.${namespace}) mkOpt;
cfg = config.${namespace}.user;
in
{
options.${namespace}.user = with types; {
email = mkOpt str "evan@reichard.io" "The email of the user.";
extraGroups = mkOpt (listOf str) [ ] "Groups for the user to be assigned.";
extraOptions = mkOpt attrs { } "Extra options passed to <option>users.users.<name></option>.";
fullName = mkOpt str "Evan Reichard" "The full name of the user.";
initialPassword =
mkOpt str "password"
"The initial password to use when the user is first created.";
name = mkOpt str "evanreichard" "The name to use for the user account.";
};
config = {
users.users.${cfg.name} = {
inherit (cfg) name initialPassword;
extraGroups = [
"wheel"
] ++ cfg.extraGroups;
group = "users";
home = "/home/${cfg.name}";
isNormalUser = true;
shell = pkgs.bashInteractive;
uid = 1000;
} // cfg.extraOptions;
};
}

View File

@ -0,0 +1,8 @@
{ inputs, ... }:
final: _prev: {
firefox-addons = import inputs.firefox-addons {
inherit (final) fetchurl;
inherit (final) lib;
inherit (final) stdenv;
};
}

21
secrets/default.yaml Normal file
View File

@ -0,0 +1,21 @@
reichard_ssh_key: ENC[AES256_GCM,data:IS2/bjFWiqLKDxmg0ucKOMzJWqlMbrUw72qLy7hZaJ5O9pPmEFDtQY7gMV1jZZhmlTr6Ay5LthLNe+38/5lttVOQ/B4EtZHSPlPyFKgvUkVtAjTSSjpxI+Md5lsUHgjP3uL+C6qHPzPeBrm0xtdsUo4GBCwhSuKQCNlUAmX6xy4i5/NI2RD6DGRKF17fKpsKj/6XZlbrKQXcDDmnXQdsMw9f1grBQpacCJ/qwUVM3zojuGd0Ei3mGvMq26ralmDUKwu5dsI3PDJWDNF4+B6Wk7NlBRJDna2lRQDNEA8x7wOV3EpaTFpluKmABTxgEmxx8ZbB+9zlLiG6m09iSU86QQLRLQGP7VuejBYLmvxlydrLaxzlZaVDWrYtFEBWSlaC+jkbanOpcVp0QQVBdJRGg3XEP4NidIAbGVv+Ejz9i3o2ayTuMUKShLKv2NoxUE5lCNX2TDp/pZw4UYW/J2d3WXqpQ2KaWdahqBai2JcYk1Otn3ia0X+T1i1dXDitT45AEI/n4z/gKeGWSDiLJ62uJejSuNXBk879SLQf,iv:wziTYwyTQXKRFrUP4HohZtXnp7sk+vLbJiQd0PLKg1o=,tag:irpzHqh3kocNGKQIeo+kRA==,type:str]
sops:
kms: []
gcp_kms: []
azure_kv: []
hc_vault: []
age:
- recipient: age1sac93wpnjcv62s7583jv6a4yspndh6k0r25g3qx3k7gq748uvafst6nz4w
enc: |
-----BEGIN AGE ENCRYPTED FILE-----
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA0SnA3M2F0cXZjOGlFSTJw
aE9BNGJsQ1JzelFoQk4yMGlpN2dkVUR4ZUNvCmljSDhsVU4rUnowV2dIdlhZYnMy
aXo2OGZRd21PYk81ZE9pV05XSmpVOEEKLS0tIGhGNkVmTnVYRENEYlBxZXJTaExt
SC91WFNocEN2K1NFK2dBUHYwZTQrVFkKKb3AlaRX96vJwEmxNNAThTlO9ZwtD1tv
c6aBELEbmJFdHOcIJITzmS3YOssDOgTL2TbcSFu8mdAQYsRvxC96HA==
-----END AGE ENCRYPTED FILE-----
lastmodified: "2025-03-30T15:06:18Z"
mac: ENC[AES256_GCM,data:ZqN6MbVcPst/zvr4KNl5AygtC8Icb1BELHg5o6rDOOb6qmB2d75Vk59ve8EiBosMhPdYAXaTCViRLxeWoG3WzEWK0bYAUBI27UBgYqaUTLXTDhohihtAwwWD37S2wFslHWddl5PngbTho8n+uMwyaeBdj53h4GbvQPC2Ji95D5A=,iv:boTLI3IXdQoBfPEqkay9jkm85AFahcNOmBBPwWbJaEw=,tag:Hic4+9Uuh8I2KokfdsZIsg==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.9.4

View File

@ -0,0 +1,57 @@
{ namespace, lib, ... }:
let
inherit (lib.${namespace}) enabled;
in
{
imports = [
./hardware-configuration.nix
];
# System Config
reichard = {
nix = enabled;
system = {
time = enabled;
boot = {
enable = true;
showNotch = true;
};
networking = {
enable = true;
enableIWD = true;
};
};
hardware = {
opengl = enabled;
asahi = {
enable = true;
enableGPU = true;
firmwareDirectory = ./firmware;
};
};
security = {
sops = {
enable = true;
sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
defaultSopsFile = lib.snowfall.fs.get-file "secrets/default.yaml";
};
};
programs = {
graphical = {
wms.hyprland = enabled;
};
};
};
# Hardware Config
hardware = {
bluetooth.enable = true;
bluetooth.powerOnBoot = true;
};
system.stateVersion = "24.11";
}

Binary file not shown.

View File

@ -0,0 +1,37 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "usb_storage" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/6dce11fa-5075-44d4-b502-14d0a1b36e7f";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/2254-0F1E";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
}

View File

View File

@ -0,0 +1,193 @@
{ pkgs, lib, modulesPath, ... }:
{
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];
config = {
reichard = {
nix.enable = false;
};
# Basic System
system.stateVersion = "24.11";
nix.settings.experimental-features = [ "nix-command" "flakes" ];
time.timeZone = "UTC";
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
};
boot = {
initrd = {
availableKernelModules = [
# Xen
"xen_blkfront"
"xen_netfront"
];
kernelModules = [ "xen_netfront" "xen_blkfront" ];
supportedFilesystems = [ "ext4" "xenfs" ];
};
kernelModules = [
# Xen VM Requirements
"xen_netfront"
"xen_blkfront"
"xenfs"
# iSCSI
"iscsi_tcp"
];
};
# Add Intel Arc A310 GPU Drivers
nixpkgs.config.allowUnfree = true;
hardware.enableRedistributableFirmware = true;
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
libvdpau-va-gl
intel-vaapi-driver
intel-media-driver
intel-compute-runtime
intel-ocl
];
};
# Network Configuration
networking = {
hostName = lib.mkForce "";
useNetworkd = true;
useDHCP = false;
firewall = {
enable = true;
allowedTCPPorts = [
# RKE2 Ports - https://docs.rke2.io/install/requirements#networking
6443 # Kubernetes API
9345 # RKE2 supervisor API
2379 # etcd Client Port
2380 # etcd Peer Port
2381 # etcd Metrics Port
10250 # kubelet metrics
9099 # Canal CNI health checks
];
allowedUDPPorts = [
# RKE2 Ports - https://docs.rke2.io/install/requirements#networking
8472 # Canal CNI with VXLAN
# 51820 # Canal CNI with WireGuard IPv4 (if using encryption)
# 51821 # Canal CNI with WireGuard IPv6 (if using encryption)
];
# Allow Multicast
extraCommands = ''
iptables -A INPUT -m pkttype --pkt-type multicast -j ACCEPT
'';
};
};
services = {
# Enable Xen Guest Utilities
xe-guest-utilities.enable = true;
# Enable iSCSI
openiscsi = {
enable = true;
name = "iqn.2025.placeholder:initiator"; # Overridden @ Runtime
};
# Cloud Init
cloud-init = {
enable = true;
network.enable = true;
settings = {
datasource_list = [ "NoCloud" ];
preserve_hostname = false;
system_info.distro = "nixos";
system_info.network.renderers = [ "networkd" ];
};
};
# Enable SSH
openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "prohibit-password";
};
};
# Enable RKE2
rke2 = {
enable = true;
disable = [ "rke2-ingress-nginx" ];
};
};
systemd.services = {
# RKE2 - Wait Cloud Init
rke2-server = {
after = [ "cloud-final.service" ];
requires = [ "cloud-final.service" ];
};
# Runtime iSCSI Initiator Setup
iscsi-initiator-setup = {
description = "Setup iSCSI Initiator Name";
requires = [ "cloud-final.service" ];
before = [ "iscsid.service" ];
after = [ "cloud-final.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
};
path = [ pkgs.hostname pkgs.util-linux ];
script = ''
mkdir -p /run/iscsi
echo "InitiatorName=iqn.2025.org.nixos:$(hostname)" > /run/iscsi/initiatorname.iscsi
mount --bind /run/iscsi/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
'';
};
};
# User Authorized Keys
users.users.root = {
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIe1n9l9pVF5+kjWJCOt3AvBVf1HOSZkEDZxCWVPSIkr evan@reichard"
];
hashedPassword = null;
};
# Add Symlinks Expected by Democratic
system.activationScripts = {
iscsi-initiator = ''
mkdir -p /usr/bin
ln -sf ${pkgs.openiscsi}/bin/iscsiadm /usr/bin/iscsiadm
ln -sf ${pkgs.openiscsi}/bin/iscsid /usr/bin/iscsid
'';
};
# System Packages
environment = {
systemPackages = with pkgs; [
htop
intel-gpu-tools
k9s
kubectl
kubernetes-helm
nfs-utils
openiscsi
tmux
vim
];
# Don't Manage - Runtime Generation
etc."iscsi/initiatorname.iscsi".enable = false;
};
};
}