config.lib -> lib

This commit is contained in:
EdenQwQ 2025-03-09 23:23:25 +08:00
parent ac0ac31e1e
commit 279cac318b
10 changed files with 15 additions and 21 deletions

View file

@ -1,6 +1,6 @@
{ pkgs, ... }:
{
config.lib.misc.addFlags =
lib.misc.addFlags =
flags: name: pkg:
pkgs.symlinkJoin {
name = "${name}-wrapped";

View file

@ -77,7 +77,7 @@ let
};
in
{
config.lib.colorScheme = {
lib.colorScheme = {
inherit convertColorScheme buildColorScheme buildSpecialisation;
};
}

View file

@ -33,7 +33,7 @@ let
in
with recolorConfig;
{
config.lib.colorScheme.recolorScript = ''
lib.colorScheme.recolorScript = ''
${pythonEnv}/bin/python ${./recolor.py} --src $out/share/icons \
--smooth '${toString smooth}' \
${

View file

@ -56,17 +56,11 @@ in
options.monitors = lib.mkOption {
type = lib.types.attrsOf monitor;
};
options.mainMonitorName = lib.mkOption {
type = lib.types.str;
};
options.otherMonitorsNames = lib.mkOption {
type = lib.types.listOf lib.types.str;
};
config.mainMonitorName =
config.lib.monitors.mainMonitorName =
builtins.attrNames config.monitors
|> builtins.filter (name: config.monitors.${name}.isMain)
|> builtins.head;
config.otherMonitorsNames =
config.lib.monitors.otherMonitorsNames =
builtins.attrNames config.monitors |> builtins.filter (name: !config.monitors.${name}.isMain);
}

View file

@ -49,5 +49,5 @@ let
+ extraConfig;
in
{
config.lib.swhkd = { inherit mkSwhkdrc; };
lib.swhkd = { inherit mkSwhkdrc; };
}

View file

@ -74,7 +74,7 @@ let
};
in
{
config.lib.wallpapers = {
lib.wallpapers = {
inherit
getWallpaper
convertWallpaper

View file

@ -1,6 +1,6 @@
{ config, pkgs, ... }:
{
config.lib.wallpapers.goNord =
lib.wallpapers.goNord =
image:
let
goNordScript =

View file

@ -4,7 +4,7 @@
...
}:
{
config.lib.wallpapers.lutgen =
lib.wallpapers.lutgen =
image:
let
inherit (image) name path live;

View file

@ -105,19 +105,19 @@
};
workspaces = {
"1" = {
open-on-output = config.mainMonitorName;
open-on-output = config.lib.monitors.mainMonitorName;
name = "coding";
};
"2" = {
open-on-output = config.mainMonitorName;
open-on-output = config.lib.monitors.mainMonitorName;
name = "browsing";
};
"3" = {
open-on-output = builtins.head config.otherMonitorsNames;
open-on-output = builtins.head config.lib.monitors.otherMonitorsNames;
name = "reading";
};
"4" = {
open-on-output = config.mainMonitorName;
open-on-output = config.lib.monitors.mainMonitorName;
name = "music";
};
};

View file

@ -159,7 +159,7 @@ in
],
${moduleConfiguration}
},
'') config.otherMonitorsNames
'') config.lib.monitors.otherMonitorsNames
|> builtins.concatStringsSep "\n";
in
# json
@ -169,7 +169,7 @@ in
{
"position": "top",
"layer": "top",
"output": "${config.mainMonitorName}",
"output": "${config.lib.monitors.mainMonitorName}",
"modules-left": [
"niri/workspaces",
"tray",