Rework docs and add streamcontroller
This commit is contained in:
parent
5443370f16
commit
7c70384da2
12 changed files with 156 additions and 112 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -1,456 +0,0 @@
|
|||
diff --git a/src/background/user-storage.ts b/src/background/user-storage.ts
|
||||
index 54612fb3b1f6..298e5032fc94 100644
|
||||
--- a/src/background/user-storage.ts
|
||||
+++ b/src/background/user-storage.ts
|
||||
@@ -5,7 +5,7 @@ import {PromiseBarrier} from '../utils/promise-barrier';
|
||||
import {isURLMatched} from '../utils/url';
|
||||
import {validateSettings} from '../utils/validation';
|
||||
|
||||
-import {readSyncStorage, readLocalStorage, writeSyncStorage, writeLocalStorage, removeSyncStorage, removeLocalStorage} from './utils/extension-api';
|
||||
+import {readManagedStorage, readSyncStorage, readLocalStorage, writeSyncStorage, writeLocalStorage, removeSyncStorage, removeLocalStorage} from './utils/extension-api';
|
||||
import {logWarn} from './utils/log';
|
||||
|
||||
|
||||
@@ -78,12 +78,7 @@ export default class UserStorage {
|
||||
return settings;
|
||||
}
|
||||
|
||||
- private static async loadSettingsFromStorage(): Promise<UserSettings> {
|
||||
- if (UserStorage.loadBarrier) {
|
||||
- return await UserStorage.loadBarrier.entry();
|
||||
- }
|
||||
- UserStorage.loadBarrier = new PromiseBarrier();
|
||||
-
|
||||
+ private static async loadSettingsFromStorageWithoutManaged(): Promise<UserSettings> {
|
||||
let local = await readLocalStorage(DEFAULT_SETTINGS);
|
||||
|
||||
if (local.schemeVersion < 2) {
|
||||
@@ -113,10 +108,8 @@ export default class UserStorage {
|
||||
if (local.syncSettings == null) {
|
||||
local.syncSettings = DEFAULT_SETTINGS.syncSettings;
|
||||
}
|
||||
+
|
||||
if (!local.syncSettings) {
|
||||
- UserStorage.migrateAutomationSettings(local);
|
||||
- UserStorage.fillDefaults(local);
|
||||
- UserStorage.loadBarrier.resolve(local);
|
||||
return local;
|
||||
}
|
||||
|
||||
@@ -126,18 +119,34 @@ export default class UserStorage {
|
||||
local.syncSettings = false;
|
||||
UserStorage.set({syncSettings: false});
|
||||
UserStorage.saveSyncSetting(false);
|
||||
- UserStorage.loadBarrier.resolve(local);
|
||||
return local;
|
||||
}
|
||||
|
||||
const {errors: syncCfgErrors} = validateSettings($sync);
|
||||
syncCfgErrors.forEach((err) => logWarn(err));
|
||||
+ return $sync;
|
||||
+ }
|
||||
+
|
||||
+ private static async loadSettingsFromStorage(): Promise<UserSettings> {
|
||||
+ if (UserStorage.loadBarrier) {
|
||||
+ return await UserStorage.loadBarrier.entry();
|
||||
+ }
|
||||
+ UserStorage.loadBarrier = new PromiseBarrier();
|
||||
|
||||
- UserStorage.migrateAutomationSettings($sync);
|
||||
- UserStorage.fillDefaults($sync);
|
||||
+ let settings = await UserStorage.loadSettingsFromStorageWithoutManaged();
|
||||
|
||||
- UserStorage.loadBarrier.resolve($sync);
|
||||
- return $sync;
|
||||
+ const managed = await readManagedStorage(settings);
|
||||
+ const {errors: managedCfgErrors} = validateSettings(managed);
|
||||
+ if (managedCfgErrors.length === 0) {
|
||||
+ settings = managed;
|
||||
+ } else {
|
||||
+ managedCfgErrors.forEach((err) => logWarn(err));
|
||||
+ }
|
||||
+
|
||||
+ UserStorage.migrateAutomationSettings(settings);
|
||||
+ UserStorage.fillDefaults(settings);
|
||||
+ UserStorage.loadBarrier.resolve(settings);
|
||||
+ return settings;
|
||||
}
|
||||
|
||||
static async saveSettings(): Promise<void> {
|
||||
diff --git a/src/background/utils/extension-api.ts b/src/background/utils/extension-api.ts
|
||||
index 6d18fc0919df..6812ac2e4224 100644
|
||||
--- a/src/background/utils/extension-api.ts
|
||||
+++ b/src/background/utils/extension-api.ts
|
||||
@@ -97,6 +97,19 @@ export async function readLocalStorage<T extends {[key: string]: any}>(defaults:
|
||||
});
|
||||
}
|
||||
|
||||
+export async function readManagedStorage<T extends {[key: string]: any}>(defaults: T): Promise<T> {
|
||||
+ return new Promise<T>((resolve) => {
|
||||
+ chrome.storage.managed.get(defaults, (managed: T) => {
|
||||
+ if (chrome.runtime.lastError) {
|
||||
+ console.error(chrome.runtime.lastError.message);
|
||||
+ resolve(defaults);
|
||||
+ return;
|
||||
+ }
|
||||
+ resolve(managed);
|
||||
+ });
|
||||
+ });
|
||||
+}
|
||||
+
|
||||
function prepareSyncStorage<T extends {[key: string]: any}>(values: T): {[key: string]: any} {
|
||||
for (const key in values) {
|
||||
const value = values[key];
|
||||
diff --git a/src/managed-storage.json b/src/managed-storage.json
|
||||
new file mode 100644
|
||||
index 000000000000..e394d0f1ff60
|
||||
--- /dev/null
|
||||
+++ b/src/managed-storage.json
|
||||
@@ -0,0 +1,304 @@
|
||||
+{
|
||||
+
|
||||
+ "$schema": "http://json-schema.org/draft-07/schema#",
|
||||
+ "type": "object",
|
||||
+ "properties": {
|
||||
+ "schemeVersion": {
|
||||
+ "type": "integer"
|
||||
+ },
|
||||
+ "enabled": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "fetchNews": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "theme": {
|
||||
+ "$ref": "Theme"
|
||||
+ },
|
||||
+ "presets": {
|
||||
+ "type": "array",
|
||||
+ "items": {
|
||||
+ "$ref": "ThemePreset"
|
||||
+ }
|
||||
+ },
|
||||
+ "customThemes": {
|
||||
+ "type": "array",
|
||||
+ "items": {
|
||||
+ "$ref": "CustomSiteConfig"
|
||||
+ }
|
||||
+ },
|
||||
+ "enabledByDefault": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "enabledFor": {
|
||||
+ "type": "array",
|
||||
+ "items": {
|
||||
+ "type": "string",
|
||||
+ "minLength": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "disabledFor": {
|
||||
+ "type": "array",
|
||||
+ "items": {
|
||||
+ "type": "string",
|
||||
+ "minLength": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "changeBrowserTheme": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "syncSettings": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "syncSitesFixes": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "automation": {
|
||||
+ "$ref": "Automation"
|
||||
+ },
|
||||
+ "time": {
|
||||
+ "$ref": "TimeSettings"
|
||||
+ },
|
||||
+ "location": {
|
||||
+ "$ref": "LocationSettings"
|
||||
+ },
|
||||
+ "previewNewDesign": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "previewNewestDesign": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "enableForPDF": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "enableForProtectedPages": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "enableContextMenus": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "detectDarkTheme": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ // Chrome's JSON schema format is weird and doesn't support `definitions` property and thus `#/definitions` references
|
||||
+ // https://datatracker.ietf.org/doc/html/draft-zyp-json-schema-03
|
||||
+ // This "property" mimics it
|
||||
+ "definitions": {
|
||||
+ "type": "object",
|
||||
+ "properties": {
|
||||
+ "Theme": {
|
||||
+ "id": "Theme",
|
||||
+ "type": "object",
|
||||
+ "properties": {
|
||||
+ "mode": {
|
||||
+ "$ref": "FilterMode"
|
||||
+ },
|
||||
+ "brightness": {
|
||||
+ "type": "integer",
|
||||
+ "minimum": 0,
|
||||
+ "maximum": 200
|
||||
+ },
|
||||
+ "contrast": {
|
||||
+ "type": "integer",
|
||||
+ "minimum": 0,
|
||||
+ "maximum": 200
|
||||
+ },
|
||||
+ "grayscale": {
|
||||
+ "type": "integer",
|
||||
+ "minimum": 0,
|
||||
+ "maximum": 100
|
||||
+ },
|
||||
+ "sepia": {
|
||||
+ "type": "integer",
|
||||
+ "minimum": 0,
|
||||
+ "maximum": 100
|
||||
+ },
|
||||
+ "useFont": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "fontFamily": {
|
||||
+ "type": "string",
|
||||
+ "minLength": 1
|
||||
+ },
|
||||
+ "textStroke": {
|
||||
+ "type": "number"
|
||||
+ },
|
||||
+ "engine": {
|
||||
+ "type": "string",
|
||||
+ "enum": [
|
||||
+ "cssFilter",
|
||||
+ "svgFilter",
|
||||
+ "staticTheme",
|
||||
+ "dynamicTheme"
|
||||
+ ]
|
||||
+ },
|
||||
+ "stylesheet": {
|
||||
+ "type": "string"
|
||||
+ },
|
||||
+ "darkSchemeBackgroundColor": {
|
||||
+ "$ref": "HexColor"
|
||||
+ },
|
||||
+ "darkSchemeTextColor": {
|
||||
+ "$ref": "HexColor"
|
||||
+ },
|
||||
+ "lightSchemeBackgroundColor": {
|
||||
+ "$ref": "HexColor"
|
||||
+ },
|
||||
+ "lightSchemeTextColor": {
|
||||
+ "$ref": "HexColor"
|
||||
+ },
|
||||
+ "scrollbarColor": {
|
||||
+ "$ref": "HexColorOrAuto"
|
||||
+ },
|
||||
+ "selectionColor": {
|
||||
+ "$ref": "HexColorOrAuto"
|
||||
+ },
|
||||
+ "styleSystemControls": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "lightColorScheme": {
|
||||
+ "type": "string",
|
||||
+ "minLength": 1
|
||||
+ },
|
||||
+ "darkColorScheme": {
|
||||
+ "type": "string",
|
||||
+ "minLength": 1
|
||||
+ },
|
||||
+ "immediateModify": {
|
||||
+ "type": "boolean"
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ "HexColor": {
|
||||
+ "id": "HexColor",
|
||||
+ "type": "string",
|
||||
+ "pattern": "^[0-9a-f]{6}$"
|
||||
+ },
|
||||
+ "HexColorOrAuto": {
|
||||
+ "id": "HexColorOrAuto",
|
||||
+ "type": "string",
|
||||
+ "pattern": "^([0-9a-f]{6}|auto)$"
|
||||
+ },
|
||||
+ "FilterMode": {
|
||||
+ "id": "FilterMode",
|
||||
+ "type": "integer",
|
||||
+ "enum": [
|
||||
+ 0,
|
||||
+ 1
|
||||
+ ]
|
||||
+ },
|
||||
+ "ThemePreset": {
|
||||
+ "id": "ThemePreset",
|
||||
+ "type": "object",
|
||||
+ "properties": {
|
||||
+ "id": {
|
||||
+ "type": "string",
|
||||
+ "minLength": 1
|
||||
+ },
|
||||
+ "name": {
|
||||
+ "type": "string",
|
||||
+ "minLength": 1
|
||||
+ },
|
||||
+ "urls": {
|
||||
+ "type": "array",
|
||||
+ "items": {
|
||||
+ "type": "string",
|
||||
+ "minLength": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "theme": {
|
||||
+ "$ref": "Theme"
|
||||
+ }
|
||||
+ },
|
||||
+ "required": [
|
||||
+ "id",
|
||||
+ "name",
|
||||
+ "urls",
|
||||
+ "theme"
|
||||
+ ]
|
||||
+ },
|
||||
+ "CustomSiteConfig": {
|
||||
+ "id": "CustomSiteConfig",
|
||||
+ "type": "object",
|
||||
+ "properties": {
|
||||
+ "url": {
|
||||
+ "type": "array",
|
||||
+ "items": {
|
||||
+ "type": "string",
|
||||
+ "minLength": 1
|
||||
+ }
|
||||
+ },
|
||||
+ "theme": {
|
||||
+ "$ref": "Theme"
|
||||
+ },
|
||||
+ "builtin": {
|
||||
+ "type": "boolean"
|
||||
+ }
|
||||
+ },
|
||||
+ "required": [
|
||||
+ "url",
|
||||
+ "theme"
|
||||
+ ]
|
||||
+ },
|
||||
+ "Automation": {
|
||||
+ "id": "Automation",
|
||||
+ "type": "object",
|
||||
+ "properties": {
|
||||
+ "enabled": {
|
||||
+ "type": "boolean"
|
||||
+ },
|
||||
+ "mode": {
|
||||
+ "$ref": "AutomationMode"
|
||||
+ },
|
||||
+ "behavior": {
|
||||
+ "type": "string",
|
||||
+ "enum": [
|
||||
+ "OnOff",
|
||||
+ "Scheme"
|
||||
+ ]
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ "AutomationMode": {
|
||||
+ "id": "AutomationMode",
|
||||
+ "type": "string",
|
||||
+ "enum": [
|
||||
+ "",
|
||||
+ "time",
|
||||
+ "system",
|
||||
+ "location"
|
||||
+ ]
|
||||
+ },
|
||||
+ "TimeSettings": {
|
||||
+ "id": "TimeSettings",
|
||||
+ "type": "object",
|
||||
+ "properties": {
|
||||
+ "activation": {
|
||||
+ "$ref": "Time"
|
||||
+ },
|
||||
+ "deactivation": {
|
||||
+ "$ref": "Time"
|
||||
+ }
|
||||
+ }
|
||||
+ },
|
||||
+ "Time": {
|
||||
+ "id": "Time",
|
||||
+ "type": "string",
|
||||
+ "pattern": "^((0?[0-9])|(1[0-9])|(2[0-3])):([0-5][0-9])$"
|
||||
+ },
|
||||
+ "LocationSettings": {
|
||||
+ "id": "LocationSettings",
|
||||
+ "type": "object",
|
||||
+ "properties": {
|
||||
+ "latitude": {
|
||||
+ "type": "number"
|
||||
+ },
|
||||
+ "longitude": {
|
||||
+ "type": "number"
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/tasks/bundle-manifest.js b/tasks/bundle-manifest.js
|
||||
index ae29531e67b7..f4058a129f52 100644
|
||||
--- a/tasks/bundle-manifest.js
|
||||
+++ b/tasks/bundle-manifest.js
|
||||
@@ -4,6 +4,7 @@ import {PLATFORM} from './platform.js';
|
||||
import * as reload from './reload.js';
|
||||
import {createTask} from './task.js';
|
||||
import {readJSON, writeJSON} from './utils.js';
|
||||
+import {copyFile} from 'node:fs/promises';
|
||||
|
||||
async function patchManifest(platform, debug, watch, test) {
|
||||
const manifest = await readJSON(absolutePath('src/manifest.json'));
|
||||
@@ -16,6 +17,11 @@ async function patchManifest(platform, debug, watch, test) {
|
||||
if (platform === PLATFORM.CHROMIUM_MV3) {
|
||||
patched.browser_action = undefined;
|
||||
}
|
||||
+ if (platform === PLATFORM.CHROMIUM_MV2 || platform === PLATFORM.CHROMIUM_MV3) {
|
||||
+ patched.storage = {
|
||||
+ managed_schema: 'managed-storage.json',
|
||||
+ };
|
||||
+ }
|
||||
if (debug) {
|
||||
patched.version = '1';
|
||||
patched.description = `Debug build, platform: ${platform}, watch: ${watch ? 'yes' : 'no'}.`;
|
||||
@@ -42,6 +48,9 @@ async function manifests({platforms, debug, watch, test}) {
|
||||
const manifest = await patchManifest(platform, debug, watch, test);
|
||||
const destDir = getDestDir({debug, platform});
|
||||
await writeJSON(`${destDir}/manifest.json`, manifest);
|
||||
+ if (platform === PLATFORM.CHROMIUM_MV2 || platform === PLATFORM.CHROMIUM_MV3) {
|
||||
+ await copyFile(absolutePath('src/managed-storage.json'), `${destDir}/managed-storage.json`);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +58,7 @@ const bundleManifestTask = createTask(
|
||||
'bundle-manifest',
|
||||
manifests,
|
||||
).addWatcher(
|
||||
- ['src/manifest*.json'],
|
||||
+ ['src/manifest*.json', 'src/managed-storage.json'],
|
||||
async (changedFiles, _, buildPlatforms) => {
|
||||
const chrome = changedFiles.some((file) => file.endsWith('manifest.json'));
|
||||
const platforms = {};
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# credits to Voronind for darkreader config https://github.com/voronind-com/nix/blob/main/home/program/firefox/default.nix
|
||||
{
|
||||
lib,
|
||||
stable,
|
||||
...
|
||||
}:
|
||||
stable.buildNpmPackage rec {
|
||||
version = "4.9.99";
|
||||
pname = "dark-reader";
|
||||
npmDepsHash = "sha256-m41HkwgbeRRmxJALQFJl/grYjjIqFOc47ltaesob1FA=";
|
||||
env.ESBUILD_BINARY_PATH = lib.getExe stable.esbuild;
|
||||
patches = [./darkeader.patch];
|
||||
src = stable.fetchFromGitHub {
|
||||
hash = "sha256-K375/4qOyE1Tp/T5V5uCGcNd1IVVbT1Pjdnq/8oRHj0=";
|
||||
owner = "darkreader";
|
||||
repo = "darkreader";
|
||||
rev = "v${version}";
|
||||
};
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp build/release/darkreader-firefox.xpi $out/latest.xpi
|
||||
'';
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
# https://github.com/0xc000022070/zen-browser-flake/issues/9#issuecomment-2711057434
|
||||
{inputs, ...}: let
|
||||
mkFirefoxModule = import "${inputs.home-manager.outPath}/modules/programs/firefox/mkFirefoxModule.nix";
|
||||
in {
|
||||
imports = [
|
||||
(mkFirefoxModule {
|
||||
modulePath = [
|
||||
"programs"
|
||||
"zen-browser"
|
||||
];
|
||||
name = "Zen Browser";
|
||||
wrappedPackageName = "zen";
|
||||
unwrappedPackageName = "zen-unwrapped";
|
||||
visible = true;
|
||||
platforms = {
|
||||
linux = {
|
||||
vendorPath = ".zen";
|
||||
configPath = ".zen";
|
||||
};
|
||||
darwin = {
|
||||
configPath = "Library/Application Support/Zen";
|
||||
};
|
||||
};
|
||||
})
|
||||
(mkFirefoxModule {
|
||||
modulePath = [
|
||||
"programs"
|
||||
"librewolf-dashnix"
|
||||
];
|
||||
name = "LibreWolf";
|
||||
description = "LibreWolf is a privacy enhanced Firefox fork.";
|
||||
wrappedPackageName = "librewolf";
|
||||
unwrappedPackageName = "librewolf-unwrapped";
|
||||
|
||||
platforms.linux = {configPath = ".librewolf";};
|
||||
platforms.darwin = {
|
||||
configPath = "Library/Application Support/LibreWolf";
|
||||
};
|
||||
|
||||
enableBookmarks = false;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
./sddm.nix
|
||||
./sops.nix
|
||||
./starship.nix
|
||||
./streamcontroller.nix
|
||||
./stylix.nix
|
||||
./supersonic.nix
|
||||
./sway.nix
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
37
modules/programs/streamcontroller.nix
Normal file
37
modules/programs/streamcontroller.nix
Normal 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;
|
||||
})
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue