mlaga97-nix/flake.nix
2025-08-03 00:19:50 -05:00

399 lines
12 KiB
Nix

# https://nix.dev/
# https://github.com/barrucadu/nixfiles/tree/master
# https://bitbucket.org/bzz/nixos/src/master/configuration.nix
# https://grahamc.com/blog/erase-your-darlings/
# https://github.com/Misterio77/nix-starter-configs
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
lix-module.url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.1.tar.gz";
lix-module.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko/latest";
disko.inputs.nixpkgs.follows = "nixpkgs";
# Encrypted home: https://github.com/nix-community/home-manager/pull/6981
home-manager.url = "github:nix-community/home-manager/release-25.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs";
# Extras
waveforms.url = "github:liff/waveforms-flake";
waveforms.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = {
self,
nixpkgs,
nixpkgs-unstable,
home-manager,
sops-nix,
disko,
waveforms,
lix-module
}@inputs: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
pkgs-unstable = import nixpkgs-unstable {
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"
];
# Allows for remote deployment via
# nixos-rebuild -L switch --flake .?submodules=1#HOSTNAME --target-host USER@HOSTNAME
#nix.settings.require-sigs = false;
}];
# TODO: Surely a better way, no?
_inherited_modules = [
home-manager.nixosModules.home-manager
disko.nixosModules.default
lix-module.nixosModules.default
];
in {
homeManagerModules = {
"lauren_lagarde" = [
{
home.username = "lauren_lagarde";
home.homeDirectory = "/home/lauren_lagarde";
nixpkgs.config.allowUnfree = true;
}
./home-manager/base.nix
];
"lauren_lagarde@living-room" = self.homeManagerModules."lauren_lagarde" ++ [
./home-manager/i3.nix
./secrets/mlaga97.nix
#./secrets/mlaga97-gui.nix
./systems/living-room/home.nix
];
"lauren_lagarde@ll-latitude-e5591" = self.homeManagerModules."lauren_lagarde" ++ [
./home-manager/i3.nix
./secrets/mlaga97.nix
./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 inputs pkgs-unstable; };
};
"lauren_lagarde@ll-latitude-e5591" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = self.homeManagerModules."lauren_lagarde@ll-latitude-e5591";
extraSpecialArgs = { inherit inputs pkgs-unstable; };
};
};
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.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.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; };
};
blockhouse = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "blockhouse";
networking.hostId = "ed658529";
system.stateVersion = "23.11";
home-manager.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; };
};
fortress = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "fortress";
system.stateVersion = "25.05";
home-manager.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; };
};
stronghold = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
{
networking.hostName = "stronghold";
networking.hostId = "c581a1cd";
}
./systems/stronghold/configuration.nix
lix-module.nixosModules.default
home-manager.nixosModules.home-manager
disko.nixosModules.default
];
};
##########################################################################
##########################################################################
##########################################################################
# 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 {
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
];
};
};
#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; };
# };
#};
};
}