🚧 Update user configuration loading and use formatter

This commit is contained in:
Jo 2025-04-26 23:08:11 +02:00
parent cd32ad1c61
commit 54edba0070
12 changed files with 83 additions and 146 deletions

View file

@ -1,8 +1,13 @@
{ lib, self, ... }: {
{
lib,
self,
...
}: {
# Create a NixOS module option on a single line.
mkOpt = type: default: description:
lib.mkOption {inherit type default description;};
# Create a simple bool options
mkBool = default: description:
lib.mkOption {
inherit default description;
@ -10,20 +15,17 @@
};
# 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;
};
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
}