Initial dendritic rewrite

This commit is contained in:
2026-04-04 16:46:30 -04:00
parent 06a8e77924
commit f080e311d1
131 changed files with 3342 additions and 3148 deletions

View File

@@ -1,40 +0,0 @@
{
inputs,
config,
pkgs,
lib,
...
}:
{
imports = [
inputs.agenix.nixosModules.default
inputs.agenix-rekey.nixosModules.default
];
environment.systemPackages = [
# agenix-rekey's CLI tool replaces standard agenix's
inputs.agenix-rekey.packages.${pkgs.stdenv.hostPlatform.system}.default
];
age = {
# Need to explicitly set identity paths because OpenSSH daemon is disabled
# but the host keys are still generated via services.openssh.generateHostKeys = true
identityPaths = map (key: key.path) config.services.openssh.hostKeys;
rekey = {
masterIdentities = [ "${inputs.self}/secrets/age-yubikey-identity-d9ed335b.pub" ];
storageMode = "local";
localStorageDir = ../../. + "/secrets/rekeyed/${config.host.name}";
}
# We only set the hostPubkey if one is supplied. For new hosts the pub key will not
# exist until it is generated after the first rebuild. Runtime decryption will fail
# but then the ssh host key will be generated in /etc/ssh and can be supplied
// lib.optionalAttrs (config.host.pubKey != null) {
hostPubkey = config.host.pubKey;
};
secrets = {
tailscale-auth.rekeyFile = ../../secrets/tailscale-auth.age;
eclypsecloud-eclypse.rekeyFile = ../../secrets/eclypsecloud-eclypse.age;
eclypse-password.rekeyFile = ../../secrets/eclypse-password.age;
};
};
}

38
modules/system/base.nix Normal file
View File

@@ -0,0 +1,38 @@
{
self,
...
}:
{
flake.modules.nixos.base =
{ pkgs, ... }:
{
imports = with self.modules.nixos; [
agenix
bluetooth
boot
firmware
network
nix
pipewire
power-management
printing
tailscale
wayland
yubikey
zsh
];
programs.gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
environment = {
systemPackages = with pkgs; [
vim
git
disktui
];
variables = {
EDITOR = "vim";
};
};
};
}

View File

@@ -1,19 +0,0 @@
{
config,
...
}:
{
boot = {
extraModulePackages = with config.boot.kernelPackages; [ virtualbox ];
loader = {
systemd-boot = {
enable = true;
configurationLimit = 10;
};
efi.canTouchEfiVariables = true;
};
kernelParams = [
"kvm.enable_virt_at_load=0" # Fixes some virtuallization issues
];
};
}

View File

@@ -1,16 +0,0 @@
{
imports = [
./agenix.nix
./boot.nix
./desktop.nix
./fileSystems.nix
./network.nix
./packages.nix
./security.nix
./services.nix
./system.nix
./tailscale.nix
./user.nix
./virtualisation.nix
];
}

View File

@@ -1,39 +0,0 @@
{
inputs,
pkgs,
...
}:
{
imports = [
inputs.niri.nixosModules.niri
];
programs = {
niri = {
enable = true;
package = pkgs.niri-unstable;
};
uwsm = {
enable = true;
waylandCompositors = {
niri = {
prettyName = "Niri";
binPath = "/run/current-system/sw/bin/niri-session";
};
};
};
};
environment.systemPackages = [ pkgs.xwayland-satellite-unstable ];
nixpkgs.overlays = [
inputs.niri.overlays.niri
];
services.displayManager = {
gdm = {
enable = true;
wayland = true;
};
};
}

View File

@@ -1,44 +0,0 @@
{
pkgs,
config,
...
}:
let
automount_opts = [
"x-systemd.automount"
"x-systemd.idle-timeout=60"
"x-systemd.device-timeout=5s"
"x-systemd.mount-timeout=5s"
"noauto"
"user"
"users"
];
in
{
fileSystems = {
"/mnt/EclypseCloud" = {
device = "//100.78.212.35/EclypseCloud";
fsType = "cifs";
options = [
"credentials=${config.age.secrets.eclypsecloud-eclypse.path}"
"uid=${toString config.users.users.eclypse.uid}"
"rw"
]
++ automount_opts;
};
"/mnt/Music" = {
device = "//100.78.212.35/music";
fsType = "cifs";
options = [
"credentials=${config.age.secrets.eclypsecloud-eclypse.path}"
"uid=${toString config.users.users.eclypse.uid}"
"rw"
]
++ automount_opts;
};
};
environment.systemPackages = with pkgs; [
cifs-utils
];
}

View File

@@ -1,23 +0,0 @@
{
config,
...
}:
{
networking = {
hostName = "${config.host.name}"; # Define your hostname
# Pick only one of the below networking options.
# wireless.enable = true; # Enables wireless support via wpa_supplicant.
networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Configure network proxy if necessary
# proxy.default = "http://user:password@proxy:port/";
# proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Open ports in the firewall.
# firewall.allowedTCPPorts = [ ... ];
# firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# firewall.enable = false;
};
}

View File

@@ -1,48 +0,0 @@
{
inputs,
pkgs,
...
}:
{
imports = [
inputs.nur.modules.nixos.default # Adds the NUR overlay
../overlays
];
programs = {
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# mtr.enable = true;
# gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
gdk-pixbuf.modulePackages = [ pkgs.librsvg ];
nix-ld.enable = true;
xwayland.enable = true;
zsh.enable = true;
};
nixpkgs = {
# ? For some reason, doing config.allowUnfree does not work
# ? Maybe becuase it's not an explicit option?
# ? https://search.nixos.org/options?channel=25.05&show=nixpkgs.config&query=nixpkgs.config
config = {
allowUnfree = true;
};
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment = {
pathsToLink = [ "/share/zsh" ];
systemPackages = with pkgs; [
vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
git
disktui
];
variables = {
EDITOR = "vim";
};
};
}

View File

@@ -1,22 +0,0 @@
{
pkgs,
...
}:
{
programs = {
yubikey-manager.enable = true;
yubikey-touch-detector.enable = true;
};
environment.systemPackages = with pkgs; [
age-plugin-yubikey
];
services = {
yubikey-agent.enable = true;
};
security = {
rtkit.enable = true;
};
}

View File

@@ -1,104 +0,0 @@
{
pkgs,
...
}:
{
services = {
xserver = {
# Enable the X11 windowing system.
# You can disable this if you're only using the Wayland session.
enable = false;
# Configure keymap in X11
xkb = {
layout = "us";
variant = "";
};
};
# Enable touchpad support (enabled default in most desktopManager).
libinput.enable = true;
# Enable CUPS to print documents.
printing = {
enable = true;
drivers = with pkgs; [
gutenprint
cnijfilter2
];
};
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
# Enable sound with pipewire.
pulseaudio.enable = false;
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
# jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
# media-session.enable = true;
};
upower.enable = true;
# Disable SSH daemon but generate host keys anyway for secret rekeying
openssh = {
enable = false;
generateHostKeys = true;
};
system76-scheduler.settings.cfsProfiles.enable = true;
tlp = {
enable = true;
settings = {
CPU_BOOST_ON_AC = 1;
CPU_BOOST_ON_BAT = 0;
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
PLATFORM_PROFILE_ON_AC = "performance";
PLATFORM_PROFILE_ON_BAT = "balanced";
START_CHARGE_THRESH_BAT1 = 65; # Only STOP_CHARGE_THRESH available on Framework
STOP_CHARGE_THRESH_BAT1 = 80;
# Fixes stuttering Hyprland animations on Intel iGPU (https://wiki.hypr.land/Configuring/Performance/)
INTEL_GPU_MIN_FREQ_ON_AC = 300;
INTEL_GPU_MIN_FREQ_ON_BAT = 300;
};
};
# Disable GNOME's power management (conflicts with TLP)
power-profiles-daemon.enable = false;
# Enable thermald (only necessary for Intel CPUs)
thermald.enable = true;
fwupd.enable = true;
fprintd.enable = true;
};
powerManagement = {
enable = true;
powertop.enable = true;
};
hardware = {
bluetooth = {
enable = true;
powerOnBoot = false;
};
sane = {
enable = true;
};
};
}

View File

@@ -1,74 +0,0 @@
{
inputs,
...
}:
{
nix = {
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
settings = {
experimental-features = [
"nix-command"
"flakes"
];
substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
"https://devenv.cachix.org"
"https://hyprland.cachix.org"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
extra-substituters = [ "https://vicinae.cachix.org" ];
extra-trusted-public-keys = [ "vicinae.cachix.org-1:1kDrfienkGHPYbkpNj1mWTr7Fm1+zcenzgTizIcI3oc=" ];
};
};
# Set your time zone.
time.timeZone = "America/New_York";
# Select internationalisation properties.
i18n = {
defaultLocale = "en_US.UTF-8";
extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
};
};
# Select internationalisation properties.
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
# };
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "25.05"; # Did you read the comment?
}

View File

@@ -1,31 +0,0 @@
{
config,
pkgs,
...
}:
{
services.tailscale = {
enable = true;
useRoutingFeatures = "client";
authKeyFile = config.age.secrets.tailscale-auth.path;
# * Only applied if `authKeyFile` is specified
extraUpFlags = [
"--ssh"
"--accept-routes=true"
];
extraSetFlags = [
"--operator=eclypse"
];
};
# Taildrop
systemd.user.services.taildrop = {
description = "Taildrop File Receiver Service";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.tailscale}/bin/tailscale file get --verbose --loop %h/Downloads/";
};
};
}

View File

@@ -1,43 +0,0 @@
{
inputs,
pkgs,
config,
...
}:
{
imports = [ inputs.home-manager.nixosModules.home-manager ];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = { inherit inputs; };
users.eclypse = {
imports = [ ../home ];
home = {
username = "eclypse";
homeDirectory = "/home/eclypse";
stateVersion = "25.05";
};
programs.home-manager.enable = true;
};
backupFileExtension = "backup";
};
users.mutableUsers = false;
users.users.eclypse = {
isNormalUser = true;
uid = 1000;
description = "Eclypse";
extraGroups = [
"networkmanager"
"wheel"
"scanner"
"lp"
"dialout"
];
hashedPasswordFile = config.age.secrets.eclypse-password.path;
shell = pkgs.zsh;
};
}

View File

@@ -1,19 +0,0 @@
{
pkgs,
...
}:
{
virtualisation = {
# virtualbox.host = {
# enable = true;
# enableExtensionPack = true;
# };
podman.enable = true;
};
environment.systemPackages = with pkgs; [
distrobox
];
users.extraGroups.vboxusers.members = [ "eclypse" ];
}