mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
feat: clean up the repo
This commit is contained in:
parent
bc9c310c77
commit
f6ec9f37eb
249 changed files with 804 additions and 13048 deletions
|
|
@ -1,8 +1,11 @@
|
|||
{ config, lib, meta, root, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
meta,
|
||||
root,
|
||||
...
|
||||
}:
|
||||
with lib; {
|
||||
options = {
|
||||
lib = mkOption {
|
||||
type = types.attrsOf (types.attrsOf types.unspecified);
|
||||
|
|
@ -11,18 +14,6 @@ with lib;
|
|||
nixosImports = mkOption {
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
darwinImports = mkOption {
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
esphomeImports = mkOption {
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
homeImports = mkOption {
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
users = mkOption {
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
};
|
||||
};
|
||||
config = {
|
||||
|
|
@ -31,35 +22,15 @@ with lib;
|
|||
(root + "/nixos/systems/HN.nix")
|
||||
(root + "/nixos/systems/HN/nixos.nix")
|
||||
]);
|
||||
esphomeImports = mkDefault (map (path: toString path) [
|
||||
(root + "/esphome/boards/HN.nix")
|
||||
(root + "/esphome/boards/HN/esphome.nix")
|
||||
]);
|
||||
darwinImports = mkDefault (map (path: toString path) [
|
||||
(root + "/darwin/systems/HN.nix")
|
||||
(root + "/darwin/systems/HN/darwin.nix")
|
||||
]);
|
||||
homeImports = [];
|
||||
users = mkDefault (singleton "kat");
|
||||
};
|
||||
lib.nixfiles.nixosImport = hostName: lib.nodeImport {
|
||||
inherit (config.network.importing) nixosImports homeImports users;
|
||||
profiles = meta.nixos;
|
||||
inherit hostName;
|
||||
};
|
||||
lib.nixfiles.esphomeImport = hostName: lib.nodeImport {
|
||||
nixosImports = config.network.importing.esphomeImports;
|
||||
homeImports = [];
|
||||
users = [];
|
||||
profiles = { base = { }; };
|
||||
inherit hostName;
|
||||
};
|
||||
lib.nixfiles.darwinImport = hostName: lib.nodeImport {
|
||||
nixosImports = config.network.importing.darwinImports;
|
||||
profiles = meta.darwin;
|
||||
inherit (config.network.importing) homeImports users;
|
||||
inherit hostName;
|
||||
};
|
||||
_module.args = { inherit (config.lib) nixfiles; };
|
||||
lib.nixfiles.nixosImport = hostName:
|
||||
lib.nodeImport {
|
||||
inherit (config.network.importing) nixosImports;
|
||||
profiles = meta.nixos;
|
||||
homeImports = [];
|
||||
users = [];
|
||||
inherit hostName;
|
||||
};
|
||||
_module.args = {inherit (config.lib) nixfiles;};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue