Refactor.

This commit is contained in:
2025-10-20 22:27:58 +01:00
parent fe51f1ac5b
commit 99db96e449
14 changed files with 268 additions and 30 deletions

View File

@@ -1,13 +1,8 @@
{ pkgs, ... }:
{
# DEPRECATED: Use cluster-node.nix for cluster nodes or minimal-node.nix for minimal systems
# This file is kept for backward compatibility with existing configurations
imports = [
./cifs-client.nix
./consul.nix
./glusterfs-client.nix
./impermanence.nix
./sshd.nix
./user-ppetru.nix
./unattended-encryption.nix
./systemd-boot.nix
./cluster-node.nix
];
}

View File

@@ -1,10 +1,8 @@
{ pkgs, ... }:
{
# Cloud node: Minimal system with Consul for cloud deployments
imports = [
./minimal-node.nix
./consul.nix
./impermanence.nix
./sshd.nix
./user-ppetru.nix
./systemd-boot.nix
];
}

13
common/cluster-node.nix Normal file
View File

@@ -0,0 +1,13 @@
{ pkgs, ... }:
{
# Cluster node configuration
# Extends minimal-node with cluster-specific services (Consul, GlusterFS, CIFS)
# Used by: compute nodes (c1, c2, c3)
imports = [
./minimal-node.nix
./unattended-encryption.nix
./cifs-client.nix
./consul.nix
./glusterfs-client.nix
];
}

View File

@@ -1,7 +1,9 @@
{ pkgs, ... }:
{
# Compute node: Cluster node with Nomad, GlusterFS server, and Syncthing
# Used by: c1, c2, c3
imports = [
./base-node.nix
./cluster-node.nix
./glusterfs.nix
./nomad.nix
./syncthing-data.nix

View File

@@ -1,11 +0,0 @@
{ lib, ... }:
{
imports = [
./impermanence.nix # TODO: find a way to avoid needing this here
];
boot.isContainer = true;
custom.impermanence.enable = false;
custom.tailscale.enable = false;
networking.useDHCP = lib.mkForce false;
}

View File

@@ -1,5 +1,11 @@
{ pkgs, ... }:
{
# Desktop profile: Graphical desktop with Hyprland
# Extends workstation-node with desktop environment
imports = [
./workstation-node.nix
];
# Enable Hyprland (Wayland compositor)
programs.hyprland = {
enable = true;

12
common/minimal-node.nix Normal file
View File

@@ -0,0 +1,12 @@
{ pkgs, ... }:
{
# Minimal base configuration for all NixOS systems
# Provides: SSH access, user management, boot, impermanence
# Note: unattended-encryption is NOT included by default - add it explicitly where needed
imports = [
./impermanence.nix
./sshd.nix
./user-ppetru.nix
./systemd-boot.nix
];
}

14
common/server-node.nix Normal file
View File

@@ -0,0 +1,14 @@
{ pkgs, ... }:
{
# Server profile: Cluster-enabled system for server deployments
# Extends cluster-node with server-specific configurations
# Future: Add bare NixOS services here (mysql, postgres, etc.) when migrating from Nomad
imports = [
./cluster-node.nix
];
# Server-specific configurations can be added here
# Example (for future use):
# services.mysql.enable = lib.mkDefault false;
# services.postgresql.enable = lib.mkDefault false;
}

View File

@@ -1,5 +1,12 @@
{ pkgs, inputs, ... }:
{
# Workstation profile: Development workstation configuration
# Extends server-node with development tools and emulation
imports = [
./server-node.nix
./unattended-encryption.nix
];
environment.systemPackages = with pkgs; [
wget
deploy-rs