new stuff

This commit is contained in:
TheGeneralist 2026-01-08 21:15:12 +01:00
parent 6014ad7d7a
commit 01c8bfce80
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
18 changed files with 721 additions and 285 deletions

33
hosts/default.nix Normal file
View file

@ -0,0 +1,33 @@
{ lib, inputs, self }:
let
inherit (lib)
mapAttrs filterAttrs hasPrefix hasSuffix;
# Read host directories
hostDirs = builtins.readDir ./.;
# Build a single host configuration
mkHostConfig = name: _type:
let
hostPath = ./${name};
hostModule = import hostPath;
in
hostModule lib inputs self;
# Determine if host is Darwin or NixOS based on naming
isDarwin = name:
hasPrefix "thegeneralist" name &&
(hasSuffix "mbp" name || hasSuffix "central-mbp" name);
# Build all host configurations
allHosts = mapAttrs mkHostConfig
(filterAttrs (_: type: type == "directory") hostDirs);
# Separate Darwin and NixOS configurations
darwinHosts = filterAttrs (name: _: isDarwin name) allHosts;
nixosHosts = filterAttrs (name: _: !isDarwin name) allHosts;
in
{
darwin = darwinHosts;
nixos = nixosHosts;
}

View file

@ -1 +1 @@
lib: inputs: self: lib.system "darwin" ./configuration.nix
lib: inputs: self: lib.mkSystem "darwin" ./configuration.nix

View file

@ -1 +1 @@
lib: inputs: self: lib.system "linux" ./configuration.nix
lib: inputs: self: lib.mkSystem "linux" ./configuration.nix

View file

@ -1 +1 @@
lib: inputs: self: lib.system "darwin" ./configuration.nix
lib: inputs: self: lib.mkSystem "darwin" ./configuration.nix

View file

@ -1 +1 @@
lib: inputs: self: lib.system "linux" ./configuration.nix
lib: inputs: self: lib.mkSystem "linux" ./configuration.nix