feat: clean up the repo

This commit is contained in:
Kat Inskip 2023-04-29 12:00:58 -07:00
parent bc9c310c77
commit f6ec9f37eb
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
249 changed files with 804 additions and 13048 deletions

View file

@ -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;};
};
}