feat(nixos:appearance): move appearance options to nixos

This commit is contained in:
ooks-io 2024-08-05 17:29:53 +12:00
parent cedeb52103
commit ceb66c03cf
51 changed files with 393 additions and 377 deletions

8
flake.lock generated
View file

@ -1769,11 +1769,11 @@
"systems": "systems_11"
},
"locked": {
"lastModified": 1722223311,
"narHash": "sha256-C6Jp8Y/qOo4t8j9tZG8Znnvhhp2k7wbNwknVV5A6yjE=",
"lastModified": 1722678438,
"narHash": "sha256-7egl3tmEWz40S31MKI8FTgoUQQLWPJ7OIBEUN0YU7JA=",
"ref": "refs/heads/master",
"rev": "aeba1bfbb4f93bfb2bdc22aca13fbebc3d104f6d",
"revCount": 18,
"rev": "d78920d714ebd5518ca385a96abbb1239725b728",
"revCount": 19,
"type": "git",
"url": "ssh://git@github.com/ooks-io/ooks-vim"
},

View file

@ -1,18 +1,7 @@
{
lib,
config,
...
}: let
inherit (lib) mkIf;
cfg = config.ooknet.cursor;
in {
config = mkIf cfg.enable {
home.pointerCursor = {
package = cfg.package;
name = cfg.name;
size = cfg.size;
gtk.enable = true;
x11.enable = true;
};
{osConfig, ...}: {
home.pointerCursor = {
inherit (osConfig.ooknet.appearance.cursor) package name size;
gtk.enable = true;
x11.enable = true;
};
}

View file

@ -4,6 +4,5 @@
./cursor.nix
./gtk.nix
./qt.nix
./wallpaper.nix
];
}

View file

@ -1,21 +1,17 @@
{
lib,
config,
osConfig,
pkgs,
...
}: let
inherit (lib) mkIf;
cfg = config.ooknet.fonts;
inherit (osConfig.ooknet.appearance.fonts) monospace regular;
in {
config = mkIf cfg.enable {
fonts.fontconfig.enable = true;
home.packages = [
cfg.monospace.package
cfg.regular.package
fonts.fontconfig.enable = true;
home.packages = [
monospace.package
regular.package
pkgs.noto-fonts
pkgs.noto-fonts-cjk
pkgs.noto-fonts-emoji
];
};
pkgs.noto-fonts
pkgs.noto-fonts-cjk
pkgs.noto-fonts-emoji
];
}

View file

@ -1,12 +1,12 @@
{
config,
osConfig,
pkgs,
inputs,
lib,
...
}: let
inherit (inputs.nix-colors.lib-contrib {inherit pkgs;}) gtkThemeFromScheme;
inherit (lib) mkIf;
inherit (osConfig.ooknet.appearance.colorscheme) palette;
cfg = config.ooknet.gtk;
in {
config = mkIf cfg.enable rec {
@ -17,8 +17,8 @@ in {
size = 12;
};
theme = {
name = config.colorscheme.slug;
package = gtkThemeFromScheme {scheme = config.colorscheme;};
name = "adw-gtk3";
package = pkgs.adw-gtk3;
};
iconTheme = {
name = "Papirus-Dark";
@ -26,6 +26,8 @@ in {
};
};
#TODO: add gtk css configuration
services.xsettingsd = {
enable = true;
settings = {

View file

@ -1,29 +0,0 @@
{
lib,
config,
inputs,
pkgs,
osConfig,
...
}: let
inherit (inputs.nix-colors.lib-contrib {inherit pkgs;}) nixWallpaperFromScheme;
inherit (lib) mkDefault mkIf;
monitors = osConfig.ooknet.host.hardware.monitors;
cfg = config.ooknet.wallpaper;
in {
config = mkIf cfg.enable {
ooknet.wallpaper.path = let
largest = f: xs: builtins.head (builtins.sort (a: b: a > b) (map f xs));
largestWidth = largest (x: x.width) monitors;
largestHeight = largest (x: x.height) monitors;
in
mkDefault (nixWallpaperFromScheme
{
scheme = config.colorscheme;
width = largestWidth;
height = largestHeight;
logoScale = 4;
});
};
}

View file

@ -1,14 +1,15 @@
{
inputs,
config,
osConfig,
pkgs,
lib,
...
}: let
inherit (config) colorscheme;
inherit (osConfig.ooknet.appearance) colorscheme;
inherit (config.ooknet) console;
inherit (lib) mkIf;
cfg = config.ooknet.editor.helix;
console = config.ooknet.console;
in {
imports = [
./languages.nix
@ -37,7 +38,7 @@ in {
];
});
settings = {
theme = colorscheme.slug;
theme = "base16_transparent";
editor = {
color-modes = true;
middle-click-paste = false;
@ -66,7 +67,6 @@ in {
W = ":set whitespace.render none";
};
};
themes = import ./theme.nix {inherit colorscheme;};
};
};
}

View file

@ -1,140 +0,0 @@
{colorscheme}: {
"${colorscheme.slug}" = {
palette = builtins.mapAttrs (_name: value: "#${value}") colorscheme.colors; # Add leading '#'
"attributes" = "base09";
"comment" = {
fg = "base03";
modifiers = ["italic"];
};
"constant" = "base09";
"constant.character.escape" = "base0C";
"constant.numeric" = "base09";
"constructor" = "base0D";
"debug" = "base03";
"diagnostic" = {modifiers = ["underlined"];};
"diagnostic.error" = {underline = {style = "curl";};};
"diagnostic.hint" = {underline = {style = "curl";};};
"diagnostic.info" = {underline = {style = "curl";};};
"diagnostic.warning" = {underline = {style = "curl";};};
"diff.delta" = "base09";
"diff.minus" = "base08";
"diff.plus" = "base0B";
"error" = "base08";
"function" = "base0D";
"hint" = "base03";
"info" = "base0D";
"keyword" = "base0E";
"label" = "base0E";
"markup.bold" = {
fg = "base0A";
modifiers = ["bold"];
};
"markup.heading" = "base0D";
"markup.italic" = {
fg = "base0E";
modifiers = ["italic"];
};
"markup.link.text" = "base08";
"markup.link.url" = {
fg = "base09";
modifiers = ["underlined"];
};
"markup.list" = "base08";
"markup.quote" = "base0C";
"markup.raw" = "base0B";
"markup.strikethrough" = {modifiers = ["crossed_out"];};
"namespace" = "base0E";
"operator" = "base05";
"special" = "base0D";
"string" = "base0B";
"type" = "base0A";
"ui.background" = {bg = "base00";};
"ui.bufferline" = {
fg = "base04";
bg = "base00";
};
"ui.bufferline.active" = {
fg = "base00";
bg = "base03";
modifiers = ["bold"];
};
"ui.cursor" = {
fg = "base04";
modifiers = ["reversed"];
};
"ui.cursor.insert" = {
fg = "base0A";
modifiers = ["underlined"];
};
"ui.cursor.match" = {
fg = "base0A";
modifiers = ["underlined"];
};
"ui.cursor.select" = {
fg = "base0A";
modifiers = ["underlined"];
};
"ui.cursorline.primary" = {
fg = "base05";
bg = "base01";
};
"ui.gutter" = {bg = "base00";};
"ui.help" = {
fg = "base06";
bg = "base01";
};
"ui.linenr" = {
fg = "base03";
bg = "base00";
};
"ui.linenr.selected" = {
fg = "base04";
bg = "base01";
modifiers = ["bold"];
};
"ui.menu" = {
fg = "base05";
bg = "base01";
};
"ui.menu.scroll" = {
fg = "base03";
bg = "base01";
};
"ui.menu.selected" = {
fg = "base01";
bg = "base04";
};
"ui.popup" = {bg = "base01";};
"ui.selection" = {bg = "base02";};
"ui.selection.primary" = {bg = "base02";};
"ui.statusline" = {
fg = "base0B";
bg = "base02";
};
"ui.statusline.inactive" = {
bg = "base01";
fg = "base02";
};
"ui.statusline.insert" = {
fg = "base00";
bg = "base0B";
};
"ui.statusline.normal" = {
fg = "base00";
bg = "base04";
};
"ui.statusline.select" = {
fg = "base00";
bg = "base0E";
};
"ui.text" = "base05";
"ui.text.focus" = "base05";
"ui.virtual.indent-guide" = {fg = "base03";};
"ui.virtual.ruler" = {bg = "base01";};
"ui.virtual.whitespace" = {fg = "base01";};
"ui.window" = {bg = "base01";};
"variable" = "base08";
"variable.other.member" = "base08";
"warning" = "base09";
};
}

View file

@ -1,13 +1,14 @@
{
config,
osConfig,
lib,
pkgs,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance.colorscheme) palette;
inherit (config.ooknet) console;
inherit (lib) mkIf;
cfg = config.ooknet.multiplexer.tmux;
console = config.ooknet.console;
in {
config = mkIf (cfg.enable || console.multiplexer == "tmux") {
programs.tmux = {

View file

@ -5,23 +5,23 @@
pkgs,
...
}: let
inherit (config.colorscheme) palette;
inherit (lib) mkIf;
inherit (osConfig.ooknet.appearance.colorscheme) slug palette;
inherit (config.ooknet) console;
inherit (osConfig.ooknet.host) admin;
inherit (lib) mkIf;
cfg = config.ooknet.multiplexer.zellij;
in {
config = mkIf (cfg.enable || console.multiplexer == "zellij") {
programs.zellij = {
enable = true;
settings = {
theme = "${config.colorscheme.slug}";
theme = "${slug}";
default_shell = "${admin.shell}";
default_layout = "default";
pane_frames = false;
scrollback_editor = "${console.editor}";
themes = {
"${config.colorscheme.slug}" = {
"${slug}" = {
fg = "#${palette.base05}";
bg = "#${palette.base00}";
black = "#${palette.base00}";
@ -41,11 +41,11 @@ in {
# Layouts
xdg.configFile = {
# Default layout
"zellij/layouts/default.kdl" = import ./layouts/defaultLayout.nix {inherit pkgs config;};
"zellij/layouts/default.kdl" = import ./layouts/defaultLayout.nix {inherit pkgs config osConfig;};
# Layout for bash scripts
"zellij/layouts/script.kdl" = import ./layouts/scriptLayout.nix {inherit pkgs config;};
"zellij/layouts/script.kdl" = import ./layouts/scriptLayout.nix {inherit pkgs config osConfig;};
# Layout for configuring my flake
"zellij/layouts/flake.kdl" = import ./layouts/flakeLayout.nix {inherit pkgs config;};
"zellij/layouts/flake.kdl" = import ./layouts/flakeLayout.nix {inherit pkgs config osConfig;};
# Additional keybinds
"zellij/config.kdl".text =
# kdl

View file

@ -1,14 +1,13 @@
{
pkgs,
osConfig,
config,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance.colorscheme) palette;
in {
text =
/*
kdl
*/
# kdl
''
layout {
default_tab_template {
@ -51,7 +50,7 @@ in {
datetime "#[fg=#${palette.base05},bold] {format} "
datetime_format "%I:%M %p"
datetime_timezone "${config.home.sessionVariables.TZ}"
datetime_timezone "${osConfig.time.timeZone}"
}
}
children

View file

@ -1,9 +1,9 @@
{
pkgs,
config,
osConfig,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance.colorscheme) palette;
in {
text =
/*
@ -51,7 +51,7 @@ in {
datetime "#[fg=#${palette.base05},bold] {format} "
datetime_format "%I:%M %p"
datetime_timezone "${config.home.sessionVariables.TZ}"
datetime_timezone "${osConfig.time.timeZone}"
}
}
children

View file

@ -1,9 +1,9 @@
{
pkgs,
config,
osConfig,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance.colorscheme) palette;
in {
text =
/*
@ -51,7 +51,7 @@ in {
datetime "#[fg=#${palette.base05},bold] {format} "
datetime_format "%I:%M %p"
datetime_timezone "${config.home.sessionVariables.TZ}"
datetime_timezone "${osConfig.time.timeZone}"
}
}
children

View file

@ -7,13 +7,13 @@
...
}: let
inherit (lib) mkIf mkMerge;
fonts = config.ooknet.fonts;
palette = config.colorscheme.palette;
inherit (osConfig.ooknet.host) admin;
inherit (osConfig.ooknet.appearance) colorscheme fonts;
inherit (colorscheme) palette;
inherit (config.ooknet.desktop) browser;
addons = inputs.firefox-addons.packages.${pkgs.system};
cfg = config.ooknet.browser.firefox;
browser = config.ooknet.desktop.browser;
admin = osConfig.ooknet.host.admin;
firefoxMime = {
"text/html" = ["firefox.desktop"];
"x-scheme-handler/http" = ["firefox.desktop"];

View file

@ -2,7 +2,9 @@
palette,
fonts,
...
}: ''
}:
# css
''
/* minimal firefox css ooks */
/* ===== Color Variables and Root Styles ===== */
@ -106,8 +108,7 @@
}
/* Expand navigation bar on focus */
#nav-bar:focus-within,
#nav-bar:hover {
#nav-bar:focus-within {
opacity: 1;
max-height: 40px !important;
height: 60px !important;

View file

@ -1,14 +1,14 @@
{
lib,
config,
osConfig,
...
}: let
inherit (lib) mkIf;
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance) colorscheme fonts;
inherit (colorscheme) palette;
inherit (config.ooknet.desktop) browser;
cfg = config.ooknet.browser.firefox;
browser = config.ooknet.desktop.browser;
fonts = config.ooknet.fonts;
in {
config = mkIf (browser == "firefox" || cfg.enable) {
xdg.configFile = {

View file

@ -1,18 +1,17 @@
{
config,
osConfig,
lib,
pkgs,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance) colorscheme fonts;
inherit (colorscheme) palette;
inherit (config.ooknet.desktop) discord;
inherit (lib) mkIf mkMerge;
cfg = config.ooknet.communication.discord;
discord = config.ooknet.desktop.discord;
fonts = config.ooknet.fonts;
vesktopMime = {
"x-scheme-handler/discord" = ["vesktop.desktop"];
};
vesktopMime = {"x-scheme-handler/discord" = ["vesktop.desktop"];};
in {
config = mkMerge [
(mkIf (cfg.enable || discord == "vesktop") {

View file

@ -5,13 +5,13 @@
lib,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance.colorscheme) palette;
inherit (osConfig.networking) hostName;
inherit (config.ooknet.multiplexer) zellij;
inherit (config.ooknet.console) multiplexer;
inherit (config.ooknet) binds;
inherit (lib) mkIf getExe;
cfg = config.ooknet.media.music.tui;
zellij = config.ooknet.multiplexer.zellij;
multiplexer = config.ooknet.console.multiplexer;
hostName = osConfig.networking.hostName;
in {
config = mkIf cfg.enable {
home.packages = with pkgs; [
@ -22,7 +22,7 @@ in {
];
ooknet.binds.spotify = {
launch = "${config.ooknet.binds.terminalLaunch} spotify_player";
launch = "${binds.terminalLaunch} spotify_player";
next = "spotify_player playback next";
previous = "spotify_player playback previous";
play = "spotify_player playback play-pause";

View file

@ -1,15 +1,16 @@
{
lib,
config,
osConfig,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance.colorscheme) palette;
inherit (osConfig.ooknet.appearance) fonts;
inherit (config.ooknet.desktop) pdf;
inherit (lib) mkIf;
zathura = {"application/pdf" = ["org.pwmt.zathura.desktop"];};
cfg = config.ooknet.productivity.pdf.zathura;
pdf = config.ooknet.desktop.pdf;
fonts = config.ooknet.fonts;
in {
config = mkIf (cfg.enable || pdf == "zathura") {
programs.zathura = {

View file

@ -1,13 +1,14 @@
{
config,
osConfig,
lib,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance) colorscheme fonts;
inherit (colorscheme) palette;
inherit (config.ooknet) desktop;
inherit (lib) mkMerge mkIf;
fonts = config.ooknet.fonts;
cfg = config.ooknet.terminal.foot;
desktop = config.ooknet.desktop;
in {
config = mkMerge [
(mkIf (cfg.enable || desktop.terminal == "foot") {

View file

@ -5,11 +5,12 @@
...
}: let
inherit (lib) mkIf;
inherit (config.colorscheme) palette;
fonts = config.ooknet.fonts;
inherit (osConfig.ooknet.appearance) colorscheme fonts;
inherit (colorscheme) palette;
inherit (config.ooknet) host desktop;
inherit (desktop) terminal;
inherit (host.admin) shell;
cfg = config.ooknet.terminal.kitty;
terminal = config.ooknet.desktop.terminal;
shell = osConfig.ooknet.host.admin.shell;
in {
config = mkIf (cfg.enable || terminal == "kitty") {
home.sessionVariables = mkIf (terminal == "kitty") {

View file

@ -5,11 +5,13 @@
osConfig,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance) colorscheme fonts;
inherit (colorscheme) palette;
inherit (osConfig.ooknet.host.hardware) monitors;
inherit (config.ooknet) wayland;
inherit (lib) mkIf head;
fonts = config.ooknet.fonts;
wayland = config.ooknet.wayland;
monitors = osConfig.ooknet.host.hardware.monitors;
monitorWidth = (head monitors).width - 20;
in {
config = mkIf (wayland.bar == "waybar") {

View file

@ -1,11 +1,12 @@
{
config,
osConfig,
lib,
...
}: let
wayland = config.ooknet.wayland;
pointer = config.home.pointerCursor;
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance) colorscheme cursor;
inherit (colorscheme) palette;
inherit (config.ooknet) wayland;
inherit (lib) mkIf;
in {
config = mkIf (wayland.compositor == "hyprland") {
@ -23,7 +24,7 @@ in {
};
exec-once = [
"hyprctl setcursor ${pointer.name} ${toString pointer.size}"
"hyprctl setcursor ${cursor.name} ${toString cursor.size}"
];
decoration = {

View file

@ -1,11 +1,12 @@
{
lib,
config,
osConfig,
...
}: let
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
wallpaperPath = config.ooknet.wallpaper.path;
inherit (config.ooknet) wayland;
wallpaperPath = osConfig.ooknet.appearance.wallpaper.path;
in {
config = mkIf (wayland.compositor == "hyprland") {
services.hyprpaper = {

View file

@ -1,12 +1,15 @@
{
lib,
config,
osConfig,
pkgs,
...
}: let
inherit (lib) mkIf;
fonts = config.ooknet.fonts;
wayland = config.ooknet.wayland;
inherit (osConfig.ooknet.appearance) colorscheme fonts;
inherit (colorscheme) palette;
inherit (config.ooknet) wayland;
inherit (config.lib.formats.rasi) mkLiteral;
in {
config = mkIf (wayland.launcher == "rofi") {
programs.rofi = {
@ -14,10 +17,7 @@ in {
font = "${fonts.monospace.family}";
package = pkgs.rofi-wayland;
terminal = "${config.home.sessionVariables.TERMINAL}";
theme = let
inherit (config.colorscheme) palette;
inherit (config.lib.formats.rasi) mkLiteral;
in {
theme = {
"*" = {
background = mkLiteral "#${palette.base00}";
foreground = mkLiteral "#${palette.base05}";

View file

@ -1,13 +1,14 @@
{
lib,
config,
osConfig,
pkgs,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance) colorscheme fonts;
inherit (colorscheme) palette;
inherit (config.ooknet) wayland;
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
fonts = config.ooknet.fonts;
in {
config = mkIf (wayland.launcher == "tofi") {
home.packages = [pkgs.tofi];

View file

@ -1,12 +1,13 @@
{
lib,
config,
osConfig,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance) colorscheme fonts;
inherit (colorscheme) palette;
inherit (config.ooknet) wayland;
inherit (lib) mkIf;
wayland = config.ooknet.wayland;
fonts = config.ooknet.fonts;
in {
config = mkIf (wayland.locker == "hyprlock") {
ooknet.binds.lock = "hyprlock";

View file

@ -1,20 +1,20 @@
{
config,
osConfig,
lib,
...
}: let
inherit (config.colorscheme) palette;
inherit (osConfig.ooknet.appearance) wallpaper colorscheme fonts;
inherit (colorscheme) palette;
inherit (config.ooknet) wayland;
inherit (lib) mkIf;
fonts = config.ooknet.fonts;
wallpaperPath = config.ooknet.wallpaper.path;
wayland = config.ooknet.wayland;
in {
config = mkIf (wayland.locker == "swaylock") {
ooknet.binds.lock = "swaylock";
programs.swaylock = {
enable = true;
settings = {
image = "${wallpaperPath}";
image = "${wallpaper.path}";
font = fonts.monospace.family;
color = "#${palette.base01}";
ring-color = "#${palette.base02}";

View file

@ -1,20 +1,21 @@
{
config,
osConfig,
lib,
...
}: let
inherit (config.colorscheme) palette variant;
inherit (osConfig.ooknet.appearance) colorscheme fonts;
inherit (colorscheme) palette variant;
inherit (config.ooknet) wayland;
inherit (lib) mkIf;
fonts = config.ooknet.fonts;
wayland = config.ooknet.wayland;
in {
config = mkIf (wayland.notification == "mako") {
services.mako = {
enable = true;
iconPath =
if variant == "dark"
then "${config.gtk.iconTheme.package}/share/icons/Papirus-Dark"
else "${config.gtk.iconTheme.package}/share/icons/Papirus-Light";
#iconPath =
# #if variant == "dark"
# #then "${config.gtk.iconTheme.package}/share/icons/Papirus-Dark"
# #else "${config.gtk.iconTheme.package}/share/icons/Papirus-Light";
font = "${fonts.regular.family} 12";
padding = "10,10";
anchor = "top-right";

View file

@ -1,25 +0,0 @@
{lib, ...}: let
inherit (lib) mkEnableOption mkOption types;
in {
options.ooknet.cursor = {
enable = mkEnableOption "Enable cursor module";
package = mkOption {
type = types.package;
default = null;
description = "Package for cursor";
example = "pkgs.bibata-cursors";
};
name = mkOption {
type = types.str;
default = "";
description = "Name of cursor";
example = "Bibata-Modern-Ice";
};
size = lib.mkOption {
type = types.int;
default = 22;
description = "Size of cursor";
example = "22";
};
};
}

View file

@ -1,10 +1,6 @@
{
imports = [
./cursor.nix
./fonts.nix
./gtk.nix
./qt.nix
./theme.nix
./wallpaper.nix
];
}

View file

@ -1,22 +0,0 @@
{lib, ...}: let
mkFontOption = kind: {
family = lib.mkOption {
type = lib.types.str;
default = "";
description = "Family name for ${kind} font profile";
example = "Fira Code";
};
package = lib.mkOption {
type = lib.types.package;
default = null;
description = "Package for ${kind} font profile";
example = "pkgs.fira-code";
};
};
in {
options.ooknet.fonts = {
enable = lib.mkEnableOption "Whether to enable font profiles";
monospace = mkFontOption "monospace";
regular = mkFontOption "regular";
};
}

View file

@ -1,9 +0,0 @@
{lib, ...}: let
inherit (lib) mkOption;
inherit (lib.types) nullOr enum;
in {
options.ooknet.theme = mkOption {
type = nullOr (enum ["minimal" "phone"]);
default = null;
};
}

View file

@ -1,12 +0,0 @@
{lib, ...}: let
inherit (lib) types mkEnableOption mkOption;
in {
options.ooknet.wallpaper = {
enable = mkEnableOption "";
path = mkOption {
type = types.path;
default = null;
description = "Wallpaper Path";
};
};
}

View file

@ -1,6 +1,5 @@
{
imports = [
./minimal.nix
# ./phone.nix
];
}

View file

@ -5,7 +5,6 @@
inputs,
...
}: let
inherit (inputs.nix-colors) colorSchemes;
inherit (lib) mkIf;
theme = config.ooknet.theme;
in {

View file

@ -8,7 +8,6 @@
in {
config = mkIf (host.admin.name == "ooks" && host.type == "desktop" && host.role == "workstation") {
ooknet = {
theme = "minimal";
desktop = {
environment = "hyprland";
browser = "firefox";

View file

@ -8,7 +8,6 @@
in {
config = mkIf (host.admin.name == "ooks" && host.type == "laptop" && host.role == "workstation") {
ooknet = {
theme = "minimal";
desktop = {
environment = "hyprland";
browser = "firefox";

View file

@ -8,7 +8,6 @@
in {
config = mkIf (host.admin.name == "ooks" && host.type == "micro" && host.role == "workstation") {
ooknet = {
theme = "minimal";
desktop = {
environment = "hyprland";
browser = "firefox";

View file

@ -11,7 +11,7 @@ in {
ooknet.host = {
name = "ooksmicro";
type = "micro";
type = "laptop";
role = "workstation";
profiles = ["console-tools"];
admin = {

View file

@ -5,5 +5,6 @@
./host
./programs
./services
./theme
];
}

View file

@ -0,0 +1,5 @@
{
imports = [
./minimal.nix
];
}

View file

@ -0,0 +1,49 @@
{
pkgs,
config,
}: let
inherit (config.ooknet.host.hardware) monitors;
inherit (config.ooknet.appearance) colorscheme;
largest = f: xs: builtins.head (builtins.sort (a: b: a > b) (map f xs));
largestWidth = largest (x: x.width) monitors;
largestHeight = largest (x: x.height) monitors;
in
{
width ? largestWidth,
height ? largestHeight,
logoScale ? 4,
backgroundColor ? colorscheme.palette.mantle,
logoColor1 ? colorscheme.palette.yellow,
logoColor2 ? colorscheme.palette.green,
}:
pkgs.stdenv.mkDerivation {
name = "generated-nix-wallpaper-${colorscheme.slug}.png";
src = pkgs.writeTextFile {
name = "template.svg";
text = ''
<svg width="${toString width}" height="${
toString height
}" version="1.1" xmlns="http://www.w3.org/2000/svg">
<rect width="${toString width}" height="${
toString height
}" fill="#${backgroundColor}"/>
<svg x="${toString (width / 2 - (logoScale * 50))}" y="${
toString (height / 2 - (logoScale * 50))
}" version="1.1" xmlns="http://www.w3.org/2000/svg">
<g transform="scale(${toString logoScale})">
<g transform="matrix(.19936 0 0 .19936 80.161 27.828)">
<path d="m-53.275 105.84-122.2-211.68 56.157-0.5268 32.624 56.869 32.856-56.565 27.902 0.011 14.291 24.69-46.81 80.49 33.229 57.826zm-142.26 92.748 244.42 0.012-27.622 48.897-65.562-0.1813 32.559 56.737-13.961 24.158-28.528 0.031-46.301-80.784-66.693-0.1359zm-9.3752-169.2-122.22 211.67-28.535-48.37 32.938-56.688-65.415-0.1717-13.942-24.169 14.237-24.721 93.111 0.2937 33.464-57.69z" fill="#${logoColor1}"/>
<path d="m-97.659 193.01 122.22-211.67 28.535 48.37-32.938 56.688 65.415 0.1716 13.941 24.169-14.237 24.721-93.111-0.2937-33.464 57.69zm-9.5985-169.65-244.42-0.012 27.622-48.897 65.562 0.1813-32.559-56.737 13.961-24.158 28.528-0.031 46.301 80.784 66.693 0.1359zm-141.76 93.224 122.2 211.68-56.157 0.5268-32.624-56.869-32.856 56.565-27.902-0.011-14.291-24.69 46.81-80.49-33.229-57.826z" fill="#${logoColor2}" style="isolation:auto;mix-blend-mode:normal"/>
</g>
</g>
</svg>
</svg>
'';
};
buildInputs = [pkgs.inkscape];
unpackPhase = "true";
buildPhase = ''
inkscape --export-type="png" $src -w ${toString width} -h ${toString height} -o wallpaper.png
'';
installPhase = "install -Dm0644 wallpaper.png $out";
}

View file

@ -0,0 +1,41 @@
{
config,
lib,
pkgs,
...
}: let
inherit (lib) mkIf;
inherit (config.ooknet.appearance) theme;
generatedWallpaper = import ./generatedWallpaper.nix {inherit config pkgs;} {};
in {
config = mkIf (theme == "minimal") {
ooknet.appearance = {
fonts = {
monospace = {
family = "JetBrainsMono Nerd Font";
package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];};
};
regular = {
family = "Fira Sans";
package = pkgs.fira;
};
};
cursor = {
name = "Bibata-Modern-Ice";
package = pkgs.bibata-cursors;
size = 22;
};
wallpaper = {
path = "${generatedWallpaper}";
};
colorscheme = {
name = "hozen";
variant = "dark";
};
};
};
}

View file

@ -0,0 +1,30 @@
{
config,
lib,
...
}: let
inherit (lib) mkOption;
inherit (lib.types) str enum attrsOf;
cfg = config.ooknet.colorscheme;
in {
# simple colorscheme module bases on misterio77/nix-colors
options.ooknet.colorscheme = {
name = mkOption {
type = enum ["hozen"];
default = "hozen";
};
variant = mkOption {
type = enum ["dark" "light"];
default = "dark";
};
slug = mkOption {
type = str;
default = "${toString cfg.name-cfg.variant}";
};
palette = {
type = attrsOf str;
default = (import ./palettes/${cfg.slug}.nix).colorscheme.palette;
};
};
}

View file

@ -0,0 +1,77 @@
{
config,
lib,
...
}: let
inherit (lib) isString hasPrefix removePrefix mkOption mkOptionType;
inherit (lib.types) enum str nullOr package path int attrsOf coercedTo;
hexColorType = mkOptionType {
name = "hex-color";
descriptionClass = "noun";
description = "RGB color in hex format";
check = x: isString x && !(hasPrefix "#" x);
};
mkFontOption = {
family = mkOption {
type = str;
default = "";
};
package = mkOption {
type = package;
default = null;
};
};
cfg = config.ooknet.appearance;
in {
imports = [./palettes];
options.ooknet.appearance = {
theme = mkOption {
type = nullOr (enum ["minimal" "phone"]);
default = null;
};
fonts = {
monospace = mkFontOption;
regular = mkFontOption;
};
wallpaper = {
path = mkOption {
type = path;
default = null;
};
};
cursor = {
package = mkOption {
type = package;
default = null;
};
name = mkOption {
type = str;
default = "";
};
size = mkOption {
type = int;
default = 22;
};
};
colorscheme = {
name = mkOption {
type = enum ["hozen"];
default = "hozen";
};
variant = mkOption {
type = enum ["dark" "light"];
default = "dark";
};
slug = mkOption {
type = str;
default = "${toString cfg.colorscheme.name}-${toString cfg.colorscheme.variant}";
};
palette = mkOption {
type = attrsOf (coercedTo str (removePrefix "#") hexColorType);
default = {};
};
};
};
}

View file

@ -0,0 +1,3 @@
{
imports = [./hozen-dark.nix];
}

View file

@ -0,0 +1,57 @@
{
config,
lib,
...
}: let
cfg = config.ooknet.appearance.colorscheme;
inherit (lib) mkIf;
in {
ooknet.appearance.colorscheme = mkIf (cfg.name == "hozen" && cfg.variant == "dark") {
palette = {
crust = "2b2927";
mantle = "33312e";
base = "3f3b37";
surface-0 = "48423c";
surface-1 = "534d46";
surface-2 = "655c53";
overlay-0 = "766b60";
overlay-1 = "9c8c7c";
overlay-2 = "ac9a86";
subtext-0 = "bfaa92";
subtext-1 = "c9b39c";
text = "d2bda7";
red = "cc6666";
dull-red = "b87a7a";
orange = "cc8566";
dull-orange = "b88d7a";
yellow = "ccad66";
dull-yellow = "ada185";
green = "a0cc66";
dull-green = "9db87a";
cyan = "85ad98";
dull-cyan = "92a099";
blue = "7A9EBB";
dull-blue = "8a94a8";
purple = "8166cc";
dull-purple = "998aa8";
base00 = "2b2927";
base01 = "33312e";
base02 = "48423c";
base03 = "534d46";
base04 = "655c53";
base05 = "c9B39C";
base06 = "deccba";
base07 = "e7d9cb";
base08 = "CC6666"; #red
base09 = "C28970"; #orange
base0A = "C2A970"; #yellow
base0B = "ACC270"; #green
base0C = "70C296"; #cyan
base0D = "7A9EB8"; #blue
base0E = "C982B0"; #purple
base0F = "B88D7A"; #dim-orange
};
};
}

View file

@ -1,5 +1,6 @@
{
imports = [
./appearance
./gaming.nix
./host.nix
./programs.nix

View file

@ -8,6 +8,7 @@
in {
config = mkIf (host.type == "desktop" && host.role == "workstation") {
ooknet = {
appearance.theme = "minimal";
services = {
gnomeServices.enable = true;
gvfs.enable = true;

View file

@ -8,6 +8,7 @@
in {
config = mkIf (host.type == "laptop" && host.role == "workstation") {
ooknet = {
appearance.theme = "minimal";
services = {
gnomeServices.enable = true;
gvfs.enable = true;