mirror of
https://github.com/thegeneralist01/config.git
synced 2026-03-07 10:59:55 +01:00
new stuff
This commit is contained in:
parent
6014ad7d7a
commit
01c8bfce80
18 changed files with 721 additions and 285 deletions
33
hosts/default.nix
Normal file
33
hosts/default.nix
Normal 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;
|
||||
}
|
||||
|
|
@ -1 +1 @@
|
|||
lib: inputs: self: lib.system "darwin" ./configuration.nix
|
||||
lib: inputs: self: lib.mkSystem "darwin" ./configuration.nix
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
lib: inputs: self: lib.system "linux" ./configuration.nix
|
||||
lib: inputs: self: lib.mkSystem "linux" ./configuration.nix
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
lib: inputs: self: lib.system "darwin" ./configuration.nix
|
||||
lib: inputs: self: lib.mkSystem "darwin" ./configuration.nix
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
lib: inputs: self: lib.system "linux" ./configuration.nix
|
||||
lib: inputs: self: lib.mkSystem "linux" ./configuration.nix
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue