modules: rename nixosModules.style to nixosModules.theme

This commit is contained in:
Anthony Rodriguez 2024-10-22 13:44:47 +02:00
parent df51d1b29d
commit 2d295004d0
Signed by: nezia
GPG key ID: EE3BE97C040A86CE
11 changed files with 28 additions and 40 deletions

View file

@ -1,4 +1,8 @@
{pkgs, ...}: let {
inputs,
pkgs,
...
}: let
betterfox = pkgs.fetchFromGitHub { betterfox = pkgs.fetchFromGitHub {
owner = "yokoffing"; owner = "yokoffing";
repo = "betterfox"; repo = "betterfox";
@ -56,7 +60,6 @@ in {
profiles = { profiles = {
nezia = { nezia = {
settings = { settings = {
"browser.urlbar.suggest.searches" = true;
"browser.search.suggest.enabled" = true; "browser.search.suggest.enabled" = true;
"ui.key.menuAccessKeyFocuses" = false; "ui.key.menuAccessKeyFocuses" = false;
}; };
@ -68,7 +71,6 @@ in {
stylus stylus
ublock-origin ublock-origin
violentmonkey violentmonkey
idontcareaboutcookies
]; ];
# https://git.jacekpoz.pl/poz/niksos/src/commit/a48647a1c5bc6877a1100a65f4dc169b2fc11ed7/hosts/hape/firefox.nix # https://git.jacekpoz.pl/poz/niksos/src/commit/a48647a1c5bc6877a1100a65f4dc169b2fc11ed7/hosts/hape/firefox.nix

View file

@ -1,6 +1,6 @@
{ {
inputs, inputs,
nixosConfig, osConfig,
lib, lib,
pkgs, pkgs,
... ...
@ -15,7 +15,7 @@
font = "monospace:size=14"; font = "monospace:size=14";
}; };
colors = let colors = let
inherit (inputs.basix.schemeData.base16.${nixosConfig.style.scheme}) palette; inherit (inputs.basix.schemeData.base16.${osConfig.theme.scheme}) palette;
in { in {
background = "${palette.base00}ff"; background = "${palette.base00}ff";
text = "${palette.base05}ff"; text = "${palette.base05}ff";

View file

@ -6,10 +6,10 @@
lib, lib,
... ...
}: let }: let
isDark = inputs.basix.schemeData.base16.${osConfig.style.scheme}.variant == "dark"; isDark = inputs.basix.schemeData.base16.${osConfig.theme.scheme}.variant == "dark";
in { in {
home.pointerCursor = { home.pointerCursor = {
inherit (osConfig.style.cursorTheme) name package size; inherit (osConfig.theme.cursorTheme) name package size;
gtk.enable = true; gtk.enable = true;
x11.enable = true; x11.enable = true;
}; };
@ -35,11 +35,11 @@ in {
gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc";
iconTheme = { iconTheme = {
inherit (osConfig.style.gtk.iconTheme) name package; inherit (osConfig.theme.gtk.iconTheme) name package;
}; };
theme = lib.mkIf (!osConfig.services.xserver.desktopManager.gnome.enable) { theme = lib.mkIf (!osConfig.services.xserver.desktopManager.gnome.enable) {
inherit (osConfig.style.gtk.theme) name package; inherit (osConfig.theme.gtk.theme) name package;
}; };
}; };
dconf.settings = { dconf.settings = {

View file

@ -6,7 +6,7 @@
osConfig, osConfig,
... ...
}: let }: let
colors = inputs.basix.schemeData.base16.${osConfig.style.scheme}.palette; colors = inputs.basix.schemeData.base16.${osConfig.theme.scheme}.palette;
in { in {
imports = [./binds.nix]; imports = [./binds.nix];

View file

@ -2,7 +2,7 @@
{ {
pkgs, pkgs,
lib, lib,
nixosConfig, osConfig,
... ...
}: { }: {
systemd.user.services.swaybg = { systemd.user.services.swaybg = {
@ -11,7 +11,7 @@
PartOf = ["graphical-session.target"]; PartOf = ["graphical-session.target"];
}; };
Service = { Service = {
ExecStart = "${lib.getExe pkgs.swaybg} -i ${nixosConfig.style.wallpaper} -m fill"; ExecStart = "${lib.getExe pkgs.swaybg} -i ${osConfig.theme.wallpaper} -m fill";
Restart = "on-failure"; Restart = "on-failure";
}; };
Install.WantedBy = ["graphical-session.target"]; Install.WantedBy = ["graphical-session.target"];

View file

@ -1,10 +1,10 @@
{ {
inputs, inputs,
pkgs, pkgs,
nixosConfig, osConfig,
... ...
}: let }: let
inherit (inputs.basix.schemeData.base16.${nixosConfig.style.scheme}) palette; inherit (inputs.basix.schemeData.base16.${osConfig.theme.scheme}) palette;
in { in {
# requires `security.pam.services.swaylock = { };` at the system level or else # requires `security.pam.services.swaylock = { };` at the system level or else
# unlock will not work. # unlock will not work.

View file

@ -1,6 +1,6 @@
{ {
inputs, inputs,
nixosConfig, osConfig,
config, config,
lib, lib,
... ...
@ -14,7 +14,7 @@
shell = "${lib.getExe config.programs.fish.package}"; shell = "${lib.getExe config.programs.fish.package}";
}; };
colors = let colors = let
schemeData = inputs.basix.schemeData.base16.${nixosConfig.style.scheme}; schemeData = inputs.basix.schemeData.base16.${osConfig.theme.scheme};
in { in {
background = schemeData.palette.base00; background = schemeData.palette.base00;
foreground = schemeData.palette.base05; foreground = schemeData.palette.base05;

View file

@ -14,19 +14,7 @@ in {
modules = [ modules = [
./vamos ./vamos
self.nixosModules.style self.nixosModules.theme
({pkgs, ...}: {
style = let
wallpaper = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true";
hash = "sha256-/HAtpGwLxjNfJvX5/4YZfM8jPNStaM3gisK8+ImRmQ4=";
};
in {
gtk.enable = true;
inherit wallpaper;
};
})
inputs.nixos-hardware.nixosModules.framework-13-7040-amd inputs.nixos-hardware.nixosModules.framework-13-7040-amd
]; ];
@ -38,12 +26,6 @@ in {
modules = [ modules = [
./solaire ./solaire
self.nixosModules.style self.nixosModules.style
{
style = {
gtk.enable = false;
wallpaper = ../wallpapers/lucy-edgerunners-wallpaper.jpg;
};
}
]; ];
}; };
} }

View file

@ -1,3 +1,3 @@
{ {
style = import ./style; theme = import ./theme;
} }

View file

@ -7,7 +7,7 @@
inherit (lib.types) string path package; inherit (lib.types) string path package;
in { in {
imports = [./gtk.nix]; imports = [./gtk.nix];
options.style = { options.theme = {
scheme = mkOption { scheme = mkOption {
description = '' description = ''
Name of the tinted-scheming color scheme to use. Name of the tinted-scheming color scheme to use.
@ -22,6 +22,10 @@ in {
''; '';
type = path; type = path;
example = lib.literalExpression "./wallpaper.png"; example = lib.literalExpression "./wallpaper.png";
default = pkgs.fetchurl {
url = "https://raw.githubusercontent.com/NixOS/nixos-artwork/e0cf0eb237dc5baba86661a3572b20a6183c1876/wallpapers/nix-wallpaper-nineish-catppuccin-frappe.png?raw=true";
hash = "sha256-/HAtpGwLxjNfJvX5/4YZfM8jPNStaM3gisK8+ImRmQ4=";
};
}; };
cursorTheme = { cursorTheme = {

View file

@ -8,9 +8,9 @@
inherit (lib) mkOption mkEnableOption; inherit (lib) mkOption mkEnableOption;
inherit (lib.types) package str; inherit (lib.types) package str;
cfg = config.style.gtk; cfg = config.theme.gtk;
in { in {
options.style.gtk = { options.theme.gtk = {
enable = mkEnableOption "enable GTK theming options"; enable = mkEnableOption "enable GTK theming options";
theme = { theme = {
name = mkOption { name = mkOption {
@ -57,7 +57,7 @@ in {
${toString themePath} set by the GTK module does not exist! ${toString themePath} set by the GTK module does not exist!
To suppress this message, make sure that To suppress this message, make sure that
`config.modules.style.gtk.theme.package` contains `config.modules.theme.gtk.theme.package` contains
the path `${cfg.theme.name}` the path `${cfg.theme.name}`
''; '';
}) })