refactor(modules): reduce host repetition

This commit is contained in:
2026-03-28 10:52:59 +00:00
parent 1bb97448a4
commit 94baea90d6
47 changed files with 876 additions and 722 deletions

View File

@@ -1,33 +1,34 @@
{den, ...}: {
den.hosts.aarch64-darwin.chidi.users.cschmatzler.aspect = "chidi-cschmatzler";
den.aspects.chidi-cschmatzler = {
{
den,
lib,
...
}: let
hostLib = import ../_lib/hosts.nix {inherit den lib;};
local = import ../_lib/local.nix;
host = "chidi";
hostMeta = local.hosts.chidi;
in
hostLib.mkUserHost {
system = hostMeta.system;
inherit host;
user = local.user.name;
includes = [den.aspects.user-darwin-laptop];
homeManager = {...}: {
programs.git.settings.user.email = "christoph@tuist.dev";
programs.git.settings.user.email = local.user.emails.work;
};
};
}
// hostLib.mkPerHostAspect {
inherit host;
includes = [
den.aspects.host-darwin-base
den.aspects.opencode-api-key
];
darwin = {...}: {
networking.hostName = host;
networking.computerName = host;
den.aspects.chidi.includes = [
(den.lib.perHost {
includes = [den.aspects.host-darwin-base];
darwin = {...}: {
networking.hostName = "chidi";
networking.computerName = "chidi";
sops.secrets.opencode-api-key = {
sopsFile = ../../secrets/opencode-api-key;
format = "binary";
owner = "cschmatzler";
path = "/run/secrets/opencode-api-key";
};
homebrew.casks = [
"slack"
];
};
})
];
}
homebrew.casks = [
"slack"
];
};
}