Applied formatting

This commit is contained in:
Jan Bulthuis 2024-07-19 14:00:55 +02:00
parent e1b1e7cc38
commit 16de891fc7
69 changed files with 997 additions and 635 deletions

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.base; cfg = config.modules.base;
in { in
{
options.modules.base = { options.modules.base = {
enable = mkEnableOption "base"; enable = mkEnableOption "base";
}; };

View File

@ -1,14 +1,18 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.clean-tmp; cfg = config.modules.clean-tmp;
in { in
{
options.modules.clean-tmp = { options.modules.clean-tmp = {
enable = mkEnableOption "clean-tmp"; enable = mkEnableOption "clean-tmp";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable { boot.tmp.cleanOnBoot = true; };
boot.tmp.cleanOnBoot = true;
};
} }

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.silent-boot; cfg = config.modules.silent-boot;
in { in
{
options.modules.silent-boot = { options.modules.silent-boot = {
enable = mkEnableOption "silent-boot"; enable = mkEnableOption "silent-boot";
}; };

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.systemd-boot; cfg = config.modules.systemd-boot;
in { in
{
options.modules.systemd-boot = { options.modules.systemd-boot = {
enable = mkEnableOption "systemd-boot"; enable = mkEnableOption "systemd-boot";
}; };

View File

@ -1,16 +1,18 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.brightnessctl; cfg = config.modules.brightnessctl;
in { in
{
options.modules.brightnessctl = { options.modules.brightnessctl = {
enable = mkEnableOption "brightnessctl"; enable = mkEnableOption "brightnessctl";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable { environment.systemPackages = [ pkgs.brightnessctl ]; };
environment.systemPackages = [
pkgs.brightnessctl
];
};
} }

View File

@ -1,6 +1,12 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; { with lib;
{
imports = [ imports = [
# Import modules # Import modules
./base/default.nix ./base/default.nix

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.fontconfig; cfg = config.modules.fontconfig;
in { in
{
options.modules.fontconfig = { options.modules.fontconfig = {
enable = mkEnableOption "fontconfig"; enable = mkEnableOption "fontconfig";
}; };

View File

@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
{ {
config = { config = {

View File

@ -1,9 +1,15 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.greetd; cfg = config.modules.greetd;
in { in
{
options.modules.greetd = { options.modules.greetd = {
enable = mkEnableOption "greetd"; enable = mkEnableOption "greetd";
command = mkOption { command = mkOption {

View File

@ -1,9 +1,15 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.tuigreet; cfg = config.modules.tuigreet;
in { in
{
options.modules.tuigreet = { options.modules.tuigreet = {
enable = mkEnableOption "tuigreet"; enable = mkEnableOption "tuigreet";
greeting = mkOption { greeting = mkOption {

View File

@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
{ {
config = { config = {

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.neovim; cfg = config.modules.neovim;
in { in
{
options.modules.neovim = { options.modules.neovim = {
enable = mkEnableOption "neovim"; enable = mkEnableOption "neovim";
}; };

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.pipewire; cfg = config.modules.pipewire;
in { in
{
options.modules.pipewire = { options.modules.pipewire = {
enable = mkEnableOption "pipewire"; enable = mkEnableOption "pipewire";
}; };

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.unfree; cfg = config.modules.unfree;
in { in
{
options.modules.unfree = { options.modules.unfree = {
enable = mkEnableOption "unfree"; enable = mkEnableOption "unfree";
allowedPackages = mkOption { allowedPackages = mkOption {

View File

@ -1,19 +1,24 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
# Nixvim # Nixvim
nixvim = import (builtins.fetchGit { nixvim = import (builtins.fetchGit { url = "https://github.com/nix-community/nixvim"; });
url = "https://github.com/nix-community/nixvim";
});
# Stylix # Stylix
stylix = import (pkgs.fetchFromGitHub { stylix = import (
pkgs.fetchFromGitHub {
owner = "danth"; owner = "danth";
repo = "stylix"; repo = "stylix";
rev = "1ff9d37d27377bfe8994c24a8d6c6c1734ffa116"; rev = "1ff9d37d27377bfe8994c24a8d6c6c1734ffa116";
sha256 = "0dz8h1ga8lnfvvmvsf6iqvnbvxrvx3qxi0y8s8b72066mqgvy8y5"; sha256 = "0dz8h1ga8lnfvvmvsf6iqvnbvxrvx3qxi0y8s8b72066mqgvy8y5";
}); }
);
# User configuration # User configuration
userModule = types.submodule { userModule = types.submodule {
@ -36,7 +41,8 @@ let
}; };
}; };
}; };
in { in
{
imports = [ imports = [
# Import home manager # Import home manager
<home-manager/nixos> <home-manager/nixos>

View File

@ -1,4 +1,9 @@
{ input, pkgs, config, ... }: {
input,
pkgs,
config,
...
}:
{ {
imports = [ imports = [

View File

@ -1,11 +1,17 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.waybar; cfg = config.modules.waybar;
theme = config.theming; theme = config.theming;
colors = theme.colors; colors = theme.colors;
in { in
{
options.modules.waybar = { options.modules.waybar = {
enable = mkEnableOption "waybar"; enable = mkEnableOption "waybar";
}; };
@ -22,9 +28,7 @@ in {
mainBar = { mainBar = {
layer = "top"; layer = "top";
spacing = 16; spacing = 16;
modules-left = [ modules-left = [ "river/tags" ];
"river/tags"
];
modules-center = [ modules-center = [
#"river/window" #"river/window"
"mpris" "mpris"
@ -61,14 +65,30 @@ in {
#default = [ "" "" ]; #default = [ "" "" ];
headphone = ""; headphone = "";
headphone-muted = ""; headphone-muted = "";
default = [ "" "" "" ]; default = [
""
""
""
];
}; };
}; };
battery = { battery = {
format = "{icon}{capacity}%"; # Spacing achieved using "Thin Space" format = "{icon}{capacity}%"; # Spacing achieved using "Thin Space"
format-charging = "{capacity}%"; # Spacing achieved using "Thin Space" format-charging = "{capacity}%"; # Spacing achieved using "Thin Space"
#format-icons = [ "󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ]; #format-icons = [ "󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ];
format-icons = [ "" "" "" "" "" "" "" "" "" "" "" ]; format-icons = [
""
""
""
""
""
""
""
""
""
""
""
];
interval = 1; interval = 1;
}; };
clock = { clock = {

View File

@ -1,9 +1,15 @@
{ lib, pkgs, config, ... }: {
lib,
pkgs,
config,
...
}:
with lib; with lib;
let let
cfg = config.modules.desktop; cfg = config.modules.desktop;
in { in
{
imports = [ imports = [
# Import desktop environment modules # Import desktop environment modules
./bar/waybar.nix ./bar/waybar.nix
@ -21,18 +27,23 @@ in {
}; };
config = { config = {
home.packages = optionals cfg.wayland (with pkgs; [ home.packages = optionals cfg.wayland (
with pkgs;
[
pkgs.wl-clipboard pkgs.wl-clipboard
pkgs.wtype pkgs.wtype
]); ]
);
home.file.".initrc" = { home.file.".initrc" = {
enable = true; enable = true;
executable = true; executable = true;
text = '' text =
''
#!${pkgs.bash}/bin/bash #!${pkgs.bash}/bin/bash
'' + cfg.initScript; ''
+ cfg.initScript;
}; };
}; };
} }

View File

@ -1,16 +1,20 @@
{ lib, pkgs, config, ... }: {
lib,
pkgs,
config,
...
}:
with lib; with lib;
let let
cfg = config.modules.waylock; cfg = config.modules.waylock;
in { in
{
options.modules.waylock = { options.modules.waylock = {
enable = mkEnableOption "waylock"; enable = mkEnableOption "waylock";
}; };
config = { config = {
home.packages = mkIf cfg.enable (with pkgs; [ home.packages = mkIf cfg.enable (with pkgs; [ waylock ]);
waylock
]);
}; };
} }

View File

@ -1,8 +1,14 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.modules.river; cfg = config.modules.river;
in { in
{
options.modules.river.enable = lib.mkEnableOption "river"; options.modules.river.enable = lib.mkEnableOption "river";
# osConfig = lib.mkIf cfg.enable { # osConfig = lib.mkIf cfg.enable {
@ -40,20 +46,31 @@ in {
enable = true; enable = true;
systemd.enable = false; systemd.enable = false;
xwayland.enable = true; xwayland.enable = true;
settings = let settings =
let
layout = "rivertile"; layout = "rivertile";
layoutOptions = "-outer-padding ${toString config.theming.layout.windowPadding} -view-padding ${toString config.theming.layout.windowPadding}"; layoutOptions = "-outer-padding ${toString config.theming.layout.windowPadding} -view-padding ${toString config.theming.layout.windowPadding}";
modes = ["normal" "locked"]; modes = [
tags = [1 2 3 4 5 6 7 8 9]; "normal"
"locked"
];
tags = [
1
2
3
4
5
6
7
8
9
];
waylockOptions = "-init-color 0x${colors.bg} -input-color 0x${colors.focused} -fail-color 0x${colors.bg}"; waylockOptions = "-init-color 0x${colors.bg} -input-color 0x${colors.focused} -fail-color 0x${colors.bg}";
colors = config.theming.colors; colors = config.theming.colors;
# Quick pow function # Quick pow function
pow2 = power: pow2 = power: if power != 0 then 2 * (pow2 (power - 1)) else 1;
if power != 0
then 2 * (pow2 (power - 1))
else 1;
# Modifiers # Modifiers
main = "Super"; main = "Super";
@ -63,7 +80,8 @@ in {
scm = "Super+Control"; scm = "Super+Control";
scam = "Super+Control+Alt"; scam = "Super+Control+Alt";
ssc = "Super+Shift+Control"; ssc = "Super+Shift+Control";
in { in
{
default-layout = "${layout}"; default-layout = "${layout}";
set-repeat = "50 300"; set-repeat = "50 300";
xcursor-theme = "BreezeX-RosePine-Linux 24"; xcursor-theme = "BreezeX-RosePine-Linux 24";
@ -79,8 +97,11 @@ in {
"\"${layout} ${layoutOptions}\"" "\"${layout} ${layoutOptions}\""
"waybar" "waybar"
]; ];
map = (lib.attrsets.recursiveUpdate ({ map = (
normal = { lib.attrsets.recursiveUpdate
({
normal =
{
"${main} Q" = "close"; "${main} Q" = "close";
"${ssm} E" = "exit"; "${ssm} E" = "exit";
@ -138,13 +159,33 @@ in {
# Toggle modes # Toggle modes
"${main} Space" = "toggle-float"; "${main} Space" = "toggle-float";
"${main} F" = "toggle-fullscreen"; "${main} F" = "toggle-fullscreen";
} // builtins.listToAttrs (builtins.concatLists (map (tag: [ }
{ name = "${main} ${toString tag}"; value = "set-focused-tags ${toString (pow2 (tag - 1))}"; } // builtins.listToAttrs (
{ name = "${ssm} ${toString tag}"; value = "set-view-tags ${toString (pow2 (tag - 1))}"; } builtins.concatLists (
{ name = "${scm} ${toString tag}"; value = "toggle-focused-tags ${toString (pow2 (tag - 1))}"; } map (tag: [
{ name = "${ssc} ${toString tag}"; value = "toggle-view-tags ${toString (pow2 (tag - 1))}"; } {
]) tags)); name = "${main} ${toString tag}";
}) (builtins.listToAttrs (map (mode: { value = "set-focused-tags ${toString (pow2 (tag - 1))}";
}
{
name = "${ssm} ${toString tag}";
value = "set-view-tags ${toString (pow2 (tag - 1))}";
}
{
name = "${scm} ${toString tag}";
value = "toggle-focused-tags ${toString (pow2 (tag - 1))}";
}
{
name = "${ssc} ${toString tag}";
value = "toggle-view-tags ${toString (pow2 (tag - 1))}";
}
]) tags
)
);
})
(
builtins.listToAttrs (
map (mode: {
name = "${mode}"; name = "${mode}";
value = { value = {
# Control volume # Control volume
@ -161,7 +202,10 @@ in {
"None XF86Go" = "spawn \"playerctl play-pause\""; "None XF86Go" = "spawn \"playerctl play-pause\"";
"None Cancel" = "spawn \"playerctl next\""; "None Cancel" = "spawn \"playerctl next\"";
}; };
}) modes))); }) modes
)
)
);
map-pointer = { map-pointer = {
normal = { normal = {
"${main} BTN_LEFT" = "move-view"; "${main} BTN_LEFT" = "move-view";

View File

@ -1,9 +1,15 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.discord; cfg = config.modules.discord;
in { in
{
options.modules.discord = { options.modules.discord = {
enable = mkEnableOption "discord"; enable = mkEnableOption "discord";
}; };
@ -11,8 +17,6 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
modules.unfree.allowedPackages = [ "discord" ]; modules.unfree.allowedPackages = [ "discord" ];
home.packages = with pkgs; [ home.packages = with pkgs; [ discord ];
discord
];
}; };
} }

View File

@ -1,14 +1,16 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.feishin; cfg = config.modules.feishin;
in { in
{
options.modules.feishin.enable = mkEnableOption "feishin"; options.modules.feishin.enable = mkEnableOption "feishin";
config = mkIf cfg.enable { config = mkIf cfg.enable { home.packages = with pkgs; [ feishin ]; };
home.packages = with pkgs; [
feishin
];
};
} }

View File

@ -1,8 +1,14 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.modules.firefox; cfg = config.modules.firefox;
in { in
{
options.modules.firefox.enable = lib.mkEnableOption "firefox"; options.modules.firefox.enable = lib.mkEnableOption "firefox";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
@ -32,7 +38,9 @@ in {
DisableTelemetry = true; DisableTelemetry = true;
DisplayBookmarksToolbar = "never"; DisplayBookmarksToolbar = "never";
DisplayMenuBar = "never"; DisplayMenuBar = "never";
DNSOverHTTPS = { Enabled = false; }; DNSOverHTTPS = {
Enabled = false;
};
DontCheckDefaultBrowser = true; DontCheckDefaultBrowser = true;
PasswordManagerEnabled = false; PasswordManagerEnabled = false;
TranslateEnabled = true; TranslateEnabled = true;
@ -42,9 +50,7 @@ in {
profiles.nixos = { profiles.nixos = {
search.default = "DuckDuckGo"; search.default = "DuckDuckGo";
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ extensions = with pkgs.nur.repos.rycee.firefox-addons; [ ublock-origin ];
ublock-origin
];
settings = { settings = {
"browser.tabs.inTitlebar" = 0; "browser.tabs.inTitlebar" = 0;

View File

@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
@ -15,8 +20,11 @@ let
</alias> </alias>
''; '';
configContent = concatStrings (map (font: aliasConfig config.theming.fonts.pkgs.${font}) config.theming.fonts.installed); configContent = concatStrings (
in { map (font: aliasConfig config.theming.fonts.pkgs.${font}) config.theming.fonts.installed
);
in
{
options.modules.fontconfig = { options.modules.fontconfig = {
enable = mkEnableOption "fontconfig"; enable = mkEnableOption "fontconfig";
}; };
@ -26,18 +34,10 @@ in {
enable = true; enable = true;
defaultFonts = { defaultFonts = {
serif = [ serif = [ config.theming.fonts.serif.name ];
config.theming.fonts.serif.name sansSerif = [ config.theming.fonts.sansSerif.name ];
]; monospace = [ config.theming.fonts.monospace.name ];
sansSerif = [ emoji = [ config.theming.fonts.emoji.name ];
config.theming.fonts.sansSerif.name
];
monospace = [
config.theming.fonts.monospace.name
];
emoji = [
config.theming.fonts.emoji.name
];
}; };
}; };

View File

@ -1,19 +1,27 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.foot; cfg = config.modules.foot;
in { in
{
options.modules.foot.enable = mkEnableOption "foot"; options.modules.foot.enable = mkEnableOption "foot";
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.foot = { programs.foot = {
enable = true; enable = true;
settings = { settings = {
main = let main =
let
font = config.theming.fonts.monospace.name; font = config.theming.fonts.monospace.name;
size = toString config.theming.fonts.monospace.recommendedSize; size = toString config.theming.fonts.monospace.recommendedSize;
in { in
{
font = mkForce "${font}:style=Regular:size=${size}"; font = mkForce "${font}:style=Regular:size=${size}";
font-bold = "${font}:style=Bold:size=${size}"; font-bold = "${font}:style=Bold:size=${size}";
font-italic = "${font}:style=Italic:size=${size}"; font-italic = "${font}:style=Italic:size=${size}";

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.nix; cfg = config.modules.nix;
in { in
{
options.modules.nix = { options.modules.nix = {
enable = mkEnableOption "nix"; enable = mkEnableOption "nix";
}; };
@ -18,9 +24,7 @@ in {
# VSCode configuration # VSCode configuration
programs.vscode = { programs.vscode = {
extensions = with pkgs.vscode-extensions; [ extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
jnoortheen.nix-ide
];
userSettings = { userSettings = {
"[nix]" = { "[nix]" = {

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.rust; cfg = config.modules.rust;
in { in
{
options.modules.rust = { options.modules.rust = {
enable = mkEnableOption "rust"; enable = mkEnableOption "rust";
}; };
@ -19,13 +25,10 @@ in {
# VSCode configuration # VSCode configuration
programs.vscode = { programs.vscode = {
extensions = with pkgs.vscode-extensions; [ extensions = with pkgs.vscode-extensions; [ rust-lang.rust-analyzer ];
rust-lang.rust-analyzer
];
userSettings = { userSettings = {
"[rust]" = { "[rust]" = { };
};
}; };
}; };

View File

@ -1,11 +1,17 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.mako; cfg = config.modules.mako;
theme = config.theming; theme = config.theming;
colors = theme.colors; colors = theme.colors;
in { in
{
options.modules.mako.enable = mkEnableOption "mako"; options.modules.mako.enable = mkEnableOption "mako";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View File

@ -1,11 +1,17 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.neovim; cfg = config.modules.neovim;
theme = config.theming; theme = config.theming;
colors = theme.colors; colors = theme.colors;
in { in
{
options.modules.neovim = { options.modules.neovim = {
enable = mkEnableOption "neovim"; enable = mkEnableOption "neovim";
}; };
@ -17,8 +23,7 @@ in {
viAlias = true; viAlias = true;
vimAlias = true; vimAlias = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [ ];
];
opts = { opts = {
number = true; number = true;

View File

@ -1,16 +1,18 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.obsidian; cfg = config.modules.obsidian;
in { in
{
options.modules.obsidian = { options.modules.obsidian = {
enable = mkEnableOption "obsidian"; enable = mkEnableOption "obsidian";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable { home.packages = with pkgs; [ obsidian ]; };
home.packages = with pkgs; [
obsidian
];
};
} }

View File

@ -1,10 +1,16 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.qutebrowser; cfg = config.modules.qutebrowser;
theme = config.theming; theme = config.theming;
in { in
{
options.modules.qutebrowser.enable = mkEnableOption "qutebrowser"; options.modules.qutebrowser.enable = mkEnableOption "qutebrowser";
config = mkIf cfg.enable { config = mkIf cfg.enable {

View File

@ -1,11 +1,17 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.rofi; cfg = config.modules.rofi;
theme = config.theming; theme = config.theming;
colors = theme.colors; colors = theme.colors;
in { in
{
options.modules.rofi.enable = mkEnableOption "rofi"; options.modules.rofi.enable = mkEnableOption "rofi";
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -13,9 +19,11 @@ in {
enable = true; enable = true;
package = pkgs.rofi-wayland; package = pkgs.rofi-wayland;
font = "${theme.fonts.monospace.name} ${toString theme.fonts.monospace.recommendedSize}"; font = "${theme.fonts.monospace.name} ${toString theme.fonts.monospace.recommendedSize}";
theme = let theme =
let
inherit (config.lib.formats.rasi) mkLiteral; inherit (config.lib.formats.rasi) mkLiteral;
in { in
{
"*" = { "*" = {
background-color = mkLiteral "rgba(0, 0, 0, 0%)"; background-color = mkLiteral "rgba(0, 0, 0, 0%)";
border-color = mkLiteral "#${colors.fg}"; border-color = mkLiteral "#${colors.fg}";

View File

@ -1,17 +1,21 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.rofi-rbw; cfg = config.modules.rofi-rbw;
in { in
{
options.modules.rofi-rbw.enable = mkEnableOption "rofi-rbw"; options.modules.rofi-rbw.enable = mkEnableOption "rofi-rbw";
config = mkIf cfg.enable { config = mkIf cfg.enable {
modules.rofi.enable = true; modules.rofi.enable = true;
home.packages = [ home.packages = [ pkgs.rofi-rbw ];
pkgs.rofi-rbw
];
# TODO: Move to separate module and make configurable # TODO: Move to separate module and make configurable
programs.rbw = { programs.rbw = {

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.bash; cfg = config.modules.bash;
in { in
{
options.modules.bash = { options.modules.bash = {
enable = mkEnableOption "bash"; enable = mkEnableOption "bash";
}; };

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.fish; cfg = config.modules.fish;
in { in
{
options.modules.fish = { options.modules.fish = {
enable = mkEnableOption "fish"; enable = mkEnableOption "fish";
@ -31,9 +37,18 @@ in {
enable = true; enable = true;
plugins = [ plugins = [
(mkIf cfg.plugins.done { name = "done"; src = pkgs.fishPlugins.done.src; }) (mkIf cfg.plugins.done {
(mkIf cfg.plugins.fzf { name = "fzf"; src = pkgs.fishPlugins.fzf-fish.src; }) name = "done";
(mkIf cfg.plugins.grc { name = "grc"; src = pkgs.fishPlugins.grc.src; }) src = pkgs.fishPlugins.done.src;
})
(mkIf cfg.plugins.fzf {
name = "fzf";
src = pkgs.fishPlugins.fzf-fish.src;
})
(mkIf cfg.plugins.grc {
name = "grc";
src = pkgs.fishPlugins.grc.src;
})
]; ];
}; };

View File

@ -1,6 +1,12 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; { with lib;
{
options.modules.steam = { options.modules.steam = {
enable = mkEnableOption "steam"; enable = mkEnableOption "steam";
}; };

View File

@ -1,10 +1,14 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
enabled = any (user: user.modules.river.enable) (attrValues config.home-manager.users); enabled = any (user: user.modules.river.enable) (attrValues config.home-manager.users);
in { in
config = mkIf enabled { {
programs.river.enable = true; config = mkIf enabled { programs.river.enable = true; };
};
} }

View File

@ -1,10 +1,14 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
enabled = any (user: user.modules.steam.enable) (attrValues config.home-manager.users); enabled = any (user: user.modules.steam.enable) (attrValues config.home-manager.users);
in { in
config = mkIf enabled { {
programs.steam.enable = true; config = mkIf enabled { programs.steam.enable = true; };
};
} }

View File

@ -1,10 +1,14 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
enabled = any (user: user.modules.waylock.enable) (attrValues config.home-manager.users); enabled = any (user: user.modules.waylock.enable) (attrValues config.home-manager.users);
in { in
config = mkIf enabled { {
security.pam.services.waylock = {}; config = mkIf enabled { security.pam.services.waylock = { }; };
};
} }

View File

@ -1,4 +1,9 @@
{ pkgs, lib, config, ... }: {
pkgs,
lib,
config,
...
}:
with lib; with lib;
let let
@ -63,25 +68,35 @@ let
] ++ map (font: font.name) cfg.fonts.extraFonts; ] ++ map (font: font.name) cfg.fonts.extraFonts;
# Flatten dependencies of fonts # Flatten dependencies of fonts
fontPackages = converge (fonts: fontPackages =
listToAttrs (map (font: { converge
(
fonts:
listToAttrs (
map
(font: {
name = font; name = font;
value = true; value = true;
}) ( })
flatten (map (font: (
[ font.name ] flatten (map (font: [ font.name ] ++ cfg.fonts.pkgs.${font.name}.fallbackFonts) (attrsToList fonts))
++ cfg.fonts.pkgs.${font.name}.fallbackFonts )
) (attrsToList fonts)) )
)) )
) (listToAttrs (map (font: { (
listToAttrs (
map (font: {
name = font; name = font;
value = true; value = true;
}) enabledFonts)); }) enabledFonts
)
);
# Convert set of fonts to list of packages # Convert set of fonts to list of packages
fontNameList = map (font: font.name) (attrsToList fontPackages); fontNameList = map (font: font.name) (attrsToList fontPackages);
fontPackageList = map (font: cfg.fonts.pkgs.${font}.package) fontNameList; fontPackageList = map (font: cfg.fonts.pkgs.${font}.package) fontNameList;
in { in
{
imports = [ imports = [
# Import all themes # Import all themes
./themes/gruvbox.nix ./themes/gruvbox.nix
@ -90,7 +105,11 @@ in {
options.modules.theming.enable = mkEnableOption "theming"; options.modules.theming.enable = mkEnableOption "theming";
options.theming = let colors = config.theming.schemeColors; in { options.theming =
let
colors = config.theming.schemeColors;
in
{
darkMode = mkOption { darkMode = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;
@ -166,10 +185,12 @@ in {
fonts = { fonts = {
pkgs = mkOption { pkgs = mkOption {
type = types.attrsOf fontModule; type = types.attrsOf fontModule;
default = builtins.listToAttrs (map (module: { default = builtins.listToAttrs (
map (module: {
name = module.name; name = module.name;
value = module; value = module;
}) (map (module: (import module) { inherit lib config pkgs; }) fontModules)); }) (map (module: (import module) { inherit lib config pkgs; }) fontModules)
);
description = "All available font modules."; description = "All available font modules.";
}; };
@ -229,7 +250,8 @@ in {
}; };
# Configure gtk theme # Configure gtk theme
gtk = let gtk =
let
disableCSD = '' disableCSD = ''
headerbar.default-decoration { headerbar.default-decoration {
margin-bottom: 50px; margin-bottom: 50px;
@ -241,7 +263,8 @@ in {
box-shadow: none; box-shadow: none;
} }
''; '';
in { in
{
enable = true; enable = true;
theme = { theme = {
@ -289,10 +312,22 @@ in {
polarity = if cfg.darkMode then "dark" else "light"; polarity = if cfg.darkMode then "dark" else "light";
fonts = { fonts = {
serif = getAttrs [ "name" "package" ] cfg.fonts.serif; serif = getAttrs [
sansSerif = getAttrs [ "name" "package" ] cfg.fonts.sansSerif; "name"
monospace = getAttrs [ "name" "package" ] cfg.fonts.monospace; "package"
emoji = getAttrs [ "name" "package" ] cfg.fonts.emoji; ] cfg.fonts.serif;
sansSerif = getAttrs [
"name"
"package"
] cfg.fonts.sansSerif;
monospace = getAttrs [
"name"
"package"
] cfg.fonts.monospace;
emoji = getAttrs [
"name"
"package"
] cfg.fonts.emoji;
sizes = { sizes = {
applications = mkDefault cfg.fonts.serif.recommendedSize; applications = mkDefault cfg.fonts.serif.recommendedSize;

View File

@ -4,6 +4,5 @@
name = "Cozette Vector"; name = "Cozette Vector";
package = pkgs.cozette; package = pkgs.cozette;
recommendedSize = 9; recommendedSize = 9;
fallbackFonts = [ fallbackFonts = [ ];
];
} }

View File

@ -4,7 +4,5 @@
name = "Cozette"; name = "Cozette";
package = pkgs.cozette; package = pkgs.cozette;
recommendedSize = 9; recommendedSize = 9;
fallbackFonts = [ fallbackFonts = [ "Cozette Vector" ];
"Cozette Vector"
];
} }

View File

@ -4,7 +4,5 @@
name = "Fira Code"; name = "Fira Code";
package = pkgs.fira-code; package = pkgs.fira-code;
recommendedSize = 12; recommendedSize = 12;
fallbackFonts = [ fallbackFonts = [ "Symbols Nerd Font Mono" ];
"Symbols Nerd Font Mono"
];
} }

View File

@ -1,14 +1,25 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.theming.themes.catppuccin; cfg = config.theming.themes.catppuccin;
in { in
{
options = { options = {
theming.themes.catppuccin = { theming.themes.catppuccin = {
enable = mkEnableOption "catppuccin"; enable = mkEnableOption "catppuccin";
flavor = mkOption { flavor = mkOption {
type = types.enum [ "latte" "frappe" "macchiato" "mocha" ]; type = types.enum [
"latte"
"frappe"
"macchiato"
"mocha"
];
default = "mocha"; default = "mocha";
description = "The flavor of catppuccin theme."; description = "The flavor of catppuccin theme.";
}; };

View File

@ -1,16 +1,26 @@
{ config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.theming.themes.gruvbox; cfg = config.theming.themes.gruvbox;
mode = if cfg.darkMode then "dark" else "light"; mode = if cfg.darkMode then "dark" else "light";
in { in
{
options = { options = {
theming.themes.gruvbox = { theming.themes.gruvbox = {
enable = mkEnableOption "gruvbox-hard"; enable = mkEnableOption "gruvbox-hard";
darkMode = mkEnableOption "dark mode"; darkMode = mkEnableOption "dark mode";
contrast = mkOption { contrast = mkOption {
type = types.enum [ "hard" "medium" "soft" ]; type = types.enum [
"hard"
"medium"
"soft"
];
default = "hard"; default = "hard";
description = "The contrast level of the theme."; description = "The contrast level of the theme.";
}; };

View File

@ -1,10 +1,16 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.vscode; cfg = config.modules.vscode;
theme = config.theming; theme = config.theming;
in { in
{
options.modules.vscode = { options.modules.vscode = {
enable = mkEnableOption "vscode"; enable = mkEnableOption "vscode";
codeFont = mkOption { codeFont = mkOption {
@ -20,17 +26,13 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
modules.unfree.allowedPackages = [ "vscode" ]; modules.unfree.allowedPackages = [ "vscode" ];
theming.fonts.extraFonts = [ theming.fonts.extraFonts = [ cfg.codeFont ];
cfg.codeFont
];
programs.vscode = { programs.vscode = {
enable = true; enable = true;
mutableExtensionsDir = false; mutableExtensionsDir = false;
extensions = with pkgs.vscode-extensions; [ extensions = with pkgs.vscode-extensions; [ eamodio.gitlens ];
eamodio.gitlens
];
userSettings = { userSettings = {
# Font setup # Font setup

View File

@ -1,9 +1,15 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.winbox; cfg = config.modules.winbox;
in { in
{
options.modules.winbox = { options.modules.winbox = {
enable = mkEnableOption "winbox"; enable = mkEnableOption "winbox";
}; };
@ -11,8 +17,6 @@ in {
config = mkIf cfg.enable { config = mkIf cfg.enable {
modules.unfree.allowedPackages = [ "winbox" ]; modules.unfree.allowedPackages = [ "winbox" ];
home.packages = with pkgs; [ home.packages = with pkgs; [ winbox ];
winbox
];
}; };
} }

View File

@ -1,8 +1,14 @@
{config, lib, pkgs, ... }: {
config,
lib,
pkgs,
...
}:
let let
cfg = config.modules.zathura; cfg = config.modules.zathura;
in { in
{
options.modules.zathura.enable = lib.mkEnableOption "zathura"; options.modules.zathura.enable = lib.mkEnableOption "zathura";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.tailscale; cfg = config.modules.tailscale;
in { in
{
options.modules.tailscale = { options.modules.tailscale = {
enable = mkEnableOption "tailscale"; enable = mkEnableOption "tailscale";
}; };

View File

@ -1,9 +1,15 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
let let
cfg = config.modules.wpa_supplicant; cfg = config.modules.wpa_supplicant;
in { in
{
options.modules.wpa_supplicant = { options.modules.wpa_supplicant = {
enable = mkEnableOption "wpa_supplicant"; enable = mkEnableOption "wpa_supplicant";
}; };

View File

@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
with lib; with lib;
# let # let

View File

@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
pkgs.stdenv.mkDerivation rec { pkgs.stdenv.mkDerivation rec {
pname = "wqy-bitmapsong-pcf"; pname = "wqy-bitmapsong-pcf";

View File

@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
pkgs.stdenv.mkDerivation rec { pkgs.stdenv.mkDerivation rec {
pname = "wqy-microhei"; pname = "wqy-microhei";

View File

@ -1,4 +1,9 @@
{ lib, config, pkgs, ... }: {
lib,
config,
pkgs,
...
}:
pkgs.stdenv.mkDerivation rec { pkgs.stdenv.mkDerivation rec {
pname = "wqy-zenhei"; pname = "wqy-zenhei";

View File

@ -39,7 +39,11 @@
}; };
# Theme configuration # Theme configuration
theming = let fontpkgs = config.theming.fonts.pkgs; in { theming =
let
fontpkgs = config.theming.fonts.pkgs;
in
{
# Fonts # Fonts
fonts.serif = fontpkgs."DejaVu Serif"; fonts.serif = fontpkgs."DejaVu Serif";
fonts.sansSerif = fontpkgs."DejaVu Sans"; fonts.sansSerif = fontpkgs."DejaVu Sans";