refactor: migrate nix-darwin config to a flake-parts dendritic layout

This commit is contained in:
Poby 2026-03-26 09:03:35 +09:00
parent f80b0b0d4f
commit 09801ac429
No known key found for this signature in database
84 changed files with 1029 additions and 687 deletions

60
modules/flake/options.nix Normal file
View file

@ -0,0 +1,60 @@
{
config,
lib,
...
}: let
inherit (lib) mkDefault mkOption;
types = lib.types;
in {
options.repo = {
user = {
name = mkOption {
type = types.str;
};
email = mkOption {
type = types.str;
};
homeDirectory = mkOption {
type = types.str;
};
homeStateVersion = mkOption {
type = types.str;
};
darwinStateVersion = mkOption {
type = types.int;
};
secretFile = mkOption {
type = types.path;
};
};
hosts = mkOption {
type = types.attrsOf (types.submodule {
options = {
system = mkOption {
type = types.str;
};
features = mkOption {
type = types.listOf types.str;
default = [];
};
};
});
default = {};
};
homeModules = mkOption {
type = types.lazyAttrsOf types.deferredModule;
default = {};
};
};
config.repo.user = {
name = mkDefault "poby";
email = mkDefault "smg981024@gmail.com";
homeDirectory = mkDefault "/Users/${config.repo.user.name}";
homeStateVersion = mkDefault "25.11";
darwinStateVersion = mkDefault 6;
secretFile = mkDefault ../../secrets/poby.yaml;
};
}