Compare commits

..

No commits in common. "b6afba390bd301034cfb8b2f06a0536e32c399af" and "80d22a470a475fa06bfcf4af1bd1ed8b23a32389" have entirely different histories.

49 changed files with 499 additions and 554 deletions

View file

@ -8,7 +8,7 @@ in {
imports = [ imports = [
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
(mkAliasOptionModule ["hm"] ["home-manager" "users" config.user.name]) (mkAliasOptionModule ["hm"] ["home-manager" "users" config.user.name])
inputs.base16.nixosModule inputs.nix-colors.homeManagerModules.default # >home manager modules >in non-hm modules
inputs.nix-index-database.nixosModules.default inputs.nix-index-database.nixosModules.default
inputs.t2fanrd.nixosModules.t2fanrd inputs.t2fanrd.nixosModules.t2fanrd
inputs.niri.nixosModules.niri inputs.niri.nixosModules.niri
@ -19,18 +19,34 @@ in {
inputs.vicinae.homeManagerModules.default inputs.vicinae.homeManagerModules.default
]; ];
# i mostly disagree with state versions, just use the oldest one i have set up system.stateVersion = "23.11";
# they seem reasonable at first but are so messy across multiple hosts
# a lot of the time they're used for stuff that isn't even state (looking at you, home-manager)
system.stateVersion = mkDefault "23.11";
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev; system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
hm.home.stateVersion = config.system.stateVersion; hm.home.stateVersion = config.system.stateVersion;
boot.kernelPackages = mkDefault pkgs.linuxPackages_latest; boot = {
kernelPackages = mkDefault pkgs.linuxPackages_latest;
kernelParams = [ "pcie_aspm.policy=performance" ];
};
# configure keymap in x11
services.xserver.xkb = {
layout = "us";
variant = "qwerty";
};
console = {
useXkbConfig = mkDefault true;
};
services.earlyoom.enable = true;
# TODO: drop geoclue entirely. too lazy 2 to that now
services.automatic-timezoned.enable = mkDefault true; services.automatic-timezoned.enable = mkDefault true;
time.timeZone = mkDefault null; # handled by automatic-timezoned time.timeZone = mkDefault null; # handled by automatic-timezoned
i18n = mkDefault {
defaultLocale = "en_US.UTF-8";
supportedLocales = [ "en_US.UTF-8/UTF-8" ];
};
location.provider = mkDefault "geoclue2"; location.provider = mkDefault "geoclue2";
services.geoclue2 = { services.geoclue2 = {
enable = mkDefault true; enable = mkDefault true;
@ -41,6 +57,10 @@ in {
submissionNick = "geoclue"; submissionNick = "geoclue";
}; };
# git is needed for flakes, yet, isn't in `environment.corePackages` hardware.enableRedistributableFirmware = true;
environment.systemPackages = with pkgs; [ git ];
environment.systemPackages = with pkgs; [
openssh mosh
git
];
} }

126
flake.lock generated
View file

@ -1,20 +1,18 @@
{ {
"nodes": { "nodes": {
"base16": { "base16-schemes": {
"inputs": { "flake": false,
"fromYaml": "fromYaml"
},
"locked": { "locked": {
"lastModified": 1755819240, "lastModified": 1696158499,
"narHash": "sha256-qcMhnL7aGAuFuutH4rq9fvAhCpJWVHLcHVZLtPctPlo=", "narHash": "sha256-5yIHgDTPjoX/3oDEfLSQ0eJZdFL1SaCfb9d6M0RmOTM=",
"owner": "senchopens", "owner": "tinted-theming",
"repo": "base16.nix", "repo": "base16-schemes",
"rev": "75ed5e5e3fce37df22e49125181fa37899c3ccd6", "rev": "a9112eaae86d9dd8ee6bb9445b664fba2f94037a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "senchopens", "owner": "tinted-theming",
"repo": "base16.nix", "repo": "base16-schemes",
"type": "github" "type": "github"
} }
}, },
@ -141,19 +139,19 @@
"type": "github" "type": "github"
} }
}, },
"fromYaml": { "fuzzel-catppuccin": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1731966426, "lastModified": 1771578346,
"narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", "narHash": "sha256-+/7lxQTRDZ0m+GAAFIjvFt8EXDeqZUtv0pLnNgaauZw=",
"owner": "SenchoPens", "owner": "catppuccin",
"repo": "fromYaml", "repo": "fuzzel",
"rev": "106af9e2f715e2d828df706c386a685698f3223b", "rev": "879879da8a7dc58f173b4cd7987723fd19bef6d5",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "SenchoPens", "owner": "catppuccin",
"repo": "fromYaml", "repo": "fuzzel",
"type": "github" "type": "github"
} }
}, },
@ -382,6 +380,25 @@
"type": "github" "type": "github"
} }
}, },
"nix-colors": {
"inputs": {
"base16-schemes": "base16-schemes",
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1707825078,
"narHash": "sha256-hTfge2J2W+42SZ7VHXkf4kjU+qzFqPeC9k66jAUBMHk=",
"owner": "misterio77",
"repo": "nix-colors",
"rev": "b01f024090d2c4fc3152cd0cf12027a7b8453ba1",
"type": "github"
},
"original": {
"owner": "misterio77",
"repo": "nix-colors",
"type": "github"
}
},
"nix-index-database": { "nix-index-database": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -433,6 +450,21 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib_2": {
"locked": {
"lastModified": 1697935651,
"narHash": "sha256-qOfWjQ2JQSQL15KLh6D7xQhx0qgZlYZTYlcEiRuAMMw=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "e1e11fdbb01113d85c7f41cada9d2847660e3902",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1776221942, "lastModified": 1776221942,
@ -529,22 +561,40 @@
"type": "github" "type": "github"
} }
}, },
"rofi-catppuccin": {
"flake": false,
"locked": {
"lastModified": 1752883501,
"narHash": "sha256-81eeFjwM/haPjIEWkZPp1JSDwhWbWDAuKtWiCg7P9Q0=",
"owner": "catppuccin",
"repo": "rofi",
"rev": "71fb15577ccb091df2f4fc1f65710edbc61b5a53",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "rofi",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"base16": "base16",
"cachyos-kernel": "cachyos-kernel", "cachyos-kernel": "cachyos-kernel",
"catppuccin": "catppuccin", "catppuccin": "catppuccin",
"fuzzel-catppuccin": "fuzzel-catppuccin",
"hardware": "hardware", "hardware": "hardware",
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprlock": "hyprlock", "hyprlock": "hyprlock",
"niri": "niri", "niri": "niri",
"nix-colors": "nix-colors",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixpkgs": "nixpkgs_4", "nixpkgs": "nixpkgs_4",
"rofi-catppuccin": "rofi-catppuccin",
"systems": "systems_2", "systems": "systems_2",
"t2fanrd": "t2fanrd", "t2fanrd": "t2fanrd",
"tt-schemes": "tt-schemes",
"vicinae": "vicinae", "vicinae": "vicinae",
"vicinae-extensions": "vicinae-extensions" "vicinae-extensions": "vicinae-extensions",
"waybar-catppuccin": "waybar-catppuccin"
} }
}, },
"systems": { "systems": {
@ -625,22 +675,6 @@
"type": "github" "type": "github"
} }
}, },
"tt-schemes": {
"flake": false,
"locked": {
"lastModified": 1776808072,
"narHash": "sha256-FwuOyAWXsdG7/1TpndL0gYPzBh5XOi1gNliZB774VaA=",
"owner": "tinted-theming",
"repo": "schemes",
"rev": "d5ddce0697a91203fd3eccc40140890a69fc279e",
"type": "github"
},
"original": {
"owner": "tinted-theming",
"repo": "schemes",
"type": "github"
}
},
"vicinae": { "vicinae": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs_6", "nixpkgs": "nixpkgs_6",
@ -708,6 +742,22 @@
"type": "github" "type": "github"
} }
}, },
"waybar-catppuccin": {
"flake": false,
"locked": {
"lastModified": 1720870206,
"narHash": "sha256-za0y6hcN2rvN6Xjf31xLRe4PP0YyHu2i454ZPjr+lWA=",
"owner": "catppuccin",
"repo": "waybar",
"rev": "ee8ed32b4f63e9c417249c109818dcc05a2e25da",
"type": "github"
},
"original": {
"owner": "catppuccin",
"repo": "waybar",
"type": "github"
}
},
"xwayland-satellite-stable": { "xwayland-satellite-stable": {
"flake": false, "flake": false,
"locked": { "locked": {

View file

@ -9,8 +9,7 @@
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
hardware.url = "github:nixos/nixos-hardware"; hardware.url = "github:nixos/nixos-hardware";
nix-colors.url = "github:misterio77/nix-colors";
base16.url = "github:senchopens/base16.nix";
nix-index-database.url = "github:nix-community/nix-index-database"; nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
@ -30,8 +29,12 @@
catppuccin.url = "github:catppuccin/nix"; catppuccin.url = "github:catppuccin/nix";
tt-schemes.url = "github:tinted-theming/schemes"; waybar-catppuccin.url = "github:catppuccin/waybar";
tt-schemes.flake = false; waybar-catppuccin.flake = false;
fuzzel-catppuccin.url = "github:catppuccin/fuzzel";
fuzzel-catppuccin.flake = false;
rofi-catppuccin.url = "github:catppuccin/rofi";
rofi-catppuccin.flake = false;
}; };
outputs = inputs @ { self, nixpkgs, systems, ... }: outputs = inputs @ { self, nixpkgs, systems, ... }:

View file

@ -33,22 +33,20 @@
boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-latest-lto-x86_64-v3; boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-latest-lto-x86_64-v3;
modules = { modules = {
core = { security.useDoas = true;
# kernel
kernel.v4l2 = true;
kernel.zswap = true;
# security
security.useDoas = true;
};
hardware = { hardware = {
audio.enable = true;
bluetooth.enable = true; bluetooth.enable = true;
pipewire.enable = true;
print.enable = true; print.enable = true;
pointer.enable = true; pointer.enable = true;
tablet.enable = true; tablet.enable = true;
networking.enable = true; networking.enable = true;
rgb.enable = true; rgb.enable = true;
}; };
dev = {
enable = true;
};
desktop = { desktop = {
# set to `x11` or `wayland`, improves compat # set to `x11` or `wayland`, improves compat
envProto = "wayland"; envProto = "wayland";
@ -59,6 +57,7 @@
# accessories # accessories
hyprlock.enable = true; hyprlock.enable = true;
hypridle.enable = true; hypridle.enable = true;
hypridle.desktop = true;
awww.enable = true; awww.enable = true;
gnome-keyring.enable = true; gnome-keyring.enable = true;
mate-polkit.enable = true; mate-polkit.enable = true;
@ -67,9 +66,10 @@
waybar.enable = true; waybar.enable = true;
wob.enable = true; wob.enable = true;
gammastep.enable = true; gammastep.enable = true;
# fuzzel.enable = true;
# cliphist.enable = true;
wl-clip-persist.enable = true; wl-clip-persist.enable = true;
vicinae.enable = true; vicinae.enable = true;
vicinae.dmenu = true;
# display manager # display manager
regreet.enable = true; regreet.enable = true;
@ -93,20 +93,22 @@
system.flatpak.enable = true; system.flatpak.enable = true;
system.mpv.enable = true; system.mpv.enable = true;
system.ananicy.enable = true; system.ananicy.enable = true;
system.zswap.enable = true;
system.kdeconnect.enable = true; system.kdeconnect.enable = true;
system.virt-manager.enable = true; system.virt-manager.enable = true;
# editors # editors
editors.micro.enable = true; editors.micro.enable = true;
editors.vscode.enable = true; editors.vscode.enable = true;
# dev
dev.git.enable = true;
# distractions # distractions
distractions.discord.enable = true; distractions.discord.enable = true;
distractions.discord.vesktop = true; distractions.discord.vesktop = true;
distractions.steam.enable = true; distractions.steam.enable = true;
# tools # tools
tools.direnv.enable = true;
tools.git.enable = true;
tools.gpg.enable = true; tools.gpg.enable = true;
tools.rbw.enable = true; tools.rbw.enable = true;
tools.noisetorch.enable = true;
}; };
}; };
} }

View file

@ -4,19 +4,17 @@
imports = imports =
[ [
inputs.hardware.nixosModules.common-cpu-amd inputs.hardware.nixosModules.common-cpu-amd
inputs.hardware.nixosModules.common-cpu-amd-zenpower
inputs.hardware.nixosModules.common-gpu-amd inputs.hardware.nixosModules.common-gpu-amd
inputs.hardware.nixosModules.common-pc-ssd inputs.hardware.nixosModules.common-pc-ssd
inputs.hardware.nixosModules.common-pc inputs.hardware.nixosModules.common-pc
inputs.hardware.nixosModules.msi-b550-a-pro # pro b550m-vc, not b550-a pro, but they use mostly the same chips
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "zenergy" ]; boot.kernelModules = [ "kvm-amd" "amdgpu" ];
boot.extraModulePackages = with config.boot.kernelPackages; [ zenergy ]; boot.extraModulePackages = [ ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;

View file

@ -31,19 +31,18 @@
]); ]);
modules = { modules = {
core = { security.useDoas = true;
laptop = true;
# kernel
kernel.zswap = true;
# security
security.useDoas = true;
};
hardware = { hardware = {
audio.enable = true;
bluetooth.enable = true; bluetooth.enable = true;
pipewire.enable = true;
print.enable = true; print.enable = true;
pointer.enable = true; pointer.enable = true;
networking.enable = true; networking.enable = true;
networking.powersave = true;
};
dev = {
enable = true;
}; };
desktop = { desktop = {
# set to `x11` or `wayland`, improves compat # set to `x11` or `wayland`, improves compat
@ -64,9 +63,10 @@
batsignal.enable = true; batsignal.enable = true;
wob.enable = true; wob.enable = true;
gammastep.enable = true; gammastep.enable = true;
# cliphist.enable = true;
# fuzzel.enable = true;
wl-clip-persist.enable = true; wl-clip-persist.enable = true;
vicinae.enable = true; vicinae.enable = true;
vicinae.dmenu = true;
# display manager # display manager
regreet.enable = true; regreet.enable = true;
@ -93,15 +93,16 @@
# editors # editors
editors.micro.enable = true; editors.micro.enable = true;
editors.vscode.enable = true; editors.vscode.enable = true;
# dev
dev.git.enable = true;
# distractions # distractions
distractions.discord.enable = true; distractions.discord.enable = true;
distractions.discord.vesktop = true; distractions.discord.vesktop = true;
distractions.steam.enable = true; distractions.steam.enable = true;
# tools # tools
tools.direnv.enable = true;
tools.git.enable = true;
tools.gpg.enable = true; tools.gpg.enable = true;
tools.rbw.enable = true; tools.rbw.enable = true;
tools.noisetorch.enable = true;
}; };
}; };
} }

View file

@ -1,14 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.core;
in {
options.modules.core = {
laptop = mkEnableOption "Enable laptop specific tweaks";
};
config = {
# TODO: add something here loooool
};
}

View file

@ -1,27 +0,0 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.core.kernel;
in {
options.modules.core.kernel = {
zswap = mkEnableOption "Enable zswap, a compressed RAM cache for swap pages";
v4l2 = mkEnableOption "Enable support for v4l2 loopback devices";
};
config = mkMerge [
(mkIf cfg.zswap {
boot.kernelParams = [
"zswap.enabled=1"
"zswap.shrinker_enabled=1"
"zswap.max_pool_percent=20"
"zswap.compressor=zstd"
"zswap.zpool=zsmalloc"
];
})
(mkIf cfg.v4l2 {
boot.kernelModules = ["v4l2loopback"];
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
})
];
}

View file

@ -1,13 +0,0 @@
{ lib, pkgs, inputs, config, ... }:
with lib;
{
i18n.defaultLocale = mkDefault "en_US.UTF-8";
services.xserver.xkb = {
layout = "us";
variant = "qwerty";
};
console = {
useXkbConfig = mkDefault true;
};
}

View file

@ -44,7 +44,7 @@ in {
default = pkgs.writeShellScript "awww-swap" '' default = pkgs.writeShellScript "awww-swap" ''
set -euo pipefail set -euo pipefail
file=$(ls ${cfg.wallpapersFolder} | dmenu -p "select a wallpaper") file=$(ls ${cfg.wallpapersFolder} | ${lib.getExe config.modules.desktop.rofi.package} -dmenu -sep '\n' -i -p "select a wallpaper")
wallpaper="${cfg.wallpapersFolder}/$file" wallpaper="${cfg.wallpapersFolder}/$file"
[ ! -f "$wallpaper" ] && exit 1 [ ! -f "$wallpaper" ] && exit 1

View file

@ -0,0 +1,32 @@
{ lib, config, pkgs, inputs, ... }:
with lib;
let
cfg = config.modules.desktop.cliphist;
in {
options.modules.desktop.cliphist = {
enable = mkEnableOption "enable cliphist, a clipboard manager for wayland";
package = mkOption {
type = types.package;
default = pkgs.cliphist;
};
summonScript = mkOption {
type = types.package;
default = pkgs.writeShellScript "cliphist-summon" ''
set -euo pipefail
${lib.getExe cfg.package} list | ${lib.getExe config.modules.desktop.fuzzel.package} --dmenu | ${lib.getExe cfg.package} decode | wl-copy
'';
};
};
config = mkIf cfg.enable {
hm.services.cliphist = {
enable = true;
allowImages = true;
package = cfg.package;
};
modules.desktop.rofi.enable = true;
};
}

View file

@ -12,22 +12,20 @@ in {
hm.services.dunst = { hm.services.dunst = {
enable = true; enable = true;
settings = let settings = with config.colorScheme.palette; {
inherit (config.modules.desktop.themes) rounding padding;
in with config.scheme.withHashtag; {
global = { global = {
follow = "mouse"; follow = "mouse";
width = 300; width = 300;
height = 145; height = 145;
frame_color = "${base02}"; frame_color = "#${base02}";
origin = "top-right"; origin = "top-right";
# various non-color theming settings # various non-color theming settings
offset = let offset = builtins.toString (padding * 2); in "${offset}x${offset}"; offset = "15x15";
padding = padding; padding = 15;
horizontal_padding = padding; horizontal_padding = 15;
text_icon_padding = padding; text_icon_padding = 15;
corner_radius = rounding; corner_radius = 8;
gap_size = 0; gap_size = 0;
frame_width = 1; frame_width = 1;
@ -35,7 +33,7 @@ in {
progress_bar = true; progress_bar = true;
progress_bar_frame_width = 1; progress_bar_frame_width = 1;
progress_bar_corner_radius = rounding; progress_bar_corner_radius = 8;
alignment = "left"; alignment = "left";
markup = "full"; markup = "full";
@ -58,19 +56,19 @@ in {
}; };
urgency_low = { urgency_low = {
background = "${base00}FF"; background = "#${base00}FF";
foreground = "${base05}"; foreground = "#${base05}";
}; };
urgency_normal = { urgency_normal = {
background = "${base00}FF"; background = "#${base00}FF";
foreground = "${base05}"; foreground = "#${base05}";
}; };
urgency_critical = { urgency_critical = {
background = "${base00}FF"; background = "#${base00}FF";
foreground = "${base05}"; foreground = "#${base05}";
frame_color = "${base08}"; # base16 spec says red frame_color = "#${base08}"; # base16 spec says red
}; };
}; };
}; };

View file

@ -123,8 +123,6 @@ in {
noto-fonts-color-emoji noto-fonts-color-emoji
noto-fonts-monochrome-emoji noto-fonts-monochrome-emoji
font-awesome font-awesome
pkgs.my.loveletter
]; ];
}) })
]); ]);

View file

@ -0,0 +1,38 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.fuzzel;
in {
options.modules.desktop.fuzzel = {
enable = mkEnableOption "Enable fuzzel, an application launcher similar to rofi's drun mode";
package = mkOption {
type = types.package;
default = pkgs.fuzzel;
};
};
config = mkIf cfg.enable {
hm.programs.fuzzel = {
enable = true;
package = cfg.package;
settings = {
main = {
terminal = "wezterm start";
font = with config.modules.desktop.fonts.fonts.monospace; "${family}:pixelsize=${toString size}";
prompt = "> ";
dpi-aware = "no";
lines = 20;
width = 28;
letter-spacing = 0.5;
horizontal-pad = 32;
vertical-pad = 8;
};
border = {
width = 1;
radius = config.modules.desktop.fonts.fonts.monospace.size;
};
};
};
};
}

View file

@ -11,6 +11,7 @@ in {
default = pkgs.hypridle; default = pkgs.hypridle;
example = "pkgs.hypridle"; example = "pkgs.hypridle";
}; };
desktop = mkEnableOption "Extend screen dimming time and disable sleeping";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -29,12 +30,12 @@ in {
listener = [ listener = [
{ {
timeout = if config.modules.core.laptop timeout = if !cfg.desktop
then 60 * 2 # 2 min then 60 * 2 # 2 min
else 60 * 35; # 35 min else 60 * 35; # 35 min
on-timeout = "${pkgs.systemd}/bin/loginctl lock-session"; # lock computer on-timeout = "${pkgs.systemd}/bin/loginctl lock-session"; # lock computer
} }
] ++ optionals (config.modules.core.laptop) [ ] ++ optionals (!cfg.desktop) [
{ {
timeout = 60; # 1 min timeout = 60; # 1 min
on-timeout = "${lib.getExe pkgs.brightnessctl} -c backlight -s set 20"; # dim screen, save brightness state on-timeout = "${lib.getExe pkgs.brightnessctl} -c backlight -s set 20"; # dim screen, save brightness state
@ -50,7 +51,7 @@ in {
on-timeout = "${pkgs.systemd}/bin/systemctl suspend"; # sleep/suspend on-timeout = "${pkgs.systemd}/bin/systemctl suspend"; # sleep/suspend
} }
] ++ optional config.modules.desktop.niri.enable { ] ++ optional config.modules.desktop.niri.enable {
timeout = if config.modules.core.laptop timeout = if !cfg.desktop
then 90 # 1.5 min then 90 # 1.5 min
else 30 * 60; # 30 min else 30 * 60; # 30 min
on-timeout = "niri msg action power-off-monitors"; on-timeout = "niri msg action power-off-monitors";

View file

@ -20,9 +20,7 @@ in {
enable = true; enable = true;
package = cfg.package; package = cfg.package;
settings = let settings = with config.colorScheme.palette; {
inherit (config.modules.desktop.themes) rounding;
in with config.scheme; {
general = { general = {
hide_cursor = false; hide_cursor = false;
text_trim = true; text_trim = true;
@ -40,7 +38,7 @@ in {
{ {
size = "280, 280"; size = "280, 280";
color = "rgb(${base00})"; color = "rgb(${base00})";
rounding = rounding; rounding = 48;
position = "0, 45"; position = "0, 45";
halign = "center"; valign = "center"; halign = "center"; valign = "center";
@ -54,7 +52,8 @@ in {
position = "0, 105"; position = "0, 105";
text = "cmd[update:1000] echo \"<span font_weight='1000'>$(date +'%H')</span>\""; text = "cmd[update:1000] echo \"<span font_weight='1000'>$(date +'%H')</span>\"";
font_size = 78; font_size = 78;
color = "rgb(${base05})"; # TODO: make more dynamic
color = "rgb(f5c2e7)"; # catppuccin pink
font_family = config.modules.desktop.fonts.fonts.sansSerif.family; font_family = config.modules.desktop.fonts.fonts.sansSerif.family;
halign = "center"; valign = "center"; halign = "center"; valign = "center";
} }
@ -74,7 +73,6 @@ in {
font_family = config.modules.desktop.fonts.fonts.sansSerif.family; font_family = config.modules.desktop.fonts.fonts.sansSerif.family;
halign = "center"; valign = "center"; halign = "center"; valign = "center";
} }
] ++ optionals config.modules.core.laptop [
{ {
position = "-15, -11"; position = "-15, -11";
halign = "right"; valign = "top"; halign = "right"; valign = "top";
@ -102,8 +100,7 @@ in {
{ {
position = "0, -140"; position = "0, -140";
size = "280, 48"; size = "280, 48";
rounding = rounding; outline_thickness = 2;
outline_thickness = 1;
dots_size = 0.3; dots_size = 0.3;
fade_on_empty = false; fade_on_empty = false;
placeholder_text = ""; placeholder_text = "";

View file

@ -65,7 +65,7 @@ in {
}; };
layout = { layout = {
gaps = config.modules.desktop.themes.padding; gaps = 6;
center-focused-column = "on-overflow"; center-focused-column = "on-overflow";
@ -229,7 +229,7 @@ in {
# TODO: configure popups # TODO: configure popups
window-rules = [ window-rules = [
{ {
geometry-corner-radius = allCorners (config.modules.desktop.themes.rounding * 1.0); geometry-corner-radius = allCorners 10.0;
clip-to-geometry = true; clip-to-geometry = true;
} }
{ {
@ -310,6 +310,7 @@ in {
]; ];
# TODO: add shadows onto notifications. weird geometry beware !!! # TODO: add shadows onto notifications. weird geometry beware !!!
# TODO: rounded vicinae
layer-rules = [ layer-rules = [
{ {
matches = [ matches = [
@ -317,11 +318,13 @@ in {
# obliterate all dmenu-like things--too dangerous to stream (clipboard history, passwords) # obliterate all dmenu-like things--too dangerous to stream (clipboard history, passwords)
{ namespace = "^rofi$"; } { namespace = "^rofi$"; }
{ namespace = "^vicinae$"; } { namespace = "^vicinae$"; }
{ namespace = "^launcher$"; }
]; ];
block-out-from = "screen-capture"; block-out-from = "screen-capture";
} }
{ {
matches = [ matches = [
{ namespace = "^launcher$"; }
{ namespace = "^rofi$"; } { namespace = "^rofi$"; }
{ namespace = "^vicinae$"; } { namespace = "^vicinae$"; }
{ namespace = "^wob$"; } { namespace = "^wob$"; }
@ -336,12 +339,13 @@ in {
} }
# shadow rounded corner cases... # shadow rounded corner cases...
# defined in program config but we need to edit geometry too for shadows!! # defined in program config but we need to edit geometry too for shadows!!
# monospace
{ {
matches = [ matches = [
{ namespace = "^launcher$"; }
{ namespace = "^rofi$"; } { namespace = "^rofi$"; }
{ namespace = "^vicinae$"; }
]; ];
geometry-corner-radius = allCorners (config.modules.desktop.themes.rounding * 1.0); geometry-corner-radius = allCorners (config.modules.desktop.fonts.fonts.monospace.size * 1.0); # its 1em, so
} }
]; ];
@ -350,6 +354,7 @@ in {
in { in {
"Mod+Shift+Slash".action = show-hotkey-overlay; "Mod+Shift+Slash".action = show-hotkey-overlay;
# "Mod+D".action = spawn "fuzzel";
"Mod+D".action = spawn "vicinae" "vicinae://toggle"; "Mod+D".action = spawn "vicinae" "vicinae://toggle";
"Mod+Q".action = close-window; "Mod+Q".action = close-window;
@ -426,7 +431,7 @@ in {
"Mod+Shift+Minus".action = set-window-height "-10%"; "Mod+Shift+Minus".action = set-window-height "-10%";
"Mod+Shift+Equal".action = set-window-height "+10%"; "Mod+Shift+Equal".action = set-window-height "+10%";
"Print".action.screenshot-screen = { show-pointer = false; }; "Print".action.screenshot = { show-pointer = false; };
"Mod+Grave".action = toggle-overview; "Mod+Grave".action = toggle-overview;
@ -452,6 +457,7 @@ in {
"XF86AudioNext".action = sh "${lib.getExe pkgs.playerctl} next"; "XF86AudioNext".action = sh "${lib.getExe pkgs.playerctl} next";
"Mod+Shift+C".action = sh "${lib.getExe pkgs.hyprpicker} -a"; "Mod+Shift+C".action = sh "${lib.getExe pkgs.hyprpicker} -a";
# "Mod+V".action = sh "${config.modules.desktop.cliphist.summonScript}";
"Mod+V".action = spawn "vicinae" "vicinae://extensions/vicinae/clipboard/history"; "Mod+V".action = spawn "vicinae" "vicinae://extensions/vicinae/clipboard/history";
"Mod+Shift+Control+T".action = toggle-debug-tint; "Mod+Shift+Control+T".action = toggle-debug-tint;

View file

@ -13,25 +13,20 @@ in {
services.greetd = { services.greetd = {
enable = true; enable = true;
settings = { settings = {
# TODO: fix focus requiring a mouse click
default_session = let default_session = let
swaymsg = "${pkgs.sway}/bin/swaymsg";
swayConfig = let swayConfig = let
monitors = config.modules.desktop.monitors; monitors = config.modules.desktop.monitors;
monitorConfig = if monitors.enable && (builtins.length monitors.monitors > 0) then monitorConfig = if monitors.enable && (builtins.length monitors.monitors > 0) then
let let
firstMonitor = builtins.head monitors.monitors; firstMonitor = builtins.head monitors.monitors;
in '' in
output "${firstMonitor.name}" scale ${toString firstMonitor.scale} "output ${firstMonitor.name} scale ${toString firstMonitor.scale}"
workspace 1 output "${firstMonitor.name}"
for_window [all] move container to workspace 1
''
else else
""; "";
in command: pkgs.writeText "kiosk-sway-config" '' in command: pkgs.writeText "kiosk-sway-config" ''
${monitorConfig} ${monitorConfig}
xwayland disable xwayland disable
exec '${swaymsg} workspace 1; ${command}; ${swaymsg} exit' exec '${command}; ${pkgs.sway}/bin/swaymsg exit'
''; '';
swayKiosk = command: "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.sway} --unsupported-gpu --config ${swayConfig command}"; swayKiosk = command: "${pkgs.dbus}/bin/dbus-run-session ${lib.getExe pkgs.sway} --unsupported-gpu --config ${swayConfig command}";
in { in {

View file

@ -6,7 +6,6 @@ let
in { in {
options.modules.desktop.rofi = { options.modules.desktop.rofi = {
enable = mkEnableOption "Enable rofi, a window switcher, run dialog and dmenu replacement"; enable = mkEnableOption "Enable rofi, a window switcher, run dialog and dmenu replacement";
dmenu = mkEnableOption "Use as a replacement for dmenu";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = pkgs.rofi-unwrapped; default = pkgs.rofi-unwrapped;
@ -24,20 +23,5 @@ in {
show-icons = true; show-icons = true;
}; };
}; };
user.packages = mkIf cfg.dmenu [ (pkgs.writeShellScriptBin "dmenu" ''
set -euo pipefail
prompt="select option"
while [ $# -gt 0 ]; do
case "$1" in
-p) shift; prompt="$1" ;;
esac
shift
done
rofi -dmenu -i -p "$prompt"
'') ];
}; };
} }

View file

@ -4,16 +4,14 @@ with lib;
let let
cfg = config.modules.desktop.themes; cfg = config.modules.desktop.themes;
accent = "pink"; accent = "pink";
accentBase = "base17";
variant = "mocha"; variant = "mocha";
dark = variant != "latte"; dark = variant != "latte";
darkString = if dark then "dark" else "light"; colorScheme = inputs.nix-colors.colorSchemes.${"catppuccin-${variant}"};
scheme = "${inputs.tt-schemes}/base24/catppuccin-${variant}.yaml";
pascalCase = s: (toUpper (substring 0 1 s)) + (toLower (substring 1 (stringLength s) s)); pascalCase = s: (toUpper (substring 0 1 s)) + (toLower (substring 1 (stringLength s) s));
in { in {
config = mkIf (cfg.active == "catppuccin") { config = mkIf (cfg.active == "catppuccin") {
scheme = scheme; colorScheme = colorScheme;
modules.desktop.themes = { modules.desktop.themes = {
dark = dark; dark = dark;
@ -37,13 +35,14 @@ in {
}; };
iconTheme = { iconTheme = {
name = "WhiteSur-${darkString}"; name = "WhiteSur-${if dark then "dark" else "light"}";
package = pkgs.whitesur-icon-theme; package = pkgs.whitesur-icon-theme;
}; };
cursorTheme = { cursorTheme = {
name = "macOS"; name = "graphite-${if dark then "dark" else "light"}";
package = pkgs.apple-cursor; package = pkgs.graphite-cursors;
size = 24;
}; };
editor = { editor = {
@ -69,24 +68,36 @@ in {
}; };
}; };
niri = let niri = with colorScheme.palette; {
colors = config.scheme.withHashtag; # TODO: make more dynamic
in with colors; { # catppuccin pink
accent = colors.${accentBase}; accent = "#f5c2e7";
inactive = "${base02}"; inactive = "#${base02}";
shadow = "${base11}"; # catppuccin crust
background = if dark then "${base11}" else "${base05}"; shadow = "#11111b";
# catppuccin crust
background = "#11111b";
}; };
waybarTop = "@define-color accent @${accentBase};"; waybar = builtins.concatStringsSep "\n" [
"@import \"${inputs.waybar-catppuccin}/themes/${variant}.css\";"
"@define-color accent @${accent};"
(lib.readFile ./waybar.css)
];
wob = with config.scheme; { wob = with colorScheme.palette; {
borderColor = "${base04}FF"; borderColor = "${base04}FF";
backgroundColor = "${base01}CC"; backgroundColor = "${base01}CC";
barColor = "${base05}FF"; barColor = "${base05}FF";
}; };
rofiTop = "* { accent: @${accentBase}; }"; rofi = builtins.concatStringsSep "\n" [
"@theme \"${inputs.rofi-catppuccin}/themes/catppuccin-${variant}.rasi\""
"* { accent: @${accent}; }"
(lib.readFile ./rofi.rasi)
];
fuzzel = "${inputs.fuzzel-catppuccin}/themes/catppuccin-${variant}/${accent}.ini";
wezterm = '' wezterm = ''
config.color_scheme = 'Catppuccin ${pascalCase variant}' config.color_scheme = 'Catppuccin ${pascalCase variant}'

View file

@ -10,27 +10,27 @@ element-text, element-icon , mode-switcher {
window { window {
height: 500px; height: 500px;
border: 1px; border: 1px;
border-radius: @roundingpx; border-radius: 1em;
border-color: @accent; border-color: @accent;
background-color: @base00; background-color: @base;
} }
mainbox { mainbox {
background-color: @base00; background-color: @base;
} }
inputbar { inputbar {
margin: 10px 5px 5px 5px; margin: 10px 5px 5px 5px;
children: [prompt, entry]; children: [prompt, entry];
background-color: @base00; background-color: @base;
padding: 1px; padding: 1px;
} }
prompt { prompt {
background-color: transparent; background-color: transparent;
padding: 1px; padding: 1px;
text-color: @base05; text-color: @text;
border-radius: @roundingpx; border-radius: 1.5em;
} }
textbox-prompt-colon { textbox-prompt-colon {
@ -41,8 +41,8 @@ textbox-prompt-colon {
entry { entry {
padding: 1px; padding: 1px;
margin: 0px; margin: 0px;
text-color: @base05; text-color: @text;
background-color: @base00; background-color: @base;
} }
listview { listview {
@ -50,26 +50,26 @@ listview {
margin: 5px 0px 0px 10px; margin: 5px 0px 0px 10px;
columns: 1; columns: 1;
lines: 10; lines: 10;
background-color: @base00; background-color: @base;
} }
element { element {
padding: 1px; padding: 1px;
background-color: @base00; background-color: @base;
text-color: @base05; text-color: @text;
} }
element-icon {size: 12px;} element-icon {size: 12px;}
element.selected { element.selected {
background-color: @base03; background-color: @surface1;
text-color: @accent; text-color: @accent;
} }
scrollbar { scrollbar {
width: 4px ; width: 4px ;
border: 0; border: 0;
handle-color: @base05; handle-color: @text;
handle-width: 8px ; handle-width: 8px ;
padding: 0; padding: 0;
} }
@ -78,13 +78,13 @@ mode-switcher {spacing: 0;}
button { button {
spacing: 0; spacing: 0;
background-color: @base02; background-color: @surface0;
text-color: @base04; text-color: @subtext1;
vertical-align: 0.5; vertical-align: 0.5;
horizontal-align: 0.5; horizontal-align: 0.5;
} }
button.selected { button.selected {
background-color: @base00; background-color: @base;
text-color: @accent; text-color: @accent;
} }

View file

@ -9,21 +9,21 @@ button, button:hover {
} }
window#waybar { window#waybar {
color: @base05; color: @text;
background: alpha(@base00, 0.9999999); background: alpha(@base, 0.9999999);
border-radius: @roundingpx; border-radius: 1em;
font-family: "CozetteVector", monospace, "FontAwesome 6 Free", "Noto Sans CJK"; font-family: "CozetteVector", monospace, "FontAwesome 6 Free", "Noto Sans CJK";
font-size: 13px; /* TODO: make this use proper font size */ font-size: 13px;
font-style: normal; font-style: normal;
border: 1px solid @base02; border: 1px solid @surface0;
} }
#workspaces, .modules-right box { #workspaces, .modules-right box {
background-color: @base02; background-color: @surface0;
margin: 0 0.25em; margin: 0 0.25em;
padding: 0.15em 0.25em; padding: 0.15em 0.25em;
border-radius: @roundingpx; border-radius: 1em;
} }
.modules-right label.module { .modules-right label.module {
margin: 0 0.5em; margin: 0 0.5em;
@ -37,32 +37,32 @@ window#waybar {
} }
#workspaces { #workspaces {
background-color: @base02; background-color: @surface0;
padding: 0; padding: 0;
} }
#workspaces button { #workspaces button {
background-color: transparent; background-color: transparent;
color: @base05; color: @text;
padding: 0 0.4em; padding: 0 0.4em;
transition: none; transition: none;
} }
#workspaces button:nth-child(1) { #workspaces button:nth-child(1) {
border-top-left-radius: @roundingpx; border-top-left-radius: 1em;
border-bottom-left-radius: @roundingpx; border-bottom-left-radius: 1em;
} }
#workspaces button:nth-last-child(1) { #workspaces button:nth-last-child(1) {
border-top-right-radius: @roundingpx; border-top-right-radius: 1em;
border-bottom-right-radius: @roundingpx; border-bottom-right-radius: 1em;
} }
#workspaces button.empty { #workspaces button.empty {
color: @base04; color: @overlay1;
} }
#workspaces button.visible { #workspaces button.visible {
background: @base03; background: @surface1;
} }
#workspaces button.focused { #workspaces button.focused {
@ -71,44 +71,47 @@ window#waybar {
#workspaces button.active { #workspaces button.active {
background: @accent; background: @accent;
color: @base02; color: @surface0;
} }
#workspaces button:hover { #workspaces button:hover {
background: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.1);
color: @base05; color: @text;
box-shadow: none; box-shadow: none;
} }
#workspaces button.active:hover { #workspaces button.active:hover {
background: @accent; background: @accent;
color: @base02; color: @surface0;
} }
#workspaces button.urgent { #workspaces button.urgent {
background: @base08; background: @red;
color: @base02; color: @surface0;
} }
#window { #window {
background: transparent; background: transparent;
} }
window#waybar.floating #window {
color: @pink;
}
#clock { #clock {
color: @base07; color: @lavender;
} }
#power-profiles-daemon { #power-profiles-daemon {
color: @base0C; color: @teal;
} }
#cpu, #network { #cpu, #network {
color: @base16; color: @sapphire;
} }
#network.disabled, #network.disconnected { #network.disabled, #network.disconnected {
color: @base04; color: @overlay1;
} }
@keyframes blink { @keyframes blink {
to { to {
color: @base05; color: @text;
} }
} }
@ -116,15 +119,15 @@ window#waybar {
animation-timing-function: linear; animation-timing-function: linear;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-direction: alternate; animation-direction: alternate;
color: @base07; color: @lavender;
} }
#memory.warning { #memory.warning {
color: @base09; color: @peach;
animation-name: blink; animation-name: blink;
animation-duration: 3s; animation-duration: 3s;
} }
#memory.critical { #memory.critical {
color: @base12; color: @maroon;
animation-name: blink; animation-name: blink;
animation-duration: 2s; animation-duration: 2s;
} }
@ -133,40 +136,40 @@ window#waybar {
animation-timing-function: linear; animation-timing-function: linear;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-direction: alternate; animation-direction: alternate;
color: @base0B; color: @green;
} }
/* this here is ditto */ /* this here is ditto */
#battery.charging { #battery.charging {
color: @base0B; color: @green;
} }
#battery.warning.discharging { #battery.warning.discharging {
color: @base09; color: @peach;
animation-name: blink; animation-name: blink;
animation-duration: 3s; animation-duration: 3s;
} }
#battery.critical.discharging { #battery.critical.discharging {
color: @base12; color: @maroon;
animation-name: blink; animation-name: blink;
animation-duration: 2s; animation-duration: 2s;
} }
#backlight, #custom-weather { #backlight, #custom-weather {
color: @base0A; color: @yellow;
} }
#pulseaudio { #pulseaudio {
color: @base17; color: @pink;
} }
#pulseaudio.muted { #pulseaudio.muted {
color: @base04; color: @overlay1;
} }
#custom-power { #custom-power {
color: @base08; color: @red;
} }
#custom-wallpaper, #custom-rgb { #custom-wallpaper, #custom-rgb {
color: @base04; color: @overlay1;
} }
#privacy { #privacy {
@ -175,7 +178,7 @@ window#waybar {
} }
#privacy-item { #privacy-item {
padding: 0 1px; padding: 0 1px;
color: @base05; color: @text;
} }
box#playback { box#playback {
@ -185,17 +188,17 @@ box#playback {
} }
#mpris { #mpris {
background-color: @base02; background-color: @surface0;
margin: 0 0.25em; margin: 0 0.25em;
padding: 0.15em 0.5em; padding: 0.15em 0.5em;
border-radius: @roundingpx; border-radius: 1em;
} }
#mpris.playing { #mpris.playing {
color: @accent; color: @accent;
background: @base02; background: @surface0;
} }
#mpris.paused, #mpris.stopped { #mpris.paused, #mpris.stopped {
color: @base04; color: @overlay1;
} }
window decoration { window decoration {
@ -203,10 +206,10 @@ window decoration {
} }
tooltip, window.popup menu { tooltip, window.popup menu {
background: @base00; background: @base;
border: 1px solid @base04; border: 1px solid @surface2;
font-size: 12px; font-size: 12px;
color: @base05; color: @text;
} }
tooltip *, window.popup { tooltip *, window.popup {
font-family: CozetteVector, monospace; font-family: CozetteVector, monospace;
@ -214,20 +217,20 @@ tooltip *, window.popup {
tooltip * { tooltip * {
padding: 0px; padding: 0px;
margin: 0px; margin: 0px;
color: @base05; color: @text;
} }
window.popup separator { window.popup separator {
background-color: @base02; background-color: @surface0;
} }
window.popup menuitem:disabled { window.popup menuitem:disabled {
color: @base04; color: @overlay1;
} }
window.popup menuitem:hover { window.popup menuitem:hover {
background-color: @accent; background-color: @accent;
color: @base02; color: @surface0;
} }
window.popup menuitem:hover > box { window.popup menuitem:hover > box {

View file

@ -12,38 +12,35 @@ in {
description = "Name of the theme to apply; see modules/desktop/themes for a list of valid options"; description = "Name of the theme to apply; see modules/desktop/themes for a list of valid options";
}; };
rounding = mkOpt int 10;
padding = mkOpt int 6;
dark = mkOpt bool false; dark = mkOpt bool false;
gtkTheme = { gtkTheme = {
name = mkOpt (nullOr str) null; name = mkOpt str "";
package = mkOpt (nullOr package) null; package = mkPackageOption pkgs "gtk" {};
}; };
kvantumTheme = { kvantumTheme = {
name = mkOpt (nullOr str) null; name = mkOpt str "";
package = mkOpt (nullOr package) null; package = mkPackageOption pkgs "kvantum" {};
}; };
iconTheme = { iconTheme = {
name = mkOpt (nullOr str) null; name = mkOpt str "";
package = mkOpt (nullOr package) null; package = mkPackageOption pkgs "icon" {};
}; };
cursorTheme = { cursorTheme = {
name = mkOpt (nullOr str) null; name = mkOpt str "";
package = mkOpt (nullOr package) null; package = mkPackageOption pkgs "cursor" {};
size = mkOpt int 24; size = mkOpt int 24;
}; };
editor = { editor = {
vscode = { vscode = {
colorTheme = { colorTheme = {
name = mkOpt (nullOr str) null; name = mkOpt str "";
extension = mkOpt (nullOr package) null; extension = mkPackageOption pkgs "extension" {};
}; };
iconTheme = { iconTheme = {
name = mkOpt (nullOr str) null; name = mkOpt str "";
extension = mkOpt (nullOr package) null; extension = mkPackageOption pkgs "extension" {};
}; };
}; };
}; };
@ -55,7 +52,7 @@ in {
background = mkOpt str ""; background = mkOpt str "";
}; };
waybarTop = mkOpt str ""; waybar = mkOpt str "";
wob = { wob = {
borderColor = mkOpt (nullOr str) null; borderColor = mkOpt (nullOr str) null;
@ -63,7 +60,9 @@ in {
barColor = mkOpt (nullOr str) null; barColor = mkOpt (nullOr str) null;
}; };
rofiTop = mkOpt (nullOr str) null; rofi = mkOpt (nullOr str) null;
fuzzel = mkOpt (nullOr str) null;
wezterm = mkOpt (nullOr str) null; wezterm = mkOpt (nullOr str) null;
@ -103,8 +102,8 @@ in {
hm.qt = { hm.qt = {
enable = true; enable = true;
platformTheme.name = if (cfg.kvantumTheme.name != null) then "qtct" else "gtk3"; platformTheme.name = "qtct";
style.name = mkIf (cfg.kvantumTheme.name != null) "kvantum"; style.name = "kvantum";
}; };
hm.home.pointerCursor = { hm.home.pointerCursor = {
@ -137,16 +136,7 @@ in {
}; };
}; };
hm.programs.waybar.style = (builtins.replaceStrings hm.programs.waybar.style = cfg.waybar;
[ "@rounding" ]
[ (builtins.toString cfg.rounding) ]
(builtins.concatStringsSep "\n" ([
cfg.waybarTop
(lib.readFile ./config/waybar.css)
]
++ lib.zipListsWith (name: hex: "@define-color base${name} #${hex};")
(builtins.genList (i: lib.fixedWidthString 2 "0" (lib.toUpper (lib.toHexString i))) 24)
config.scheme.toList)));
hm.services.wob.settings."" = { hm.services.wob.settings."" = {
border_color = cfg.wob.borderColor; border_color = cfg.wob.borderColor;
@ -154,16 +144,18 @@ in {
bar_color = cfg.wob.barColor; bar_color = cfg.wob.barColor;
}; };
hm.programs.rofi.theme = builtins.toFile "rofi.rasi" (builtins.replaceStrings # silly litle hack--rofi hm module doesn't play nice with strings
[ "@rounding" ] # so, we have to write the config to a file and then read it :P
[ (builtins.toString cfg.rounding) ] # ...and then back to a string
(builtins.concatStringsSep "\n" ([ hm.programs.rofi.theme = "${pkgs.writeTextFile {
cfg.rofiTop name = "rofi-theme.rasi";
(lib.readFile ./config/rofi.rasi) text = cfg.rofi;
] }}";
++ lib.zipListsWith (name: hex: "* { base${name}: #${hex}; }")
(builtins.genList (i: lib.fixedWidthString 2 "0" (lib.toUpper (lib.toHexString i))) 24) hm.programs.fuzzel.settings.main = {
config.scheme.toList))); include = cfg.fuzzel;
icon-theme = cfg.iconTheme.name;
};
hm.services.vicinae.settings.theme = let hm.services.vicinae.settings.theme = let
themeConf = { themeConf = {
@ -187,7 +179,7 @@ in {
Appearance = { Appearance = {
icon_theme = cfg.iconTheme.name; icon_theme = cfg.iconTheme.name;
standard_dialogs = "xdgdesktopportal"; standard_dialogs = "xdgdesktopportal";
style = "kvantum"; # its ok if this is always the case, override it anyway style = "kvantum";
}; };
Fonts = with config.modules.desktop.fonts.fonts; { Fonts = with config.modules.desktop.fonts.fonts; {
@ -195,25 +187,22 @@ in {
fixed = ''"${monospace.family},-1,${toString monospace.size},5,${toString weight},${zeros},1"''; fixed = ''"${monospace.family},-1,${toString monospace.size},5,${toString weight},${zeros},1"'';
}; };
}; };
in mkMerge [ in {
{ # technically could cause issues with KDE if we use that
# technically could cause issues with KDE if we use that # not a concern for now
# not a concern for now "kdeglobals".text = ''
"kdeglobals".text = '' [Icons]
[Icons] Theme=${cfg.iconTheme.name}
Theme=${cfg.iconTheme.name} '';
'';
"qt5ct/qt5ct.conf".source = iniFmt.generate "qt5ct.conf" (mkQtctConf 5); "Kvantum/${cfg.kvantumTheme.name}".source = "${cfg.kvantumTheme.package}/share/Kvantum/${cfg.kvantumTheme.name}";
"qt6ct/qt6ct.conf".source = iniFmt.generate "qt6ct.conf" (mkQtctConf 6); "Kvantum/kvantum.kvconfig".text = ''
} [General]
(mkIf (cfg.kvantumTheme.name != null) { theme=${cfg.kvantumTheme.name}
"Kvantum/${cfg.kvantumTheme.name}".source = "${cfg.kvantumTheme.package}/share/Kvantum/${cfg.kvantumTheme.name}"; '';
"Kvantum/kvantum.kvconfig".text = ''
[General] "qt5ct/qt5ct.conf".source = iniFmt.generate "qt5ct.conf" (mkQtctConf 5);
theme=${cfg.kvantumTheme.name} "qt6ct/qt6ct.conf".source = iniFmt.generate "qt6ct.conf" (mkQtctConf 6);
''; };
})
];
}; };
} }

View file

@ -1,82 +0,0 @@
{ inputs, config, lib, pkgs, system, ... }:
with lib;
let
cfg = config.modules.desktop.themes;
# TODO: gruvbox theme doesn't use these that much
accent = "pink";
accentBase = "base17";
dark = true;
darkString = if dark then "dark" else "light";
scheme = "${inputs.tt-schemes}/base24/gruvbox-${if dark then "dark" else "light"}.yaml";
pascalCase = s: (toUpper (substring 0 1 s)) + (toLower (substring 1 (stringLength s) s));
in {
config = mkIf (cfg.active == "gruvbox") {
scheme = scheme;
modules.desktop.themes = {
dark = dark;
rounding = 0;
gtkTheme = {
name = "Gruvbox-${pascalCase accent}-${pascalCase darkString}-Compact";
package = pkgs.gruvbox-gtk-theme.override {
colorVariants = [ darkString ];
themeVariants = [ accent ];
tweakVariants = [ "macos" ];
sizeVariants = [ "compact" ];
};
};
iconTheme = {
name = "Gruvbox-Plus-${pascalCase darkString}";
package = pkgs.gruvbox-plus-icons;
};
cursorTheme = {
name = "macOS";
package = pkgs.apple-cursor;
};
editor = {
vscode = {
colorTheme = {
name = "Gruvbox ${pascalCase darkString} Medium";
extension = pkgs.vscode-extensions.jdinhlife.gruvbox;
};
iconTheme = {
name = "material-icon-theme";
extension = pkgs.vscode-extensions.pkief.material-icon-theme;
};
};
};
niri = let
colors = config.scheme.withHashtag;
in with colors; {
accent = colors.${accentBase};
inactive = "${base02}";
shadow = "${base11}";
background = if dark then "${base11}" else "${base05}";
};
waybarTop = "@define-color accent @${accentBase};";
wob = with config.scheme; {
borderColor = "${base04}FF";
backgroundColor = "${base01}CC";
barColor = "${base05}FF";
};
rofiTop = "* { accent: @${accentBase}; }";
wezterm = ''
config.color_scheme = 'Gruvbox${pascalCase darkString}'
'';
vicinae = "gruvbox-${if dark then "dark" else "light"}";
};
};
}

View file

@ -6,7 +6,6 @@ let
in { in {
options.modules.desktop.vicinae = { options.modules.desktop.vicinae = {
enable = mkEnableOption "Enable vicinae, a launcher built in react"; enable = mkEnableOption "Enable vicinae, a launcher built in react";
dmenu = mkEnableOption "Use as a replacement for dmenu";
package = mkOption { package = mkOption {
type = types.package; type = types.package;
default = inputs.vicinae.packages.${system}.default; default = inputs.vicinae.packages.${system}.default;
@ -30,15 +29,14 @@ in {
# i disagree with these # i disagree with these
telemetry.system_info = false; telemetry.system_info = false;
providers.core.entrypoints.sponsor.enable = false;
pop_to_root_on_close = true; pop_to_root_on_close = true;
launcher_window = { launcher_window = {
opacity = 0.8; opacity = 0.8;
client_side_decorations.enabled = true; client_side_decorations.enabled = false;
client_side_decorations.border_width = 0;
client_side_decorations.rounding = config.modules.desktop.themes.rounding;
layer_shell = { layer_shell = {
enabled = true; enabled = true;
@ -53,24 +51,14 @@ in {
]; ];
providers = { providers = {
core.entrypoints = {
keybind-settings.enabled = false;
report-bug.enabled = false;
sponsor.enabled = false;
};
applications = { applications = {
preferences = { preferences = {
defaultAction = "launch"; defaultAction = "launch";
}; };
}; };
files.enabled = false;
manage-shortcuts.enabled = false;
theme.enabled = false;
developer.enabled = false;
}; };
fallbacks = [ "files:search" ];
escape_key_behavior = "close_window"; escape_key_behavior = "close_window";
font = let font = let
@ -84,20 +72,5 @@ in {
nix nix
] ++ optional config.modules.desktop.niri.enable niri; ] ++ optional config.modules.desktop.niri.enable niri;
}; };
user.packages = mkIf cfg.dmenu [ (pkgs.writeShellScriptBin "dmenu" ''
set -euo pipefail
prompt="select option"
while [ $# -gt 0 ]; do
case "$1" in
-p) shift; prompt="$1" ;;
esac
shift
done
vicinae dmenu --placeholder "$prompt"
'') ];
}; };
} }

View file

@ -23,18 +23,16 @@ in {
systemd.enable = true; systemd.enable = true;
package = cfg.package; package = cfg.package;
settings = let settings = {
inherit (config.modules.desktop.themes) padding;
in {
mainBar = mkMerge [ mainBar = mkMerge [
{ {
layer = "top"; layer = "top";
position = "top"; position = "top";
spacing = 4; spacing = 4;
height = 32; height = 32;
margin-top = padding; margin-top = 6;
margin-left = padding; margin-left = 6;
margin-right = padding; margin-right = 6;
margin-bottom = 0; margin-bottom = 0;
modules-left = [ modules-left = [
"niri/workspaces" "niri/workspaces"
@ -83,16 +81,7 @@ in {
powerMenuScript = pkgs.writeShellScript "power-menu" '' powerMenuScript = pkgs.writeShellScript "power-menu" ''
set -euo pipefail set -euo pipefail
cmd=$( cmd=$(echo ' shutdown| reboot|󰒲 sleep| hibernate| lock| exit desktop environment' | ${lib.getExe config.modules.desktop.rofi.package} -dmenu -sep '|' -i -p 'what to do ?')
printf "%s\n" \
" shutdown" \
" reboot" \
"󰒲 sleep" \
" hibernate" \
" lock" \
" exit desktop environment" \
| dmenu -p "what to do ?"
)
case "$cmd" in case "$cmd" in
" shutdown") " shutdown")
poweroff poweroff
@ -222,6 +211,20 @@ in {
power-saver = " save"; power-saver = " save";
}; };
}; };
battery = {
interval = 30;
states = {
warning = 20;
critical = 10;
};
design-capacity = false;
format = "{icon} {capacity}%";
format-icons = ["" "" "" "" ""];
format-critical = " {capacity}%";
format-charging = " {capacity}%";
tooltip = true;
tooltip-format = "{timeTo} ({power}W)";
};
privacy = { privacy = {
icon-spacing = 0; icon-spacing = 0;
icon-size = 12; icon-size = 12;
@ -312,22 +315,6 @@ in {
return-type = "json"; return-type = "json";
}; };
} }
(mkIf config.modules.core.laptop {
battery = {
interval = 30;
states = {
warning = 20;
critical = 10;
};
design-capacity = false;
format = "{icon} {capacity}%";
format-icons = ["" "" "" "" ""];
format-critical = " {capacity}%";
format-charging = " {capacity}%";
tooltip = true;
tooltip-format = "{timeTo} ({power}W)";
};
})
(mkIf config.modules.desktop.awww.enable { (mkIf config.modules.desktop.awww.enable {
"custom/wallpaper" = { "custom/wallpaper" = {
format = ""; format = "";

View file

@ -6,15 +6,11 @@ let
in { in {
options.modules.hardware.bluetooth = { options.modules.hardware.bluetooth = {
enable = mkEnableOption "Enable bluetooth, a short-range communication technology"; enable = mkEnableOption "Enable bluetooth, a short-range communication technology";
powerOnBoot = mkEnableOption {
default = !config.modules.core.laptop;
description = "Power up bluetooth devices on boot";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = cfg.powerOnBoot; hardware.bluetooth.powerOnBoot = true;
hardware.bluetooth.settings = { hardware.bluetooth.settings = {
General = { General = {
Experimental = true; Experimental = true;

View file

@ -1,6 +0,0 @@
{ pkgs, ... }:
{
config = {
hardware.enableRedistributableFirmware = true;
};
}

View file

@ -6,10 +6,7 @@ let
in { in {
options.modules.hardware.networking = { options.modules.hardware.networking = {
enable = mkEnableOption "Enable NetworkManager, a daemon for configuring network interfaces"; enable = mkEnableOption "Enable NetworkManager, a daemon for configuring network interfaces";
powersave = mkEnableOption { powersave = mkEnableOption "Enable power saving options over Wi-Fi";
default = config.modules.core.laptop;
description = "Enable power saving options over Wi-Fi";
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.hardware.audio; cfg = config.modules.hardware.pipewire;
in { in {
options.modules.hardware.audio = { options.modules.hardware.pipewire = {
enable = mkEnableOption "Enable audio through pipewire, a modern audio server"; enable = mkEnableOption "Enable pipewire, a modern audio server";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {

View file

@ -21,7 +21,7 @@ in {
find /var/lib/OpenRGB -name "*.orp" 2>/dev/null find /var/lib/OpenRGB -name "*.orp" 2>/dev/null
) )
selected=$(printf '%s\n' "''${files[@]}" | xargs -n1 basename | dmenu -p "select profile") selected=$(printf '%s\n' "''${files[@]}" | xargs -n1 basename | ${lib.getExe config.modules.desktop.rofi.package} -dmenu -i -p "select profile")
[[ -z "$selected" ]] && exit 0 [[ -z "$selected" ]] && exit 0

View file

@ -2,9 +2,9 @@
with lib; with lib;
let let
cfg = config.modules.core.security; cfg = config.modules.security;
in { in {
options.modules.core.security = { options.modules.security = {
useDoas = mkEnableOption "use opendoas instead of sudo"; useDoas = mkEnableOption "use opendoas instead of sudo";
}; };
@ -64,13 +64,28 @@ in {
# personal computer? no firewall ty :3 # personal computer? no firewall ty :3
networking.firewall.enable = false; networking.firewall.enable = false;
# stay up to date on firmware services.usbguard = {
IPCAllowedUsers = [ "root" "${env.mainUser}" ];
presentDevicePolicy = "allow";
rules = ''
allow with-interface equals { 08:*:* }
# reject devices with suspicious combination of interfaces (ex. mass storage + keyboard)
reject with-interface all-of { 08:*:* 03:00:* }
reject with-interface all-of { 08:*:* 03:01:* }
reject with-interface all-of { 08:*:* e0:*:* }
reject with-interface all-of { 08:*:* 02:*:* }
'';
};
services.fwupd.enable = true; services.fwupd.enable = true;
} }
(mkIf cfg.useDoas { (mkIf cfg.useDoas {
security.sudo.enable = false; security.sudo.enable = false;
security.doas.enable = true; security.doas.enable = true;
security.doas.extraRules = [ { users = [ config.user.name ]; noPass = true; persist = false; keepEnv = true; } ]; security.doas.extraRules = [
{ users = [ config.user.name ]; noPass = true; persist = false; keepEnv = true; }
];
environment.systemPackages = with pkgs; [ doas-sudo-shim ]; environment.systemPackages = with pkgs; [ doas-sudo-shim ];
}) })
]; ];

View file

@ -2,9 +2,9 @@
with lib; with lib;
let let
cfg = config.modules.software.tools.git; cfg = config.modules.software.dev.git;
in { in {
options.modules.software.tools.git = { options.modules.software.dev.git = {
enable = mkEnableOption "Enable git. You know what git is"; enable = mkEnableOption "Enable git. You know what git is";
package = mkOption { package = mkOption {
type = types.package; type = types.package;

View file

@ -17,6 +17,8 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
user.packages = [ finalPackage ]; user.packages = [
finalPackage
];
}; };
} }

View file

@ -28,8 +28,7 @@ in {
}; };
}; };
# TODO: rework these.. hm.xdg.configFile."micro/colorschemes/${schemeName}.micro".text = with config.colorScheme.palette; ''
hm.xdg.configFile."micro/colorschemes/${schemeName}.micro".text = with config.scheme; ''
color-link default "#${base05},#${base00}" color-link default "#${base05},#${base00}"
color-link comment "#${base03},#${base00}" color-link comment "#${base03},#${base00}"
color-link identifier "#${base0D},#${base00}" color-link identifier "#${base0D},#${base00}"

View file

@ -24,7 +24,9 @@ in {
programs.fish.enable = true; programs.fish.enable = true;
users.defaultUserShell = pkgs.fish; users.defaultUserShell = pkgs.fish;
hm.programs.fish = { hm.programs.fish = let
colorScript = nix-colors-lib.shellThemeFromScheme { scheme = config.colorScheme; };
in {
enable = true; enable = true;
plugins = let plugins = let
mkPlugin = name: { mkPlugin = name: {
@ -41,6 +43,7 @@ in {
]; ];
interactiveShellInit = '' interactiveShellInit = ''
${lib.getExe pkgs.nix-your-shell} fish | source ${lib.getExe pkgs.nix-your-shell} fish | source
sh ${colorScript}
''; '';
functions.fish_greeting = '' functions.fish_greeting = ''
${lib.getExe pkgs.fastfetch} --logo-type small --key-width 11 -s title:separator:os:host:kernel:uptime:memory:swap ${lib.getExe pkgs.fastfetch} --logo-type small --key-width 11 -s title:separator:os:host:kernel:uptime:memory:swap

View file

@ -24,10 +24,10 @@ in {
visualizer = { visualizer = {
mode = "noalbumart"; mode = "noalbumart";
}; };
modernz = with config.scheme.withHashtag; { modernz = with config.colorScheme.palette; {
bottomhover = "no"; bottomhover = "no";
hover_effect = ""; # these are weird lookin hover_effect = ""; # these are weird lookin
seekbarfg_color = "${base0D}"; # blue is a sane default seekbarfg_color = "#${base0D}"; # blue is a sane default
}; };
}; };

View file

@ -36,7 +36,7 @@ in {
config.freetype_load_flags = 'MONOCHROME' config.freetype_load_flags = 'MONOCHROME'
config.enable_wayland = true config.enable_wayland = true
config.use_fancy_tab_bar = false config.use_fancy_tab_bar = false
config.use_resize_increments = false config.use_resize_increments = true
config.initial_cols = 120 config.initial_cols = 120
config.initial_rows = 40 config.initial_rows = 40
config.window_background_opacity = 0.8 config.window_background_opacity = 0.8

View file

@ -0,0 +1,21 @@
{ lib, config, pkgs, ... }:
with lib;
let
# TODO: move this dawg
cfg = config.modules.software.system.zswap;
in {
options.modules.software.system.zswap = {
enable = mkEnableOption "Enable zswap, a compressed RAM cache for swap pages";
};
config = mkIf cfg.enable {
boot.kernelParams = [
"zswap.enabled=1"
"zswap.shrinker_enabled=1" # high mem: shrink zswap, mv to swap
"zswap.max_pool_percent=20" # TODO: tune this (keep in mind shrinker is enabled)
"zswap.compressor=zstd"
"zswap.zpool=zsmalloc"
];
};
}

View file

@ -1,18 +0,0 @@
{ lib, config, ... }:
with lib;
let
cfg = config.modules.software.tools.direnv;
in {
options.modules.software.tools.direnv = {
enable = mkEnableOption "Enable direnv, a shell extension that manages your environment";
};
config = mkIf cfg.enable {
programs.direnv = {
enable = true;
silent = true;
nix-direnv.enable = true;
};
};
}

View file

@ -0,0 +1,14 @@
{ config, lib, ... }:
with lib;
let
cfg = config.modules.software.tools.noisetorch;
in {
options.modules.software.tools.noisetorch = {
enable = mkEnableOption "Enable noisetorch, a microphone noise supression tool";
};
config = mkIf cfg.enable {
programs.noisetorch.enable = true;
};
}

View file

@ -1,28 +0,0 @@
{ lib, stdenvNoCC }:
stdenvNoCC.mkDerivation {
pname = "loveletter";
version = "1.0.0";
# i think i got this off of a cd collection on nyaa and it had some bootleg stuff too
# looks to be the same as http://www.konaka.com/alice6/lain/resources.html
# downloaded locally bcz the source's uptime isn't trustworthy
src = ./.;
installPhase = ''
runHook preInstall
install -Dm644 -t $out/share/fonts/truetype ./loveletter.ttf
runHook postInstall
'';
meta = with lib; {
description = "The LoveLetter font as featured in Serial Experiments Lain";
homepage = "http://www.konaka.com/alice6/lain/resources.html";
# idk what to put here:
# license = licenses.ofl;
platforms = platforms.all;
};
}

Binary file not shown.