finalize home configuration loading as nixos module, and more stuffs :3

This commit is contained in:
Jo 2025-04-24 03:01:52 +02:00
parent f89cbcc552
commit dc87b2c186
16 changed files with 192 additions and 87 deletions

View file

@ -1,4 +1,4 @@
{lib, ...}: {
{ lib, self, ... }: {
# Create a NixOS module option on a single line.
mkOpt = type: default: description:
lib.mkOption {inherit type default description;};
@ -9,5 +9,21 @@
type = lib.types.bool;
};
# Todo: add mkIfElse function
# Create a module compliant with the NixOS module system.
mkModule =
{
name ? "puzzlevision",
class,
modules,
}: {
_class = class;
# Template: "[path-to-flake]/flake.nix#[class-name]Modules.[module-name]"
# Example: "[path-to-flake]/flake.nix#nixosModules.system.audio"
_file = "${self.outPath}/flake.nix#${class}Modules.${name}";
imports = modules;
};
# TODO: add mkIfElse function
}