Rework docs and add streamcontroller

This commit is contained in:
DashieTM 2025-03-15 17:37:06 +01:00
parent 5443370f16
commit 7c70384da2
12 changed files with 156 additions and 112 deletions

View file

@ -21,7 +21,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-conf: |
extra-experimental-features = nix-command flakes
extra-experimental-features = nix-command flakes pipe-operators
- name: Set up cache
uses: DeterminateSystems/magic-nix-cache-action@main

View file

@ -15,7 +15,7 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
extra-conf: |
extra-experimental-features = nix-command flakes
extra-experimental-features = nix-command flakes pipe-operators
- name: Set up cache
uses: DeterminateSystems/magic-nix-cache-action@main
- name: Build ISO
@ -27,4 +27,3 @@ jobs:
uses: softprops/action-gh-release@v1
with:
path: path/

View file

@ -14,15 +14,35 @@
echo "- [${name}](${name}.md)" >> src/SUMMARY.md
'';
system = (build_systems {root = ../example/.;})."example".options;
makeOptionsDocPrograms = name: pkgs.nixosOptionsDoc {options = system.mods.${name};};
makeOptionsDocPrograms = names: pkgs.nixosOptionsDoc {options = lib.attrByPath (lib.splitString "." names) null system.mods;};
conf = makeOptionsDoc system.conf;
paths = builtins.readDir ../modules/programs;
names = lib.lists.remove "default" (
map (name: lib.strings.removeSuffix ".nix" name) (lib.attrsets.mapAttrsToList (name: _: name) paths)
basePath = ../modules/programs;
pathToAttrs = path:
lib.attrsets.mapAttrsToList (
name: meta: {
name = name;
meta = meta;
}
)
(builtins.readDir path);
pathToStrings = path: prefix: let
mapFn = attrs:
if attrs.meta == "directory"
then pathToStrings "${basePath}/${attrs.name}" attrs.name
else if prefix != ""
then "${prefix}.${attrs.name}"
else attrs.name;
in
map
mapFn
(pathToAttrs path);
filteredNames = builtins.filter (names: !(lib.strings.hasInfix "default" names)) (
map (name: lib.strings.removeSuffix ".nix" name) (lib.lists.flatten (pathToStrings basePath ""))
);
mods = map makeOptionsDocPrograms names;
docs = lib.strings.concatLines (map generateDocs (lib.lists.zipLists names mods));
summary = lib.strings.concatStringsSep " " (map summaryAppend names);
deduplicatedNames = map (name: lib.strings.splitString "." name |> lib.lists.unique |> lib.strings.concatStringsSep "." ) filteredNames;
mods = map makeOptionsDocPrograms deduplicatedNames;
docs = lib.strings.concatLines (map generateDocs (lib.lists.zipLists deduplicatedNames mods));
summary = lib.strings.concatStringsSep " " (map summaryAppend deduplicatedNames);
in
pkgs.stdenvNoCC.mkDerivation {
name = "dashNix-book";

View file

@ -35,7 +35,7 @@
./common.nix
./themes
./sync.nix
../modules/programs/browser/foxwrappers.nix
../lib/foxwrappers.nix
]
++ homeMods
++ additionalHomeMods

View file

@ -104,17 +104,6 @@
'';
};
streamdeck = {
enable = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Install streamdeck configuration program.
'';
};
};
kernelOverride = lib.mkOption {
default = null;
type = with lib.types; nullOr package;

View file

@ -39,7 +39,7 @@ in {
(mkExtension "@react-devtools" "https://addons.mozilla.org/firefox/downloads/latest/react-devtools/latest.xpi")
(mkExtension "extension@redux.devtools" "https://addons.mozilla.org/firefox/downloads/latest/reduxdevtools/latest.xpi")
(mkExtension "private-relay@firefox.com" "https://addons.mozilla.org/firefox/downloads/latest/private-relay/latest.xpi")
(mkExtension "addon@darkreader.org" "file://${pkgs.callPackage ./darkreader.nix {inherit lib stable;}}/latest.xpi")
(mkExtension "addon@darkreader.org" "file://${pkgs.callPackage ../../../patches/darkreader.nix {inherit lib stable;}}/latest.xpi")
];
example = [];
type = with lib.types; listOf anything;

View file

@ -34,6 +34,7 @@
./sddm.nix
./sops.nix
./starship.nix
./streamcontroller.nix
./stylix.nix
./supersonic.nix
./sway.nix

View file

@ -13,95 +13,93 @@
then config.mods.homePackages.browser.meta.mainProgram
else config.mods.homePackages.browser.pname;
in {
options.mods = {
hyprland = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enable Hyprland
'';
};
monitor = lib.mkOption {
default = [
# main monitor
"${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
# all others
",highrr,auto,1"
];
example = ["DP-1,3440x1440@180,2560x0,1,vrr,0"];
type = with lib.types; listOf str;
description = ''
The monitor configuration for hyprland.
'';
};
workspace = lib.mkOption {
default = [];
example = ["2,monitor:DP-1, default:true"];
type = with lib.types; listOf str;
description = ''
The workspace configuration for hyprland.
'';
};
noAtomic = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Use tearing
'';
};
extraAutostart = lib.mkOption {
default = [];
example = ["your application"];
type = lib.types.listOf lib.types.str;
description = ''
Extra exec_once.
'';
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured Hyprland config.
'';
};
customConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Custom Hyprland configuration.
Will be merged with default configuration if enabled.
'';
};
plugins = lib.mkOption {
default = [];
example = [];
type = with lib.types; listOf package;
description = ''
Plugins to be added to Hyprland.
'';
};
pluginConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Plugin configuration to be added to Hyprland.
'';
};
hyprspaceEnable = lib.mkOption {
default = false;
type = lib.types.bool;
example = true;
description = ''
Enables Hyprspace plugin for hyprland.
Please note, plugins tend to break VERY often.
'';
};
options.mods.hyprland = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enable Hyprland
'';
};
monitor = lib.mkOption {
default = [
# main monitor
"${config.conf.defaultMonitor},${config.conf.defaultMonitorMode},0x0,${config.conf.defaultMonitorScale}"
# all others
",highrr,auto,1"
];
example = ["DP-1,3440x1440@180,2560x0,1,vrr,0"];
type = with lib.types; listOf str;
description = ''
The monitor configuration for hyprland.
'';
};
workspace = lib.mkOption {
default = [];
example = ["2,monitor:DP-1, default:true"];
type = with lib.types; listOf str;
description = ''
The workspace configuration for hyprland.
'';
};
noAtomic = lib.mkOption {
default = false;
example = true;
type = lib.types.bool;
description = ''
Use tearing
'';
};
extraAutostart = lib.mkOption {
default = [];
example = ["your application"];
type = lib.types.listOf lib.types.str;
description = ''
Extra exec_once.
'';
};
useDefaultConfig = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Use preconfigured Hyprland config.
'';
};
customConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Custom Hyprland configuration.
Will be merged with default configuration if enabled.
'';
};
plugins = lib.mkOption {
default = [];
example = [];
type = with lib.types; listOf package;
description = ''
Plugins to be added to Hyprland.
'';
};
pluginConfig = lib.mkOption {
default = {};
example = {};
type = with lib.types; attrsOf anything;
description = ''
Plugin configuration to be added to Hyprland.
'';
};
hyprspaceEnable = lib.mkOption {
default = false;
type = lib.types.bool;
example = true;
description = ''
Enables Hyprspace plugin for hyprland.
Please note, plugins tend to break VERY often.
'';
};
};

View file

@ -0,0 +1,37 @@
{
lib,
pkgs,
config,
options,
...
}: {
options.mods = {
streamcontroller = {
enable = lib.mkOption {
default = true;
example = false;
type = lib.types.bool;
description = ''
Enables starship prompt
'';
};
configFilePath = lib.mkOption {
default = null;
type = with lib.types; nullOr path;
description = ''
Path to the config json for the streamcontroller.
-> ./something.json
'';
};
};
};
config = lib.mkIf config.mods.streamcontroller.enable (
lib.optionalAttrs (options ? environment.systemPackages) {
programs.streamcontroller.enable = true;
}
// (lib.optionalAttrs (options ? home.file) {
home.file."var/app/com.core447.StreamController/data/pages/defaultpage.json".path = lib.mkIf (!isNull config.mods.streamcontroller.path) config.mods.streamcontroller.path;
})
);
}