refactor: reorganize flake structure and consolidate user config

Directory structure:
- Move from src/ to root level (system/, user/)
- Remove unused machines (workstation, vm, laptop)

User configuration:
- Add user/home.nix for shared defaults (pass, essentials, default modules)
- Centralize user options in user/default.nix
- Move submodules to consistent paths (bash/bash, git/git, neovim/nvim, vim/vim)

Module reorganization:
- Flatten nested module structures (remove /modules/ subdirs)
- Split CLI vs GUI tools (dev/ for CLI, gui/dev/ for GUI)
- Move neovim/vim to top-level modules (not under utils/)
- Remove security.enable - pass now in user/home.nix
- Remove utils.enable - essentials now in user/home.nix
- Add security/yubikey module with yubikey-manager, age-plugin-yubikey
- Move pcb, design to gui/dev/
- Replace penpot docker wrapper with nixpkgs penpot-desktop
- Remove i3 config
- Remove deprecated wsl.nativeSystemd option

GUI improvements:
- Browser-focused mimeApps in gui/default.nix
- Each WM handles its own auto-start via profileExtra

Cleanup:
- Update README with new structure
- Update justfile paths and valid systems
- Fix submodule paths in .gitmodules
This commit is contained in:
Bryan Ramos 2026-03-14 15:26:18 -04:00
parent ac95d1c23d
commit 14efa80cab
141 changed files with 505 additions and 1561 deletions

8
.gitmodules vendored
View file

@ -1,15 +1,15 @@
[submodule "nvim"] [submodule "nvim"]
path = src/user/modules/utils/modules/neovim/config/nvim path = user/modules/neovim/nvim
url = https://github.com/itme-brain/nvim.git url = https://github.com/itme-brain/nvim.git
[submodule "vim"] [submodule "vim"]
path = src/user/modules/utils/modules/vim/vim path = user/modules/vim/vim
url = https://github.com/itme-brain/vim.git url = https://github.com/itme-brain/vim.git
[submodule "git"] [submodule "git"]
path = src/user/modules/git/git path = user/modules/git/git
url = https://github.com/itme-brain/git.git url = https://github.com/itme-brain/git.git
[submodule "bash"] [submodule "bash"]
path = src/user/modules/bash/config/bash path = user/modules/bash/bash
url = https://github.com/itme-brain/bash.git url = https://github.com/itme-brain/bash.git

189
README.md
View file

@ -1,23 +1,27 @@
# My Nix Configurations 💻 # NixOS Configuration
My modular Nix configs 🔥 Modular NixOS flake configuration with home-manager integration.
## Requirements ⚙️ ## Requirements
- [Nix 2.0 & Flakes enabled](https://nixos.wiki/wiki/Flakes#Enable_flakes_permanently_in_NixOS) - [Nix with Flakes](https://nixos.wiki/wiki/Flakes#Enable_flakes_permanently_in_NixOS)
- [NixOS](https://www.nixos.org/) for system configurations - [NixOS](https://www.nixos.org/) for system configurations
- [Nix Home-Manager](https://nix-community.github.io/home-manager/index.xhtml#sec-flakes-standalone) for user configurations - [Home-Manager](https://nix-community.github.io/home-manager/) for user configurations
## Flake Endpoints ❄️ ## Flake Outputs
NixOS Configurations: `desktop` · `workstation` · `server` (wip) · `vm` · `wsl` | Configuration | Description |
|---------------|-------------|
| `desktop` | Primary workstation |
| `server` | Home server |
| `wsl` | Windows Subsystem for Linux |
## Fresh Install 🚀 ## Fresh Install
From the NixOS live installer: From the NixOS live installer:
```bash ```bash
# Enable flakes (not enabled by default on installer) # Enable flakes
echo "experimental-features = nix-command flakes" | sudo tee -a /etc/nix/nix.conf echo "experimental-features = nix-command flakes" | sudo tee -a /etc/nix/nix.conf
# Clone repo # Clone repo
@ -29,117 +33,90 @@ nix develop
just install desktop just install desktop
``` ```
Replace `desktop` with `workstation` or `vm` as needed. ## Getting Started
## Getting Started 🔧
```bash ```bash
git clone --recurse-submodules git@github.com:itme-brain/nixos.git git clone --recurse-submodules git@github.com:itme-brain/nixos.git
cd nixos
nix develop
just
``` ```
Enter the dev shell with `nix develop`, then run `just` to see available project scripts. **Note:** Replace `hardware.nix` in `system/machines/<machine>` with output from `nixos-generate-config` for your hardware.
Useful resources: ## Directory Structure
- [nixpkgs Packages](https://search.nixos.org/packages) 📦️
- [nixpkgs Options](https://search.nixos.org/options?) 🔍️
- [Home-Manager Options](https://mipmip.github.io/home-manager-option-search/) ☕️
⚠️ Be sure to tailor any hardware settings to your own — replace the `hardware.nix` in `src/system/machines/<machine>` with output from `nixos-generate-config`
## Submodules 🔗
Standalone portable configurations maintained as separate repos. Each can be cloned independently on any system — NixOS or not.
| Submodule | Purpose | Repo | Standalone Install |
|-----------|---------|------|--------------------|
| **nvim** | Full IDE (LSP, treesitter, telescope) | [itme-brain/nvim](https://github.com/itme-brain/nvim) | `git clone git@github.com:itme-brain/nvim.git ~/.config/nvim` |
| **vim** | Lightweight editor for headless servers | [itme-brain/vim](https://github.com/itme-brain/vim) | `git clone git@github.com:itme-brain/vim.git ~/.vim` |
```bash
# Update a submodule
cd <submodule-path>
git add . && git commit -m "your changes" && git push
cd /path/to/nixos
git add <submodule-path> && git commit -m "Update <name> submodule"
# Pull submodule updates from remote
git submodule update --remote
git add <submodule-path> && git commit -m "Update <name> submodule"
```
## Directory Structure 🗂️
``` ```
. .
├── flake.nix # Flake entrypoint - defines all NixOS configurations ├── flake.nix
├── flake.lock ├── flake.lock
├── justfile # Project scripts (via `just`) ├── justfile
├── system.configs -> src/system/machines/ # Symlink for quick access
├── user.configs -> src/user/config/ # Symlink for quick access
└── src/
├── system/ # System-level (NixOS) configuration
│ ├── machines/ # Per-machine NixOS configurations
│ │ ├── desktop/ # Desktop config (flake: nixosConfigurations.desktop)
│ │ │ ├── default.nix # Machine entry point
│ │ │ ├── hardware.nix # Machine-specific hardware config
│ │ │ ├── system.nix # System-level settings
│ │ │ └── modules/
│ │ │ ├── disko/ # Disk partitioning (disko)
│ │ │ └── home-manager/ # Home-manager integration + home.nix
│ │ ├── workstation/ # Workstation config (same structure as desktop)
│ │ ├── server/ # Server config (no disko)
│ │ ├── vm/ # VM config
│ │ ├── wsl/ # WSL config (includes wsl module)
│ │ └── laptop/ # Laptop config (stub)
│ └── modules/ # Shared system modules (imported by machines)
│ ├── default.nix
│ ├── bitcoin/ # Bitcoin node + electrum server
│ ├── forgejo/ # Self-hosted Forgejo
│ └── nginx/ # Nginx reverse proxy
└── user/ # User-level (home-manager) configuration ├── system/
├── default.nix # User module entry point │ ├── keys/ # Machine SSH keys
├── config/ # User identity & settings │ │ └── desktop/
│ ├── default.nix # Common user variables (username, email, etc.) │ └── machines/
│ ├── bookmarks/ # Browser bookmarks │ ├── desktop/
│ ├── keys/ # Public keys │ │ ├── default.nix # Machine entry point
│ │ ├── pgp/ # PGP public keys │ │ ├── hardware.nix # Hardware config
│ │ └── ssh/ # SSH public keys │ │ ├── system.nix # System settings
│ ├── nvim # Symlink to neovim submodule config │ │ └── modules/
│ └── vim # Symlink to vim submodule config │ │ ├── disko/ # Disk partitioning
└── modules/ # Home-manager modules │ │ └── home-manager/ # Home-manager integration
├── bash/ # Shell config (aliases, prompt, bashrc) │ ├── server/ # Server (same structure)
├── git/ # Git config + helper scripts │ └── wsl/ # WSL (same structure)
├── tmux/ # Tmux config
├── security/ # Security tools (GPG) └── user/
├── utils/ # CLI utilities ├── default.nix # User options (name, email, keys)
│ └── modules/ ├── home.nix # Shared home-manager defaults
│ ├── dev/ # Dev tools (penpot, PCB design) ├── bookmarks/
│ ├── email/ # Email client (aerc) ├── keys/
│ ├── irc/ # IRC client │ ├── age/
│ ├── neovim/ # Neovim (config is a git submodule) │ ├── pgp/
│ └── vim/ # Vim lightweight (config is a git submodule) │ └── ssh/
└── gui/ # GUI applications └── modules/
├── modules/ ├── bash/bash/ # Shell (submodule)
│ ├── alacritty/ # Terminal emulator ├── git/git/ # Git (submodule)
│ ├── browsers/ # Firefox & Chromium ├── neovim/nvim/ # Neovim (submodule)
│ ├── corn/ # Corn app ├── vim/vim/ # Vim (submodule)
│ ├── fun/ # Discord, etc. ├── tmux/
│ ├── utils/ # GUI utilities ├── dev/ # CLI dev tools
│ └── writing/ # Writing tools ├── security/
└── wm/ # Window managers │ ├── gpg/
├── hyprland/ # Hyprland (Wayland) + waybar, rofi │ └── yubikey/
├── sway/ # Sway (Wayland) + rofi ├── utils/
├── i3/ # i3 (X11) + rofi │ ├── dev/ # Dev tools (claude-code, direnv, etc.)
└── shared/ # Shared WM config (mimeapps) │ ├── email/
│ ├── irc/
│ └── writing/
└── gui/
├── default.nix # Browser-focused mimeApps
├── wm/
│ ├── hyprland/
│ └── sway/
├── browsers/
├── alacritty/
├── dev/
│ ├── pcb/ # Arduino, KiCad
│ └── design/ # Penpot
├── corn/
├── fun/
└── utils/
``` ```
### How it works ## Architecture
**flake.nix** defines NixOS configurations (desktop, workstation, server, wsl) that each reference a machine under `src/system/machines/`. Each machine's `default.nix` pulls in its own `hardware.nix`, `system.nix`, and per-machine modules (disko, home-manager). **flake.nix** defines NixOS configurations that reference machines under `system/machines/`.
Each machine imports its hardware, system settings, and home-manager config.
The **system layer** (`src/system/`) handles NixOS-level concerns: hardware, bootloader, networking, and system services. Shared modules in `src/system/modules/` can be imported by any machine. **user/home.nix** provides shared defaults for all users:
- Essential packages
- Default modules
The **user layer** (`src/user/`) handles home-manager configuration. `src/user/config/` defines user identity (name, email, keys), while `src/user/modules/` contains modular home-manager configs for individual tools. Each machine's `home-manager/home.nix` selects which user modules to enable. **Machine home.nix** imports user defaults and enables machine-specific modules.
Root symlinks `system.configs` and `user.configs` provide quick access to machine definitions and user config from the repo root. ## Resources
- [nixpkgs Packages](https://search.nixos.org/packages)
- [nixpkgs Options](https://search.nixos.org/options)
- [Home-Manager Options](https://home-manager-options.extranix.com)

6
flake.lock generated
View file

@ -102,11 +102,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1772822230, "lastModified": 1773375660,
"narHash": "sha256-yf3iYLGbGVlIthlQIk5/4/EQDZNNEmuqKZkQssMljuw=", "narHash": "sha256-SEzUWw2Rf5Ki3bcM26nSKgbeoqi2uYy8IHVBqOKjX3w=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "71caefce12ba78d84fe618cf61644dce01cf3a96", "rev": "3e20095fe3c6cbb1ddcef89b26969a69a1570776",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -22,10 +22,9 @@
}; };
}; };
outputs = { nixpkgs, nur, home-manager, nixos-wsl, disko, ... }: outputs = { nixpkgs, nur, ... }@inputs:
let let
system = "x86_64-linux"; mkPkgs = system: import nixpkgs {
pkgs = import nixpkgs {
inherit system; inherit system;
config = { config = {
allowUnfree = true; allowUnfree = true;
@ -36,52 +35,23 @@
]; ];
}; };
mkSystem = { path, system ? "x86_64-linux" }:
let pkgs = mkPkgs system;
in nixpkgs.lib.nixosSystem {
inherit system pkgs;
specialArgs = { inherit inputs; };
modules = [ path ];
};
in in
with pkgs;
{ {
nixosConfigurations = { nixosConfigurations = {
desktop = nixpkgs.lib.nixosSystem { desktop = mkSystem { path = ./system/machines/desktop; };
inherit system pkgs; server = mkSystem { path = ./system/machines/server; };
modules = [ wsl = mkSystem { path = ./system/machines/wsl; };
disko.nixosModules.disko
./src/system/machines/desktop
home-manager.nixosModules.home-manager
(import ./src/system/machines/desktop/modules/home-manager)
];
}; };
workstation = nixpkgs.lib.nixosSystem { devShells.x86_64-linux.default = with mkPkgs "x86_64-linux"; mkShell {
inherit system pkgs;
modules = [
./src/system/machines/workstation
home-manager.nixosModules.home-manager
(import ./src/system/machines/workstation/modules/home-manager)
];
};
server = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
disko.nixosModules.disko
./src/system/machines/server
home-manager.nixosModules.home-manager
(import ./src/system/machines/server/modules/home-manager)
];
};
wsl = nixpkgs.lib.nixosSystem {
inherit system pkgs;
modules = [
./src/system/machines/wsl
nixos-wsl.nixosModules.wsl
(import ./src/system/machines/wsl/modules/wsl)
home-manager.nixosModules.home-manager
(import ./src/system/machines/wsl/modules/home-manager)
];
};
};
devShells.${system}.default = mkShell {
name = "devShell"; name = "devShell";
packages = [ packages = [
just just

View file

@ -1,5 +1,5 @@
SYSTEM := "$(echo $HOSTNAME)" SYSTEM := "$(echo $HOSTNAME)"
VALID_SYSTEMS := "desktop workstation server wsl vm laptop" VALID_SYSTEMS := "desktop server wsl"
# Print this list # Print this list
default: default:
@ -10,7 +10,7 @@ default:
_validate SYSTEM: _validate SYSTEM:
#!/usr/bin/env bash #!/usr/bin/env bash
case "{{SYSTEM}}" in case "{{SYSTEM}}" in
desktop|workstation|server|wsl|vm|laptop) ;; desktop|server|wsl) ;;
*) echo "Error: Unknown system '{{SYSTEM}}'. Use one of: {{VALID_SYSTEMS}}"; exit 1 ;; *) echo "Error: Unknown system '{{SYSTEM}}'. Use one of: {{VALID_SYSTEMS}}"; exit 1 ;;
esac esac
@ -105,7 +105,7 @@ partition SYSTEM:
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
DISKO_CONFIG="./src/system/machines/{{SYSTEM}}/modules/disko/default.nix" DISKO_CONFIG="./system/machines/{{SYSTEM}}/modules/disko/default.nix"
if [[ ! -f "$DISKO_CONFIG" ]]; then if [[ ! -f "$DISKO_CONFIG" ]]; then
echo "Error: No disko config for '{{SYSTEM}}'" echo "Error: No disko config for '{{SYSTEM}}'"
@ -172,7 +172,7 @@ install SYSTEM:
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
DISKO_CONFIG="./src/system/machines/{{SYSTEM}}/modules/disko/default.nix" DISKO_CONFIG="./system/machines/{{SYSTEM}}/modules/disko/default.nix"
if [[ ! -f "$DISKO_CONFIG" ]]; then if [[ ! -f "$DISKO_CONFIG" ]]; then
echo "Error: No disko config for '{{SYSTEM}}'" echo "Error: No disko config for '{{SYSTEM}}'"

View file

@ -1,14 +0,0 @@
{ lib, pkgs, config, ... }:
with lib;
{
options = {
machines = mkOption {
description = "Machine Configurations";
type = types.attrs;
default = {
keys = import ./keys { inherit lib; };
};
};
};
}

View file

@ -1,3 +0,0 @@
# Desktop Keys
ssh.pub.key - ~/.ssh/id_rsa

View file

@ -1,11 +0,0 @@
{ ... }:
{
imports = [
../../../user/config
../../config
./hardware.nix
./system.nix
./modules/disko
];
}

View file

@ -1,72 +0,0 @@
{ config, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
monitors = config.monitors;
};
home-manager.users.${config.user.name} = {
imports = [ ../../../../../user ];
programs.home-manager.enable = true;
programs.ssh = {
enable = true;
enableDefaultConfig = false;
matchBlocks = {
"*" = {
serverAliveInterval = 60;
serverAliveCountMax = 3;
};
"server" = {
hostname = "192.168.0.154";
user = "bryan";
};
};
};
home.stateVersion = "23.11";
home.username = "${config.user.name}";
home.homeDirectory = "/home/${config.user.name}";
modules = {
user = {
bash.enable = true;
git.enable = true;
security = {
enable = true;
gpg.enable = true;
};
tmux.enable = true;
utils = {
enable = true;
dev = {
enable = true;
};
irc.enable = true;
neovim.enable = true;
vim.enable = false;
};
gui = {
wm.hyprland.enable = true;
browser = {
firefox.enable = true;
};
alacritty.enable = true;
corn.enable = true;
fun.enable = true;
utils.enable = true;
writing.enable = true;
};
};
};
};
}

View file

@ -1 +0,0 @@
#TODO: nixify the shitty laptop

View file

@ -1,10 +0,0 @@
{ ... }:
{
imports = [
../../../user/config
../../config
./hardware.nix
./system.nix
];
}

View file

@ -1,5 +0,0 @@
{
imports = [
./home
];
}

View file

@ -1,33 +0,0 @@
{ config, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${config.user.name} = {
imports = [ ../../../../../user ];
programs.home-manager.enable = true;
home.stateVersion = "25.11";
home.username = "${config.user.name}";
home.homeDirectory = "/home/${config.user.name}";
modules = {
user = {
bash.enable = true;
git.enable = true;
tmux.enable = true;
security = {
gpg.enable = true;
};
utils = {
enable = true;
vim.enable = true;
};
};
};
};
}

View file

@ -1,10 +0,0 @@
{ ... }:
{
imports = [
../../../user/config
../../config
./hardware.nix
./system.nix
];
}

View file

@ -1,14 +0,0 @@
{ config, lib, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,5 +0,0 @@
{
imports = [
./home
];
}

View file

@ -1,49 +0,0 @@
{ disk ? "/dev/vda" }:
{
disko.devices = {
disk = {
one = {
type = "disk";
device = disk;
content = {
type = "gpt";
partitions = {
boot = {
size = "200M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
primary = {
size = "100%";
content = {
type = "lvm_pv";
vg = "vm";
};
};
};
};
};
};
lvm_vg = {
vm = {
type = "lvm_vg";
lvs = {
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [ "defaults" ];
};
};
};
};
};
};
}

View file

@ -1,32 +0,0 @@
{ config, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${config.user.name} = {
imports = [ ../../../../../user ];
programs.home-manager.enable = true;
home.stateVersion = "23.11";
home.username = "${config.user.name}";
home.homeDirectory = "/home/${config.user.name}";
modules = {
user = {
bash.enable = true;
git.enable = true;
security = {
gpg.enable = true;
};
utils = {
enable = true;
vim.enable = true;
};
};
};
};
}

View file

@ -1,96 +0,0 @@
{ pkgs, lib, config, ... }:
{ system.stateVersion = "23.11";
imports = [ ../../modules ];
users.users = {
${config.user.name} = {
isNormalUser = true;
extraGroups = config.user.groups;
openssh.authorizedKeys.keys = [ "${config.user.keys.ssh.yubikey}" ];
};
};
nix = {
channel.enable = false;
package = pkgs.nixVersions.stable;
extraOptions = "experimental-features = nix-command flakes";
settings = {
auto-optimise-store = true;
trusted-users = [ "${config.user.name}" ];
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
};
boot.loader = {
timeout = null;
grub = {
enable = true;
useOSProber = true;
devices = [ "nodev" ];
efiSupport = true;
configurationLimit = 3;
splashImage = null;
};
efi = {
canTouchEfiVariables = true;
};
};
#fonts.packages = with pkgs; [
# terminus_font
# terminus-nerdfont
#];
security.sudo = {
wheelNeedsPassword = false;
execWheelOnly = true;
};
time = {
timeZone = "America/New_York";
hardwareClockInLocalTime = false;
};
services.timesyncd = lib.mkDefault {
enable = true;
servers = [
"0.pool.ntp.org"
"1.pool.ntp.org"
"2.pool.ntp.org"
"3.pool.ntp.org"
];
};
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true;
};
networking = {
hostName = "vm";
useDHCP = lib.mkDefault true;
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [ 22 80 443 ];
};
};
services.openssh = {
enable = true;
startWhenNeeded = true;
settings = {
X11Forwarding = false;
PasswordAuthentication = true;
};
};
}

View file

@ -1,10 +0,0 @@
{ ... }:
{
imports = [
../../../user/config
../../config
./hardware.nix
./system.nix
];
}

View file

@ -1,101 +0,0 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot = {
initrd = {
availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
kernelModules = [ "dm-snapshot" ];
};
extraModulePackages = [ ];
kernelParams = [ "intel_iommu=on" ];
kernelModules = [
"kvm-intel"
"virtio"
"vfio-pci"
"coretemp"
"ipmi_devintf"
"ipmi_si"
];
};
environment.systemPackages = with pkgs; [
ipmitool
ipmicfg
ipmiutil
ipmiview
linuxHeaders
vulkan-headers
vulkan-loader
vulkan-tools
vulkan-extension-layer
mesa
mesa-demos
libGL
];
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/6e964c61-ea77-48cc-b495-6a8516b8e756";
fsType = "xfs";
};
"/home" = {
device = "/dev/disk/by-uuid/db504fb8-14f8-4292-b745-32d6255c4893";
fsType = "xfs";
};
"/boot" = {
device = "/dev/disk/by-uuid/61E7-6E56";
fsType = "vfat";
};
"/var/lib/libvirt/images" = {
device = "/home/VMs";
options = [ "bind" ];
};
};
systemd.tmpfiles.rules = [
"d /home/VMs 0755 root root"
];
virtualisation.libvirtd = {
enable = true;
qemu = {
runAsRoot = true;
};
};
services.xserver.videoDrivers = lib.mkDefault [ "nvidia" ];
hardware = {
graphics = {
enable = true;
enable32Bit = true;
};
nvidia = {
open = false;
powerManagement.enable = false;
powerManagement.finegrained = false;
modesetting.enable = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "550.120";
sha256_64bit = "sha256-gBkoJ0dTzM52JwmOoHjMNwcN2uBN46oIRZHAX8cDVpc=";
settingsSha256 = "sha256-fPfIPwpIijoUpNlAUt9C8EeXR5In633qnlelL+btGbU=";
persistencedSha256 = lib.fakeSha256;
};
};
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -1,58 +0,0 @@
{ disk }:
{
disko.devices = {
disk = {
one = {
type = "disk";
device = disk;
content = {
type = "gpt";
partitions = {
boot = {
size = "1G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
primary = {
size = "100%";
content = {
type = "lvm_pv";
vg = "nix";
};
};
};
};
};
};
lvm_vg = {
nix = {
type = "lvm_vg";
lvs = {
root = {
size = "5%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
mountOptions = [ "defaults" ];
};
};
home = {
size = "100%FREE";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/home";
};
};
};
};
};
};
}

View file

@ -1,52 +0,0 @@
{ config, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${config.user.name} = {
imports = [ ../../../../../user ];
programs.home-manager.enable = true;
home.stateVersion = "23.11";
home.username = "${config.user.name}";
home.homeDirectory = "/home/${config.user.name}";
modules = {
user = {
bash.enable = true;
git.enable = true;
security = {
enable = true;
gpg.enable = true;
};
tmux.enable = true;
utils = {
enable = true;
dev = {
enable = true;
};
email.enable = true;
neovim.enable = true;
vim.enable = true;
};
gui = {
wm.i3.enable = true;
browser = {
chromium.enable = true;
};
alacritty.enable = true;
utils.enable = true;
writing.enable = true;
};
};
};
};
}

View file

@ -1,131 +0,0 @@
{ pkgs, lib, config, home-manager, ... }:
with lib;
{
system.stateVersion = "23.11";
users.users = {
${config.user.name} = {
isNormalUser = true;
extraGroups = config.user.groups
++ [ "video" "audio" "kvm" "libvirtd" "dialout" ];
openssh.authorizedKeys.keys = [
"${config.user.keys.ssh.yubikey}"
"${config.user.keys.ssh.work}"
];
};
};
nix = {
channel.enable = false;
package = pkgs.nixVersions.stable;
extraOptions = ''
experimental-features = nix-command flakes
keep-going = true
'';
settings = {
auto-optimise-store = true;
trusted-users = [ "${config.user.name}" ];
substitute = true;
max-jobs = "auto";
};
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
};
boot.loader = {
systemd-boot = {
enable = true;
configurationLimit = 5;
memtest86.enable = true;
};
timeout = null;
};
environment.systemPackages = with pkgs; [
vim
git
usbutils
];
fonts.packages = with pkgs; [
terminus_font
terminus-nerdfont
];
security = {
sudo = {
wheelNeedsPassword = false;
execWheelOnly = true;
};
polkit.enable = true;
};
time = {
timeZone = "America/New_York";
hardwareClockInLocalTime = true;
};
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "Lat2-Terminus16";
useXkbConfig = true;
};
networking = {
hostName = "workstation";
useDHCP = lib.mkDefault true;
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [ 22 80 443 ];
};
};
programs.i3lock = {
enable = true;
package = pkgs.i3lock-fancy;
};
services = {
xserver.enable = true;
displayManager.ly.enable = true;
teamviewer.enable = true;
timesyncd = lib.mkDefault {
enable = true;
servers = [
"0.pool.ntp.org"
"1.pool.ntp.org"
"2.pool.ntp.org"
"3.pool.ntp.org"
];
};
pipewire = {
enable = true;
audio.enable = true;
wireplumber.enable = true;
pulse.enable = true;
jack.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
};
openssh = {
enable = true;
startWhenNeeded = false;
settings = {
X11Forwarding = false;
PasswordAuthentication = true;
};
};
};
}

View file

@ -1,9 +0,0 @@
{ ... }:
{
imports = [
../../../user/config
../../config
./system.nix
];
}

View file

@ -1,9 +0,0 @@
{
imports = [
<<<<<<<< HEAD:src/system/machines/wsl/modules/home-manager/default.nix
./home.nix
========
./c-lightning-REST
>>>>>>>> lightning:src/system/modules/bitcoin/modules/clightning/plugins/default.nix
];
}

View file

@ -1,38 +0,0 @@
{ config, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${config.user.name} = {
imports = [ ../../../../../user ];
programs.home-manager.enable = true;
home.stateVersion = "23.11";
home.username = "${config.user.name}";
home.homeDirectory = "/home/${config.user.name}";
modules = {
user = {
bash.enable = true;
git.enable = true;
security = {
enable = true;
gpg.enable = true;
};
tmux.enable = true;
utils = {
enable = true;
dev.enable = true;
email.enable = true;
irc.enable = true;
neovim.enable = true;
};
};
};
};
}

View file

@ -1 +0,0 @@
../modules/bash/config/bash/

View file

@ -1 +0,0 @@
../modules/git/git/

View file

@ -1 +0,0 @@
../modules/utils/modules/neovim/config/nvim

View file

@ -1 +0,0 @@
../modules/utils/modules/vim/vim/

@ -1 +0,0 @@
Subproject commit 79eb823bbb9ff88f284ae055fe1de954df8bf2e0

View file

@ -1,38 +0,0 @@
{ lib, config, ... }:
with lib;
let
tmux = config.modules.user.tmux;
gui = config.modules.user.gui.wm;
sway = config.modules.user.gui.wm.sway;
hyprland = config.modules.user.gui.wm.hyprland;
wm = {
enable = builtins.any (mod: mod.enable or false) (builtins.attrValues gui);
};
in
''
case $- in
*i*)
${optionalString wm.enable ''
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
${optionalString sway.enable ''
exec sway
''
}
${optionalString hyprland.enable ''
exec Hyprland
''
}
exit 0
fi
''}
${optionalString tmux.enable ''
if [ -z "$DISPLAY" ] && [ -z "$TMUX" ] && [ -z "$SSH_TTY" ]; then
exec tmux
fi
''}
;;
esac
''

View file

@ -1,144 +0,0 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.modules.user.gui.wm.sway;
modifier = config.wayland.windowManager.sway.config.modifier;
wallpaper = builtins.fetchurl {
url = "https://images6.alphacoders.com/117/1174033.png";
sha256 = "1ph5m9s57076jx6042iipqx2ifzadmd5z4lf5l49wgq4jb92mp16";
};
barStatus = pkgs.writeShellScript "status.sh" ''
#!/usr/bin/env bash
while :; do
echo "$(ip -4 addr show eno1 | awk '/inet / {print $2}' | cut -d'/' -f1) | $(free -h | awk '/^Mem/ {print $3}') | $(date +'%I:%M:%S %p') | $(date +'%m-%d-%Y')"; sleep 1;
done
'';
in
{ options.modules.user.gui.wm.i3 = { enable = mkEnableOption "Enable i3 WM"; };
config = mkIf cfg.enable {
xsession = {
enable = true;
windowManager.i3 = {
config = {
defaultWorkspace = "workspace number 1";
fonts = {
names = [ "Terminus" ];
};
modifier = "Mod1";
menu = "rofi -show drun -show-icons -drun-icon-theme Qogir -font 'Noto Sans 14'";
terminal = "${pkgs.alacritty}/bin/alacritty";
bars = [
{
position = "top";
statusCommand = "${barStatus}";
fonts = {
names = [ "Terminus" ];
size = 12.0;
};
colors = {
background = "#0A0E14";
statusline = "#FFFFFF";
};
}
];
gaps = {
smartGaps = false;
inner = 10;
};
floating = {
titlebar = false;
border = 0;
criteria = [
{
title = "Android Emulator";
}
];
};
window = {
titlebar = false;
border= 0;
};
keybindings = lib.mkOptionDefault {
"${modifier}+q" = "kill";
"Print" = "exec grim ~/Pictures/screenshot-$(date +'%Y%m%d-%H%M%S').png";
"${modifier}+Shift+Print" = "exec grim -g \"$(slurp)\" ~/Pictures/screenshot-$(date +'%Y%m%d-%H%M%S').png";
"${modifier}+Print" = ''exec sh -c 'grim -g "$(swaymsg -t get_tree | jq -j '"'"'.. | select(.type?) | select(.focused).rect | "\(.x),\(.y) \(.width)x\(.height)"'"'"')" ~/Pictures/screenshot-$(date +'%Y%m%d-%H%M%S').png' '';
"${modifier}+Shift+f" = "exec alacritty -e sh -c 'EDITOR=nvim ranger'";
"${modifier}+Shift+d" = "exec rofi -modi emoji -show emoji";
};
};
extraConfig = ''
exec_always ${pkgs.autotiling}/bin/autotiling -sr "1.61"
'';
};
};
programs.rofi = import ./config/rofi { inherit pkgs config lib; };
home.file.".config/rofi" = {
source = ./config/rofi/config;
recursive = true;
};
xdg = {
portal = {
enable = true;
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
config.common.default = "*";
};
};
gtk = {
enable = true;
theme.package = pkgs.juno-theme;
theme.name = "Juno-ocean";
iconTheme.package = pkgs.qogir-icon-theme;
iconTheme.name = "Qogir";
};
qt = {
enable = true;
style.package = pkgs.juno-theme;
platformTheme.name = "gtk";
};
home.packages = with pkgs; [
pavucontrol
xdg-utils
wl-clipboard
autotiling
grim
jq
slurp
ranger
highlight
nerd-fonts.terminess-ttf
noto-fonts
noto-fonts-cjk-sans
noto-fonts-color-emoji
];
programs = {
imv.enable = true;
};
fonts.fontconfig.enable = true;
};
}

View file

@ -1,32 +0,0 @@
{ pkgs, lib, config, ... }:
let
browser = config.programs;
fileTypes = [
"text/html" "application/pdf" "application/xml"
"image/png" "image/svg+xml" "image/jpg"
"image/jpeg" "image/gif" "image/webp"
"image/avif" "image/bmp" "image/tiff"
];
defaultBrowser = if browser.firefox.enable then
"firefox.desktop"
else if browser.brave.enable then
"brave-browser.desktop"
else if browser.chromium.enable then
"chromium.desktop"
else null;
in
{
xdg.mimeApps = lib.optionalAttrs (defaultBrowser != null && config.xdg.portal.enable) {
enable = true;
defaultApplications = builtins.listToAttrs (
map (type: {
name = type;
value = [ defaultBrowser ];
}) fileTypes
);
};
}

View file

@ -1,7 +0,0 @@
configuration {
font: "SF Pro Rounded 10";
show-icons: true;
kb-cancel: "Escape,Alt+F1";
}
@theme "~/.config/rofi/material-ocean.rasi"

View file

@ -1,95 +0,0 @@
* {
background: #0f111a;
foreground: #f1f1f1;
selected: #ff4151;
}
window {
transparency: "real";
background-color: @background;
text-color: @foreground;
}
prompt {
enabled: true;
padding: 4px 4px 6px 6px;
background-color: @background;
text-color: @foreground;
}
textbox-prompt-colon {
expand: false;
background-color: @background;
padding: 4px 0px 0px 6px;
}
inputbar {
children: [ textbox-prompt-colon, entry ];
background-color: @background;
text-color: @foreground;
expand: false;
border: 0px 0px 0px 0px;
border-radius: 0px;
border-color: @selected;
margin: 0px 0px 0px 0px;
padding: 0px 0px 4px 0px;
position: center;
}
entry {
background-color: @background;
text-color: @foreground;
placeholder-color: @foreground;
expand: true;
horizontal-align: 0;
blink: true;
padding: 4px 0px 0px 4px;
}
case-indicator {
background-color: @background;
text-color: @foreground;
spacing: 0;
}
listview {
background-color: @background;
columns: 1;
spacing: 5px;
cycle: true;
dynamic: true;
layout: vertical;
}
mainbox {
background-color: @background;
children: [ inputbar, listview ];
spacing: 5px;
padding: 5px 5px 5px 5px;
}
element {
background-color: @background;
text-color: @foreground;
orientation: horizontal;
border-radius: 4px;
padding: 6px 6px 6px 6px;
}
element-text, element-icon {
background-color: inherit;
text-color: inherit;
}
element-icon {
size: 18px;
border: 4px;
}
element selected {
background-color: @selected;
text-color: @background;
border: 0px;
border-radius: 0px;
border-color: @selected;
}

View file

@ -1,183 +0,0 @@
{ pkgs, config, ... }:
let
inherit (config.lib.formats.rasi) mkLiteral;
in
{
enable = true;
package = pkgs.rofi;
location = "center";
terminal = "\${pkgs.alacritty}/bin/alacritty";
plugins = with pkgs; [
rofi-emoji
];
#theme = {
# "*" = {
# nord0 = mkLiteral "#2e3440";
# nord1 = mkLiteral "#3b4252";
# nord2 = mkLiteral "#434c5e";
# nord3 = mkLiteral "#4c566a";
# nord4 = mkLiteral "#d8dee9";
# nord5 = mkLiteral "#e5e9f0";
# nord6 = mkLiteral "#eceff4";
# nord7 = mkLiteral "#8fbcbb";
# nord8 = mkLiteral "#88c0d0";
# nord9 = mkLiteral "#81a1c1";
# nord10 = mkLiteral "#5e81ac";
# nord11 = mkLiteral "#bf616a";
# nord12 = mkLiteral "#d08770";
# nord13 = mkLiteral "#ebcb8b";
# nord14 = mkLiteral "#a3be8c";
# nord15 = mkLiteral "#b48ead";
# spacing = 2;
# background-color = mkLiteral "var(nord1)";
# background = mkLiteral "var(nord1)";
# foreground = mkLiteral "var(nord4)";
# normal-background = mkLiteral "var(background)";
# normal-foreground = mkLiteral "var(foreground)";
# alternate-normal-background = mkLiteral "var(background)";
# alternate-normal-foreground = mkLiteral "var(foreground)";
# selected-normal-background = mkLiteral "var(nord8)";
# selected-normal-foreground = mkLiteral "var(background)";
# active-background = mkLiteral "var(background)";
# active-foreground = mkLiteral "var(nord10)";
# alternate-active-background = mkLiteral "var(background)";
# alternate-active-foreground = mkLiteral "var(nord10)";
# selected-active-background = mkLiteral "var(nord10)";
# selected-active-foreground = mkLiteral "var(background)";
# urgent-background = mkLiteral "var(background)";
# urgent-foreground = mkLiteral "var(nord11)";
# alternate-urgent-background = mkLiteral "var(background)";
# alternate-urgent-foreground = mkLiteral "var(nord11)";
# selected-urgent-background = mkLiteral "var(nord11)";
# selected-urgent-foreground = mkLiteral "var(background)";
# };
#
# element = {
# padding = mkLiteral "0px 0px 0px 7px";
# spacing = mkLiteral "5px";
# border = 0;
# cursor = mkLiteral "pointer";
# };
# "element normal.normal" = {
# background-color = mkLiteral "var(normal-background)";
# text-color = mkLiteral "var(normal-foreground)";
# };
# "element normal.urgent" = {
# background-color = mkLiteral "var(urgent-background)";
# text-color = mkLiteral "var(urgent-foreground)";
# };
# "element normal.active" = {
# background-color = mkLiteral "var(active-background)";
# text-color = mkLiteral "var(active-foreground)";
# };
# "element selected.normal" = {
# background-color = mkLiteral "var(selected-normal-background)";
# text-color = mkLiteral "var(selected-normal-foreground)";
# };
# "element selected.urgent" = {
# background-color = mkLiteral "var(selected-urgent-background)";
# text-color = mkLiteral "var(selected-urgent-foreground)";
# };
# "element selected.active" = {
# background-color = mkLiteral "var(selected-active-background)";
# text-color = mkLiteral "var(selected-active-foreground)";
# };
# "element alternate.normal" = {
# background-color = mkLiteral "var(alternate-normal-background)";
# text-color = mkLiteral "var(alternate-normal-foreground)";
# };
# "element alternate.urgent" = {
# background-color = mkLiteral "var(alternate-urgent-background)";
# text-color = mkLiteral "var(alternate-urgent-foreground)";
# };
# "element alternate.active" = {
# background-color = mkLiteral "var(alternate-active-background)";
# text-color = mkLiteral "var(alternate-active-foreground)";
# };
# "element-text" = {
# background-color = mkLiteral "rgba(0, 0, 0, 0%)";
# text-color = mkLiteral "inherit";
# highlight = mkLiteral "inherit";
# cursor = mkLiteral "inherit";
# };
# "element-icon" = {
# background-color = mkLiteral "rgba(0, 0, 0, 0%)";
# size = mkLiteral "1.0000em";
# text-color = mkLiteral "inherit";
# cursor = mkLiteral "inherit";
# };
# window = {
# padding = 0;
# border = 0;
# background-color = mkLiteral "var(background)";
# };
# mainbox = {
# padding = 0;
# border = 0;
# };
# message = {
# margin = mkLiteral "0px 7px";
# };
# textbox = {
# text-color = mkLiteral "var(foreground)";
# };
# listview = {
# margin = mkLiteral "0px 0px 5px";
# scrollbar = true;
# spacing = mkLiteral "2px";
# fixed-height = 0;
# };
# scrollbar = {
# padding = 0;
# handle-width = mkLiteral "14px";
# border = 0;
# handle-color = mkLiteral "var(nord3)";
# };
# button = {
# spacing = 0;
# text-color = mkLiteral "var(normal-foreground)";
# cursor = mkLiteral "pointer";
# };
# "button selected" = {
# background-color = mkLiteral "var(selected-normal-background)";
# text-color = mkLiteral "var(selected-normal-foreground)";
# };
# inputbar = {
# padding = mkLiteral "7px";
# margin = mkLiteral "7px";
# spacing = 0;
# text-color = mkLiteral "var(normal-foreground)";
# background-color = mkLiteral "var(nord3)";
# children = [ "entry" ];
# };
# entry = {
# spacing = 0;
# cursor = mkLiteral "text";
# text-color = mkLiteral "var(normal-foreground)";
# background-color = mkLiteral "var(nord3)";
# };
#};
}

View file

@ -1,23 +0,0 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.modules.user.security;
pass = pkgs.pass.withExtensions (exts: with exts; [
pass-audit
pass-otp
pass-update
#pass-tomb
]);
in
{ options.modules.user.security = { enable = mkEnableOption "Enable security module"; };
config = mkIf cfg.enable {
home.packages = with pkgs; [
pass
wireguard-tools
ipscan
yubikey-manager
];
};
}

View file

@ -1,21 +0,0 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.modules.user.utils;
in
{ options.modules.user.utils = { enable = mkEnableOption "user.utils"; };
config = mkIf cfg.enable {
home.packages = with pkgs; [
wget curl fastfetch
unzip fping calc fd pciutils
rsync zip lshw wireshark
calcurse
];
programs.bash.shellAliases = {
calendar = "${pkgs.calcurse}/bin/calcurse";
};
};
}

View file

@ -1,31 +0,0 @@
#TODO: Create a penpot derivation and properly fix the script
''
function penpot() {
case "$1" in
run)
sudo docker compose -p penpot -f ~/Documents/tools/penpot/docker-compose.yaml up -d >/dev/null 2>&1
nohup bash -c '(sleep 10 && if [[ "$OSTYPE" == "linux-gnu"* ]]; then
xdg-open "http://localhost:9001"
elif [[ "$OSTYPE" == "darwin"* ]]; then
open "http://localhost:9001"
fi)' >/dev/null 2>&1 &
echo "Started penpot on http://localhost:9001"
;;
stop)
echo "Stopping penpot"
sudo docker compose -p penpot -f ~/Documents/tools/penpot/docker-compose.yaml down >/dev/null 2>&1
;;
update)
sudo docker compose -f ~/Documents/tools/penpot/docker-compose.yaml pull
echo "Updated penpot!"
;;
help)
xdg-open "https://help.penpot.app/"
echo "Opened penpot help page in your browser."
;;
*)
echo "Usage: penpot {run|stop|update|help}"
;;
esac
}
''

@ -1 +0,0 @@
Subproject commit 64b4c545481b593d2859bfb3e1c10cd91742213f

View file

@ -1 +0,0 @@
src/system/machines/

View file

@ -1,12 +1,11 @@
{ lib }: { lib, ... }:
with lib;
with builtins; with builtins;
let let
extractName = filename: extractName = filename:
let let
# Remove .key extension noKey = removeSuffix ".key" filename;
noKey = lib.removeSuffix ".key" filename;
# Remove .pub/.priv/.public/.private markers
noMarkers = replaceStrings noMarkers = replaceStrings
[ ".pub" ".priv" ".public" ".private" ] [ ".pub" ".priv" ".public" ".private" ]
[ "" "" "" "" ] [ "" "" "" "" ]
@ -23,11 +22,22 @@ let
value = readFile "${dir}/${subdir}/${file}"; value = readFile "${dir}/${subdir}/${file}";
}) (filter (file: }) (filter (file:
(readDir "${dir}/${subdir}").${file} == "regular" && (readDir "${dir}/${subdir}").${file} == "regular" &&
lib.hasSuffix ".key" file hasSuffix ".key" file
) (attrNames (readDir "${dir}/${subdir}"))) ) (attrNames (readDir "${dir}/${subdir}")))
); );
}) (filter (node: (readDir dir).${node} == "directory") (attrNames (readDir dir))) }) (filter (node: (readDir dir).${node} == "directory") (attrNames (readDir dir)))
) )
); );
in in
constructKeys ./. {
options = {
machines = mkOption {
description = "Machine Configurations";
type = types.attrs;
default = {
keys = constructKeys ./.;
};
};
};
}

View file

@ -0,0 +1,14 @@
{ inputs, ... }:
{
imports = [
inputs.disko.nixosModules.disko
(import ./modules/disko)
inputs.home-manager.nixosModules.home-manager
(import ./modules/home-manager)
../../../user
../../keys
./hardware.nix
./system.nix
];
}

View file

@ -0,0 +1,54 @@
{ config, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
monitors = config.monitors;
};
home-manager.users.${config.user.name} = {
imports = [
../../../../../user
../../../../../user/home.nix
../../../../../user/modules
];
home.stateVersion = "23.11";
programs.ssh = {
enable = true;
enableDefaultConfig = false;
matchBlocks = {
"*" = {
serverAliveInterval = 60;
serverAliveCountMax = 3;
};
"server" = {
hostname = "192.168.0.154";
user = "bryan";
};
};
};
# Machine-specific modules
modules.user = {
vim.enable = false;
security.yubikey.enable = true;
utils = {
dev.enable = true;
irc.enable = true;
writing.enable = true;
};
gui = {
wm.hyprland.enable = true;
browser.firefox.enable = true;
alacritty.enable = true;
corn.enable = true;
fun.enable = true;
utils.enable = true;
};
};
};
}

View file

@ -0,0 +1,14 @@
{ inputs, ... }:
{
imports = [
inputs.disko.nixosModules.disko
(import ./modules/disko)
inputs.home-manager.nixosModules.home-manager
(import ./modules/home-manager)
../../../user
../../keys
./hardware.nix
./system.nix
];
}

View file

@ -1,10 +1,7 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
{ {
imports = [ imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
(modulesPath + "/installer/scan/not-detected.nix")
./modules/disko
];
boot = { boot = {
initrd = { initrd = {

View file

@ -8,7 +8,9 @@ let
builtins.pathExists path && builtins.pathExists path &&
builtins.readFileType path == "directory" && builtins.readFileType path == "directory" &&
builtins.baseNameOf path != "config" && builtins.baseNameOf path != "config" &&
builtins.baseNameOf path != "plugins"; builtins.baseNameOf path != "plugins" &&
builtins.baseNameOf path != "home-manager" &&
builtins.baseNameOf path != "disko";
isModule = file: file == "default.nix"; isModule = file: file == "default.nix";
isNix = file: builtins.match ".*\\.nix" file != null && file != "default.nix"; isNix = file: builtins.match ".*\\.nix" file != null && file != "default.nix";

View file

@ -20,7 +20,14 @@ in
settings = { settings = {
mqtt.enabled = false; mqtt.enabled = false;
# ffmpeg.hwaccel_args = "preset-vaapi"; # Disabled - camera uses HEVC which Haswell can't decode # ffmpeg.hwaccel_args = "preset-vaapi"; # Disabled - camera uses HEVC which Haswell can't decode
record.enabled = true; record = {
enabled = true;
# 24/7 recording - needs better hardware
# retain = {
# days = 14;
# mode = "all";
# };
};
cameras = { cameras = {
doorbell = { doorbell = {
enabled = true; enabled = true;

View file

@ -0,0 +1,23 @@
{ config, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${config.user.name} = {
imports = [
../../../../../user
../../../../../user/home.nix
../../../../../user/modules
];
home.stateVersion = "25.11";
# Machine-specific modules
modules.user = {
neovim.enable = false;
vim.enable = true;
tmux.enable = false;
utils.dev.enable = true;
};
};
}

View file

@ -0,0 +1,69 @@
{ pkgs, lib, config, ... }:
with lib;
let
cfg = config.modules.system.webdav;
domain = "ramos.codes";
in
{
options.modules.system.webdav = {
enable = mkEnableOption "WebDAV server for phone backups";
directory = mkOption {
type = types.path;
default = "/var/lib/seedvault";
description = "Directory to store backups";
};
};
config = mkIf cfg.enable {
# Create backup directory
systemd.tmpfiles.rules = [
"d ${cfg.directory} 0750 webdav webdav -"
];
services.webdav = {
enable = true;
# Credentials in /var/lib/webdav/env:
# WEBDAV_USERNAME=seedvault
# WEBDAV_PASSWORD=your-secure-password
environmentFile = "/var/lib/webdav/env";
settings = {
address = "127.0.0.1";
port = 8090;
directory = cfg.directory;
behindProxy = true;
permissions = "CRUD"; # Create, Read, Update, Delete
users = [
{
username = "{env}WEBDAV_USERNAME";
password = "{env}WEBDAV_PASSWORD";
}
];
};
};
services.nginx.virtualHosts."backup.${domain}" = {
useACMEHost = domain;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:8090";
extraConfig = ''
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# WebDAV needs these
proxy_pass_request_headers on;
proxy_set_header Destination $http_destination;
# Large file uploads for backups
client_max_body_size 0;
proxy_request_buffering off;
'';
};
};
};
}

View file

@ -2,13 +2,14 @@
{ system.stateVersion = "25.11"; { system.stateVersion = "25.11";
imports = [ ../../modules ]; imports = [ ./modules ];
modules.system = { modules.system = {
nginx.enable = true; nginx.enable = true;
forgejo.enable = true; forgejo.enable = true;
frigate.enable = true; frigate.enable = true;
immich.enable = true; immich.enable = true;
webdav.enable = false;
# bitcoin = { # bitcoin = {
# enable = true; # enable = true;
# electrum.enable = true; # electrum.enable = true;

View file

@ -0,0 +1,13 @@
{ inputs, ... }:
{
imports = [
inputs.nixos-wsl.nixosModules.wsl
(import ./modules/wsl)
inputs.home-manager.nixosModules.home-manager
(import ./modules/home-manager)
../../../user
../../keys
./system.nix
];
}

View file

@ -0,0 +1,24 @@
{ config, ... }:
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.${config.user.name} = {
imports = [
../../../../../user
../../../../../user/home.nix
../../../../../user/modules
];
home.stateVersion = "23.11";
# Machine-specific modules
modules.user = {
utils = {
dev.enable = true;
email.enable = true;
irc.enable = true;
};
};
};
}

View file

@ -1,12 +1,11 @@
{ config, lib, ... }: { config, lib, ... }:
{ {
imports = [ ../../../../../user/config ]; imports = [ ../../../../../user ];
wsl = rec { wsl = rec {
enable = true; enable = true;
defaultUser = lib.mkDefault config.user.name; defaultUser = lib.mkDefault config.user.name;
nativeSystemd = true;
useWindowsDriver = true; useWindowsDriver = true;
wslConf = { wslConf = {

View file

@ -1 +0,0 @@
src/user/config/

View file

@ -1,10 +1,6 @@
{ lib, pkgs, config, ... }: { lib, pkgs, ... }:
with lib; with lib;
let
modules = config.modules.user;
in
{ {
options = { options = {
user = mkOption { user = mkOption {

38
user/home.nix Normal file
View file

@ -0,0 +1,38 @@
{ lib, pkgs, config, ... }:
let
pass = pkgs.pass.withExtensions (exts: with exts; [
pass-audit
pass-otp
pass-update
pass-tomb
]);
in
{
programs.home-manager.enable = true;
home.username = config.user.name;
home.homeDirectory = "/home/${config.user.name}";
# Essential packages for all users
home.packages = with pkgs; [
pass
wget curl fastfetch fd
unzip zip rsync
calc calcurse
];
programs.bash.shellAliases = {
cal = "${pkgs.calcurse}/bin/calcurse";
calendar = "${pkgs.calcurse}/bin/calcurse";
};
# Default modules for all users (machines can override with mkForce false)
modules.user = {
bash.enable = lib.mkDefault true;
git.enable = lib.mkDefault true;
neovim.enable = lib.mkDefault true;
security.gpg.enable = lib.mkDefault true;
};
}

@ -0,0 +1 @@
Subproject commit f6700648a3186a1a1cc7d004df7ef14953272c81

View file

@ -10,12 +10,10 @@ in
programs.bash = { programs.bash = {
enable = true; enable = true;
initExtra = "source ~/.config/bash/bashrc"; initExtra = "source ~/.config/bash/bashrc";
profileExtra = import ./config/shellHook.nix { inherit lib config; };
}; };
# .bashrc
home.file.".config/bash" = { home.file.".config/bash" = {
source = ./config/bash; source = ./bash;
recursive = true; recursive = true;
}; };

View file

@ -14,7 +14,6 @@ let
!(builtins.elem (builtins.baseNameOf path) excludedDirs) && !(builtins.elem (builtins.baseNameOf path) excludedDirs) &&
!(isSubmodule path); !(isSubmodule path);
isModule = file: file == "default.nix"; isModule = file: file == "default.nix";
isNix = file: builtins.match ".*\\.nix" file != null && file != "default.nix";
in in
builtins.concatMap (name: builtins.concatMap (name:
@ -25,15 +24,11 @@ let
mkModules path false mkModules path false
else if isModule name && !isRoot then else if isModule name && !isRoot then
[ dir ] [ dir ]
else if isNix name then
[ path ]
else else
[] []
) names; ) names;
in in
{ {
imports = [ imports = mkModules ./. true;
./config
] ++ mkModules ./. true;
} }

Some files were not shown because too many files have changed in this diff Show more