Run nixfmt-rfc-style on repository and add it to Zed config

This commit is contained in:
Jo 2025-05-26 18:06:37 +02:00
parent f5e5adb2fd
commit 45494079c5
41 changed files with 441 additions and 240 deletions

View file

@ -2,30 +2,35 @@
lib,
self,
...
}: {
}:
{
# Create a NixOS module option on a single line.
mkOpt = type: default: description:
lib.mkOption {inherit type default description;};
mkOpt =
type: default: description:
lib.mkOption { inherit type default description; };
# Create a simple bool options
mkBool = default: description:
mkBool =
default: description:
lib.mkOption {
inherit default description;
type = lib.types.bool;
};
# 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
}