move options to separate modules, set up mkDocs generation
Build docs with nix and Material for mkDocs / build-docs (push) Successful in 1m33s
Build docs with nix and Material for mkDocs / build-docs (push) Successful in 1m33s
This commit is contained in:
33 files changed
+385
-276
No files matched your search
@@ -0,0 +1,5 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.homeModules.audioOptions = { lib, ...}: {
|
||||
options.features.services.easyeffects.enable = lib.mkEnableOption "easyeffects";
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.gamingOptions = { lib, ... }: {
|
||||
options.features.hardware.steam-controller.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable tweaks and configurations that assist when using Valve's Steam Controller";
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.gamingOptions = { lib, ... }: {
|
||||
options.features.hardware.steam-controller.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = "Enable tweaks and configurations that assist when using Valve's Steam Controller";
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
{ inputs, self, ... }: let
|
||||
mkSharedGlobalOptions = { lib }: {
|
||||
info = {
|
||||
rootPath = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "This option is used to tell the config the global path to the flake's root directory, in order to perform impure actions (in a Nix sense, not morally impure, I promise).";
|
||||
default = "/home/grey/nixos";
|
||||
};
|
||||
|
||||
hostName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "This option is used to tell the config the hostname of the current machine, mostly for symlinking the right dotfiles.";
|
||||
default = "";
|
||||
};
|
||||
|
||||
stateVersion = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "This option is used to set the stateVersion value.";
|
||||
example = "26.11";
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
features = {
|
||||
applications = {
|
||||
cli = {
|
||||
color-converter.enable = lib.mkEnableOption "color-converter";
|
||||
fastfetch.enable = lib.mkEnableOption "fastfetch";
|
||||
nh.enable = lib.mkEnableOption "nh";
|
||||
};
|
||||
|
||||
extraPackages = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.package);
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
shells = {
|
||||
zsh = {
|
||||
enable = lib.mkEnableOption "zsh";
|
||||
antidote.enable = lib.mkEnableOption "antidote";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
mkExtraPackagesDescription = optionName: "This options is equivalent to `${optionName}`, and exists purely for convenience.";
|
||||
in {
|
||||
flake.nixosModules.globalOptions = { lib, ... }: {
|
||||
options = (mkSharedGlobalOptions { inherit lib; }) // {
|
||||
components = {
|
||||
bootLoader = lib.mkOption {
|
||||
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/components/boot-loaders";
|
||||
description = "This option defines the bootloader that should be used, enabling any config associated with it in the process.";
|
||||
default = "grub";
|
||||
};
|
||||
};
|
||||
|
||||
features = (mkSharedGlobalOptions { inherit lib; }).features // {
|
||||
shells = {
|
||||
defaultShell = lib.mkOption {
|
||||
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/features/shells";
|
||||
description = "This option controls the shell that should be used as the default, enabling that shell in the process.";
|
||||
default = "zsh";
|
||||
};
|
||||
} // (mkSharedGlobalOptions { inherit lib; }).features.shells;
|
||||
|
||||
nixos.home-manager.enable = lib.mkEnableOption "home-manager";
|
||||
|
||||
applications = (mkSharedGlobalOptions { inherit lib; }).features.applications // {
|
||||
extraPackages = (mkSharedGlobalOptions { inherit lib; }).features.applications.extraPackages // { description = mkExtraPackagesDescription "environment.systemPackages"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.globalOptions = { lib, ... }: {
|
||||
options = (mkSharedGlobalOptions { inherit lib; }) // {
|
||||
info = {
|
||||
isStandalone = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "This option tells the config whether this home-manager config is part of a larger NixOS config or not, and is read-only.";
|
||||
default = true;
|
||||
readOnly = true;
|
||||
};
|
||||
} // (mkSharedGlobalOptions { inherit lib; }).info;
|
||||
|
||||
features = (mkSharedGlobalOptions { inherit lib; }).features // {
|
||||
applications = (mkSharedGlobalOptions { inherit lib; }).features.applications // {
|
||||
shellScripts = lib.mkOption {
|
||||
type = lib.types.attrsOf (lib.types.str);
|
||||
description = "This option is a set of multiline strings, which are processed into executable bash scripts in `$XDG_BIN_HOME`. The shebang (`#!/bin/bash`) is added afterwards, and shouldn't be included in definitions.";
|
||||
default = {};
|
||||
};
|
||||
|
||||
extraPackages = (mkSharedGlobalOptions { inherit lib; }).features.applications.extraPackages // { description = mkExtraPackagesDescription "home.packages"; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
{ inputs, self, ... }: let
|
||||
mkSharedGraphicsOptions = { pkgs, lib }: {
|
||||
components = {
|
||||
windowManagers = lib.mkOption {
|
||||
type = inputs.helpers.mkOptionalListOfType (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/window-managers");
|
||||
description = "This option defines the window manager(s) that should be installed, enabling any config associated with it in the process. It can be either a list or just one value.";
|
||||
default = [];
|
||||
};
|
||||
|
||||
shells = lib.mkOption {
|
||||
type = inputs.helpers.mkOptionalListOfType (inputs.helpers.mkEnumFromDirContents "${self}/modules/components/shells");
|
||||
description = "This option defines the graphical shell(s) that should be installed (e.g. Noctalia, DMS), enabling any config associated with it in the process. It can be either a list or just one value.";
|
||||
default = [];
|
||||
};
|
||||
};
|
||||
|
||||
features = {
|
||||
applications.gui = {
|
||||
equibop = {
|
||||
enable = lib.mkEnableOption "equibop";
|
||||
autostart = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "This option controls whether an `equibop.desktop` file is generated and placed into `$XDG_CONFIG_HOME/autostart`.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
|
||||
floorp.enable = lib.mkEnableOption "floorp";
|
||||
|
||||
fluxer.enable = lib.mkEnableOption "fluxer";
|
||||
fluxer-canary.enable = lib.mkEnableOption "fluxer-canary";
|
||||
|
||||
kitty.enable = lib.mkEnableOption "kitty";
|
||||
|
||||
nautilus.enable = lib.mkEnableOption "nautilus";
|
||||
|
||||
remmina.enable = lib.mkEnableOption "remmina";
|
||||
|
||||
spotify = {
|
||||
enable = lib.mkEnableOption "spotify";
|
||||
spicetify = {
|
||||
enable = lib.mkEnableOption "spicetify";
|
||||
theme = lib.mkOption {
|
||||
type = lib.types.nullOr (lib.types.enum (builtins.attrNames inputs.spicetify.legacyPackages.${pkgs.stdenv.hostPlatform.system}.themes));
|
||||
description = "This option is used to select a theme for Spicetify to use, from the list of available packages themes.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
vscode.enable = lib.mkEnableOption "vscode";
|
||||
};
|
||||
|
||||
nixos.stylix.enable = lib.mkEnableOption "stylix";
|
||||
};
|
||||
};
|
||||
|
||||
redundantOptionWarn = name: value: "The functionality of this option completely depends on `${name}` being `${value}`, and will not be evaluated otherwise.";
|
||||
in {
|
||||
flake.nixosModules.graphicsOptions = { pkgs, lib, ... }: {
|
||||
options = (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }) // {
|
||||
components = (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }).components // {
|
||||
displayManager = lib.mkOption {
|
||||
type = inputs.helpers.mkEnumFromDirContents "${self}/modules/components/display-managers";
|
||||
description = "This option defines the bootloader that should be used, enabling any config associated with it in the process.";
|
||||
default = "lightdm";
|
||||
};
|
||||
};
|
||||
|
||||
features = (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }).features // {
|
||||
applications.gui = {
|
||||
equibop.enable.description = (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }).features.applications.gui.equibop.enable.description + "\n" + (redundantOptionWarn "features.nixos.home-manager.enable" "true");
|
||||
spotify.spicetify.theme.description = (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }).features.applications.gui.spotify.spicetify.theme.description + "\n" + (redundantOptionWarn "features.nixos.home-manager.enable" "true");
|
||||
} // (mkSharedGraphicsOptions { inherit pkgs; inherit lib; }).features.applications.gui;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
flake.homeModules.graphicsOptions = { pkgs, lib, ... }: {
|
||||
options = mkSharedGraphicsOptions { inherit pkgs; inherit lib; };
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{ inputs, self, ... }: {
|
||||
flake.nixosModules.options = { ... }: {
|
||||
imports = with self.nixosModules; [
|
||||
globalOptions
|
||||
graphicsOptions
|
||||
gamingOptions
|
||||
];
|
||||
};
|
||||
|
||||
flake.homeModules.options = { ... }: {
|
||||
imports = with self.homeModules; [
|
||||
globalOptions
|
||||
audioOptions
|
||||
graphicsOptions
|
||||
gamingOptions
|
||||
];
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user