refactor(modules): reduce host repetition
This commit is contained in:
@@ -1,28 +1,30 @@
|
||||
{den, ...}: {
|
||||
den.hosts.aarch64-darwin.janet.users.cschmatzler.aspect = "janet-cschmatzler";
|
||||
|
||||
den.aspects.janet-cschmatzler = {
|
||||
{
|
||||
den,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
hostLib = import ../_lib/hosts.nix {inherit den lib;};
|
||||
local = import ../_lib/local.nix;
|
||||
host = "janet";
|
||||
hostMeta = local.hosts.janet;
|
||||
in
|
||||
hostLib.mkUserHost {
|
||||
system = hostMeta.system;
|
||||
inherit host;
|
||||
user = local.user.name;
|
||||
includes = [
|
||||
den.aspects.user-darwin-laptop
|
||||
den.aspects.user-personal
|
||||
];
|
||||
};
|
||||
|
||||
den.aspects.janet.includes = [
|
||||
(den.lib.perHost {
|
||||
includes = [den.aspects.host-darwin-base];
|
||||
|
||||
darwin = {...}: {
|
||||
networking.hostName = "janet";
|
||||
networking.computerName = "janet";
|
||||
|
||||
sops.secrets.opencode-api-key = {
|
||||
sopsFile = ../../secrets/opencode-api-key;
|
||||
format = "binary";
|
||||
owner = "cschmatzler";
|
||||
path = "/run/secrets/opencode-api-key";
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
}
|
||||
// hostLib.mkPerHostAspect {
|
||||
inherit host;
|
||||
includes = [
|
||||
den.aspects.host-darwin-base
|
||||
den.aspects.opencode-api-key
|
||||
];
|
||||
darwin = {...}: {
|
||||
networking.hostName = host;
|
||||
networking.computerName = host;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user