Moved user modules

This commit is contained in:
Jan-Bulthuis committed 2025-01-24 00:50:13 +01:00
1 parent 9352fa2649
commit 0932432e11
80 files changed
+64 -6

No files matched your search

+2
View File
@@ -82,6 +82,8 @@ in
"nvidia-settings"
];
nix.settings.experimental-features = "nix-command flakes";
networking.useDHCP = true;
nixpkgs.hostPlatform = "x86_64-linux";
# TODO: Move to USB module
# services.gvfs.enable = true;
+3 -3
View File
@@ -56,10 +56,10 @@ in
{
imports = [
# Import home manager
<home-manager/nixos>
# <home-manager/nixos>
# Import system wide configuration required for user modules
./modules/systemwide/default.nix
../../user-modules/systemwide/default.nix
];
options = {
@@ -85,7 +85,7 @@ in
nixvim.homeManagerModules.nixvim
# Modules
./modules/default.nix
../../user-modules/default.nix
# Custom packages
../../pkgs/default.nix
@@ -1,28 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.bluetuith;
in
{
options.modules.bluetuith = {
enable = mkEnableOption "bluetuith";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [ bluetuith ];
# Add nix tree
xdg.desktopEntries.bluetuith = {
exec = "${pkgs.bluetuith}/bin/bluetuith";
name = "Bluetuith";
terminal = true;
type = "Application";
};
};
}
-34
View File
@@ -1,34 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
{
imports = [
./firefox/default.nix
./qutebrowser/default.nix
];
options.default.browser = mkOption {
type = types.str;
default = "";
description = "Default browser";
};
config = {
xdg.mimeApps = {
enable = true;
defaultApplications = {
"text/html" = "${config.default.browser}";
"x-scheme-handler/http" = "${config.default.browser}";
"x-scheme-handler/https" = "${config.default.browser}";
"x-scheme-handler/about" = "${config.default.browser}";
"x-scheme-handler/unknown" = "${config.default.browser}";
};
};
};
}
@@ -1,87 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.firefox;
in
{
options.modules.firefox = {
enable = lib.mkEnableOption "firefox";
default = lib.mkEnableOption "default";
};
config = lib.mkIf cfg.enable {
default.browser = mkIf cfg.default "firefox.desktop";
# Enable NUR
nixpkgs.config.packageOverrides = pkgs: {
# TODO: Pin the version
nur = import (builtins.fetchTarball {
url = "https://github.com/nix-community/NUR/archive/f6b1d11161a18420ae699f3202f6cf113f509e8a.tar.gz";
sha256 = "1yj78q8dgvx94mdhd9dy9p7iwxmfl6rx8h0sypfp2x5wzb1sr2g6";
}) { inherit pkgs; };
};
programs.firefox = {
enable = true;
policies = {
AppAutoUpdate = false;
# BlockAboutAddons = true;
# BlockAboutConfig = true;
# BlockAboutProfiles = true;
DisableAppUpdate = true;
DisableFeedbackCommands = true;
DisableMasterPasswordCreation = true;
DisablePocket = true;
DisableProfileImport = true;
DisableProfileRefresh = true;
DisableSetDesktopBackground = true;
DisableTelemetry = true;
DisplayBookmarksToolbar = "never";
DisplayMenuBar = "never";
DNSOverHTTPS = {
Enabled = false;
};
DontCheckDefaultBrowser = true;
PasswordManagerEnabled = false;
TranslateEnabled = true;
UseSystemPrintDialog = true;
};
profiles.nixos = {
search.default = "DuckDuckGo";
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
# firefox-color
ublock-origin
];
# Theming
userChrome = readFile (
pkgs.substituteAll {
src = ./userChrome.css;
colors = config.theming.colorsCSS;
}
);
settings = {
"browser.tabs.inTitlebar" = 0;
"extensions.autoDisableScopes" = 0;
"devtools.chrome.enabled" = true;
"devtools.debugger.remote-enabled" = true;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
# Force overwriting configuration file
search.force = true;
containersForce = true;
};
};
};
}
@@ -1,73 +0,0 @@
/* Import theme colors */
@colors@
/* Configure titlebar */
#titlebar {
/* Add consistent margins to tab bar */
padding: 0 2px !important;
/* Add emphasized color to background of tab bar */
background-color: var(--nix-color-bg-status) !important;
/* Set correct text color */
color: var(--nix-color-fg) !important;
}
.tab-background:is([selected], [multiselected]) {
/* Set correct background color */
background-color: var(--nix-color-bg) !important;
}
.tab-content {
/* Set correct text color */
color: var(--nix-color-fg) !important;
}
/* Configure navigation bar */
#nav-bar {
/* Set correct background color */
background-color: var(--nix-color-bg) !important;
/* Set correct text color */
color: var(--nix-color-fg) !important;
}
#urlbar {
/* Set correct text color */
color: var(--nix-color-fg) !important;
}
#urlbar[open]>#urlbar-background {
/* Set correct background color when opened */
background-color: var(--nix-color-bg) !important;
/* Use same box-shadow as tabs when opened */
border: none !important;
box-shadow: 0 0 4px rgba(0, 0, 0, .4) !important;
}
#urlbar[focused]:not([suppress-focus-border])>#urlbar-background {
/* Set better outline for focused urlbar */
outline-color: var(--nix-color-border-focused) !important;
outline-width: 1px !important;
outline-offset: 0 !important;
}
#urlbar-background {
/* Set the correct background color */
background-color: var(--nix-color-bg-status) !important;
}
/* Configure popups */
panelview {
/* Set correct background color for popups */
background-color: var(--nix-color-bg) !important;
/* Set correct text color */
color: var(--nix-color-fg) !important;
}
menupopup {
/* Set correct background color for context menus */
--panel-background: var(--nix-color-bg) !important;
}
Whitespace-only changes.
@@ -1,51 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.qutebrowser;
theme = config.theming;
in
{
options.modules.qutebrowser = {
enable = mkEnableOption "qutebrowser";
default = mkEnableOption "default";
};
config = mkIf cfg.enable {
default.browser = mkIf cfg.default "org.qutebrowser.qutebrowser.desktop";
# TODO: Remove once nixpkgs updates
# nixpkgs.config.packageOverrides = pkgs: {
# python3 = pkgs.python3.override {
# packageOverrides = self: super: {
# pykeepass = super.pykeepass.overrideAttrs (attrs: {
# version = "4.1.0.post1";
# src = pkgs.fetchFromGitHub {
# owner = "libkeepass";
# repo = "pykeepass";
# rev = "refs/tags/v4.1.0.post1";
# hash = "sha256-64is/XoRF/kojqd4jQIAQi1od8TRhiv9uR+WNIGvP2A=";
# };
# });
# };
# };
# };
programs.qutebrowser = {
enable = true;
extraConfig = ''
# config.set("completion.web_history.max_items", 30)
config.set("colors.webpage.darkmode.enabled", False)
config.set("colors.webpage.preferred_color_scheme", "${if theme.darkMode then "dark" else "light"}")
config.set("fonts.default_family", "${theme.fonts.monospace.name}")
config.set("fonts.default_size", "${toString theme.fonts.monospace.recommendedSize}pt")
'';
};
};
}
-368
View File
@@ -1,368 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.btop;
colors = config.theming.schemeColors;
in
{
options.modules.btop = {
enable = mkEnableOption "btop";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [ btop ];
xdg.configFile."btop/btop.conf" = {
enable = true;
text = ''
#? Config file for btop v. 1.4.0
#* Name of a btop++/bpytop/bashtop formatted ".theme" file, "Default" and "TTY" for builtin themes.
#* Themes should be placed in "../share/btop/themes" relative to binary or "$HOME/.config/btop/themes"
color_theme = "nixos"
#* If the theme set background should be shown, set to False if you want terminal background transparency.
theme_background = True
#* Sets if 24-bit truecolor should be used, will convert 24-bit colors to 256 color (6x6x6 color cube) if false.
truecolor = True
#* Set to true to force tty mode regardless if a real tty has been detected or not.
#* Will force 16-color mode and TTY theme, set all graph symbols to "tty" and swap out other non tty friendly symbols.
force_tty = False
#* Define presets for the layout of the boxes. Preset 0 is always all boxes shown with default settings. Max 9 presets.
#* Format: "box_name:P:G,box_name:P:G" P=(0 or 1) for alternate positions, G=graph symbol to use for box.
#* Use whitespace " " as separator between different presets.
#* Example: "cpu:0:default,mem:0:tty,proc:1:default cpu:0:braille,proc:0:tty"
presets = "cpu:1:default,proc:0:default cpu:0:default,mem:0:default,net:0:default cpu:0:block,net:0:tty"
#* Set to True to enable "h,j,k,l,g,G" keys for directional control in lists.
#* Conflicting keys for h:"help" and k:"kill" is accessible while holding shift.
vim_keys = False
#* Rounded corners on boxes, is ignored if TTY mode is ON.
rounded_corners = False
#* Default symbols to use for graph creation, "braille", "block" or "tty".
#* "braille" offers the highest resolution but might not be included in all fonts.
#* "block" has half the resolution of braille but uses more common characters.
#* "tty" uses only 3 different symbols but will work with most fonts and should work in a real TTY.
#* Note that "tty" only has half the horizontal resolution of the other two, so will show a shorter historical view.
graph_symbol = "braille"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_cpu = "default"
# Graph symbol to use for graphs in gpu box, "default", "braille", "block" or "tty".
graph_symbol_gpu = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_mem = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_net = "default"
# Graph symbol to use for graphs in cpu box, "default", "braille", "block" or "tty".
graph_symbol_proc = "default"
#* Manually set which boxes to show. Available values are "cpu mem net proc" and "gpu0" through "gpu5", separate values with whitespace.
shown_boxes = "cpu net proc mem"
#* Update time in milliseconds, recommended 2000 ms or above for better sample times for graphs.
update_ms = 500
#* Processes sorting, "pid" "program" "arguments" "threads" "user" "memory" "cpu lazy" "cpu direct",
#* "cpu lazy" sorts top process over time (easier to follow), "cpu direct" updates top process directly.
proc_sorting = "cpu lazy"
#* Reverse sorting order, True or False.
proc_reversed = False
#* Show processes as a tree.
proc_tree = False
#* Use the cpu graph colors in the process list.
proc_colors = True
#* Use a darkening gradient in the process list.
proc_gradient = True
#* If process cpu usage should be of the core it's running on or usage of the total available cpu power.
proc_per_core = False
#* Show process memory as bytes instead of percent.
proc_mem_bytes = True
#* Show cpu graph for each process.
proc_cpu_graphs = True
#* Use /proc/[pid]/smaps for memory information in the process info box (very slow but more accurate)
proc_info_smaps = False
#* Show proc box on left side of screen instead of right.
proc_left = False
#* (Linux) Filter processes tied to the Linux kernel(similar behavior to htop).
proc_filter_kernel = False
#* In tree-view, always accumulate child process resources in the parent process.
proc_aggregate = False
#* Sets the CPU stat shown in upper half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_upper = "Auto"
#* Sets the CPU stat shown in lower half of the CPU graph, "total" is always available.
#* Select from a list of detected attributes from the options menu.
cpu_graph_lower = "Auto"
#* If gpu info should be shown in the cpu box. Available values = "Auto", "On" and "Off".
show_gpu_info = "Auto"
#* Toggles if the lower CPU graph should be inverted.
cpu_invert_lower = True
#* Set to True to completely disable the lower CPU graph.
cpu_single_graph = False
#* Show cpu box at bottom of screen instead of top.
cpu_bottom = False
#* Shows the system uptime in the CPU box.
show_uptime = True
#* Show cpu temperature.
check_temp = True
#* Which sensor to use for cpu temperature, use options menu to select from list of available sensors.
cpu_sensor = "Auto"
#* Show temperatures for cpu cores also if check_temp is True and sensors has been found.
show_coretemp = True
#* Set a custom mapping between core and coretemp, can be needed on certain cpus to get correct temperature for correct core.
#* Use lm-sensors or similar to see which cores are reporting temperatures on your machine.
#* Format "x:y" x=core with wrong temp, y=core with correct temp, use space as separator between multiple entries.
#* Example: "4:0 5:1 6:3"
cpu_core_map = ""
#* Which temperature scale to use, available values: "celsius", "fahrenheit", "kelvin" and "rankine".
temp_scale = "celsius"
#* Use base 10 for bits/bytes sizes, KB = 1000 instead of KiB = 1024.
base_10_sizes = False
#* Show CPU frequency.
show_cpu_freq = True
#* Draw a clock at top of screen, formatting according to strftime, empty string to disable.
#* Special formatting: /host = hostname | /user = username | /uptime = system uptime
clock_format = "%X"
#* Update main ui in background when menus are showing, set this to false if the menus is flickering too much for comfort.
background_update = True
#* Custom cpu model name, empty string to disable.
custom_cpu_name = ""
#* Optional filter for shown disks, should be full path of a mountpoint, separate multiple values with whitespace " ".
#* Begin line with "exclude=" to change to exclude filter, otherwise defaults to "most include" filter. Example: disks_filter="exclude=/boot /home/user".
disks_filter = ""
#* Show graphs instead of meters for memory values.
mem_graphs = True
#* Show mem box below net box instead of above.
mem_below_net = False
#* Count ZFS ARC in cached and available memory.
zfs_arc_cached = True
#* If swap memory should be shown in memory box.
show_swap = True
#* Show swap as a disk, ignores show_swap value above, inserts itself after first disk.
swap_disk = True
#* If mem box should be split to also show disks info.
show_disks = True
#* Filter out non physical disks. Set this to False to include network disks, RAM disks and similar.
only_physical = True
#* Read disks list from /etc/fstab. This also disables only_physical.
use_fstab = True
#* Setting this to True will hide all datasets, and only show ZFS pools. (IO stats will be calculated per-pool)
zfs_hide_datasets = False
#* Set to true to show available disk space for privileged users.
disk_free_priv = False
#* Toggles if io activity % (disk busy time) should be shown in regular disk usage view.
show_io_stat = True
#* Toggles io mode for disks, showing big graphs for disk read/write speeds.
io_mode = True
#* Set to True to show combined read/write io graphs in io mode.
io_graph_combined = False
#* Set the top speed for the io graphs in MiB/s (100 by default), use format "mountpoint:speed" separate disks with whitespace " ".
#* Example: "/mnt/media:100 /:20 /boot:1".
io_graph_speeds = ""
#* Set fixed values for network graphs in Mebibits. Is only used if net_auto is also set to False.
net_download = 100
net_upload = 100
#* Use network graphs auto rescaling mode, ignores any values set above and rescales down to 10 Kibibytes at the lowest.
net_auto = True
#* Sync the auto scaling for download and upload to whichever currently has the highest scale.
net_sync = True
#* Starts with the Network Interface specified here.
net_iface = ""
#* Show battery stats in top right if battery is present.
show_battery = False
#* Which battery to use if multiple are present. "Auto" for auto detection.
selected_battery = "Auto"
#* Show power stats of battery next to charge indicator.
show_battery_watts = True
#* Set loglevel for "~/.config/btop/btop.log" levels are: "ERROR" "WARNING" "INFO" "DEBUG".
#* The level set includes all lower levels, i.e. "DEBUG" will show all logging info.
log_level = "WARNING"
#* Measure PCIe throughput on NVIDIA cards, may impact performance on certain cards.
nvml_measure_pcie_speeds = True
#* Horizontally mirror the GPU graph.
gpu_mirror_graph = True
#* Custom gpu0 model name, empty string to disable.
custom_gpu_name0 = ""
#* Custom gpu1 model name, empty string to disable.
custom_gpu_name1 = ""
#* Custom gpu2 model name, empty string to disable.
custom_gpu_name2 = ""
#* Custom gpu3 model name, empty string to disable.
custom_gpu_name3 = ""
#* Custom gpu4 model name, empty string to disable.
custom_gpu_name4 = ""
#* Custom gpu5 model name, empty string to disable.
custom_gpu_name5 = ""
'';
};
xdg.configFile."btop/themes/nixos.theme" = {
enable = true;
text = with colors; ''
# Main background, empty for terminal default, need to be empty if you want transparent background
theme[main_bg]="#${base00}"
# Main text color
theme[main_fg]="#${base05}"
# Title color for boxes
theme[title]="#${base05}"
# Highlight color for keyboard shortcuts
theme[hi_fg]="#${base0D}"
# Background color of selected item in processes box
theme[selected_bg]="#${base03}"
# Foreground color of selected item in processes box
theme[selected_fg]="#${base0D}"
# Color of inactive/disabled text
theme[inactive_fg]="#8c8fa1"
# Color of text appearing on top of graphs, i.e uptime and current network graph scaling
theme[graph_text]="#${base06}"
# Background color of the percentage meters
theme[meter_bg]="#${base03}"
# Misc colors for processes box including mini cpu graphs, details memory graph and details status text
theme[proc_misc]="#${base06}"
# CPU, Memory, Network, Proc box outline colors
theme[cpu_box]="#${base0E}" #Mauve
theme[mem_box]="#${base0B}" #Green
theme[net_box]="#e64553" #Maroon
theme[proc_box]="#${colors.base0D}" #Blue
# Box divider line and small boxes line color
theme[div_line]="#9ca0b0"
# Temperature graph color (Green -> Yellow -> Red)
theme[temp_start]="#${base0B}"
theme[temp_mid]="#${base0A}"
theme[temp_end]="#${base08}"
# CPU graph colors (Teal -> Lavender)
theme[cpu_start]="#${base0C}"
theme[cpu_mid]="#209fb5"
theme[cpu_end]="#${base07}"
# Mem/Disk free meter (Mauve -> Lavender -> Blue)
theme[free_start]="#${base0E}"
theme[free_mid]="#${base07}"
theme[free_end]="#${base0D}"
# Mem/Disk cached meter (Sapphire -> Lavender)
theme[cached_start]="#209fb5"
theme[cached_mid]="#${base0D}"
theme[cached_end]="#${base07}"
# Mem/Disk available meter (Peach -> Red)
theme[available_start]="#${base09}"
theme[available_mid]="#e64553"
theme[available_end]="#${base08}"
# Mem/Disk used meter (Green -> Sky)
theme[used_start]="#${base0B}"
theme[used_mid]="#${base0C}"
theme[used_end]="#04a5e5"
# Download graph colors (Peach -> Red)
theme[download_start]="#${base09}"
theme[download_mid]="#e64553"
theme[download_end]="#${base08}"
# Upload graph colors (Green -> Sky)
theme[upload_start]="#${base0B}"
theme[upload_mid]="#${base0C}"
theme[upload_end]="#04a5e5"
# Process box color gradient for threads, mem and cpu usage (Sapphire -> Mauve)
theme[process_start]="#209fb5"
theme[process_mid]="#${base07}"
theme[process_end]="#${base0E}"
'';
};
modules.shell.aliases = {
top = "btop";
};
};
}
-47
View File
@@ -1,47 +0,0 @@
{
...
}:
{
imports = [
# Import all modules
./bluetuith/default.nix
./browser/default.nix
./btop/default.nix
./desktop/default.nix
./development/default.nix
./discord/default.nix
./feishin/default.nix
./fontconfig/default.nix
./games/modrinth.nix
./git/default.nix
./language/cpp.nix
./language/haskell.nix
./language/js.nix
./language/jupyter.nix
./language/nix.nix
./language/python.nix
./language/rust.nix
./language/tex.nix
./mako/default.nix
./neovim/default.nix
./obsidian/default.nix
./rofi/default.nix
./rofi/rofi-rbw.nix
./shell/default.nix
./shell/bash.nix
./shell/fish.nix
./spotify/default.nix
./steam/default.nix
./terminal/default.nix
./terminal/foot/default.nix
./theming/default.nix
./vscode/default.nix
./whatsapp/default.nix
./winbox/default.nix
./zathura/default.nix
# Import unfree helper
../../unfree/default.nix
];
}
@@ -1,23 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.glpaper;
in
{
options.modules.glpaper = {
enable = mkEnableOption "glpaper";
shader = mkOption {
type = types.path;
default = ./shaders/waves.glsl;
description = "Shader to use for the background";
};
};
config = mkIf cfg.enable { home.packages = [ pkgs.glpaper ]; };
}
@@ -1,169 +0,0 @@
#define zoom 0.900
#define tile 0.850
#define speed2 0.0
#ifdef GL_ES
precision highp float;
#endif
uniform float time;
uniform vec2 resolution;
#define time3 (time * 0.01)
#define mouse vec2(sin(time3)/48., cos(time3)/48.)
#define iterations 14
#define formuparam2 0.79
#define volsteps 5
#define stepsize 0.390
#define brightness 0.003
#define darkmatter 0.400
#define distfading 0.560
#define saturation 0.800
#define transverseSpeed zoom*2.0
#define cloud 0.11
float triangle(float x, float a) {
float output2 = 2.0 * abs(2.0 * ((x/a) - floor((x/a) + 0.5))) - 1.0;
return output2;
}
float field(in vec3 p) {
float strength = 7. + .03 * log(1.e-6 + fract(sin(time3) * 4373.11));
float accum = 0.;
float prev = 0.;
float tw = 0.;
// Replace or uncomment the for-loop as intended in your logic
float mag = dot(p, p);
p = abs(p) / mag + vec3(-.5, -.8 + 0.1*sin(time3*0.7 + 2.0), -1.1+0.3*cos(time3*0.3));
float w = exp(-float(0) / 7.);
accum += w * exp(-strength * pow(abs(mag - prev), 2.3));
tw += w;
prev = mag;
return max(0., 5. * accum / tw - .7);
}
void main() {
vec2 uv2 = 2. * gl_FragCoord.xy / vec2(512) - 1.;
vec2 uvs = uv2 * vec2(512) / 512.;
float time2 = time3;
float speed = speed2;
speed = .01 * cos(time2*0.02 + 3.1415926/4.0);
float formuparam = formuparam2;
vec2 uv = uvs;
float a_xz = 0.9;
float a_yz = -.6;
float a_xy = 0.9 + time3*0.08;
mat2 rot_xz = mat2(cos(a_xz),sin(a_xz),-sin(a_xz),cos(a_xz));
mat2 rot_yz = mat2(cos(a_yz),sin(a_yz),-sin(a_yz),cos(a_yz));
mat2 rot_xy = mat2(cos(a_xy),sin(a_xy),-sin(a_xy),cos(a_xy));
float v2 =1.0;
vec3 dir=vec3(uv*zoom,1.);
vec3 from=vec3(0.0, 0.0,0.0);
from.x -= 5.0*(mouse.x-0.5);
from.y -= 5.0*(mouse.y-0.5);
vec3 forward = vec3(0.,0.,1.);
from.x += transverseSpeed*(1.0)*cos(0.01*time3) + 0.001*time3;
from.y += transverseSpeed*(1.0)*sin(0.01*time3) +0.001*time3;
from.z += 0.003*time3;
dir.xy*=rot_xy;
forward.xy *= rot_xy;
dir.xz*=rot_xz;
forward.xz *= rot_xz;
dir.yz*= rot_yz;
forward.yz *= rot_yz;
from.xy*=-rot_xy;
from.xz*=rot_xz;
from.yz*= rot_yz;
float zooom = (time2-3311.)*speed;
from += forward* zooom;
float sampleShift = mod( zooom, stepsize );
float zoffset = -sampleShift;
sampleShift /= stepsize;
float s=0.24;
float s3 = s + stepsize/2.0;
vec3 v=vec3(0.);
float t3 = 0.0;
vec3 backCol2 = vec3(0.);
for (int r=0; r<volsteps; r++) {
vec3 p2=from+(s+zoffset)*dir;
vec3 p3=from+(s3+zoffset)*dir;
p2 = abs(vec3(tile)-mod(p2,vec3(tile*2.)));
p3 = abs(vec3(tile)-mod(p3,vec3(tile*2.)));
#ifdef cloud
t3 = field(p3);
#endif
float pa,a=pa=0.;
for (int i=0; i<iterations; i++) {
p2=abs(p2)/dot(p2,p2)-formuparam;
float D = abs(length(p2)-pa);
a += i > 7 ? min( 12., D) : D;
pa=length(p2);
}
a*=a*a;
float s1 = s+zoffset;
float fade = pow(distfading,max(0.,float(r)-sampleShift));
v+=fade;
if( r == 0 )
fade *= (1. - (sampleShift));
if( r == volsteps-1 )
fade *= sampleShift;
v+=vec3(s1,s1*s1,s1*s1*s1*s1)*a*brightness*fade;
backCol2 += mix(.11, 1., v2) * vec3(1.8 * t3 * t3 * t3, 1.4 * t3 * t3, t3) * fade;
s+=stepsize;
s3 += stepsize;
}
v=mix(vec3(length(v)),v,saturation);
vec4 forCol2 = vec4(v*.01,1.);
#ifdef cloud
backCol2 *= cloud;
#endif
backCol2.b *= 1.8;
backCol2.r *= 0.05;
backCol2.b = 0.5*mix(backCol2.g, backCol2.b, 0.8);
backCol2.g = 0.0;
backCol2.bg = mix(backCol2.gb, backCol2.bg, 0.5*(cos(time3*0.01) + 1.0));
gl_FragColor = forCol2 + vec4(backCol2, 1.0);
}
@@ -1,118 +0,0 @@
#ifdef GL_ES
precision mediump float;
#endif
// glslsandbox uniforms
uniform float time;
uniform vec2 resolution;
// shadertoy emulation
#define iTime time * 0.01 + 10.0
#define iResolution resolution
#define fragCoord gl_FragCoord
#define fragColor gl_FragColor
float colormap_red(float x) {
if (x < 0.0) {
return 54.0 / 255.0;
} else if (x < 20049.0 / 82979.0) {
return (829.79 * x + 54.51) / 255.0;
} else {
return 1.0;
}
}
float colormap_green(float x) {
if (x < 20049.0 / 82979.0) {
return 0.0;
} else if (x < 327013.0 / 810990.0) {
return (8546482679670.0 / 10875673217.0 * x - 2064961390770.0 / 10875673217.0) / 255.0;
} else if (x <= 1.0) {
return (103806720.0 / 483977.0 * x + 19607415.0 / 483977.0) / 255.0;
} else {
return 1.0;
}
}
float colormap_blue(float x) {
if (x < 0.0) {
return 54.0 / 255.0;
} else if (x < 7249.0 / 82979.0) {
return (829.79 * x + 54.51) / 255.0;
} else if (x < 20049.0 / 82979.0) {
return 127.0 / 255.0;
} else if (x < 327013.0 / 810990.0) {
return (792.02249341361393720147485376583 * x - 64.364790735602331034989206222672) / 255.0;
} else {
return 1.0;
}
}
vec4 colormap(float x) {
return vec4(colormap_red(x), colormap_green(x), colormap_blue(x), 1.0);
}
// https://iquilezles.org/articles/warp
/*float noise( in vec2 x )
{
vec2 p = floor(x);
vec2 f = fract(x);
f = f*f*(3.0-2.0*f);
float a = textureLod(iChannel0,(p+vec2(0.5,0.5))/256.0,0.0).x;
float b = textureLod(iChannel0,(p+vec2(1.5,0.5))/256.0,0.0).x;
float c = textureLod(iChannel0,(p+vec2(0.5,1.5))/256.0,0.0).x;
float d = textureLod(iChannel0,(p+vec2(1.5,1.5))/256.0,0.0).x;
return mix(mix( a, b,f.x), mix( c, d,f.x),f.y);
}*/
float rand(vec2 n) {
return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
}
float noise(vec2 p){
vec2 ip = floor(p);
vec2 u = fract(p);
u = u*u*(3.0-2.0*u);
float res = mix(
mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x),
mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y);
return res*res;
}
const mat2 mtx = mat2( 0.80, 0.60, -0.60, 0.80 );
float fbm( vec2 p )
{
float f = 0.0;
f += 0.500000*noise( p + iTime ); p = mtx*p*2.02;
f += 0.031250*noise( p ); p = mtx*p*2.01;
f += 0.250000*noise( p ); p = mtx*p*2.03;
f += 0.125000*noise( p ); p = mtx*p*2.01;
f += 0.062500*noise( p ); p = mtx*p*2.04;
f += 0.015625*noise( p + sin(iTime) );
return f/0.96875;
}
float pattern( in vec2 p )
{
return fbm( p + fbm( p + fbm( p ) ) );
}
void main()
{
vec2 uv = fragCoord.xy/iResolution.x;
float shade = pattern(uv);
fragColor = vec4(colormap(shade).rgb, shade);
}
/** SHADERDATA
{
"title": "Base warp fBM",
"description": "Noise but Pink",
"model": "person"
}
*/
@@ -1,13 +0,0 @@
#ifdef GL_ES
precision mediump float;
#endif
// glslsandbox uniforms
uniform float time;
uniform vec2 resolution;
// shadertoy emulation
#define iTime time
#define iResolution resolution
#define fragCoord gl_FragCoord
#define fragColor gl_FragColor
@@ -1,208 +0,0 @@
#ifdef GL_ES
precision highp float;
#endif
uniform float time;
uniform vec2 resolution;
#define CHAR_SIZE vec2(6, 7)
#define CHAR_SPACING vec2(6, 9)
vec2 start_pos = vec2(0);
vec2 print_pos = vec2(0);
vec2 print_pos_pre_move = vec2(0);
vec3 text_color = vec3(1);
/*
Top left pixel is the most significant bit.
Bottom right pixel is the least significant bit.
███ |
█ █ |
█ █ |
█ █ |
█████ |
█ █ |
█ █ |
000000
100010
100010
100010
111110
100010
100010
011100 (upper 21 bits)
100010 -> 011100 100010 100010 100 -> 935188
100010
100
010 (lower 21 bits)
111110 -> 010 111110 100010 100010 -> 780450
100010
100010
vec2(935188.0,780450.0)
*/
//Text coloring
#define HEX(i) text_color = mod(vec3(i / 65536,i / 256,i),vec3(256.0))/255.0;
#define RGB(r,g,b) text_color = vec3(r,g,b);
#define STRWIDTH(c) (c * CHAR_SPACING.x)
#define STRHEIGHT(c) (c * CHAR_SPACING.y)
#define BEGIN_TEXT(x,y) print_pos = floor(vec2(x,y)); start_pos = floor(vec2(x,y));
//Automatically generated from the sprite sheet here: http://uzebox.org/wiki/index.php?title=File:Font6x8.png
#define _ col+=char(vec2(0.0,0.0),uv);
#define _spc col+=char(vec2(0.0,0.0),uv)*text_color;
#define _exc col+=char(vec2(276705.0,32776.0),uv)*text_color;
#define _quo col+=char(vec2(1797408.0,0.0),uv)*text_color;
#define _hsh col+=char(vec2(10738.0,1134484.0),uv)*text_color;
#define _dol col+=char(vec2(538883.0,19976.0),uv)*text_color;
#define _pct col+=char(vec2(1664033.0,68006.0),uv)*text_color;
#define _amp col+=char(vec2(545090.0,174362.0),uv)*text_color;
#define _apo col+=char(vec2(798848.0,0.0),uv)*text_color;
#define _lbr col+=char(vec2(270466.0,66568.0),uv)*text_color;
#define _rbr col+=char(vec2(528449.0,33296.0),uv)*text_color;
#define _ast col+=char(vec2(10471.0,1688832.0),uv)*text_color;
#define _crs col+=char(vec2(4167.0,1606144.0),uv)*text_color;
#define _per col+=char(vec2(0.0,1560.0),uv)*text_color;
#define _dsh col+=char(vec2(7.0,1572864.0),uv)*text_color;
#define _com col+=char(vec2(0.0,1544.0),uv)*text_color;
#define _lsl col+=char(vec2(1057.0,67584.0),uv)*text_color;
#define _0 col+=char(vec2(935221.0,731292.0),uv)*text_color;
#define _1 col+=char(vec2(274497.0,33308.0),uv)*text_color;
#define _2 col+=char(vec2(934929.0,1116222.0),uv)*text_color;
#define _3 col+=char(vec2(934931.0,1058972.0),uv)*text_color;
#define _4 col+=char(vec2(137380.0,1302788.0),uv)*text_color;
#define _5 col+=char(vec2(2048263.0,1058972.0),uv)*text_color;
#define _6 col+=char(vec2(401671.0,1190044.0),uv)*text_color;
#define _7 col+=char(vec2(2032673.0,66576.0),uv)*text_color;
#define _8 col+=char(vec2(935187.0,1190044.0),uv)*text_color;
#define _9 col+=char(vec2(935187.0,1581336.0),uv)*text_color;
#define _col col+=char(vec2(195.0,1560.0),uv)*text_color;
#define _scl col+=char(vec2(195.0,1544.0),uv)*text_color;
#define _les col+=char(vec2(135300.0,66052.0),uv)*text_color;
#define _equ col+=char(vec2(496.0,3968.0),uv)*text_color;
#define _grt col+=char(vec2(528416.0,541200.0),uv)*text_color;
#define _que col+=char(vec2(934929.0,1081352.0),uv)*text_color;
#define _ats col+=char(vec2(935285.0,714780.0),uv)*text_color;
#define _A col+=char(vec2(935188.0,780450.0),uv)*text_color;
#define _B col+=char(vec2(1983767.0,1190076.0),uv)*text_color;
#define _C col+=char(vec2(935172.0,133276.0),uv)*text_color;
#define _D col+=char(vec2(1983764.0,665788.0),uv)*text_color;
#define _E col+=char(vec2(2048263.0,1181758.0),uv)*text_color;
#define _F col+=char(vec2(2048263.0,1181728.0),uv)*text_color;
#define _G col+=char(vec2(935173.0,1714334.0),uv)*text_color;
#define _H col+=char(vec2(1131799.0,1714338.0),uv)*text_color;
#define _I col+=char(vec2(921665.0,33308.0),uv)*text_color;
#define _J col+=char(vec2(66576.0,665756.0),uv)*text_color;
#define _K col+=char(vec2(1132870.0,166178.0),uv)*text_color;
#define _L col+=char(vec2(1065220.0,133182.0),uv)*text_color;
#define _M col+=char(vec2(1142100.0,665762.0),uv)*text_color;
#define _N col+=char(vec2(1140052.0,1714338.0),uv)*text_color;
#define _O col+=char(vec2(935188.0,665756.0),uv)*text_color;
#define _P col+=char(vec2(1983767.0,1181728.0),uv)*text_color;
#define _Q col+=char(vec2(935188.0,698650.0),uv)*text_color;
#define _R col+=char(vec2(1983767.0,1198242.0),uv)*text_color;
#define _S col+=char(vec2(935171.0,1058972.0),uv)*text_color;
#define _T col+=char(vec2(2035777.0,33288.0),uv)*text_color;
#define _U col+=char(vec2(1131796.0,665756.0),uv)*text_color;
#define _V col+=char(vec2(1131796.0,664840.0),uv)*text_color;
#define _W col+=char(vec2(1131861.0,699028.0),uv)*text_color;
#define _X col+=char(vec2(1131681.0,84130.0),uv)*text_color;
#define _Y col+=char(vec2(1131794.0,1081864.0),uv)*text_color;
#define _Z col+=char(vec2(1968194.0,133180.0),uv)*text_color;
#define _lsb col+=char(vec2(925826.0,66588.0),uv)*text_color;
#define _rsl col+=char(vec2(16513.0,16512.0),uv)*text_color;
#define _rsb col+=char(vec2(919584.0,1065244.0),uv)*text_color;
#define _pow col+=char(vec2(272656.0,0.0),uv)*text_color;
#define _usc col+=char(vec2(0.0,62.0),uv)*text_color;
#define _a col+=char(vec2(224.0,649374.0),uv)*text_color;
#define _b col+=char(vec2(1065444.0,665788.0),uv)*text_color;
#define _c col+=char(vec2(228.0,657564.0),uv)*text_color;
#define _d col+=char(vec2(66804.0,665758.0),uv)*text_color;
#define _e col+=char(vec2(228.0,772124.0),uv)*text_color;
#define _f col+=char(vec2(401543.0,1115152.0),uv)*text_color;
#define _g col+=char(vec2(244.0,665474.0),uv)*text_color;
#define _h col+=char(vec2(1065444.0,665762.0),uv)*text_color;
#define _i col+=char(vec2(262209.0,33292.0),uv)*text_color;
#define _j col+=char(vec2(131168.0,1066252.0),uv)*text_color;
#define _k col+=char(vec2(1065253.0,199204.0),uv)*text_color;
#define _l col+=char(vec2(266305.0,33292.0),uv)*text_color;
#define _m col+=char(vec2(421.0,698530.0),uv)*text_color;
#define _n col+=char(vec2(452.0,1198372.0),uv)*text_color;
#define _o col+=char(vec2(228.0,665756.0),uv)*text_color;
#define _p col+=char(vec2(484.0,667424.0),uv)*text_color;
#define _q col+=char(vec2(244.0,665474.0),uv)*text_color;
#define _r col+=char(vec2(354.0,590904.0),uv)*text_color;
#define _s col+=char(vec2(228.0,114844.0),uv)*text_color;
#define _t col+=char(vec2(8674.0,66824.0),uv)*text_color;
#define _u col+=char(vec2(292.0,1198868.0),uv)*text_color;
#define _v col+=char(vec2(276.0,664840.0),uv)*text_color;
#define _w col+=char(vec2(276.0,700308.0),uv)*text_color;
#define _x col+=char(vec2(292.0,1149220.0),uv)*text_color;
#define _y col+=char(vec2(292.0,1163824.0),uv)*text_color;
#define _z col+=char(vec2(480.0,1148988.0),uv)*text_color;
#define _lpa col+=char(vec2(401542.0,66572.0),uv)*text_color;
#define _bar col+=char(vec2(266304.0,33288.0),uv)*text_color;
#define _rpa col+=char(vec2(788512.0,1589528.0),uv)*text_color;
#define _tid col+=char(vec2(675840.0,0.0),uv)*text_color;
#define _lar col+=char(vec2(8387.0,1147904.0),uv)*text_color;
#define _nl print_pos = start_pos - vec2(0,CHAR_SPACING.y);
//Extracts bit b from the given number.
float extract_bit(float n, float b)
{
b = clamp(b,-1.0,22.0);
return floor(mod(floor(n / pow(2.0,floor(b))),2.0));
}
//Returns the pixel at uv in the given bit-packed sprite.
float sprite(vec2 spr, vec2 size, vec2 uv)
{
uv = floor(uv);
float bit = (size.x-uv.x-1.0) + uv.y * size.x;
bool bounds = all(greaterThanEqual(uv,vec2(0)))&& all(lessThan(uv,size));
return bounds ? extract_bit(spr.x, bit - 21.0) + extract_bit(spr.y, bit) : 0.0;
}
//Prints a character and moves the print position forward by 1 character width.
vec3 char(vec2 ch, vec2 uv)
{
float px = sprite(ch, CHAR_SIZE, uv - print_pos);
print_pos.x += CHAR_SPACING.x;
print_pos.y += sin(4.*print_pos.x-time*10.);
return vec3(px);
}
vec3 Text(vec2 uv)
{
vec3 col = vec3(0.0);
vec2 center_pos = vec2(resolution.x/2.0 - STRWIDTH(20.0)/2.0,resolution.y/2.0 - STRHEIGHT(1.0)/2.0);
BEGIN_TEXT(center_pos.x,center_pos.y)
HEX(0x00ffFF) _ _ _w _a _t _e _r _ _;
BEGIN_TEXT(resolution.x/2.0-STRWIDTH(11.0)/2.0,resolution.y/2.0)
print_pos += vec2(cos(time)*96.,sin(time)*96.);
// RGB(1,0,0) _M RGB(1,.5,0)_o RGB(1,1,0)_v RGB(0,1,0)_i RGB(0,.5,1)_n RGB(0.5,0,1)_g _ RGB(1,0,0)_T RGB(1,.5,0)_e RGB(1,1,0)_x RGB(0,1,0)_t
return col;
}
void main( void )
{
vec2 uv = gl_FragCoord.xy;
vec2 duv = floor(gl_FragCoord.xy);
vec3 pixel = Text(duv);
vec3 col = pixel*0.9+0.1;
col *= (1.-distance(mod(uv,vec2(1.0)),vec2(0.65)))*1.2;
gl_FragColor = vec4(vec3(col), 1.0);
}
@@ -1,108 +0,0 @@
#ifdef GL_ES
precision mediump float;
#endif
uniform float time;
uniform vec2 resolution;
#define iTime time * 0.05 + 50.0
#define iResolution resolution
#define fragCoord gl_FragCoord
#define fragColor gl_FragColor
float colormap_red(float x) {
if (x < 0.0) {
return 54.0 / 255.0;
} else if (x < 20049.0 / 82979.0) {
return (829.79 * x + 54.51) / 255.0;
} else {
return 1.0;
}
}
float colormap_green(float x) {
if (x < 20049.0 / 82979.0) {
return 0.0;
} else if (x < 327013.0 / 810990.0) {
return (8546482679670.0 / 10875673217.0 * x - 2064961390770.0 / 10875673217.0) / 255.0;
} else if (x <= 1.0) {
return (103806720.0 / 483977.0 * x + 19607415.0 / 483977.0) / 255.0;
} else {
return 1.0;
}
}
float colormap_blue(float x) {
if (x < 0.0) {
return 54.0 / 255.0;
} else if (x < 7249.0 / 82979.0) {
return (829.79 * x + 54.51) / 255.0;
} else if (x < 20049.0 / 82979.0) {
return 127.0 / 255.0;
} else if (x < 327013.0 / 810990.0) {
return (792.02249341361393720147485376583 * x - 64.364790735602331034989206222672) / 255.0;
} else {
return 1.0;
}
}
vec4 colormap(float x) {
return vec4(colormap_red(x), colormap_green(x), colormap_blue(x), 1.0);
}
// https://iquilezles.org/articles/warp
/*float noise( in vec2 x )
{
vec2 p = floor(x);
vec2 f = fract(x);
f = f*f*(3.0-2.0*f);
float a = textureLod(iChannel0,(p+vec2(0.5,0.5))/256.0,0.0).x;
float b = textureLod(iChannel0,(p+vec2(1.5,0.5))/256.0,0.0).x;
float c = textureLod(iChannel0,(p+vec2(0.5,1.5))/256.0,0.0).x;
float d = textureLod(iChannel0,(p+vec2(1.5,1.5))/256.0,0.0).x;
return mix(mix( a, b,f.x), mix( c, d,f.x),f.y);
}*/
float rand(vec2 n) {
return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453);
}
float noise(vec2 p){
vec2 ip = floor(p);
vec2 u = fract(p);
u = u*u*(3.0-2.0*u);
float res = mix(
mix(rand(ip),rand(ip+vec2(1.0,0.0)),u.x),
mix(rand(ip+vec2(0.0,1.0)),rand(ip+vec2(1.0,1.0)),u.x),u.y);
return res*res;
}
const mat2 mtx = mat2( 0.80, 0.60, -0.60, 0.80 );
float fbm( vec2 p )
{
float f = 0.0;
f += 0.500000*noise( p + iTime ); p = mtx*p*2.02;
f += 0.031250*noise( p ); p = mtx*p*2.01;
f += 0.250000*noise( p ); p = mtx*p*2.03;
f += 0.125000*noise( p ); p = mtx*p*2.01;
f += 0.062500*noise( p ); p = mtx*p*2.04;
f += 0.015625*noise( p + sin(iTime) );
return f/0.96875;
}
float pattern( in vec2 p )
{
return fbm( p + fbm( p + fbm( p ) ) );
}
void main()
{
vec2 uv = fragCoord.xy/iResolution.x;
float shade = pattern(uv);
fragColor = vec4(colormap(shade).rgb, shade);
}
@@ -1,162 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.waybar;
theme = config.theming;
colors = theme.colors;
in
{
options.modules.waybar = {
enable = mkEnableOption "waybar";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
pulsemixer
playerctl
wpa_supplicant_gui # TODO: Move
];
modules.desktop.reloadScript = ''
# if ${pkgs.procps}/bin/pgrep waybar; then
# ${pkgs.procps}/bin/pkill waybar
# fi
${pkgs.waybar}/bin/waybar &
'';
programs.waybar = {
enable = true;
settings = {
mainBar = {
layer = "top";
spacing = 16;
modules-left = [ "river/tags" ];
modules-center = [
#"river/window"
"mpris"
];
modules-right = [
"bluetooth"
"network"
"pulseaudio"
"battery"
"clock"
];
"river/window" = {
max-length = 50;
};
"river/tags" = {
tag-labels = [
"一"
"二"
"三"
"四"
"五"
"六"
"七"
"八"
"九"
];
disable-click = false;
};
network = {
tooltip = false;
on-click = "wpa_gui";
format-wifi = "直 {essid}"; # Spacing achieved using "Thin Space"
format-ethernet = "TODO";
format-disconnected = "睊";
};
pulseaudio = {
tooltip = false;
format = "{icon}   {volume}%"; # Spacing achieved using "Thin Space"
#format-muted = "";
format-muted = "{icon}  --%"; # Spacing achieved using "Thin Space"
format-icons = {
#headphone = "";
#default = [ "" "" ];
headphone = "";
headphone-muted = "";
default = [
""
""
""
];
};
};
battery = {
format = "{icon} {capacity}%"; # Spacing achieved using "Thin Space"
format-charging = " {capacity}%"; # Spacing achieved using "Thin Space"
#format-icons = [ "󰂎" "󰁺" "󰁻" "󰁼" "󰁽" "󰁾" "󰁿" "󰂀" "󰂁" "󰂂" "󰁹" ];
format-icons = [
""
""
""
""
""
""
""
""
""
""
""
];
interval = 1;
};
clock = {
#format = "󰅐 {:%H:%M}";
#format = "   {:%H:%M}"; # Spacing achieved using "Thin Space"
format = "{:%H:%M}";
};
mpris = {
format = "{dynamic}";
tooltip-format = "";
interval = 1;
};
bluetooth = {
tooltip = false;
format = "  {status}"; # Spacing achieved using "Thin Space"
format-connected = "  {device_alias}"; # Spacing achieved using "Thin Space"
};
};
};
# TODO: Replace base03 color with named color
style = ''
window#waybar {
color: #${colors.fg};
background-color: #${colors.bg};
border-style: none none solid none;
border-width: ${toString theme.layout.borderSize}px;
border-color: #${colors.border-unfocused};
font-size: 12px;
font-family: "${theme.fonts.monospace.name}";
}
.modules-right {
margin: 0 8px 0 0;
}
#tags button {
color: #${theme.schemeColors.base03};
padding: 0 5px 1px 5px;
border-radius: 0;
font-size: 16px;
font-family: "wenquanyi bitmap song";
}
#tags button.occupied {
color: #${colors.fg};
}
#tags button.focused {
color: #${colors.accent};
}
'';
};
};
}
-69
View File
@@ -1,69 +0,0 @@
{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.modules.desktop;
in
{
imports = [
# Import desktop environment modules
./background/glpaper/default.nix
./bar/waybar.nix
./lock-screen/waylock.nix
./window-manager/river.nix
];
options.modules.desktop = {
wayland = mkEnableOption "wayland";
initScript = mkOption {
type = types.lines;
default = "${pkgs.bash}/bin/bash";
description = "Bash script to execute after logging in.";
};
reloadScript = mkOption {
type = types.lines;
default = "";
description = "Shell script to execute after reload/rebuild.";
};
};
config = {
# Ensure desktop related systemd services (xdg) have access to session variables.
systemd.user.sessionVariables = config.home.sessionVariables;
home.packages = optionals cfg.wayland (
with pkgs;
[
wl-clipboard
wtype
grim
slurp
]
);
home.activation = {
customReloadScript = lib.hm.dag.entryAfter [ "writeBoundary" ] (
''
#!${pkgs.bash}/bin/bash
''
+ cfg.reloadScript
);
};
home.file.".initrc" = {
enable = true;
executable = true;
text =
''
#!${pkgs.bash}/bin/bash
''
+ cfg.initScript;
};
};
}
@@ -1,20 +0,0 @@
{
lib,
pkgs,
config,
...
}:
with lib;
let
cfg = config.modules.waylock;
in
{
options.modules.waylock = {
enable = mkEnableOption "waylock";
};
config = {
home.packages = mkIf cfg.enable (with pkgs; [ waylock ]);
};
}
@@ -1,256 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.modules.river;
in
{
options.modules.river.enable = lib.mkEnableOption "river";
# osConfig = lib.mkIf cfg.enable {
# programs.river.enable = true;
# };
config = lib.mkIf cfg.enable {
# Set desktop type to wayland
modules.desktop.wayland = true;
# TODO: Move elsewhere and make keybindings more configurable
modules.rofi.enable = true;
# TODO: Move elsewhere
home.packages = with pkgs; [
brightnessctl
river-filtile
# owm
udiskie # TODO: Move to USB module
];
# Change desktop to execute river
modules.desktop.initScript = ''
river
'';
modules.desktop.reloadScript = ''
${pkgs.river}/bin/riverctl background-color 0x${config.theming.colors.bg}
'';
# Update background after rebuild
# home.activation = {
# river = lib.hm.dag.entryBetween [ "reloadSystemd" ] [ "installPackages" ] ''
# # Close waybar
# PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill waybar
# # Kill rivertile
# PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill rivertile
# # Kill glpaper
# PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill glpaper
# # Restart river
# PATH="${pkgs.river}/bin:${pkgs.systemd}/bin:${pkgs.waybar}/bin:$PATH" $DRY_RUN_CMD ~/.config/river/init
# '';
# };
# River setup
wayland.windowManager.river = {
enable = true;
xwayland.enable = true;
settings =
let
layout = "filtile";
layoutOptions = "-outer-padding ${toString config.theming.layout.windowPadding} -view-padding ${toString config.theming.layout.windowPadding}";
modes = [
"normal"
"locked"
];
tags = [
1
2
3
4
5
6
7
8
9
];
waylockOptions = "-init-color 0x${colors.bg} -input-color 0x${colors.border-focused} -fail-color 0x${colors.bg}";
colors = config.theming.colors;
# Quick pow function
pow2 = power: if power != 0 then 2 * (pow2 (power - 1)) else 1;
# Modifiers
main = "Super";
ssm = "Super+Shift";
sas = "Super+Alt+Shift";
sam = "Super+Alt";
scm = "Super+Control";
scam = "Super+Control+Alt";
ssc = "Super+Shift+Control";
in
{
default-layout = "${layout}";
set-repeat = "50 300";
xcursor-theme = "BreezeX-RosePine-Linux 24";
keyboard-layout = "-options \"caps:escape\" us";
border-width = toString config.theming.layout.borderSize;
background-color = "0x${colors.bg}";
border-color-focused = "0x${colors.fg}";
border-color-unfocused = "0x${colors.border-unfocused}"; # TODO: Change to use named color;
border-color-urgent = "0x${colors.fg}";
# TODO: Make a desktop options for DE applications
spawn = [
"\"${layout} ${layoutOptions}\""
"waybar" # TODO: Decouple
"\"glpaper eDP-1 ${toString config.modules.glpaper.shader}\""
"udiskie"
];
map = (
lib.attrsets.recursiveUpdate
{
normal =
{
"${main} Q" = "close";
"${ssm} E" = "exit";
# Basic utilities
"${main} X " = "spawn \"waylock -fork-on-lock ${waylockOptions}\"";
"${ssm} Return" = "spawn foot";
"${main} P" = "spawn \"rofi -show drun\"";
"${ssm} P" = "spawn rofi-rbw";
"${main} S" =
"spawn \"grim -g \\\"\\\$(slurp)\\\" ~/Images/Screenshots/\\\$(date +'%s_grim.png')\"";
# Window focus
"${main} J" = "focus-view next";
"${main} K" = "focus-view previous";
# Swap windows
"${ssm} J" = "swap next";
"${ssm} K" = "swap previous";
"${main} Return" = "zoom";
# Main ratio
"${main} H" = "send-layout-cmd ${layout} 'main-ratio -0.05'";
"${main} L" = "send-layout-cmd ${layout} 'main-ratio +0.05'";
# Main count
"${ssm} H" = "send-layout-cmd ${layout} 'main-count +1'";
"${ssm} L" = "send-layout-cmd ${layout} 'main-count -1'";
# Tags
"${main} 0" = "set-focused-tags ${toString (pow2 32 - 1)}";
"${ssm} 0" = "set-view-tags ${toString (pow2 32 - 1)}";
# Orientation
"${main} Up" = "send-layout-cmd ${layout} \"main-location top\"";
"${main} Right" = "send-layout-cmd ${layout} \"main-location right\"";
"${main} Down" = "send-layout-cmd ${layout} \"main-location bottom\"";
"${main} Left" = "send-layout-cmd ${layout} \"main-location left\"";
# Move floating windows
"${sam} H" = "move left 100";
"${sam} J" = "move down 100";
"${sam} K" = "move up 100";
"${sam} L" = "move right 100";
# Snap floating windows
"${scam} H" = "snap left";
"${scam} J" = "snap down";
"${scam} K" = "snap up";
"${scam} L" = "snap right";
# Resize floating windows
"${sas} H" = "resize horizontal -100";
"${sas} J" = "resize vertical 100";
"${sas} K" = "resize vertical -100";
"${sas} L" = "resize horizontal 100";
# Toggle modes
"${main} Space" = "toggle-float";
"${main} F" = "toggle-fullscreen";
}
// builtins.listToAttrs (
builtins.concatLists (
map (tag: [
{
name = "${main} ${toString tag}";
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}";
value = {
# Control volume
"None XF86AudioRaiseVolume" = "spawn \"pulsemixer --change-volume +5\"";
"None XF86AudioLowerVolume" = "spawn \"pulsemixer --change-volume -5\"";
"None XF86AudioMute" = "spawn \"pulsemixer --toggle-mute\"";
# Control brightness
"None XF86MonBrightnessUp" = "spawn \"brightnessctl set +5%\"";
"None XF86MonBrightnessDown" = "spawn \"brightnessctl set 5%-\"";
# Control music playback
"None XF86Messenger" = "spawn \"playerctl previous\"";
"None XF86Go" = "spawn \"playerctl play-pause\"";
"None Cancel" = "spawn \"playerctl next\"";
};
}) modes
)
)
);
map-pointer = {
normal = {
"${main} BTN_LEFT" = "move-view";
"${main} BTN_RIGHT" = "resize-view";
"${main} BTN_MIDDLE" = "toggle-float";
};
};
input = {
"'*'" = {
accel-profile = "adaptive";
pointer-accel = "0.5";
scroll-factor = "0.8";
};
"'*Synaptics*'" = {
natural-scroll = "enabled";
};
};
rule-add = {
"-app-id" = {
"'bar'" = "csd";
"'*'" = "ssd";
"'wpa_gui'" = "float";
};
};
};
};
};
}
@@ -1,8 +0,0 @@
{ ... }:
{
imports = [
# Import systemwide configuration files.
./utilities/docker.nix
];
}
@@ -1,41 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.docker;
in
{
options.modules.docker = {
enable = mkEnableOption "docker";
};
config = mkIf cfg.enable {
# Development packages
home.packages = with pkgs; [
docker
docker-compose
];
# Allow unfree
modules.unfree.allowedPackages = [
];
# VSCode configuration
programs.vscode = {
extensions = with pkgs.vscode-extensions; [
ms-azuretools.vscode-docker
];
userSettings = {
};
};
# Neovim configuration
programs.nixvim = { };
};
}
-22
View File
@@ -1,22 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.discord;
in
{
options.modules.discord = {
enable = mkEnableOption "discord";
};
config = mkIf cfg.enable {
modules.unfree.allowedPackages = [ "discord" ];
home.packages = with pkgs; [ discord ];
};
}
-16
View File
@@ -1,16 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.feishin;
in
{
options.modules.feishin.enable = mkEnableOption "feishin";
config = mkIf cfg.enable { home.packages = with pkgs; [ feishin ]; };
}
@@ -1,64 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.fontconfig;
aliasConfig = font: ''
<alias>
<family>${font.name}</family>
<prefer>
<family>${font.name}</family>
${concatStrings (map (font: " <family>${font}</family>\n") font.fallbackFonts)}
</prefer>
</alias>
'';
configContent = concatStrings (
map (font: aliasConfig config.theming.fonts.pkgs.${font}) config.theming.fonts.installed
);
in
{
options.modules.fontconfig = {
enable = mkEnableOption "fontconfig";
};
config = mkIf cfg.enable {
fonts.fontconfig = {
enable = true;
defaultFonts = {
serif = [ config.theming.fonts.serif.name ];
sansSerif = [ config.theming.fonts.sansSerif.name ];
monospace = [ config.theming.fonts.monospace.name ];
emoji = [ config.theming.fonts.emoji.name ];
};
};
home.file.".config/fontconfig/conf.d/20-family-fallbacks.conf" = {
enable = true;
# text = ''
# <?xml version="1.0"?>
# <fontconfig>
# ${configContent}
# </fontconfig>
# '';
text = ''
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
${configContent}
</fontconfig>
'';
};
};
}
-27
View File
@@ -1,27 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.modrinth;
in
{
options.modules.modrinth = {
enable = mkEnableOption "modrinth";
};
config = mkIf cfg.enable {
modules.unfree.allowedPackages = [
"modrinth-app"
"modrinth-app-unwrapped"
];
home.packages = with pkgs; [
modrinth-app
];
};
}
-53
View File
@@ -1,53 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.git;
in
{
options.modules.git = {
enable = mkEnableOption "git";
user = mkOption {
type = types.str;
description = "Default user name to use.";
};
email = mkOption {
type = types.str;
description = "Default user email to use.";
};
ignores = mkOption {
type = types.listOf types.str;
default = [ ];
description = "Paths to globally ignore";
};
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
git
lazygit
];
programs.git = {
enable = true;
extraConfig = {
pull = {
rebase = false;
};
};
userName = cfg.user;
userEmail = cfg.email;
ignores = cfg.ignores;
};
};
}
-54
View File
@@ -1,54 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.rust;
in
{
options.modules.cpp = {
enable = mkEnableOption "cpp";
};
config = mkIf cfg.enable {
# Allow unfree
modules.unfree.allowedPackages = [
"vscode-extension-ms-vscode-cpptools"
# TODO: Remove, it should not be here
# "android-studio-stable"
# "android-sdk-cmdline-tools"
# "android-sdk-tools"
];
# Gitignore additions
modules.git.ignores = [
".ccls-cache"
];
# Development packages
home.packages = with pkgs; [
gnumake
];
# VSCode configuration
programs.vscode = {
extensions = with pkgs.vscode-extensions; [
ms-vscode.cpptools
ms-vscode.cmake-tools
];
userSettings = {
# "C_Cpp.clang_format_fallbackStyle" = "{ BasedOnStyle: Google, IndentWidth: 4 }";
};
};
# Neovim configuration
programs.nixvim = {
plugins.lsp.servers.ccls.enable = true;
};
};
}
@@ -1,40 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.haskell;
in
{
options.modules.haskell = {
enable = mkEnableOption "haskell";
};
config = mkIf cfg.enable {
# Development packages
home.packages = with pkgs; [
haskell.compiler.ghc948
(haskell-language-server.override { supportedGhcVersions = [ "948" ]; })
];
# VSCode configuration
programs.vscode = {
extensions = with pkgs.vscode-extensions; [
haskell.haskell
justusadam.language-haskell
];
userSettings = {
"[haskell]" = { };
# "haskell.formattingProvider" = "fourmolu";
};
};
# Neovim configuration
programs.nixvim = { };
};
}
-36
View File
@@ -1,36 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.js;
in
{
options.modules.js = {
enable = mkEnableOption "js";
};
config = mkIf cfg.enable {
# Development packages
home.packages = with pkgs; [
nodejs
tailwindcss
];
# VSCode configuration
programs.vscode = {
extensions = with pkgs.vscode-extensions; [
bradlc.vscode-tailwindcss
];
userSettings = { };
};
# Neovim configuration
programs.nixvim = { };
};
}
@@ -1,42 +0,0 @@
{
lib,
config,
pkgs,
...
}:
# TODO: Move to a module for notebooks in general
with lib;
let
cfg = config.modules.jupyter;
in
{
options.modules.jupyter = {
enable = mkEnableOption "jupyter";
};
config = mkIf cfg.enable {
# Development packages
home.packages = with pkgs; [
evcxr
];
modules.python.extraPythonPackages = p: [
p.jupyter
p.notebook
];
# VSCode configuration
programs.vscode = {
extensions = with pkgs.vscode-extensions; [
ms-toolsai.jupyter
ms-toolsai.jupyter-renderers
];
userSettings = { };
};
# Neovim configuration
programs.nixvim = { };
};
}
-58
View File
@@ -1,58 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.nix;
in
{
options.modules.nix = {
enable = mkEnableOption "nix";
};
config = mkIf cfg.enable {
# Development packages
home.packages = with pkgs; [
nix-tree
nixfmt-rfc-style
nixd
];
# Add nix tree
xdg.desktopEntries.nix-tree = {
exec = "${pkgs.nix-tree}/bin/nix-tree";
name = "Nix Tree";
terminal = true;
type = "Application";
};
# VSCode configuration
programs.vscode = {
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
userSettings = {
"[nix]" = {
"editor.tabSize" = 2;
};
"nix.enableLanguageServer" = true;
"nix.serverPath" = "nixd";
"nix.serverSettings" = {
nixd = {
formatting = {
command = [ "nixfmt" ];
};
};
};
};
};
# Neovim configuration
programs.nixvim = {
};
};
}
-57
View File
@@ -1,57 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.python;
package = pkgs.python3.withPackages cfg.extraPythonPackages;
in
{
options.modules.python = {
enable = mkEnableOption "python";
extraPythonPackages = mkOption {
type = types.functionTo (types.listOf types.package) // {
merge =
loc: defs: p:
lib.concatMap (def: (def.value p)) defs;
};
default = p: [ ];
description = "Extra Python packages to install";
};
};
config = mkIf cfg.enable {
# Development packages
home.packages = [
package
];
# Allow unfree
modules.unfree.allowedPackages = [
"vscode-extension-MS-python-vscode-pylance"
];
# VSCode configuration
programs.vscode = {
extensions = with pkgs.vscode-extensions; [
ms-python.python
ms-python.debugpy
ms-python.vscode-pylance
ms-python.black-formatter
];
userSettings = {
"[python]" = {
"editor.defaultFormatter" = "ms-python.black-formatter";
};
};
};
# Neovim configuration
programs.nixvim = { };
};
}
-56
View File
@@ -1,56 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.rust;
in
{
options.modules.rust = {
enable = mkEnableOption "rust";
};
config = mkIf cfg.enable {
# Development packages
home.packages = with pkgs; [
rustup
# rustc
# cargo
gcc
lldb
bacon
# rust-analyzer
# rustfmt
# clippy
];
# VSCode configuration
programs.vscode = {
extensions = with pkgs.vscode-extensions; [
rust-lang.rust-analyzer
vadimcn.vscode-lldb
tamasfe.even-better-toml
serayuzgur.crates
];
userSettings = {
"[rust]" = {
"editor.inlayHints.enabled" = "off";
};
"rust-analyzer.check.command" = "clippy";
"rust-analyzer.showUnlinkedFileNotification" = false;
};
};
# Neovim configuration
programs.nixvim = {
plugins.rustaceanvim = {
enable = true;
};
};
};
}
-67
View File
@@ -1,67 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.tex;
in
{
options.modules.tex = {
enable = mkEnableOption "tex";
};
config = mkIf cfg.enable {
# Development packages
home.packages = with pkgs; [
(texlive.combine {
inherit (texlive) scheme-full;
})
];
# Pygments for minted
modules.python.extraPythonPackages = p: [
p.pygments
];
# VSCode configuration
programs.vscode = {
extensions = with pkgs.vscode-extensions; [ jnoortheen.nix-ide ];
userSettings = {
"[tex]" = { };
};
};
# Neovim configuration
programs.nixvim = {
extraConfigVim = ''
" Enforce latexmk
let g:vimtex_compiler_method = 'latexmk'
" Set latexmk compilation settings
let g:vimtex_compiler_latexmk = {
\ 'options': [
\ '-shell-escape',
\ '-verbose',
\ '-file-line-error',
\ '-synctex=1',
\ '-interaction=nonstopmode',
\ ],
\}
'';
# Vimtex plugin
plugins.vimtex = {
enable = true;
texlivePackage = null;
settings = {
view_method = "zathura";
};
};
};
};
}
-31
View File
@@ -1,31 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.mako;
theme = config.theming;
colors = theme.colors;
in
{
options.modules.mako.enable = mkEnableOption "mako";
config = mkIf cfg.enable {
services.mako = {
enable = true;
anchor = "top-right";
defaultTimeout = 5000;
backgroundColor = "#${colors.bg}ff";
textColor = "#${colors.fg}ff";
borderColor = "#${colors.fg}ff";
progressColor = "#${colors.accent}ff";
borderRadius = 0;
borderSize = theme.layout.borderSize;
font = "${theme.fonts.monospace.name} ${toString theme.fonts.monospace.recommendedSize}";
};
};
}
-191
View File
@@ -1,191 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.neovim;
theme = config.theming;
colors = theme.colors;
in
{
options.modules.neovim = {
enable = mkEnableOption "neovim";
};
config = mkIf cfg.enable {
programs.nixvim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
extraPackages = with pkgs; [ ];
opts = {
number = true;
relativenumber = true;
signcolumn = "yes";
ignorecase = true;
smartcase = true;
tabstop = 4;
shiftwidth = 4;
softtabstop = 0;
expandtab = true;
smarttab = true;
list = true;
listchars = "tab:»┈«,trail:·,extends:→,precedes:←,nbsp:␣";
};
diagnostics = {
enable = true;
signs = true;
underline = true;
update_in_insert = true;
};
extraConfigLua = ''
vim.fn.sign_define("DiagnosticSignError",
{text = "", texthl = "DiagnosticSignError"})
vim.fn.sign_define("DiagnosticSignWarn",
{text = "", texthl = "DiagnosticSignWarn"})
vim.fn.sign_define("DiagnosticSignInfo",
{text = "", texthl = "DiagnosticSignInfo"})
vim.fn.sign_define("DiagnosticSignHint",
{text = "💡", texthl = "DiagnosticSignHint"})
'';
keymaps = [
# Save shortcut
{
action = ":update<CR>";
key = "<C-s>";
mode = "n";
}
{
action = "<C-o>:update<CR>";
key = "<C-s>";
mode = "i";
}
# Neo tree
{
action = ":Neotree action=focus reveal toggle<CR>";
key = "<leader>n";
mode = "n";
options.silent = true;
}
];
autoCmd = [
{
desc = "Automatic formatting";
event = "BufWritePre";
callback = {
__raw = ''
function()
vim.lsp.buf.format {
async = false,
}
end
'';
};
}
];
highlight = {
Comment = {
italic = true;
fg = theme.schemeColors.withHashtag.base03; # TODO: Come up with a good name colors.muted maybe?
};
};
plugins.lsp = {
enable = true;
};
#plugins.treesitter = {
# enable = true;
#};
plugins.cmp = {
enable = true;
settings = {
mapping = {
"<C-Space>" = "cmp.mapping.complete()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-e>" = "cmp.mapping.close()";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
};
sources = [
{ name = "path"; }
{ name = "nvim_lsp"; }
];
};
};
plugins.web-devicons = {
enable = true;
};
plugins.neo-tree = {
enable = true;
closeIfLastWindow = true;
window = {
width = 30;
autoExpandWidth = true;
};
extraOptions = {
default_component_configs.git_status.symbols = {
# Change type
added = "+";
deleted = "✕";
modified = "✦";
renamed = "→";
# Status type
untracked = "?";
ignored = "▫";
unstaged = "□";
staged = "■";
conflict = "‼";
};
};
};
#plugins.cmp-nvim-lsp.enable = true;
plugins.gitsigns = {
enable = true;
settings.current_line_blame = true;
};
#plugins.copilot-vim = {
# enable = true;
#};
# plugins.vimtex = {
# enable = true;
# texlivePackage = null;
# settings = {
# view_method = "zathura";
# };
# };
};
programs.neovim.defaultEditor = true;
};
}
@@ -1,22 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.obsidian;
in
{
options.modules.obsidian = {
enable = mkEnableOption "obsidian";
};
config = mkIf cfg.enable {
modules.unfree.allowedPackages = [ "obsidian" ];
home.packages = with pkgs; [ obsidian ];
};
}
-62
View File
@@ -1,62 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.rofi;
theme = config.theming;
colors = theme.colors;
in
{
options.modules.rofi.enable = mkEnableOption "rofi";
config = mkIf cfg.enable {
programs.rofi = {
enable = true;
terminal = config.default.terminal;
package = pkgs.rofi-wayland;
font = "${theme.fonts.monospace.name} ${toString theme.fonts.monospace.recommendedSize}";
theme =
let
inherit (config.lib.formats.rasi) mkLiteral;
in
{
"*" = {
background-color = mkLiteral "rgba(0, 0, 0, 0%)";
border-color = mkLiteral "#${colors.fg}";
text-color = mkLiteral "#${colors.fg}";
};
mainbox = {
background-color = mkLiteral "#${colors.bg}";
border = mkLiteral "${toString theme.layout.borderSize}px";
};
element-text = {
highlight = mkLiteral "#${colors.fg-search}";
};
inputbar = {
children = mkLiteral "[textbox-search, entry]";
};
listview = {
padding = mkLiteral "2px 0px";
};
textbox-search = {
expand = false;
content = "> ";
};
"inputbar, message" = {
padding = mkLiteral "2px";
};
element = {
padding = mkLiteral "0px 2px";
};
"element selected" = {
background-color = mkLiteral "#${colors.border-unfocused}";
};
};
};
};
}
-30
View File
@@ -1,30 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.rofi-rbw;
in
{
options.modules.rofi-rbw.enable = mkEnableOption "rofi-rbw";
config = mkIf cfg.enable {
modules.rofi.enable = true;
home.packages = [ pkgs.rofi-rbw ];
# TODO: Move to separate module and make configurable
programs.rbw = {
enable = true;
settings = {
base_url = "https://keys.bulthuis.dev";
email = "jan@bulthuis.dev";
pinentry = pkgs.pinentry;
};
};
};
}
-22
View File
@@ -1,22 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.bash;
in
{
options.modules.bash = {
enable = mkEnableOption "bash";
};
config.programs.bash = {
enable = cfg.enable;
shellAliases = config.modules.shell.aliases;
};
}
-19
View File
@@ -1,19 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib;
{
options.modules.shell = {
aliases = mkOption {
type = types.attrsOf types.str;
default = {
"..." = "cd ../..";
};
description = "Shell aliases";
};
};
}
-63
View File
@@ -1,63 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
cfg = config.modules.fish;
in
{
options.modules.fish = {
enable = mkEnableOption "fish";
plugins = {
done = mkEnableOption "done";
fzf = mkEnableOption "fzf";
grc = mkEnableOption "grc";
};
};
config = mkIf cfg.enable {
# Make bash load into fish
# Bash will remain the default shell as fish is not POSIX compliant.
modules.bash.enable = true;
programs.bash.initExtra = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
# Actual fish configuration
programs.fish = {
enable = true;
shellAliases = config.modules.shell.aliases;
plugins = [
(mkIf cfg.plugins.done {
name = "done";
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;
})
];
};
# Fish plugin dependencies
home.packages = with pkgs; [
(mkIf cfg.plugins.fzf fzf)
(mkIf cfg.plugins.grc grc)
];
};
}
-24
View File
@@ -1,24 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.spotify;
in
{
options.modules.spotify.enable = mkEnableOption "spotify";
config = mkIf cfg.enable {
modules.unfree.allowedPackages = [
"spotify"
];
home.packages = with pkgs; [
spotify
];
};
}
-13
View File
@@ -1,13 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
{
options.modules.steam = {
enable = mkEnableOption "steam";
};
}
@@ -1,11 +0,0 @@
{ ... }:
{
imports = [
# Import systemwide configuration files.
./docker.nix
./river.nix
./steam.nix
./waylock.nix
];
}
@@ -1,17 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
enabled = any (user: user.modules.docker.enable) (attrValues config.home-manager.users);
in
{
config = mkIf enabled {
virtualisation.docker.enable = true;
machine.sudo-groups = [ "docker" ];
};
}
@@ -1,14 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
enabled = any (user: user.modules.river.enable) (attrValues config.home-manager.users);
in
{
config = mkIf enabled { programs.river.enable = true; };
}
@@ -1,21 +0,0 @@
{
lib,
config,
...
}:
with lib;
let
enabled = any (user: user.modules.steam.enable) (attrValues config.home-manager.users);
in
{
config = mkIf enabled {
modules.unfree.allowedPackages = [
"steam"
"steam-original"
"steam-unwrapped"
];
programs.steam.enable = true;
};
}
@@ -1,14 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
let
enabled = any (user: user.modules.waylock.enable) (attrValues config.home-manager.users);
in
{
config = mkIf enabled { security.pam.services.waylock = { }; };
}
@@ -1,14 +0,0 @@
{
lib,
config,
pkgs,
...
}:
with lib;
{
options.default.terminal = mkOption {
type = types.str;
description = "Default terminal application";
};
}
@@ -1,35 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.foot;
in
{
options.modules.foot.enable = mkEnableOption "foot";
config = mkIf cfg.enable {
default.terminal = mkDefault "${pkgs.foot}/bin/foot";
programs.foot = {
enable = true;
settings = {
main =
let
font = config.theming.fonts.monospace.name;
size = toString config.theming.fonts.monospace.recommendedSize;
in
{
font = mkForce "${font}:style=Regular:size=${size}";
font-bold = "${font}:style=Bold:size=${size}";
font-italic = "${font}:style=Italic:size=${size}";
font-bold-italic = "${font}:style=Bold Italic:size=${size}";
};
};
};
};
}
-367
View File
@@ -1,367 +0,0 @@
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.theming;
# Font module type
fontModule = types.submodule {
options = {
name = mkOption {
type = types.str;
description = "Font family name.";
};
package = mkOption {
type = types.anything;
description = "Font package";
};
recommendedSize = mkOption {
type = types.nullOr types.int;
default = null;
description = "Recommended size for displaying this font.";
};
fallbackFonts = mkOption {
type = types.listOf types.str;
default = [ ];
description = "Fallback fonts for specified font.";
};
};
};
fontModules = [
# Import all fonts
./fonts/cozette-vector.nix
./fonts/cozette.nix
./fonts/dejavu-sans.nix
./fonts/dejavu-serif.nix
./fonts/dina.nix
./fonts/fira-code.nix
./fonts/nerd-fonts-symbols.nix
./fonts/noto-color-emoji.nix
./fonts/wqy-bitmapsong.nix
./fonts/wqy-microhei-mono.nix
./fonts/wqy-microhei.nix
./fonts/wqy-zenhei-mono.nix
./fonts/wqy-zenhei-sharp.nix
./fonts/wqy-zenhei.nix
];
# Gather enabled fonts.
enabledFonts = [
cfg.fonts.serif.name
cfg.fonts.sansSerif.name
cfg.fonts.monospace.name
cfg.fonts.emoji.name
] ++ map (font: font.name) cfg.fonts.extraFonts;
# Flatten dependencies of fonts
fontPackages =
converge
(
fonts:
listToAttrs (
map
(font: {
name = font;
value = true;
})
(
flatten (map (font: [ font.name ] ++ cfg.fonts.pkgs.${font.name}.fallbackFonts) (attrsToList fonts))
)
)
)
(
listToAttrs (
map (font: {
name = font;
value = true;
}) enabledFonts
)
);
# Convert set of fonts to list of packages
fontNameList = map (font: font.name) (attrsToList fontPackages);
fontPackageList = map (font: cfg.fonts.pkgs.${font}.package) fontNameList;
in
{
imports = [
# Import all themes
./themes/catppuccin.nix
./themes/gruvbox.nix
./themes/oxocarbon.nix
./themes/papercolor.nix
./themes/sakura.nix
./themes/nord.nix
];
options.modules.theming.enable = mkEnableOption "theming";
options.theming =
let
colors = config.theming.schemeColors;
in
{
darkMode = mkOption {
type = types.bool;
default = false;
example = true;
description = "Whether the app should use dark mode.";
};
colorScheme = mkOption {
type = types.nullOr types.str;
default = null;
description = "Base 16 color scheme to use for styling. See stylix documentation for more information.";
};
clientSideDecorations = mkOption {
type = types.bool;
default = false;
description = "Whether to enable client side decorations for windows.";
};
schemeColors = mkOption {
type = types.attrsOf types.anything;
default = config.lib.stylix.colors;
description = "Generated colors from scheme";
};
colors = {
bg = mkOption {
type = types.str;
default = colors.base00;
};
fg = mkOption {
type = types.str;
default = colors.base05;
};
bg-status = mkOption {
type = types.str;
default = colors.base01;
};
fg-status = mkOption {
type = types.str;
default = colors.base04;
};
bg-selection = mkOption {
type = types.str;
default = colors.base02;
};
bg-highlight = mkOption {
type = types.str;
default = colors.base03;
};
fg-search = mkOption {
type = types.str;
default = colors.base0A;
};
accent = mkOption {
type = types.str;
default = colors.base0E;
};
border-focused = mkOption {
type = types.str;
default = cfg.colors.fg;
};
border-unfocused = mkOption {
type = types.str;
default = cfg.colors.bg-selection;
};
};
colorsCSS = mkOption {
type = types.lines;
default =
":root {\n"
+ concatStrings (
map (color: " --nix-color-${color.name}: #${color.value};\n") (attrsToList cfg.colors)
)
+ "}\n\n";
description = "Colors as css variables";
};
layout = {
borderRadius = mkOption {
type = types.int;
default = 0;
description = "Border radius of windows.";
};
borderSize = mkOption {
type = types.int;
default = 1;
description = "Size of borders used throughout UI.";
};
windowPadding = mkOption {
type = types.int;
default = 2;
description = "Margin of each window, actual space between windows will be twice this number.";
};
};
fonts = {
pkgs = mkOption {
type = types.attrsOf fontModule;
default = builtins.listToAttrs (
map (module: {
name = module.name;
value = module;
}) (map (module: (import module) { inherit lib config pkgs; }) fontModules)
);
description = "All available font modules.";
};
installed = mkOption {
type = types.listOf types.str;
default = fontNameList;
description = "List of installed fonts.";
};
serif = mkOption {
type = fontModule;
description = "Default serif font";
};
sansSerif = mkOption {
type = fontModule;
description = "Default sansSerif font.";
};
monospace = mkOption {
type = fontModule;
description = "Default monospace font.";
};
emoji = mkOption {
type = fontModule;
description = "Default emoji font.";
};
extraFonts = mkOption {
type = types.listOf fontModule;
default = [ ];
description = "Additional fonts to install.";
};
};
};
config = mkIf config.modules.theming.enable {
# Enable fontconfig
modules.fontconfig.enable = true;
# Install configured fonts
home.packages = fontPackageList;
# Configure gnome theme
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = if cfg.darkMode then "prefer-dark" else "prefer-light";
};
};
# Configure qt theme
qt = {
enable = true;
platformTheme.name = "adwaita";
style.name = if cfg.darkMode then "adwaita-dark" else "adwaita-light";
};
# Configure gtk theme
gtk =
let
disableCSD = ''
headerbar.default-decoration {
margin-bottom: 50px;
margin-top: -100px;
}
window.csd,
window.csd decoration {
box-shadow: none;
}
'';
in
{
enable = true;
theme = {
name = if cfg.darkMode then "Adwaita-dark" else "Adwaita-light";
package = pkgs.gnome-themes-extra;
};
gtk3.extraCss = mkIf (!cfg.clientSideDecorations) disableCSD;
gtk4.extraCss = mkIf (!cfg.clientSideDecorations) disableCSD;
};
# TODO: This should just straight up not be here
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
modules.git.ignores = [
".direnv"
];
# TODO: Make cursors configurable using modules.
home.pointerCursor = {
gtk.enable = true;
name = lib.mkForce "BreezeX-RosePine-Linux";
package = lib.mkForce pkgs.rose-pine-cursor;
size = lib.mkForce 24;
x11 = {
defaultCursor = lib.mkForce "BreezeX-RosePine-Linux";
enable = true;
};
};
# Enable stylix
# TODO: Move to own module
stylix = {
enable = true;
autoEnable = false;
targets = {
foot.enable = true;
nixvim.enable = true;
qutebrowser.enable = true;
vscode.enable = true;
zathura.enable = true;
};
base16Scheme = cfg.colorScheme;
polarity = if cfg.darkMode then "dark" else "light";
fonts = {
serif = getAttrs [
"name"
"package"
] 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 = {
applications = mkDefault cfg.fonts.serif.recommendedSize;
desktop = mkDefault cfg.fonts.monospace.recommendedSize; # TODO: See below
popups = mkDefault cfg.fonts.monospace.recommendedSize; # TODO: Add dedicated UI font
terminal = mkDefault cfg.fonts.monospace.recommendedSize;
};
};
};
};
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "Cozette Vector";
package = pkgs.cozette;
recommendedSize = 9;
fallbackFonts = [ ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "Cozette";
package = pkgs.cozette;
recommendedSize = 9;
fallbackFonts = [ "Cozette Vector" ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "DejaVu Sans";
package = pkgs.dejavu_fonts;
recommendedSize = 12;
fallbackFonts = [ ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "DejaVu Serif";
package = pkgs.dejavu_fonts;
recommendedSize = 12;
fallbackFonts = [ ];
}
@@ -1,12 +0,0 @@
{ pkgs, ... }:
{
name = "Dina";
package = pkgs.dina-font;
recommendedSize = 9;
fallbackFonts = [
"Cozette"
"wenquanyi bitmap song"
"Symbols Nerd Font Mono"
];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "Fira Code";
package = pkgs.fira-code;
recommendedSize = 12;
fallbackFonts = [ "Symbols Nerd Font Mono" ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "Symbols Nerd Font Mono";
package = pkgs.nerd-fonts.symbols-only;
recommendedSize = 12;
fallbackFonts = [ ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "Noto Color Emoji";
package = pkgs.noto-fonts-color-emoji;
recommendedSize = 12;
fallbackFonts = [ ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "wenquanyi bitmap song";
package = pkgs.wqy-bitmapsong;
recommendedSize = 12;
fallbackFonts = [ ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "WenQuanYi Micro Hei Mono";
package = pkgs.wqy-microhei;
recommendedSize = 12;
fallbackFonts = [ ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "WenQuanYi Micro Hei";
package = pkgs.wqy-microhei;
recommendedSize = 12;
fallbackFonts = [ ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "WenQuanYi Zen Hei Mono";
package = pkgs.wqy-zenhei;
recommendedSize = 12;
fallbackFonts = [ ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "WenQuanYi Zen Hei Sharp";
package = pkgs.wqy-zenhei;
recommendedSize = 12;
fallbackFonts = [ ];
}
@@ -1,8 +0,0 @@
{ pkgs, ... }:
{
name = "WenQuanYi Zen Hei";
package = pkgs.wqy-zenhei;
recommendedSize = 12;
fallbackFonts = [ ];
}
@@ -1,33 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.theming.themes.catppuccin;
in
{
options = {
theming.themes.catppuccin = {
enable = mkEnableOption "catppuccin";
flavor = mkOption {
type = types.enum [
"latte"
"frappe"
"macchiato"
"mocha"
];
default = "mocha";
description = "The flavor of catppuccin theme.";
};
};
};
config.theming = mkIf cfg.enable {
darkMode = (cfg.flavor != "latte");
colorScheme = "${pkgs.base16-schemes}/share/themes/catppuccin-${cfg.flavor}.yaml";
};
}
@@ -1,34 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.theming.themes.gruvbox;
mode = if cfg.darkMode then "dark" else "light";
in
{
options = {
theming.themes.gruvbox = {
enable = mkEnableOption "gruvbox-hard";
darkMode = mkEnableOption "dark mode";
contrast = mkOption {
type = types.enum [
"hard"
"medium"
"soft"
];
default = "hard";
description = "The contrast level of the theme.";
};
};
};
config.theming = mkIf cfg.enable {
darkMode = cfg.darkMode;
colorScheme = "${pkgs.base16-schemes}/share/themes/gruvbox-${mode}-${cfg.contrast}.yaml";
};
}
@@ -1,25 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.theming.themes.nord;
mode = if cfg.darkMode then "" else "-light";
in
{
options = {
theming.themes.nord = {
enable = mkEnableOption "nord";
darkMode = mkEnableOption "dark mode";
};
};
config.theming = mkIf cfg.enable {
darkMode = cfg.darkMode;
colorScheme = "${pkgs.base16-schemes}/share/themes/nord${mode}.yaml";
};
}
@@ -1,25 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.theming.themes.oxocarbon;
mode = if cfg.darkMode then "dark" else "light";
in
{
options = {
theming.themes.oxocarbon = {
enable = mkEnableOption "oxocarbon";
darkMode = mkEnableOption "dark mode";
};
};
config.theming = mkIf cfg.enable {
darkMode = cfg.darkMode;
colorScheme = "${pkgs.base16-schemes}/share/themes/oxocarbon-${mode}.yaml";
};
}
@@ -1,25 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.theming.themes.papercolor;
mode = if cfg.darkMode then "dark" else "light";
in
{
options = {
theming.themes.papercolor = {
enable = mkEnableOption "papercolor";
darkMode = mkEnableOption "dark mode";
};
};
config.theming = mkIf cfg.enable {
darkMode = cfg.darkMode;
colorScheme = "${pkgs.base16-schemes}/share/themes/papercolor-${mode}.yaml";
};
}
@@ -1,23 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.theming.themes.sakura;
in
{
options = {
theming.themes.sakura = {
enable = mkEnableOption "sakura";
};
};
config.theming = mkIf cfg.enable {
darkMode = false;
colorScheme = "${pkgs.base16-schemes}/share/themes/sakura.yaml";
};
}
-74
View File
@@ -1,74 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.vscode;
theme = config.theming;
in
{
options.modules.vscode = {
enable = mkEnableOption "vscode";
codeFont = mkOption {
type = types.anything;
default = theme.fonts.pkgs."Fira Code";
};
fallbackFont = mkOption {
type = types.anything;
default = theme.fonts.pkgs."Symbols Nerd Font Mono";
};
};
config = mkIf cfg.enable {
modules.unfree.allowedPackages = [
"vscode"
"vscode-extension-github-copilot"
"vscode-extension-github-copilot-chat"
"vscode-extension-ms-vsliveshare-vsliveshare"
];
theming.fonts.extraFonts = [ cfg.codeFont ];
programs.vscode = {
enable = true;
mutableExtensionsDir = false;
extensions = with pkgs.vscode-extensions; [
eamodio.gitlens
ms-vscode.hexeditor
mkhl.direnv
usernamehw.errorlens
gruntfuggly.todo-tree
github.copilot
github.copilot-chat
tomoki1207.pdf
ms-vsliveshare.vsliveshare
];
userSettings = {
# Font setup
# TODO: Move the conversion factor to theme settings
"editor.fontFamily" = mkForce "'${cfg.codeFont.name}', '${cfg.fallbackFont.name}'";
"editor.fontSize" = mkForce (cfg.codeFont.recommendedSize); # Convert pt to px
"editor.fontLigatures" = true;
"terminal.integrated.fontFamily" = mkForce "'${cfg.codeFont.name}', '${cfg.fallbackFont.name}'";
"terminal.integrated.fontSize" = mkForce (cfg.codeFont.recommendedSize); # Convert pt to px
# Formatting
"editor.formatOnSave" = true;
"editor.tabSize" = 4;
# Layout
"window.menuBarVisibility" = "hidden";
# Git settings
"git.autofetch" = true;
"git.enableSmartCommit" = false;
};
};
};
}
@@ -1,22 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.whatsapp;
in
{
options.modules.whatsapp = {
enable = mkEnableOption "whatsapp";
};
config = mkIf cfg.enable {
modules.unfree.allowedPackages = [ "whatsapp-for-linux" ];
home.packages = with pkgs; [ whatsapp-for-linux ];
};
}
-22
View File
@@ -1,22 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.winbox;
in
{
options.modules.winbox = {
enable = mkEnableOption "winbox";
};
config = mkIf cfg.enable {
modules.unfree.allowedPackages = [ "winbox" ];
home.packages = with pkgs; [ winbox ];
};
}
-36
View File
@@ -1,36 +0,0 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.modules.zathura;
colors = config.theming.colors;
in
{
options.modules.zathura.enable = lib.mkEnableOption "zathura";
config = lib.mkIf cfg.enable {
programs.zathura = {
enable = true;
options = {
guioptions = "none";
recolor = true;
recolor-keephue = false;
recolor-darkcolor = lib.mkForce "#${colors.accent}";
recolor-lightcolor = lib.mkForce "#${colors.bg}";
};
};
xdg.mimeApps = {
enable = true;
defaultApplications = {
"application/pdf" = "zathura";
};
};
};
}