Compare commits

..

2 Commits

Author SHA1 Message Date
4717886bcc pointers & 3 drag 2025-04-06 20:04:13 -04:00
7705f24e0f fw + avahi 2025-04-06 12:53:13 -04:00
15 changed files with 169 additions and 79 deletions

View File

@ -1,4 +1,4 @@
{ lib, config, namespace, osConfig, ... }:
{ pkgs, lib, config, namespace, osConfig, ... }:
let
inherit (lib.${namespace}) enabled;
in
@ -11,6 +11,7 @@ in
services = {
ssh-agent = enabled;
fusuma = enabled;
sops = {
enable = true;
defaultSopsFile = lib.snowfall.fs.get-file "secrets/default.yaml";
@ -40,6 +41,22 @@ in
};
};
dconf = {
settings = {
"org/gnome/desktop/interface" = {
cursor-theme = "catppuccin-macchiato-mauve-cursors";
};
};
};
home.pointerCursor = {
x11.enable = true;
gtk.enable = true;
package = pkgs.catppuccin-cursors.macchiatoMauve;
name = "catppuccin-macchiato-mauve-cursors";
size = 64;
};
# Kubernetes Secrets
sops.secrets = lib.mkIf osConfig.${namespace}.security.sops.enable {
rke2_kubeconfig = {

View File

@ -16,8 +16,8 @@ keybind = ctrl+left=goto_split:left
keybind = ctrl+right=goto_split:right
keybind = ctrl+up=goto_split:up
keybind = ctrl+down=goto_split:down
keybind = ctrl+]=next_tab
keybind = ctrl+[=previous_tab
keybind = ctrl+]=goto_split:next
keybind = ctrl+[=goto_split:previous
# Keybindings - Navigation - Tabs
keybind = ctrl+1=goto_tab:1

View File

@ -167,6 +167,7 @@ input {
disable_while_typing = true
natural_scroll = true
clickfinger_behavior = true
tap-to-click = false
}
}

View File

@ -0,0 +1,35 @@
{ config, pkgs, lib, namespace, ... }:
let
cfg = config.${namespace}.services.fusuma;
in
{
options.${namespace}.services.fusuma = {
enable = lib.mkEnableOption "Fusuma";
};
config = lib.mkIf cfg.enable {
services.fusuma = {
enable = true;
extraPackages = with pkgs; [ ydotool deterministic-uname uutils-coreutils-noprefix ];
settings = {
swipe = {
"3" = {
begin = {
command = "ydotool click 40";
interval = 0.00;
};
update = {
command = "ydotool mousemove -- $move_x, $move_y";
interval = 0.01;
accel = 1.00;
# accel = 1.70;
};
end = {
command = "ydotool click 80";
};
};
};
};
};
};
}

View File

@ -5,6 +5,7 @@ let
mkIf
mkDefault
mkMerge
mkEnableOption
;
inherit (lib.${namespace}) mkOpt;
@ -20,7 +21,7 @@ let
in
{
options.${namespace}.user = {
enable = mkOpt types.bool false "Whether to configure the user account.";
enable = mkEnableOption "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.";

View File

@ -14,11 +14,6 @@ in
catppuccin-sddm
];
environment.sessionVariables = {
QT_SCREEN_SCALE_FACTORS = "2";
QT_FONT_DPI = "192";
};
services = {
displayManager = {
sddm = {
@ -29,5 +24,10 @@ in
};
};
};
environment.sessionVariables = {
QT_SCREEN_SCALE_FACTORS = "2";
QT_FONT_DPI = "192";
};
};
}

View File

@ -1,6 +1,6 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf mkForce;
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;
cfg = config.${namespace}.hardware.opengl;

View File

@ -0,0 +1,27 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.services.avahi;
in
{
options.${namespace}.services.avahi = {
enable = lib.mkEnableOption "Avahi";
};
config = mkIf cfg.enable {
services.avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
publish = {
enable = true;
addresses = true;
domain = true;
hinfo = true;
userServices = true;
workstation = true;
};
};
};
}

View File

@ -1,7 +1,7 @@
{ config, pkgs, lib, namespace, host, ... }:
let
inherit (lib) types mkIf;
inherit (lib.${namespace}) mkOpt;
inherit (lib.${namespace}) mkOpt mkBoolOpt;
cfg = config.${namespace}.services.openiscsi;
in
@ -9,7 +9,7 @@ in
options.${namespace}.services.openiscsi = {
enable = lib.mkEnableOption "Open iSCSI support";
name = mkOpt types.str "iqn.2025.reichard.io:${host}" "iSCSI name";
symlink = mkOpt types.bool false "Create a symlink to the iSCSI binaries";
symlink = mkBoolOpt false "Create a symlink to the iSCSI binaries";
};
config = mkIf cfg.enable {

View File

@ -1,7 +1,7 @@
{ config, lib, namespace, ... }:
let
inherit (lib) types mkIf;
inherit (lib.${namespace}) mkOpt;
inherit (lib.${namespace}) mkOpt mkBoolOpt;
cfg = config.${namespace}.services.rke2;
in
@ -9,6 +9,7 @@ in
options.${namespace}.services.rke2 = with types; {
enable = lib.mkEnableOption "Enable RKE2";
disable = mkOpt (listOf str) [ ] "Disable services";
openFirewall = mkBoolOpt true "Open firewall";
};
config = mkIf cfg.enable {
@ -16,5 +17,23 @@ in
enable = true;
disable = cfg.disable;
};
networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [
# 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
];
networking.firewall.allowedUDPPorts = mkIf cfg.openFirewall [
# 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)
];
};
}

View File

@ -0,0 +1,19 @@
{ config, lib, namespace, ... }:
let
inherit (lib) mkIf;
cfg = config.${namespace}.services.ydotool;
in
{
options.${namespace}.services.ydotool = {
enable = lib.mkEnableOption "ydotool";
};
config = mkIf cfg.enable {
reichard.user.extraGroups = [ "input" ];
programs.ydotool = {
enable = true;
group = "input";
};
};
}

View File

@ -1,14 +1,16 @@
{ config, lib, pkgs, namespace, ... }:
let
inherit (lib) mkIf mkForce;
inherit (lib.${namespace}) mkBoolOpt;
inherit (lib) mkIf mkDefault mkEnableOption;
inherit (lib.${namespace}) mkBoolOpt enabled;
cfg = config.${namespace}.system.networking;
in
{
options.${namespace}.system.networking = {
enable = lib.mkEnableOption "networking support";
enableIWD = mkBoolOpt false "enable iwd";
enable = mkEnableOption "Enable Networking";
enableIWD = mkEnableOption "Enable IWD";
useDHCP = mkBoolOpt true "Use DHCP";
useNetworkd = mkBoolOpt false "Use networkd";
};
config = mkIf cfg.enable {
@ -21,8 +23,9 @@ in
reichard.user.extraGroups = [ "network" ];
networking = {
firewall.enable = true;
usePredictableInterfaceNames = mkForce true;
firewall = enabled;
useDHCP = mkDefault cfg.useDHCP;
useNetworkd = cfg.useNetworkd;
} // (lib.optionalAttrs cfg.enableIWD) {
wireless.iwd = {
enable = true;

View File

@ -21,12 +21,9 @@ in
users.users.${cfg.name} = {
inherit (cfg) name initialPassword;
extraGroups = [
"wheel"
] ++ cfg.extraGroups;
group = "users";
home = "/home/${cfg.name}";
extraGroups = [ "wheel" ] ++ cfg.extraGroups;
isNormalUser = true;
shell = pkgs.bashInteractive;
uid = 1000;

View File

@ -7,6 +7,9 @@ in
./hardware-configuration.nix
];
system.stateVersion = "24.11";
time.timeZone = "America/New_York";
# System Config
reichard = {
nix = enabled;
@ -15,6 +18,7 @@ in
boot = {
enable = true;
showNotch = true;
silentBoot = true;
};
networking = {
enable = true;
@ -31,6 +35,11 @@ in
};
};
services = {
avahi = enabled;
ydotool = enabled;
};
security = {
sops = {
enable = true;
@ -45,13 +54,4 @@ in
};
};
};
# Hardware Config
hardware = {
bluetooth.enable = true;
bluetooth.powerOnBoot = true;
};
time.timeZone = "America/New_York";
system.stateVersion = "24.11";
}

View File

@ -8,6 +8,16 @@ in
];
config = {
# Basic System
system.stateVersion = "24.11";
time.timeZone = "UTC";
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
};
reichard = {
nix = enabled;
@ -16,9 +26,15 @@ in
enable = true;
xenGuest = true;
};
networking = {
enable = true;
useDHCP = false;
useNetworkd = true;
};
};
services = {
avahi = enabled;
openssh = enabled;
cloud-init = enabled;
rke2 = {
@ -39,50 +55,6 @@ in
};
};
# Basic System
system.stateVersion = "24.11";
time.timeZone = "UTC";
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
autoResize = true;
};
# 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
'';
};
};
systemd.services = {
# RKE2 - Wait Cloud Init
rke2-server = {
@ -112,7 +84,6 @@ in
};
};
# System Packages
environment = {
systemPackages = with pkgs; [
htop