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

View file

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

View file

@ -14,15 +14,35 @@
echo "- [${name}](${name}.md)" >> src/SUMMARY.md echo "- [${name}](${name}.md)" >> src/SUMMARY.md
''; '';
system = (build_systems {root = ../example/.;})."example".options; 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; conf = makeOptionsDoc system.conf;
paths = builtins.readDir ../modules/programs; basePath = ../modules/programs;
names = lib.lists.remove "default" ( pathToAttrs = path:
map (name: lib.strings.removeSuffix ".nix" name) (lib.attrsets.mapAttrsToList (name: _: name) paths) 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; deduplicatedNames = map (name: lib.strings.splitString "." name |> lib.lists.unique |> lib.strings.concatStringsSep "." ) filteredNames;
docs = lib.strings.concatLines (map generateDocs (lib.lists.zipLists names mods)); mods = map makeOptionsDocPrograms deduplicatedNames;
summary = lib.strings.concatStringsSep " " (map summaryAppend names); docs = lib.strings.concatLines (map generateDocs (lib.lists.zipLists deduplicatedNames mods));
summary = lib.strings.concatStringsSep " " (map summaryAppend deduplicatedNames);
in in
pkgs.stdenvNoCC.mkDerivation { pkgs.stdenvNoCC.mkDerivation {
name = "dashNix-book"; name = "dashNix-book";

View file

@ -35,7 +35,7 @@
./common.nix ./common.nix
./themes ./themes
./sync.nix ./sync.nix
../modules/programs/browser/foxwrappers.nix ../lib/foxwrappers.nix
] ]
++ homeMods ++ homeMods
++ additionalHomeMods ++ 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 { kernelOverride = lib.mkOption {
default = null; default = null;
type = with lib.types; nullOr package; 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 "@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 "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 "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 = []; example = [];
type = with lib.types; listOf anything; type = with lib.types; listOf anything;

View file

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

View file

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