Large refactor to clean up flake.nix

This commit is contained in:
Lauren Lagarde 2025-08-12 22:53:14 -05:00
parent 916595caa3
commit 67f0d12fc4
11 changed files with 206 additions and 362 deletions

377
flake.nix
View file

@ -3,6 +3,7 @@
# https://bitbucket.org/bzz/nixos/src/master/configuration.nix
# https://grahamc.com/blog/erase-your-darlings/
# https://github.com/Misterio77/nix-starter-configs
# https://github.com/solomon-b/nixos-config
{
inputs = {
@ -48,38 +49,12 @@
inherit system;
config.allowUnfree = true;
};
# Look into: https://git.sr.ht/~magic_rb/dotfiles/tree/master/item/nixos/systems/gooseberry
pi_modules = [{
# Disabling the whole `profiles/base.nix` module, which is responsible
# for adding ZFS and a bunch of other unnecessary programs:
disabledModules = [
"profiles/base.nix"
];
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
"/boot/firmware" = {
device = "/dev/disk/by-label/FIRMWARE";
fsType = "vfat";
};
};
}];
# TODO: Surely a better way, no?
_inherited_modules = [
home-manager.nixosModules.home-manager
disko.nixosModules.default
lix-module.nixosModules.default
];
in {
############################################################################
############################################################################
############################################################################
# Home Manager Configurations
homeManagerModules = {
"lauren_lagarde" = [
{
@ -92,360 +67,80 @@
./home-manager/base.nix
];
"lauren_lagarde@living-room" = self.homeManagerModules."lauren_lagarde" ++ [
./home-manager/i3.nix
"lauren_lagarde@tui.mlaga97.space" = self.homeManagerModules."lauren_lagarde" ++ [
./secrets/mlaga97.nix
#./secrets/mlaga97-gui.nix
./systems/living-room/home.nix
];
"lauren_lagarde@ll-latitude-e5591" = self.homeManagerModules."lauren_lagarde" ++ [
"lauren_lagarde@gui.mlaga97.space" = self.homeManagerModules."lauren_lagarde@tui.mlaga97.space" ++ [
./home-manager/i3.nix
];
./secrets/mlaga97.nix
"lauren_lagarde@personal.mlaga97.space" = self.homeManagerModules."lauren_lagarde@gui.mlaga97.space" ++ [
./secrets/mlaga97-gui.nix
./systems/ll-latitude-e5591/home.nix
];
};
homeConfigurations = {
"lauren_lagarde" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = self.homeManagerModules."lauren_lagarde";
extraSpecialArgs = { inherit self inputs pkgs-unstable; };
modules = self.homeManagerModules."lauren_lagarde";
};
"lauren_lagarde@ll-latitude-e5591" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = self.homeManagerModules."lauren_lagarde@ll-latitude-e5591";
extraSpecialArgs = { inherit self inputs pkgs-unstable; };
modules = self.homeManagerModules."lauren_lagarde@personal.mlaga97.space";
};
};
############################################################################
############################################################################
############################################################################
# NixOS System Configurations
nixosConfigurations = {
##########################################################################
##########################################################################
##########################################################################
# Physical Systems
ll-latitude-e5591 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "ll-latitude-e5591";
networking.hostId = "f55542ee";
system.stateVersion = "24.11";
time.timeZone = "America/Chicago";
sops.defaultSopsFile = ./secrets.yaml;
}
./systems/ll-latitude-e5591/configuration.nix
./nixos/disko/nvme/uefi-luks-lvm-ext4.nix
sops-nix.nixosModules.sops
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
waveforms.nixosModule
disko.nixosModules.default
];
specialArgs = { inherit inputs pkgs-unstable; };
};
living-room = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "living-room";
system.stateVersion = "25.05";
home-manager = {
extraSpecialArgs = { inherit self pkgs-unstable; };
users."lauren_lagarde" = {
home.stateVersion = "25.05";
imports = self.homeManagerModules."lauren_lagarde@living-room";
};
};
time.timeZone = "America/Chicago";
sops.defaultSopsFile = ./secrets.yaml;
}
./systems/living-room/configuration.nix
sops-nix.nixosModules.sops
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
disko.nixosModules.default
];
specialArgs = { inherit inputs pkgs-unstable; };
};
bastion = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "bastion";
networking.hostId = "0d13f99b";
system.stateVersion = "24.11";
home-manager = {
extraSpecialArgs = { inherit self pkgs-unstable; };
users."lauren_lagarde" = {
home.stateVersion = "24.11";
imports = self.homeManagerModules."lauren_lagarde" ++ [
./secrets/mlaga97.nix
];
};
};
time.timeZone = "America/Chicago";
sops.defaultSopsFile = ./secrets.yaml;
}
./systems/bastion/configuration.nix
sops-nix.nixosModules.sops
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
disko.nixosModules.default
];
specialArgs = { inherit inputs pkgs-unstable; };
specialArgs = { inherit self inputs pkgs-unstable; };
modules = [ ./systems/bastion/configuration.nix ];
};
blockhouse = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "blockhouse";
networking.hostId = "ed658529";
system.stateVersion = "23.11";
home-manager = {
extraSpecialArgs = { inherit self pkgs-unstable; };
users."lauren_lagarde" = {
home.stateVersion = "24.11";
imports = self.homeManagerModules."lauren_lagarde" ++ [
./secrets/mlaga97.nix
];
};
};
time.timeZone = "America/Chicago";
sops.defaultSopsFile = ./secrets.yaml;
}
./systems/blockhouse/configuration.nix
sops-nix.nixosModules.sops
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
disko.nixosModules.default
];
specialArgs = { inherit inputs pkgs-unstable; };
specialArgs = { inherit self inputs pkgs-unstable; };
modules = [ ./systems/blockhouse/configuration.nix ];
};
fortress = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "fortress";
system.stateVersion = "25.05";
home-manager = {
extraSpecialArgs = { inherit self pkgs-unstable; };
users."lauren_lagarde" = {
home.stateVersion = "25.05";
imports = self.homeManagerModules."lauren_lagarde" ++ [
./secrets/mlaga97.nix
];
};
};
time.timeZone = "America/Chicago";
sops.defaultSopsFile = ./secrets.yaml;
}
./systems/fortress/configuration.nix
sops-nix.nixosModules.sops
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
];
specialArgs = { inherit inputs pkgs-unstable; };
specialArgs = { inherit self inputs pkgs-unstable; };
modules = [ ./systems/fortress/configuration.nix ];
};
stronghold = nixpkgs.lib.nixosSystem {
living-room = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "stronghold";
networking.hostId = "c581a1cd";
}
./systems/stronghold/configuration.nix
specialArgs = { inherit self inputs pkgs-unstable; };
modules = [ ./systems/living-room/configuration.nix ];
};
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
disko.nixosModules.default
];
ll-latitude-e5591 = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs pkgs-unstable; };
modules = [ ./systems/ll-latitude-e5591/configuration.nix ];
};
redoubt = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = pi_modules ++ [
{
networking.hostName = "redoubt";
system.stateVersion = "25.05";
home-manager = {
extraSpecialArgs = { inherit self pkgs-unstable; };
users."lauren_lagarde" = {
home.stateVersion = "25.05";
imports = self.homeManagerModules."lauren_lagarde" ++ [
./secrets/mlaga97.nix
];
};
};
time.timeZone = "America/Chicago";
sops.defaultSopsFile = ./secrets.yaml;
}
./systems/redoubt/configuration.nix
sops-nix.nixosModules.sops
home-manager.nixosModules.home-manager
];
specialArgs = { inherit inputs pkgs-unstable; };
specialArgs = { inherit self inputs pkgs-unstable; };
modules = [ ./systems/redoubt/configuration.nix ];
};
##########################################################################
##########################################################################
##########################################################################
# Other
ll-nixos-headless-pi = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
modules = pi_modules ++ [
{
networking.hostName = "ll-nixos-headless-pi";
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
"/boot/firmware" = {
device = "/dev/disk/by-label/FIRMWARE";
fsType = "vfat";
};
};
}
./systems/ll-nixos-headless.nix
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
waveforms.nixosModule
disko.nixosModules.default
];
specialArgs = { inherit inputs pkgs-unstable; };
};
ll-nixos-base = nixpkgs.lib.nixosSystem {
stronghold = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "ll-nixos-base";
home-manager.users."lauren_lagarde" = { config, pkgs-unstable, ... }: {
imports = inputs.mlaga97-home-manager.homeManagerModules."lauren_lagarde@ll-latitude-e5591";
};
}
./systems/ll-nixos-base.nix
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
waveforms.nixosModule
disko.nixosModules.default
];
specialArgs = { inherit inputs pkgs-unstable; };
};
vm-docker-luks-test = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "vm-docker-luks-test";
networking.hostId = "1b5432b7";
}
./systems/vm-docker-luks.nix
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
disko.nixosModules.default
];
};
vm-docker-zfs-test = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "vm-docker-zfs-test";
networking.hostId = "459ecfce";
}
./systems/vm-docker-host/vm-docker-host-zfs.nix
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
disko.nixosModules.default
];
specialArgs = { inherit self inputs pkgs-unstable; };
modules = [ ./systems/stronghold/configuration.nix ];
};
};
#packages.aarch64-linux = {
# ll-nixos-headless-pi-sdcard = nixos-generators.nixosGenerate {
# system = "aarch64-linux";
# format = "sd-aarch64";
# modules = pi_modules ++ [
# { networking.hostName = "ll-nixos-headless-pi"; }
# ./systems/ll-nixos-headless.nix
# lix-module.nixosModules.default
# home-manager.nixosModules.home-manager
# ];
# specialArgs = { inherit inputs pkgs-unstable; };
# };
# token-pi-sdcard = nixos-generators.nixosGenerate {
# system = "aarch64-linux";
# format = "sd-aarch64";
# modules = pi_modules ++ [
# { networking.hostName = "token-pi"; }
# ./systems/ll-nixos-headless.nix
# lix-module.nixosModules.default
# home-manager.nixosModules.home-manager
# ];
# specialArgs = { inherit inputs pkgs-unstable; };
# };
# outpost-sdcard = nixos-generators.nixosGenerate {
# system = "aarch64-linux";
# format = "sd-aarch64";
# modules = pi_modules ++ [
# ./systems/outpost.nix
# lix-module.nixosModules.default
# home-manager.nixosModules.home-manager
# ];
# specialArgs = { inherit inputs pkgs-unstable; };
# };
#};
};
}