some changes

This commit is contained in:
zack 2025-04-27 11:11:51 -04:00
parent 2d25c605b7
commit 825f05c50a
No known key found for this signature in database
GPG key ID: EE8A2B709E2401D1
45 changed files with 1826 additions and 1586 deletions

464
flake.lock generated

File diff suppressed because it is too large Load diff

View file

@ -28,14 +28,11 @@
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
resume.url = "git+https://git.zoeys.cloud/zoey/resume";
anyrun.url = "github:anyrun-org/anyrun";
anyrun.inputs.nixpkgs.follows = "nixpkgs";
resume.url = "path:/home/zoey/dev/resume";
ags.url = "github:Aylur/ags/v1";
ags.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
agenix.inputs.darwin.follows = "";
# to replace with sops-nix
sops-nix.url = "github:Mic92/sops-nix";
@ -52,7 +49,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
blog.url = "git+https://git.zoeys.cloud/zoey/web";
blog.url = "path:/home/zoey/dev/web";
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
@ -101,12 +98,11 @@
};
umu.url = "github:Open-Wine-Components/umu-launcher?dir=packaging/nix";
# umu.inputs.nixpkgs.follows = "nixpkgs";
zen-browser.url = "github:0xc000022070/zen-browser-flake";
zoeycomputer = {
url = "git+https://git.zoeys.cloud/zoey/zoeys.computer";
url = "path:/home/zoey/dev/zoeys.computer";
inputs.nixpkgs.follows = "nixpkgs";
};
@ -173,7 +169,6 @@
homes.modules = with inputs; [
spicetify-nix.homeManagerModules.default
catppuccin.homeModules.catppuccin
anyrun.homeManagerModules.default
ags.homeManagerModules.default
];

View file

@ -10,6 +10,7 @@
apps = {
web.librewolf.enable = true;
web.zen.setDefault = true;
web.zen.enable = true;
tools.git.enable = true;
tools.tmux.enable = true;
@ -35,8 +36,8 @@
mail.aerc.enable = true;
helpers = {
rofi.enable = true;
waybar.enable = true;
swaync.enable = true;
};
};
@ -127,7 +128,6 @@
pkgs.heroic
pkgs.cartridges
pkgs.discord-canary
pkgs.darktable
@ -178,17 +178,9 @@
pkgs.parsec-bin
pkgs.filezilla
lib.custom.nixos-stable.zed-editor
pkgs.zed-editor
pkgs.rmpc
# (inputs.zen-browser.packages.${pkgs.system}.twilight.overrideAttrs {
# version = "1.7.7t";
# src = builtins.fetchTarball {
# url = "https://github.com/zen-browser/desktop/releases/download/twilight/zen.linux-x86_64.tar.xz";
# sha256 = "sha256:1wgkqdfny6bqwmpka6knrjzsidpm3v5kiijkmszg7wiisl47lgal";
# };
# })
inputs.zen-browser.packages.${pkgs.system}.beta
pkgs.starfetch
@ -277,20 +269,6 @@
catppuccin.enable = true;
};
# systemd.user.services.xwaylandvideobridge = {
# Unit = {
# Description = "Tool to make it easy to stream wayland windows and screens to exisiting applications running under Xwayland";
# };
# Service = {
# Type = "simple";
# ExecStart = lib.getExe pkgs.xwaylandvideobridge;
# Restart = "on-failure";
# };
# Install = {
# WantedBy = ["default.target"];
# };
# };
services = {
gpg-agent = {
enable = true;

View file

@ -1,22 +1,203 @@
{
{lib}: let
hexCharToInt = char: let
charCode = lib.strings.charToInt char;
zeroCode = lib.strings.charToInt "0";
nineCode = lib.strings.charToInt "9";
aCode = lib.strings.charToInt "a";
fCode = lib.strings.charToInt "f";
ACode = lib.strings.charToInt "A";
FCode = lib.strings.charToInt "F";
in
if charCode >= zeroCode && charCode <= nineCode
then charCode - zeroCode
else if charCode >= aCode && charCode <= fCode
then charCode - aCode + 10
else if charCode >= ACode && charCode <= FCode
then charCode - ACode + 10
else builtins.throw "Invalid hex character: ${builtins.toString char}";
hexCompToInt = hexComp: let
trimmedStr = lib.strings.removePrefix "0x" hexComp;
chars = lib.strings.stringToCharacters trimmedStr;
op = acc: char: (acc * 16) + (hexCharToInt char);
in
if trimmedStr == ""
then 0
else builtins.foldl' op 0 chars;
intCompToHex = intComp: let
clampedInt = lib.max 0 (lib.min 255 (builtins.floor (intComp + 0.5)));
hexString = lib.trivial.toHexString clampedInt;
in
lib.strings.fixedWidthString 2 "0" hexString;
hexToRgb = hexColor: let
hex = lib.strings.removePrefix "#" hexColor;
in {
r = hexCompToInt (lib.strings.substring 0 2 hex);
g = hexCompToInt (lib.strings.substring 2 2 hex);
b = hexCompToInt (lib.strings.substring 4 2 hex);
};
rgbToHex = rgbColor: "#${intCompToHex rgbColor.r}${intCompToHex rgbColor.g}${intCompToHex rgbColor.b}";
/**
* Linearly interpolates between two hex colors.
*
* @param color1Hex - The starting color hex string (e.g., "#RRGGBB").
* @param color2Hex - The ending color hex string (e.g., "#RRGGBB").
* @param t - The interpolation factor (float, typically 0.0 to 1.0).
* @return The blended color as a hex string "#RRGGBB".
*/
lerpColorFunc = color1Hex: color2Hex: t: let
rgb1 = hexToRgb color1Hex;
rgb2 = hexToRgb color2Hex;
lerpedR = (rgb1.r * (1.0 - t)) + (rgb2.r * t);
lerpedG = (rgb1.g * (1.0 - t)) + (rgb2.g * t);
lerpedB = (rgb1.b * (1.0 - t)) + (rgb2.b * t);
resultRgb = {
r = lerpedR;
g = lerpedG;
b = lerpedB;
};
in
rgbToHex resultRgb;
in {
x = c: "#${c}";
colors = {
"base" = "191724";
"surface" = "1f1d2e";
"overlay" = "26233a";
"muted" = "6e6a86";
"subtle" = "6e6a86";
"text" = "e0def4";
"love" = "eb6f92";
"gold" = "f6c177";
"rose" = "ebbcba";
"pine" = "31748f";
"foam" = "9ccfd8";
"iris" = "c4a7e7";
"highlightlow" = "21202e";
"highlightmed" = "403d52";
"highlighthigh" = "524f67";
rosewater = {
hex = "#f5e0dc";
rgb = "rgb(245, 224, 220)";
hsl = "hsl(10, 56%, 91%)";
};
flamingo = {
hex = "#f2cdcd";
rgb = "rgb(242, 205, 205)";
hsl = "hsl(0, 59%, 88%)";
};
pink = {
hex = "#f5c2e7";
rgb = "rgb(245, 194, 231)";
hsl = "hsl(316, 72%, 86%)";
};
mauve = {
hex = "#cba6f7";
rgb = "rgb(203, 166, 247)";
hsl = "hsl(267, 84%, 81%)";
};
red = {
hex = "#f38ba8";
rgb = "rgb(243, 139, 168)";
hsl = "hsl(343, 81%, 75%)";
};
maroon = {
hex = "#eba0ac";
rgb = "rgb(235, 160, 172)";
hsl = "hsl(350, 65%, 77%)";
};
peach = {
hex = "#fab387";
rgb = "rgb(250, 179, 135)";
hsl = "hsl(25, 92%, 75%)";
};
yellow = {
hex = "#f9e2af";
rgb = "rgb(249, 226, 175)";
hsl = "hsl(41, 86%, 83%)";
};
green = {
hex = "#a6e3a1";
rgb = "rgb(166, 227, 161)";
hsl = "hsl(115, 54%, 76%)";
};
teal = {
hex = "#94e2d5";
rgb = "rgb(148, 226, 213)";
hsl = "hsl(170, 57%, 73%)";
};
sky = {
hex = "#89dceb";
rgb = "rgb(137, 220, 235)";
hsl = "hsl(190, 71%, 73%)";
};
sapphire = {
hex = "#74c7ec";
rgb = "rgb(116, 199, 236)";
hsl = "hsl(200, 77%, 69%)";
};
blue = {
hex = "#89b4fa";
rgb = "rgb(137, 180, 250)";
hsl = "hsl(217, 91%, 76%)";
};
lavender = {
hex = "#b4befe";
rgb = "rgb(180, 190, 254)";
hsl = "hsl(232, 97%, 85%)";
};
text = {
hex = "#cdd6f4";
rgb = "rgb(205, 214, 244)";
hsl = "hsl(226, 64%, 88%)";
};
subtext1 = {
hex = "#bac2de";
rgb = "rgb(186, 194, 222)";
hsl = "hsl(227, 36%, 80%)";
};
subtext0 = {
hex = "#a6adc8";
rgb = "rgb(166, 173, 200)";
hsl = "hsl(228, 26%, 72%)";
};
overlay2 = {
hex = "#9399b2";
rgb = "rgb(147, 153, 178)";
hsl = "hsl(228, 19%, 64%)";
};
overlay1 = {
hex = "#7f849c";
rgb = "rgb(127, 132, 156)";
hsl = "hsl(230, 15%, 55%)";
};
overlay0 = {
hex = "#6c7086";
rgb = "rgb(108, 112, 134)";
hsl = "hsl(232, 11%, 47%)";
};
surface2 = {
hex = "#585b70";
rgb = "rgb(88, 91, 112)";
hsl = "hsl(233, 12%, 39%)";
};
surface1 = {
hex = "#45475a";
rgb = "rgb(69, 71, 90)";
hsl = "hsl(234, 13%, 31%)";
};
surface0 = {
hex = "#313244";
rgb = "rgb(49, 50, 68)";
hsl = "hsl(237, 16%, 23%)";
};
base = {
hex = "#1e1e2e";
rgb = "rgb(30, 30, 46)";
hsl = "hsl(240, 21%, 15%)";
};
mantle = {
hex = "#181825";
rgb = "rgb(24, 24, 37)";
hsl = "hsl(240, 21%, 12%)";
};
crust = {
hex = "#11111b";
rgb = "rgb(17, 17, 27)";
hsl = "hsl(240, 23%, 9%)";
};
};
fonts = {
@ -28,5 +209,7 @@
};
};
wallpaper = ./wall4p.jpg;
wallpaper = ./svema_26_big.jpg;
lerpColor = lerpColorFunc;
}

BIN
lib/theme/svema_26_big.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

View file

@ -48,7 +48,43 @@ in {
programs.ags = {
enable = true;
configDir = ./cfg;
# Generate _colors.scss with our theme colors
configDir = pkgs.runCommand "ags-config" {} ''
cp -r ${./cfg} $out
chmod -R +w $out
cat > $out/scss/_colors.scss << EOF
/* Generated from lib/theme/default.nix */
$rosewater: ${colors.rosewater.hex};
$flamingo: ${colors.flamingo.hex};
$pink: ${colors.pink.hex};
$mauve: ${colors.mauve.hex};
$red: ${colors.red.hex};
$maroon: ${colors.maroon.hex};
$peach: ${colors.peach.hex};
$yellow: ${colors.yellow.hex};
$green: ${colors.green.hex};
$teal: ${colors.teal.hex};
$sky: ${colors.sky.hex};
$sapphire: ${colors.sapphire.hex};
$blue: ${colors.blue.hex};
$lavender: ${colors.lavender.hex};
$text: ${colors.text.hex};
$subtext1: ${colors.subtext1.hex};
$subtext0: ${colors.subtext0.hex};
$overlay2: ${colors.overlay2.hex};
$overlay1: ${colors.overlay1.hex};
$overlay0: ${colors.overlay0.hex};
$surface2: ${colors.surface2.hex};
$surface1: ${colors.surface1.hex};
$surface0: ${colors.surface0.hex};
$base: ${colors.base.hex};
$mantle: ${colors.mantle.hex};
$crust: ${colors.crust.hex};
/* Default accent color */
$accent: ${colors.sapphire.hex};
EOF
'';
extraPackages = dependencies;
};

View file

@ -14,100 +14,102 @@ in {
enable = mkBoolOpt false "Enable Anyrun";
};
config = mkIf cfg.enable {
programs.anyrun = {
enable = true;
config = {
plugins = [
inputs.anyrun.packages.${pkgs.system}.applications
inputs.anyrun.packages.${pkgs.system}.shell
inputs.anyrun.packages.${pkgs.system}.websearch
inputs.anyrun.packages.${pkgs.system}.rink
inputs.anyrun.packages.${pkgs.system}.stdin
];
x = {fraction = 0.5;};
y = {absolute = 0;};
hideIcons = false;
ignoreExclusiveZones = false;
layer = "overlay";
hidePluginInfo = true;
closeOnClick = true;
showResultsImmediately = false;
maxEntries = null;
};
extraCss = ''
*{
all: unset;
color: #cdd6f4;
font-family: "JetBrainsMono Nerd Font";
font-weight: bold;
}
#window{
background-color: transparent;
}
#entry{
background-color: #1e1e2e;
border-radius: 15px;
border: 3px solid #11111b;
font-size: 16px;
margin-top: 10px;
padding: 1px 15px;
}
#match {
margin-bottom: 2px;
margin-top: 2px;
padding: 1px 15px;
}
#match-desc{
color: #bac2de;
font-size: 12px;
font-weight: normal;
}
#match:selected {
background: #313244;
border-radius: 15px;
}
#plugin{
background-color: #1e1e2e;
border-radius: 15px;
border: 3px solid #11111b;
margin-top:10px;
padding: 10px 1px;
}
#plugin > *{
all:unset;
}
'';
extraConfigFiles."applications.ron".text = ''
Config(
desktop_actions: false,
max_entries: 5,
terminal: Some("Kitty"),
)
'';
extraConfigFiles."shell.ron".text = ''
Config(
prefix: ">",
)
'';
extraConfigFiles."websearch.ron".text = ''
Config(
prefix: "",
// Options: Google, Ecosia, Bing, DuckDuckGo, Custom
//
// Custom engines can be defined as such:
// Custom(
// name: "Searx",
// url: "searx.be/?q={}",
// )
//
// NOTE: `{}` is replaced by the search query and `https://` is automatically added in front.
engines: [DuckDuckGo]
)
'';
config =
mkIf cfg.enable {
};
};
# programs.anyrun = {
# enable = true;
# config = {
# plugins = [
# inputs.anyrun.packages.${pkgs.system}.applications
# inputs.anyrun.packages.${pkgs.system}.shell
# inputs.anyrun.packages.${pkgs.system}.websearch
# inputs.anyrun.packages.${pkgs.system}.rink
# inputs.anyrun.packages.${pkgs.system}.stdin
# ];
# x = {fraction = 0.5;};
# y = {absolute = 0;};
# hideIcons = false;
# ignoreExclusiveZones = false;
# layer = "overlay";
# hidePluginInfo = true;
# closeOnClick = true;
# showResultsImmediately = false;
# maxEntries = null;
# };
# extraCss = ''
# *{
# all: unset;
# color: #cdd6f4;
# font-family: "JetBrainsMono Nerd Font";
# font-weight: bold;
# }
# #window{
# background-color: transparent;
# }
# #entry{
# background-color: #1e1e2e;
# border-radius: 15px;
# border: 3px solid #11111b;
# font-size: 16px;
# margin-top: 10px;
# padding: 1px 15px;
# }
# #match {
# margin-bottom: 2px;
# margin-top: 2px;
# padding: 1px 15px;
# }
# #match-desc{
# color: #bac2de;
# font-size: 12px;
# font-weight: normal;
# }
# #match:selected {
# background: #313244;
# border-radius: 15px;
# }
# #plugin{
# background-color: #1e1e2e;
# border-radius: 15px;
# border: 3px solid #11111b;
# margin-top:10px;
# padding: 10px 1px;
# }
# #plugin > *{
# all:unset;
# }
# '';
#
# extraConfigFiles."applications.ron".text = ''
# Config(
# desktop_actions: false,
# max_entries: 5,
# terminal: Some("Kitty"),
# )
# '';
#
# extraConfigFiles."shell.ron".text = ''
# Config(
# prefix: ">",
# )
# '';
#
# extraConfigFiles."websearch.ron".text = ''
# Config(
# prefix: "",
# // Options: Google, Ecosia, Bing, DuckDuckGo, Custom
# //
# // Custom engines can be defined as such:
# // Custom(
# // name: "Searx",
# // url: "searx.be/?q={}",
# // )
# //
# // NOTE: `{}` is replaced by the search query and `https://` is automatically added in front.
# engines: [DuckDuckGo]
# )
# '';
# };
# };
}

View file

@ -1,80 +0,0 @@
{
options,
config,
lib,
inputs,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.apps.helpers.snc;
in {
options.apps.helpers.snc = with types; {
enable = mkBoolOpt false "Enable Sway Notification Center";
};
config = mkIf cfg.enable {
home = {
packages = with pkgs; [swaynotificationcenter];
# Copy the theme file to the correct location
file.".config/swaync/style.css".source = ./theme/ctp.css;
# Create default config file
file.".config/swaync/config.json".text = builtins.toJSON {
"$schema" = "/etc/xdg/swaync/configSchema.json";
"positionX" = "right";
"positionY" = "top";
"layer" = "overlay";
"control-center-margin-top" = 0;
"control-center-margin-bottom" = 0;
"control-center-margin-right" = 0;
"control-center-margin-left" = 0;
"notification-icon-size" = 64;
"notification-body-image-height" = 100;
"notification-body-image-width" = 200;
"timeout" = 10;
"timeout-low" = 5;
"timeout-critical" = 0;
"fit-to-screen" = true;
"control-center-width" = 500;
"notification-window-width" = 500;
"keyboard-shortcuts" = true;
"image-visibility" = "when-available";
"transition-time" = 200;
"hide-on-clear" = false;
"hide-on-action" = true;
"script-fail-notify" = true;
"scripts" = {};
"notification-visibility" = {};
"widgets" = [
"title"
"dnd"
"notifications"
];
};
};
# Add systemd user service
systemd.user.services.swaync = {
Unit = {
Description = "Sway Notification Center";
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.swaynotificationcenter}/bin/swaync";
ExecReload = "${pkgs.swaynotificationcenter}/bin/swaync-client --reload-config";
Restart = "always";
RestartSec = 3;
};
Install = {
WantedBy = ["graphical-session.target"];
};
};
};
}

View file

@ -1,451 +0,0 @@
* {
all: unset;
font-size: 14px;
font-family: "Iosevka";
transition: 200ms;
}
trough highlight {
background: #cdd6f4;
}
scale trough {
margin: 0rem 1rem;
background-color: #313244;
min-height: 8px;
min-width: 70px;
}
slider {
background-color: #89b4fa;
}
.floating-notifications.background .notification-row .notification-background {
box-shadow:
0 0 8px 0 rgba(0, 0, 0, 0.8),
inset 0 0 0 1px #313244;
border-radius: 12.6px;
margin: 18px;
background-color: #1e1e2e;
color: #cdd6f4;
padding: 0;
}
.floating-notifications.background
.notification-row
.notification-background
.notification {
padding: 7px;
border-radius: 12.6px;
}
.floating-notifications.background
.notification-row
.notification-background
.notification.critical {
box-shadow: inset 0 0 7px 0 #f38ba8;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
.notification-content {
margin: 7px;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
.notification-content
.summary {
color: #cdd6f4;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
.notification-content
.time {
color: #a6adc8;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
.notification-content
.body {
color: #cdd6f4;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
> *:last-child
> * {
min-height: 3.4em;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
> *:last-child
> *
.notification-action {
border-radius: 7px;
color: #cdd6f4;
background-color: #313244;
box-shadow: inset 0 0 0 1px #45475a;
margin: 7px;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
> *:last-child
> *
.notification-action:hover {
box-shadow: inset 0 0 0 1px #45475a;
background-color: #313244;
color: #cdd6f4;
}
.floating-notifications.background
.notification-row
.notification-background
.notification
> *:last-child
> *
.notification-action:active {
box-shadow: inset 0 0 0 1px #45475a;
background-color: #74c7ec;
color: #cdd6f4;
}
.floating-notifications.background
.notification-row
.notification-background
.close-button {
margin: 7px;
padding: 2px;
border-radius: 6.3px;
color: #1e1e2e;
background-color: #f38ba8;
}
.floating-notifications.background
.notification-row
.notification-background
.close-button:hover {
background-color: #eba0ac;
color: #1e1e2e;
}
.floating-notifications.background
.notification-row
.notification-background
.close-button:active {
background-color: #f38ba8;
color: #1e1e2e;
}
.control-center {
box-shadow:
0 0 8px 0 rgba(0, 0, 0, 0.8),
inset 0 0 0 1px #313244;
border-radius: 12.6px;
margin: 18px;
background-color: #1e1e2e;
color: #cdd6f4;
padding: 14px;
}
.control-center .widget-title > label {
color: #cdd6f4;
font-size: 1.3em;
}
.control-center .widget-title button {
border-radius: 7px;
color: #cdd6f4;
background-color: #313244;
box-shadow: inset 0 0 0 1px #45475a;
padding: 8px;
}
.control-center .widget-title button:hover {
box-shadow: inset 0 0 0 1px #45475a;
background-color: #585b70;
color: #cdd6f4;
}
.control-center .widget-title button:active {
box-shadow: inset 0 0 0 1px #45475a;
background-color: #74c7ec;
color: #1e1e2e;
}
.control-center .notification-row .notification-background {
border-radius: 7px;
color: #cdd6f4;
background-color: #313244;
box-shadow: inset 0 0 0 1px #45475a;
margin-top: 14px;
}
.control-center .notification-row .notification-background .notification {
padding: 7px;
border-radius: 7px;
}
.control-center
.notification-row
.notification-background
.notification.critical {
box-shadow: inset 0 0 7px 0 #f38ba8;
}
.control-center
.notification-row
.notification-background
.notification
.notification-content {
margin: 7px;
}
.control-center
.notification-row
.notification-background
.notification
.notification-content
.summary {
color: #cdd6f4;
}
.control-center
.notification-row
.notification-background
.notification
.notification-content
.time {
color: #a6adc8;
}
.control-center
.notification-row
.notification-background
.notification
.notification-content
.body {
color: #cdd6f4;
}
.control-center
.notification-row
.notification-background
.notification
> *:last-child
> * {
min-height: 3.4em;
}
.control-center
.notification-row
.notification-background
.notification
> *:last-child
> *
.notification-action {
border-radius: 7px;
color: #cdd6f4;
background-color: #11111b;
box-shadow: inset 0 0 0 1px #45475a;
margin: 7px;
}
.control-center
.notification-row
.notification-background
.notification
> *:last-child
> *
.notification-action:hover {
box-shadow: inset 0 0 0 1px #45475a;
background-color: #313244;
color: #cdd6f4;
}
.control-center
.notification-row
.notification-background
.notification
> *:last-child
> *
.notification-action:active {
box-shadow: inset 0 0 0 1px #45475a;
background-color: #74c7ec;
color: #cdd6f4;
}
.control-center .notification-row .notification-background .close-button {
margin: 7px;
padding: 2px;
border-radius: 6.3px;
color: #1e1e2e;
background-color: #eba0ac;
}
.close-button {
border-radius: 6.3px;
}
.control-center .notification-row .notification-background .close-button:hover {
background-color: #f38ba8;
color: #1e1e2e;
}
.control-center
.notification-row
.notification-background
.close-button:active {
background-color: #f38ba8;
color: #1e1e2e;
}
.control-center .notification-row .notification-background:hover {
box-shadow: inset 0 0 0 1px #45475a;
background-color: #7f849c;
color: #cdd6f4;
}
.control-center .notification-row .notification-background:active {
box-shadow: inset 0 0 0 1px #45475a;
background-color: #74c7ec;
color: #cdd6f4;
}
.notification.critical progress {
background-color: #f38ba8;
}
.notification.low progress,
.notification.normal progress {
background-color: #89b4fa;
}
.control-center-dnd {
margin-top: 5px;
border-radius: 8px;
background: #313244;
border: 1px solid #45475a;
box-shadow: none;
}
.control-center-dnd:checked {
background: #313244;
}
.control-center-dnd slider {
background: #45475a;
border-radius: 8px;
}
.widget-dnd {
margin: 0px;
font-size: 1.1rem;
}
.widget-dnd > switch {
font-size: initial;
border-radius: 8px;
background: #313244;
border: 1px solid #45475a;
box-shadow: none;
}
.widget-dnd > switch:checked {
background: #313244;
}
.widget-dnd > switch slider {
background: #45475a;
border-radius: 8px;
border: 1px solid #6c7086;
}
.widget-mpris .widget-mpris-player {
background: #313244;
padding: 7px;
}
.widget-mpris .widget-mpris-title {
font-size: 1.2rem;
}
.widget-mpris .widget-mpris-subtitle {
font-size: 0.8rem;
}
.widget-menubar > box > .menu-button-bar > button > label {
font-size: 3rem;
padding: 0.5rem 2rem;
}
.widget-menubar > box > .menu-button-bar > :last-child {
color: #f38ba8;
}
.power-buttons button:hover,
.powermode-buttons button:hover,
.screenshot-buttons button:hover {
background: #313244;
}
.control-center .widget-label > label {
color: #cdd6f4;
font-size: 2rem;
}
.widget-buttons-grid {
padding-top: 1rem;
}
.widget-buttons-grid > flowbox > flowboxchild > button label {
font-size: 2.5rem;
}
.widget-volume {
padding-top: 1rem;
}
.widget-volume label {
font-size: 1.5rem;
color: #74c7ec;
}
.widget-volume trough highlight {
background: #74c7ec;
}
.widget-backlight trough highlight {
background: #f9e2af;
}
.widget-backlight label {
font-size: 1.5rem;
color: #f9e2af;
}
.widget-backlight .KB {
padding-bottom: 1rem;
}
.image {
padding-right: 0.5rem;
}

View file

@ -51,12 +51,12 @@ in {
inherit (config.lib.formats.rasi) mkLiteral;
in {
"*" = {
background = "#181825";
prompt = "#1e1e2e";
border = "#313244";
text = "#cdd6f4";
stext = "#45475a";
select = "#1e1e2e";
background = colors.mantle.hex;
prompt = colors.base.hex;
border = colors.surface0.hex;
text = colors.text.hex;
stext = colors.surface1.hex;
select = colors.base.hex;
"background-color" = mkLiteral "transparent";
"text-color" = mkLiteral "@text";
margin = 0;
@ -143,15 +143,42 @@ in {
};
};
# Create the colors.rasi file
# Create the colors.rasi file with our theme colors
xdg.configFile."rofi/colors.rasi".text = ''
* {
background: #181825;
prompt: #1e1e2e;
border: #313244;
text: #cdd6f4;
stext: #45475a;
select: #1e1e2e;
background: ${colors.mantle.hex};
prompt: ${colors.base.hex};
border: ${colors.surface0.hex};
text: ${colors.text.hex};
stext: ${colors.surface1.hex};
select: ${colors.base.hex};
/* Full color palette */
rosewater: ${colors.rosewater.hex};
flamingo: ${colors.flamingo.hex};
pink: ${colors.pink.hex};
mauve: ${colors.mauve.hex};
red: ${colors.red.hex};
maroon: ${colors.maroon.hex};
peach: ${colors.peach.hex};
yellow: ${colors.yellow.hex};
green: ${colors.green.hex};
teal: ${colors.teal.hex};
sky: ${colors.sky.hex};
sapphire: ${colors.sapphire.hex};
blue: ${colors.blue.hex};
lavender: ${colors.lavender.hex};
subtext0: ${colors.subtext0.hex};
subtext1: ${colors.subtext1.hex};
overlay0: ${colors.overlay0.hex};
overlay1: ${colors.overlay1.hex};
overlay2: ${colors.overlay2.hex};
surface0: ${colors.surface0.hex};
surface1: ${colors.surface1.hex};
surface2: ${colors.surface2.hex};
base: ${colors.base.hex};
mantle: ${colors.mantle.hex};
crust: ${colors.crust.hex};
}
'';

View file

@ -0,0 +1,366 @@
{
options,
config,
lib,
inputs,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.apps.helpers.swaync;
in {
options.apps.helpers.swaync = with types; {
enable = mkBoolOpt false "Enable SwayNC";
};
config = mkIf cfg.enable {
services.swaync = {
enable = true;
style = lib.mkForce ''
* {
all: unset;
font-size: 14px;
font-family: "Adwaita Sans", "JetBrains Mono Nerd Font";
transition: 200ms;
}
trough highlight {
background: ${colors.text.hex};
}
scale trough {
margin: 0rem 1rem;
background-color: ${colors.surface0.hex};
min-height: 8px;
min-width: 70px;
}
slider {
background-color: ${colors.blue.hex};
}
.floating-notifications.background .notification-row .notification-background {
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px ${colors.surface0.hex};
border-radius: 12.6px;
margin: 18px;
background-color: ${colors.base.hex};
color: ${colors.text.hex};
padding: 0;
}
.floating-notifications.background .notification-row .notification-background .notification {
padding: 7px;
border-radius: 12.6px;
}
.floating-notifications.background .notification-row .notification-background .notification.critical {
box-shadow: inset 0 0 7px 0 ${colors.red.hex};
}
.floating-notifications.background .notification-row .notification-background .notification .notification-content {
margin: 7px;
}
.floating-notifications.background .notification-row .notification-background .notification .notification-content .summary {
color: ${colors.text.hex};
}
.floating-notifications.background .notification-row .notification-background .notification .notification-content .time {
color: ${colors.subtext0.hex};
}
.floating-notifications.background .notification-row .notification-background .notification .notification-content .body {
color: ${colors.text.hex};
}
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * {
min-height: 3.4em;
}
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action {
border-radius: 7px;
color: ${colors.text.hex};
background-color: ${colors.surface0.hex};
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
margin: 7px;
}
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action:hover {
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
background-color: ${colors.surface0.hex};
color: ${colors.text.hex};
}
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action:active {
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
background-color: ${colors.sky.hex};
color: ${colors.text.hex};
}
.floating-notifications.background .notification-row .notification-background .close-button {
margin: 7px;
padding: 2px;
border-radius: 6.3px;
color: ${colors.base.hex};
background-color: ${colors.red.hex};
}
.floating-notifications.background .notification-row .notification-background .close-button:hover {
background-color: ${colors.maroon.hex};
color: ${colors.base.hex};
}
.floating-notifications.background .notification-row .notification-background .close-button:active {
background-color: ${colors.red.hex};
color: ${colors.base.hex};
}
.control-center {
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px ${colors.surface0.hex};
border-radius: 12.6px;
margin: 18px;
background-color: ${colors.base.hex};
color: ${colors.text.hex};
padding: 14px;
}
.control-center .widget-title > label {
color: ${colors.text.hex};
font-size: 1.3em;
}
.control-center .widget-title button {
border-radius: 7px;
color: ${colors.text.hex};
background-color: ${colors.surface0.hex};
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
padding: 8px;
}
.control-center .widget-title button:hover {
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
background-color: ${colors.surface2.hex};
color: ${colors.text.hex};
}
.control-center .widget-title button:active {
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
background-color: ${colors.sky.hex};
color: ${colors.base.hex};
}
.control-center .notification-row .notification-background {
border-radius: 7px;
color: ${colors.text.hex};
background-color: ${colors.surface0.hex};
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
margin-top: 14px;
}
.control-center .notification-row .notification-background .notification {
padding: 7px;
border-radius: 7px;
}
.control-center .notification-row .notification-background .notification.critical {
box-shadow: inset 0 0 7px 0 ${colors.red.hex};
}
.control-center .notification-row .notification-background .notification .notification-content {
margin: 7px;
}
.control-center .notification-row .notification-background .notification .notification-content .summary {
color: ${colors.text.hex};
}
.control-center .notification-row .notification-background .notification .notification-content .time {
color: ${colors.subtext0.hex};
}
.control-center .notification-row .notification-background .notification .notification-content .body {
color: ${colors.text.hex};
}
.control-center .notification-row .notification-background .notification > *:last-child > * {
min-height: 3.4em;
}
.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action {
border-radius: 7px;
color: ${colors.text.hex};
background-color: ${colors.crust.hex};
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
margin: 7px;
}
.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action:hover {
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
background-color: ${colors.surface0.hex};
color: ${colors.text.hex};
}
.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action:active {
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
background-color: ${colors.sky.hex};
color: ${colors.text.hex};
}
.control-center .notification-row .notification-background .close-button {
margin: 7px;
padding: 2px;
border-radius: 6.3px;
color: ${colors.base.hex};
background-color: ${colors.maroon.hex};
}
.close-button {
border-radius: 6.3px;
}
.control-center .notification-row .notification-background .close-button:hover {
background-color: ${colors.red.hex};
color: ${colors.base.hex};
}
.control-center .notification-row .notification-background .close-button:active {
background-color: ${colors.red.hex};
color: ${colors.base.hex};
}
.control-center .notification-row .notification-background:hover {
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
background-color: ${colors.overlay1.hex};
color: ${colors.text.hex};
}
.control-center .notification-row .notification-background:active {
box-shadow: inset 0 0 0 1px ${colors.surface1.hex};
background-color: ${colors.sky.hex};
color: ${colors.text.hex};
}
.notification.critical progress {
background-color: ${colors.red.hex};
}
.notification.low progress,
.notification.normal progress {
background-color: ${colors.blue.hex};
}
.control-center-dnd {
margin-top: 5px;
border-radius: 8px;
background: ${colors.surface0.hex};
border: 1px solid ${colors.surface1.hex};
box-shadow: none;
}
.control-center-dnd:checked {
background: ${colors.surface0.hex};
}
.control-center-dnd slider {
background: ${colors.surface1.hex};
border-radius: 8px;
}
.widget-dnd {
margin: 0px;
font-size: 1.1rem;
}
.widget-dnd > switch {
font-size: initial;
border-radius: 8px;
background: ${colors.surface0.hex};
border: 1px solid ${colors.surface1.hex};
box-shadow: none;
}
.widget-dnd > switch:checked {
background: ${colors.surface0.hex};
}
.widget-dnd > switch slider {
background: ${colors.surface1.hex};
border-radius: 8px;
border: 1px solid ${colors.overlay0.hex};
}
.widget-mpris .widget-mpris-player .widget-mpd {
background: ${colors.surface0.hex};
padding: 7px;
}
.widget-mpris .widget-mpris-title .widget-mpd .widget-mpd-title {
font-size: 1.2rem;
}
.widget-mpris .widget-mpris-subtitle .widget-mpd .widget-mpd-subtitle {
font-size: 0.8rem;
}
.widget-menubar > box > .menu-button-bar > button > label {
font-size: 3rem;
padding: 0.5rem 2rem;
}
.widget-menubar > box > .menu-button-bar > :last-child {
color: ${colors.red.hex};
}
.power-buttons button:hover,
.powermode-buttons button:hover,
.screenshot-buttons button:hover {
background: ${colors.surface0.hex};
}
.control-center .widget-label > label {
color: ${colors.text.hex};
font-size: 2rem;
}
.widget-buttons-grid {
padding-top: 1rem;
}
.widget-buttons-grid > flowbox > flowboxchild > button label {
font-size: 2.5rem;
}
.widget-volume {
padding-top: 1rem;
}
.widget-volume label {
font-size: 1.5rem;
color: ${colors.sky.hex};
}
.widget-volume trough highlight {
background: ${colors.sky.hex};
}
.widget-backlight trough highlight {
background: ${colors.yellow.hex};
}
.widget-backlight label {
font-size: 1.5rem;
color: ${colors.yellow.hex};
}
.widget-backlight .KB {
padding-bottom: 1rem;
}
.image {
padding-right: 0.5rem;
}
'';
};
};
}

View file

@ -15,362 +15,101 @@ in {
};
config = mkIf cfg.enable {
services.swaync = {
enable = true;
style = lib.mkForce ''
* {
all: unset;
font-size: 14px;
font-family: "Adwaita Sans", "JetBrains Mono Nerd Font";
transition: 200ms;
}
trough highlight {
background: #cad3f5;
}
scale trough {
margin: 0rem 1rem;
background-color: #363a4f;
min-height: 8px;
min-width: 70px;
}
slider {
background-color: #8aadf4;
}
.floating-notifications.background .notification-row .notification-background {
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px #363a4f;
border-radius: 12.6px;
margin: 18px;
background-color: #24273a;
color: #cad3f5;
padding: 0;
}
.floating-notifications.background .notification-row .notification-background .notification {
padding: 7px;
border-radius: 12.6px;
}
.floating-notifications.background .notification-row .notification-background .notification.critical {
box-shadow: inset 0 0 7px 0 #ed8796;
}
.floating-notifications.background .notification-row .notification-background .notification .notification-content {
margin: 7px;
}
.floating-notifications.background .notification-row .notification-background .notification .notification-content .summary {
color: #cad3f5;
}
.floating-notifications.background .notification-row .notification-background .notification .notification-content .time {
color: #a5adcb;
}
.floating-notifications.background .notification-row .notification-background .notification .notification-content .body {
color: #cad3f5;
}
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * {
min-height: 3.4em;
}
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action {
border-radius: 7px;
color: #cad3f5;
background-color: #363a4f;
box-shadow: inset 0 0 0 1px #494d64;
margin: 7px;
}
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action:hover {
box-shadow: inset 0 0 0 1px #494d64;
background-color: #363a4f;
color: #cad3f5;
}
.floating-notifications.background .notification-row .notification-background .notification > *:last-child > * .notification-action:active {
box-shadow: inset 0 0 0 1px #494d64;
background-color: #7dc4e4;
color: #cad3f5;
}
.floating-notifications.background .notification-row .notification-background .close-button {
margin: 7px;
padding: 2px;
border-radius: 6.3px;
color: #24273a;
background-color: #ed8796;
}
.floating-notifications.background .notification-row .notification-background .close-button:hover {
background-color: #ee99a0;
color: #24273a;
}
.floating-notifications.background .notification-row .notification-background .close-button:active {
background-color: #ed8796;
color: #24273a;
}
.control-center {
box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.8), inset 0 0 0 1px #363a4f;
border-radius: 12.6px;
margin: 18px;
background-color: #24273a;
color: #cad3f5;
padding: 14px;
}
.control-center .widget-title > label {
color: #cad3f5;
font-size: 1.3em;
}
.control-center .widget-title button {
border-radius: 7px;
color: #cad3f5;
background-color: #363a4f;
box-shadow: inset 0 0 0 1px #494d64;
padding: 8px;
}
.control-center .widget-title button:hover {
box-shadow: inset 0 0 0 1px #494d64;
background-color: #5b6078;
color: #cad3f5;
}
.control-center .widget-title button:active {
box-shadow: inset 0 0 0 1px #494d64;
background-color: #7dc4e4;
color: #24273a;
}
.control-center .notification-row .notification-background {
border-radius: 7px;
color: #cad3f5;
background-color: #363a4f;
box-shadow: inset 0 0 0 1px #494d64;
margin-top: 14px;
}
.control-center .notification-row .notification-background .notification {
padding: 7px;
border-radius: 7px;
}
.control-center .notification-row .notification-background .notification.critical {
box-shadow: inset 0 0 7px 0 #ed8796;
}
.control-center .notification-row .notification-background .notification .notification-content {
margin: 7px;
}
.control-center .notification-row .notification-background .notification .notification-content .summary {
color: #cad3f5;
}
.control-center .notification-row .notification-background .notification .notification-content .time {
color: #a5adcb;
}
.control-center .notification-row .notification-background .notification .notification-content .body {
color: #cad3f5;
}
.control-center .notification-row .notification-background .notification > *:last-child > * {
min-height: 3.4em;
}
.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action {
border-radius: 7px;
color: #cad3f5;
background-color: #181926;
box-shadow: inset 0 0 0 1px #494d64;
margin: 7px;
}
.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action:hover {
box-shadow: inset 0 0 0 1px #494d64;
background-color: #363a4f;
color: #cad3f5;
}
.control-center .notification-row .notification-background .notification > *:last-child > * .notification-action:active {
box-shadow: inset 0 0 0 1px #494d64;
background-color: #7dc4e4;
color: #cad3f5;
}
.control-center .notification-row .notification-background .close-button {
margin: 7px;
padding: 2px;
border-radius: 6.3px;
color: #24273a;
background-color: #ee99a0;
}
.close-button {
border-radius: 6.3px;
}
.control-center .notification-row .notification-background .close-button:hover {
background-color: #ed8796;
color: #24273a;
}
.control-center .notification-row .notification-background .close-button:active {
background-color: #ed8796;
color: #24273a;
}
.control-center .notification-row .notification-background:hover {
box-shadow: inset 0 0 0 1px #494d64;
background-color: #8087a2;
color: #cad3f5;
}
.control-center .notification-row .notification-background:active {
box-shadow: inset 0 0 0 1px #494d64;
background-color: #7dc4e4;
color: #cad3f5;
}
.notification.critical progress {
background-color: #ed8796;
}
.notification.low progress,
.notification.normal progress {
background-color: #8aadf4;
}
.control-center-dnd {
margin-top: 5px;
border-radius: 8px;
background: #363a4f;
border: 1px solid #494d64;
box-shadow: none;
}
.control-center-dnd:checked {
background: #363a4f;
}
.control-center-dnd slider {
background: #494d64;
border-radius: 8px;
}
.widget-dnd {
margin: 0px;
font-size: 1.1rem;
}
.widget-dnd > switch {
font-size: initial;
border-radius: 8px;
background: #363a4f;
border: 1px solid #494d64;
box-shadow: none;
}
.widget-dnd > switch:checked {
background: #363a4f;
}
.widget-dnd > switch slider {
background: #494d64;
border-radius: 8px;
border: 1px solid #6e738d;
}
.widget-mpris .widget-mpris-player .widget-mpd {
background: #363a4f;
padding: 7px;
}
.widget-mpris .widget-mpris-title .widget-mpd .widget-mpd-title {
font-size: 1.2rem;
}
.widget-mpris .widget-mpris-subtitle .widget-mpd .widget-mpd-subtitle {
font-size: 0.8rem;
}
.widget-menubar > box > .menu-button-bar > button > label {
font-size: 3rem;
padding: 0.5rem 2rem;
}
.widget-menubar > box > .menu-button-bar > :last-child {
color: #ed8796;
}
.power-buttons button:hover,
.powermode-buttons button:hover,
.screenshot-buttons button:hover {
background: #363a4f;
}
.control-center .widget-label > label {
color: #cad3f5;
font-size: 2rem;
}
.widget-buttons-grid {
padding-top: 1rem;
}
.widget-buttons-grid > flowbox > flowboxchild > button label {
font-size: 2.5rem;
}
.widget-volume {
padding-top: 1rem;
}
.widget-volume label {
font-size: 1.5rem;
color: #7dc4e4;
}
.widget-volume trough highlight {
background: #7dc4e4;
}
.widget-backlight trough highlight {
background: #eed49f;
}
.widget-backlight label {
font-size: 1.5rem;
color: #eed49f;
}
.widget-backlight .KB {
padding-bottom: 1rem;
}
.image {
padding-right: 0.5rem;
}
'';
};
programs.waybar = {
enable = true;
systemd.enable = true;
systemd.target = "graphical-session.target";
style = ''
/* Custom colors from lib/theme/default.nix */
@define-color rosewater ${colors.rosewater.hex};
@define-color flamingo ${colors.flamingo.hex};
@define-color pink ${colors.pink.hex};
@define-color mauve ${colors.mauve.hex};
@define-color red ${colors.red.hex};
@define-color maroon ${colors.maroon.hex};
@define-color peach ${colors.peach.hex};
@define-color yellow ${colors.yellow.hex};
@define-color green ${colors.green.hex};
@define-color teal ${colors.teal.hex};
@define-color sky ${colors.sky.hex};
@define-color sapphire ${colors.sapphire.hex};
@define-color blue ${colors.blue.hex};
@define-color lavender ${colors.lavender.hex};
@define-color text ${colors.text.hex};
@define-color subtext1 ${colors.subtext1.hex};
@define-color subtext0 ${colors.subtext0.hex};
@define-color overlay2 ${colors.overlay2.hex};
@define-color overlay1 ${colors.overlay1.hex};
@define-color overlay0 ${colors.overlay0.hex};
@define-color surface2 ${colors.surface2.hex};
@define-color surface1 ${colors.surface1.hex};
@define-color surface0 ${colors.surface0.hex};
@define-color base ${colors.base.hex};
@define-color mantle ${colors.mantle.hex};
@define-color crust ${colors.crust.hex};
/* Mullvad specific styles */
#custom-mullvad.connected {
color: @green;
}
#custom-mullvad.disconnected {
color: @red;
}
${builtins.readFile ./style.css}
'';
settings = let
# Script to get Mullvad status for Waybar
mullvad-status = pkgs.writeShellScriptBin "mullvad-status-waybar" ''
#!${pkgs.runtimeShell}
set -euo pipefail
# Run mullvad status, capture output, handle potential errors
STATUS=$(mullvad status || echo "Disconnected")
if echo "$STATUS" | grep -q "Connected"; then
# Extract Relay using sed: find line starting with Relay:, remove prefix
SERVER=$(echo "$STATUS" | sed -n 's/^\s*Relay:\s*//p')
# Extract Location using sed: find line starting with Visible location:,
# remove prefix, keep text up to the first comma
LOCATION=$(echo "$STATUS" | sed -n 's/^\s*Visible location:\s*\([^,]*\).*/\1/p')
# Trim potential leading/trailing whitespace just in case sed leaves some
SERVER=$(echo "$SERVER" | sed 's/^[ \t]*//;s/[ \t]*$//')
LOCATION=$(echo "$LOCATION" | sed 's/^[ \t]*//;s/[ \t]*$//')
# Construct tooltip based on extracted info
if [ -n "$SERVER" ] && [ -n "$LOCATION" ]; then
TOOLTIP="Mullvad: Connected via $SERVER ($LOCATION)"
elif [ -n "$SERVER" ]; then
# Fallback if location parsing failed but server was found
TOOLTIP="Mullvad: Connected via $SERVER"
else
# Generic fallback if parsing failed
TOOLTIP="Mullvad: Connected"
fi
# Output JSON for Waybar
# Using nerd font icons: nf-fa-lock (connected), nf-fa-unlock (disconnected)
# Ensure your font supports these glyphs:  (U+F023),  (U+F09C)
echo '{"text": "", "tooltip": "'"$TOOLTIP"'", "class": "connected"}'
else
# Output disconnected status
echo '{"text": "", "tooltip": "Mullvad: Disconnected", "class": "disconnected"}'
fi
'';
# Script to toggle Mullvad connection
mullvad-toggle = pkgs.writeShellScriptBin "mullvad-toggle" ''
set -euo pipefail
if mullvad status | grep -q "Connected"; then
mullvad disconnect
else
mullvad connect
fi
# Optional: trigger a Waybar refresh if needed, though interval should handle it
# pkill -SIGRTMIN+8 waybar
'';
cava = pkgs.writeShellScriptBin "cava" "${builtins.readFile ./bar.sh}";
in {
mainBar = {
@ -392,6 +131,7 @@ in {
"custom/gpu-mem"
"custom/gpu-temp"
"pulseaudio"
"custom/mullvad"
"custom/weather"
"clock"
"clock#simpleclock"
@ -409,6 +149,15 @@ in {
exec = "spotifatius monitor";
};
"custom/mullvad" = {
format = "{}";
return-type = "json";
interval = 1;
exec = "${mullvad-status}/bin/mullvad-status-waybar";
"on-click" = "${mullvad-toggle}/bin/mullvad-toggle";
tooltip = true;
};
mpd = {
format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} - {title}";
"format-disconnected" = "Disconnected ";
@ -516,7 +265,7 @@ in {
tray = {
"show-passive-items" = true;
spacing = 10;
spacing = 2;
};
"clock#simpleclock" = {

View file

@ -17,7 +17,7 @@ window#waybar {
}
#custom-cava-system, #custom-cava-tt {
color: #cba6f7;
color: @mauve;
border-left: 0px;
border-right: 0px;
padding: 6px;
@ -94,7 +94,9 @@ menu,
#bluetooth,
#network,
#battery,
#custom-power, #custom-notification,
#custom-power,
#custom-notification,
#custom-mullvad,
#custom-weather {
background: @base;
padding: 8px 8px;
@ -103,6 +105,7 @@ menu,
border-radius: 6px;
}
#custom-mullvad,
#custom-notification {
padding-left: 12px;
padding-right: 18px;
@ -123,7 +126,7 @@ menu,
font-style: normal;
opacity: 1;
font-size: 16px;
color: #1e1;
color: @surface0;
border-radius: 6px;
}
@ -132,22 +135,20 @@ menu,
margin: 3px;
border-radius: 6px;
border: none;
color: #f5e0dc;
/* background-color: #1e1e2e; */
transition: all 0.3s ease-in-out;
opacity: 0.4;
}
#workspaces button.active {
color: #1e1e2e;
background: #cba6f7;
color: @base;
background: @mauve;
min-width: 20px;
opacity: 1;
}
#workspaces button:hover {
color: #c3dee5;
background: #1e1e2e;
color: @text;
background: @mantle;
opacity: 1;
animation: none;
}
@ -164,20 +165,20 @@ menu,
padding: 0px 10px;
margin-right: 2px;
background: @base;
color: rgba(137, 220, 235, 1);
color: @sky;
border-radius: 0 6px 6px 0;
}
#pulseaudio {
padding: 0 8px;
margin-right: 1px;
color: @beige;
color: @yellow;
border-radius: 6px 6px;
}
#bluetooth,
#network {
color: #cba6f7;
color: @mauve;
border-radius: 6px;
margin: 0 1px;
}
@ -193,8 +194,6 @@ menu,
#network {
min-width: 30px;
padding: 0 7px 0 2px;
/* margin: 0 2px; */
border-radius: 6px;
/* border-radius: 0 6px 6px 0; */
}

View file

@ -72,7 +72,7 @@ in {
settings = {
colors = {
primary.background = "#11111b";
primary.background = colors.crust.hex;
};
env = {
term = "xterm-256color";

View file

@ -21,6 +21,30 @@ in {
};
colors = {
alpha = "0.9";
# Custom colors from lib/theme/default.nix
foreground = "${colors.text.hex}";
background = "${colors.crust.hex}";
# Normal colors
regular0 = "${colors.surface1.hex}"; # black
regular1 = "${colors.red.hex}"; # red
regular2 = "${colors.green.hex}"; # green
regular3 = "${colors.yellow.hex}"; # yellow
regular4 = "${colors.blue.hex}"; # blue
regular5 = "${colors.mauve.hex}"; # magenta
regular6 = "${colors.teal.hex}"; # cyan
regular7 = "${colors.text.hex}"; # white
# Bright colors
bright0 = "${colors.surface2.hex}"; # bright black
bright1 = "${colors.red.hex}"; # bright red
bright2 = "${colors.green.hex}"; # bright green
bright3 = "${colors.yellow.hex}"; # bright yellow
bright4 = "${colors.blue.hex}"; # bright blue
bright5 = "${colors.mauve.hex}"; # bright magenta
bright6 = "${colors.teal.hex}"; # bright cyan
bright7 = "${colors.text.hex}"; # bright white
};
};
};

View file

@ -21,10 +21,15 @@ in {
# italic = mkStringOpt "Iosevka Bold Italic" "Italic Font";
# bold_italic = mkStringOpt "Iosevka ExtraBold Italic" "Bold Italic Font";
normal = mkStringOpt "Iosevka" "Normal Font";
bold = mkStringOpt "Iosevka" "Bold Font";
italic = mkStringOpt "Iosevka" "Italic Font";
bold_italic = mkStringOpt "Iosevka" "Bold Italic Font";
normal = mkStringOpt "Cozette" "Normal";
bold = mkStringOpt "Cozette" "Bold";
italic = mkStringOpt "Cozette" "Italic";
bold_italic = mkStringOpt "Cozette" "Bold Italic";
# normal = mkStringOpt "Iosevka Nerd Font Mono" "Normal Font";
# bold = mkStringOpt "Iosevka Nerd Font Mono" "Bold Font";
# italic = mkStringOpt "Iosevka Nerd Font Mono" "Italic Font";
# bold_italic = mkStringOpt "Iosevka Nerd Font Mono" "Bold Italic Font";
};
};
@ -36,6 +41,16 @@ in {
font-family = cfg.fonts.normal;
gtk-single-instance = true;
gtk-titlebar = false;
background = colors.crust.hex;
window-padding-x = 20;
window-padding-y = 20;
window-padding-balance = true;
font-style = "SemiBold";
font-style-bold = "Bold";
font-style-italic = "SemiBold Italic";
font-style-bold-italic = "Bold Italic";
};
};
};

View file

@ -20,10 +20,10 @@ in {
# bold = mkStringOpt "Kirsch Nerd Font Mono" "BBoldold Font";
# italic = mkStringOpt "Kirsch Nerd Font Mono" "Italic Font";
# bold_italic = mkStringOpt "Kirsch Nerd Font Mono" "Bold Italic Font";
normal = mkStringOpt "CozetteVector" "Normal Font";
bold = mkStringOpt "CozetteVector" "Bold Font";
italic = mkStringOpt "CozetteVector" "Italic Font";
bold_italic = mkStringOpt "CozetteVector" "Bold Italic Font";
normal = mkStringOpt "PragmataPro Mono Liga" "Normal Font";
bold = mkStringOpt "PragmataPro Mono Liga Bold" "Bold Font";
italic = mkStringOpt "PragmataPro Mono Liga Italic" "Italic Font";
bold_italic = mkStringOpt "PragmataPro Mono Liga Bold Italic" "Bold Italic Font";
};
};
@ -46,7 +46,28 @@ in {
settings = {
window_padding_width = 12;
# background_opacity = "0.9";
# background = "#000000";
background = colors.crust.hex;
foreground = colors.text.hex;
# Normal colors
color0 = colors.surface1.hex; # black
color1 = colors.red.hex; # red
color2 = colors.green.hex; # green
color3 = colors.yellow.hex; # yellow
color4 = colors.blue.hex; # blue
color5 = colors.mauve.hex; # magenta
color6 = colors.teal.hex; # cyan
color7 = colors.text.hex; # white
# Bright colors
color8 = colors.surface2.hex; # bright black
color9 = colors.red.hex; # bright red
color10 = colors.green.hex; # bright green
color11 = colors.yellow.hex; # bright yellow
color12 = colors.blue.hex; # bright blue
color13 = colors.mauve.hex; # bright magenta
color14 = colors.teal.hex; # bright cyan
color15 = colors.text.hex; # bright white
};
};
};

View file

@ -1,8 +1,6 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib;
@ -18,6 +16,12 @@ in {
direnv = {
enable = true;
nix-direnv.enable = true;
config = {
global = {
log_format = "-";
log_filter = "^$";
};
};
};
};
home.sessionVariables = {

View file

@ -11,3 +11,5 @@ end
vim.g.lazyvim_blink_main = true
vim.o.termguicolors = true
vim.g.lazyvim_python_lsp = "basedpyright"

View file

@ -70,7 +70,11 @@ return {
---@class PluginLspOpts
opts = {
servers = {
emmet_ls = {},
jinja_lsp = {},
emmet_ls = {
filetypes = { "html", "jinja" },
},
somesass_ls = {},
slangd = {
settings = {
slangd = {

View file

@ -21,7 +21,7 @@ in {
package = pkgs.swaylock-effects;
settings = with colors; {
clock = true;
color = base;
color = base.hex;
font = "Work Sans";
image = "${wallpaper}";
show-failed-attempts = false;
@ -33,21 +33,21 @@ in {
inside-color = "00000000";
key-hl-color = "f2cdcd";
separator-color = "00000000";
text-color = text;
text-color = text.hex;
text-caps-lock-color = "";
line-ver-color = love;
ring-ver-color = rose;
inside-ver-color = base;
text-ver-color = text;
ring-wrong-color = foam;
text-wrong-color = foam;
inside-wrong-color = base;
inside-clear-color = base;
text-clear-color = text;
ring-clear-color = iris;
line-clear-color = base;
line-wrong-color = base;
bs-hl-color = foam;
line-ver-color = rosewater.hex;
ring-ver-color = rosewater.hex;
inside-ver-color = base.hex;
text-ver-color = text.hex;
ring-wrong-color = teal.hex;
text-wrong-color = teal.hex;
inside-wrong-color = base.hex;
inside-clear-color = base.hex;
text-clear-color = text.hex;
ring-clear-color = lavender.hex;
line-clear-color = base.hex;
line-wrong-color = base.hex;
bs-hl-color = teal.hex;
line-uses-ring = false;
grace = 2;
grace-no-mouse = true;

View file

@ -129,8 +129,8 @@ in {
allow_tearing = true;
# active border color
"col.active_border" = "rgb(${base})";
"col.inactive_border" = "rgb(${base})";
"col.active_border" = "rgb(${colors.lavender.hex})";
"col.inactive_border" = "rgb(${colors.base.hex})";
};
input = {

View file

@ -25,6 +25,20 @@ with lib.custom; let
}: {
gradient = {inherit from to angle relative-to in';};
};
spawnSlackOnWeekday = pkgs.writeShellScriptBin "spawn-slack-on-weekday" ''
# Get the day of the week (1=Monday, ..., 7=Sunday)
DAY_OF_WEEK=$(${pkgs.coreutils}/bin/date +%u)
# Check if it's a weekday (between 1 and 5 inclusive)
if [ "$DAY_OF_WEEK" -ge 1 ] && [ "$DAY_OF_WEEK" -le 5 ]; then
# Execute Slack. Use the full path for robustness.
# Ensure pkgs.slack is available (e.g., via environment.systemPackages)
exec ${pkgs.slack}/bin/slack
fi
# Exit successfully if not a weekday or after exec replaces the process
exit 0
'';
in {
options.wms.niri = with types; {
enable = mkBoolOpt false "Enable niri";
@ -108,7 +122,11 @@ in {
# Environment variables
environment = {
DISPLAY = ":0";
DISPLAY = ":0"; # for applications using xwayland-satillite
};
hotkey-overlay = {
skip-at-startup = true;
};
# Layout settings
@ -131,9 +149,9 @@ in {
focus-ring = {
enable = true; # Not explicitly 'off'
width = 4;
active = mkGradient "#89b4fa" "#74c7ec" {angle = 45;};
active = mkGradient colors.blue.hex colors.sky.hex {angle = 45;};
# active = mkColor "#7fc8ff"; # Alternative solid color from KDL
inactive = mkGradient "#505050" "#808080" {
inactive = mkGradient colors.surface1.hex colors.surface2.hex {
angle = 45;
relative-to = "workspace-view";
};
@ -143,8 +161,8 @@ in {
border = {
enable = true; # Explicitly 'off' in KDL
width = 0;
active = mkColor "#89b4fa";
inactive = mkColor "#1e1e2e";
active = mkColor colors.blue.hex;
inactive = mkColor colors.base.hex;
# active-gradient = ... # Commented out in KDL
# inactive-gradient = ... # Commented out in KDL
};
@ -160,13 +178,12 @@ in {
# Spawn processes at startup
spawn-at-startup = [
{command = ["xwayland-satellite"];}
{command = ["thunderbird"];}
{command = ["zen"];}
{
command = [
"${lib.getExe pkgs.bash} -c '(( $(date +%u) < 6 )) && ${lib.getExe pkgs.slack}'"
];
}
{command = ["${pkgs.writeShellScriptBin "thunderbird-delayed" ''sleep 5; thunderbird''}/bin/thunderbird-delayed"];}
{command = ["${pkgs.writeShellScriptBin "zen-delayed" ''sleep 5; zen''}/bin/zen-delayed"];}
{command = ["vesktop"];}
{command = ["spotify"];}
{command = ["${spawnSlackOnWeekday}/bin/spawn-slack-on-weekday"];}
];
# Prefer server-side decorations
@ -187,6 +204,16 @@ in {
wait-for-frame-completion-in-pipewire = [];
};
layer-rules = [
{
matches = [
{namespace = "notifications$";}
];
block-out-from = "screen-capture";
}
];
# Window rules
window-rules = [
# Password manager rule (example from KDL comments)
@ -194,12 +221,13 @@ in {
matches = [
{app-id = "^org\\.keepassxc\\.KeePassXC$";}
{app-id = "^org\\.gnome\\.World\\.Secrets$";}
{app-id = "^1Password$";}
{app-id = "^thunderbird$";}
{app-id = "^signal$";}
{app-id = "^vesktop$";}
{app-id = "^slack$";}
];
block-out-from = "screen-capture";
# block-out-from = "screencast"; # Alternative
}
# Rounded corners rule (example from KDL comments)
{
@ -216,22 +244,16 @@ in {
{
matches = [{is-window-cast-target = true;}];
focus-ring = {
active = mkColor "#f38ba8";
inactive = mkColor "#7d0d2d";
};
border = {
# Only inactive is specified in KDL rule
active = mkColor "#f38ba8";
width = 4;
inactive = mkColor "#7d0d2d";
active = mkColor colors.red.hex;
inactive = mkColor (lerpColor colors.red.hex colors.base.hex 0.5);
};
shadow = {
# Only color is specified in KDL rule
color = "#7d0d2d70";
};
tab-indicator = {
active = mkColor "#f38ba8";
inactive = mkColor "#7d0d2d";
active = mkColor colors.red.hex;
inactive = mkColor (lerpColor colors.red.hex colors.base.hex 0.5);
};
}
@ -253,17 +275,77 @@ in {
y = 16;
};
}
{
matches = [
{
at-startup = true;
app-id = "^zen$";
}
];
open-maximized = true;
open-on-workspace = "browser";
}
{
matches = [
{
at-startup = true;
app-id = "^spotify$";
}
{
at-startup = true;
app-id = "^vesktop$";
}
];
open-on-workspace = "chat";
}
{
matches = [
{
at-startup = true;
app-id = "^Slack$";
}
{
at-startup = true;
app-id = "^thunderbird$";
}
];
open-on-workspace = "work";
}
];
workspaces."01-browser" = {
name = "browser";
};
workspaces."02-code" = {
name = "code";
};
workspaces."03-chat" = {
name = "chat";
};
workspaces."04-work" = {
name = "work";
};
# Keybindings
binds = {
"Mod+Shift+Slash" = {action = actions.show-hotkey-overlay;};
"Mod+Return" = {action = actions.spawn "alacritty";};
"Mod+Return" = {action = actions.spawn "kitty";};
"Mod+D" = {action = actions.spawn "fuzzel";};
"Super+Alt+L" = {action = actions.spawn "swaylock";};
# "Mod+T" = { action = actions.spawn "bash" "-c" "notify-send hello && exec alacritty"; };
"Mod+S" = {action = actions.set-dynamic-cast-window;};
"Mod+Shift+S" = {action = actions.set-dynamic-cast-monitor;};
"Mod+Z" = {action = actions.clear-dynamic-cast-target;};
"XF86AudioRaiseVolume" = {
allow-when-locked = true;
action = actions.spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+";
@ -322,6 +404,8 @@ in {
"Mod+Shift+K" = {action = actions.focus-workspace-up;};
"Mod+Shift+L" = {action = actions.focus-monitor-right;};
"Mod+Ctrl+Shift+F" = {action = actions.toggle-windowed-fullscreen;};
"Mod+Shift+Ctrl+Left" = {action = actions.move-column-to-monitor-left;};
"Mod+Shift+Ctrl+Down" = {action = actions.move-column-to-monitor-down;};
"Mod+Shift+Ctrl+Up" = {action = actions.move-column-to-monitor-up;};

View file

@ -43,18 +43,17 @@ in {
# Command to execute. Use full paths for robustness.
# We use sh -c to run multiple commands sequentially.
# pactl is provided by the pulseaudio package.
ExecStart = ''
${pkgs.runtimeShell} -c '
echo "Attempting to load Cava combine modules..."
# Load null sink (returns non-zero if it fails AND module doesn't exist)
${pkgs.pulseaudio}/bin/pactl load-module module-null-sink sink_name=cava-line-in sink_properties=device.description="Cava_Combined_LineIn"
# Load loopbacks (returns non-zero on failure)
${pkgs.pulseaudio}/bin/pactl load-module module-loopback source="alsa_input.usb-MOTU_M4_M4MA03F7DV-00.HiFi__Line3__source" sink=cava-line-in latency_msec=10
${pkgs.pulseaudio}/bin/pactl load-module module-loopback source="alsa_input.usb-MOTU_M4_M4MA03F7DV-00.HiFi__Line4__source" sink=cava-line-in latency_msec=10
echo "Finished loading Cava combine modules (ignore errors if already loaded)."
# Exit successfully even if modules were already loaded (pactl might return 0)
exit 0
'';
ExecStart = "${pkgs.writeShellScriptBin "cava-start" ''
echo "Attempting to load Cava combine modules..."
# Load null sink (returns non-zero if it fails AND module doesn't exist)
${pkgs.pulseaudio}/bin/pactl load-module module-null-sink sink_name=cava-line-in sink_properties=device.description="Cava_Combined_LineIn"
# Load loopbacks (returns non-zero on failure)
${pkgs.pulseaudio}/bin/pactl load-module module-loopback source="alsa_input.usb-MOTU_M4_M4MA03F7DV-00.HiFi__Line3__source" sink=cava-line-in latency_msec=10
${pkgs.pulseaudio}/bin/pactl load-module module-loopback source="alsa_input.usb-MOTU_M4_M4MA03F7DV-00.HiFi__Line4__source" sink=cava-line-in latency_msec=10
echo "Finished loading Cava combine modules (ignore errors if already loaded)."
# Exit successfully even if modules were already loaded (pactl might return 0)
exit 0
''}/bin/cava-start";
# Prevent service from restarting automatically
Restart = "no";

View file

@ -8,6 +8,104 @@
with lib;
with lib.custom; let
cfg = config.hardware.gpu-passthru;
startScript = ''
#!/run/current-system/sw/bin/bash
# Debugging
exec 19>/home/zoey/Desktop/startlogfile
BASH_XTRACEFD=19
set -x
# Load variables we defined
source "/etc/libvirt/hooks/kvm.conf"
# Change to performance governor
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
# Isolate host to core 0
systemctl set-property --runtime -- user.slice AllowedCPUs=0-8
systemctl set-property --runtime -- system.slice AllowedCPUs=0-8
systemctl set-property --runtime -- init.scope AllowedCPUs=0-8
# disable vpn
mullvad disconnect -w
# Logout
# source "/home/owner/Desktop/Sync/Files/Tools/logout.sh"
# Stop display manager
systemctl stop display-manager.service
killall gdm-wayland-session
killall niri
killall niri-session
# Unbind VTconsoles
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
# Unbind EFI Framebuffer
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
# Avoid race condition
sleep 5
# Unload NVIDIA kernel modules
modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia
# Detach GPU devices from host
virsh nodedev-detach $VIRSH_GPU_VIDEO
virsh nodedev-detach $VIRSH_GPU_AUDIO
# Load vfio module
modprobe vfio-pci
'';
stopScript = ''
#!/run/current-system/sw/bin/bash
# Debugging
exec 19>/home/zoey/Desktop/stoplogfile
BASH_XTRACEFD=19
set -x
# Load variables we defined
source "/etc/libvirt/hooks/kvm.conf"
# Unload vfio module
modprobe -r vfio-pci
# Attach GPU devices from host
virsh nodedev-reattach $VIRSH_GPU_VIDEO
virsh nodedev-reattach $VIRSH_GPU_AUDIO
# Read nvidia x config
nvidia-xconfig --query-gpu-info > /dev/null 2>&1
# Load NVIDIA kernel modules
modprobe nvidia_drm nvidia_modeset nvidia_uvm nvidia
# Avoid race condition
sleep 5
# Bind EFI Framebuffer
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/bind
# Bind VTconsoles
echo 1 > /sys/class/vtconsole/vtcon0/bind
echo 1 > /sys/class/vtconsole/vtcon1/bind
# Start display manager
systemctl start display-manager.service
# Return host to all cores
systemctl set-property --runtime -- user.slice AllowedCPUs=0-31
systemctl set-property --runtime -- system.slice AllowedCPUs=0-31
systemctl set-property --runtime -- init.scope AllowedCPUs=0-31
# Change to powersave governor
echo powersave | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
'';
in {
options.hardware.gpu-passthru = with types; {
enable = mkBoolOpt false "Enable support for single gpu-passthru";
@ -113,106 +211,22 @@ in {
};
"libvirt/hooks/qemu.d/win10/prepare/begin/start.sh" = {
text = ''
#!/run/current-system/sw/bin/bash
# Debugging
exec 19>/home/zoey/Desktop/startlogfile
BASH_XTRACEFD=19
set -x
# Load variables we defined
source "/etc/libvirt/hooks/kvm.conf"
# Change to performance governor
echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
# Isolate host to core 0
systemctl set-property --runtime -- user.slice AllowedCPUs=0-8
systemctl set-property --runtime -- system.slice AllowedCPUs=0-8
systemctl set-property --runtime -- init.scope AllowedCPUs=0-8
# disable vpn
mullvad disconnect -w
# Logout
# source "/home/owner/Desktop/Sync/Files/Tools/logout.sh"
# Stop display manager
systemctl stop display-manager.service
killall gdm-wayland-session
killall niri
killall niri-session
# Unbind VTconsoles
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
# Unbind EFI Framebuffer
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind
# Avoid race condition
sleep 5
# Unload NVIDIA kernel modules
modprobe -r nvidia_drm nvidia_modeset nvidia_uvm nvidia
# Detach GPU devices from host
virsh nodedev-detach $VIRSH_GPU_VIDEO
virsh nodedev-detach $VIRSH_GPU_AUDIO
# Load vfio module
modprobe vfio-pci
'';
text = startScript;
mode = "0755";
};
"libvirt/hooks/qemu.d/win10/release/end/stop.sh" = {
text = ''
#!/run/current-system/sw/bin/bash
text = stopScript;
mode = "0755";
};
# Debugging
exec 19>/home/zoey/Desktop/stoplogfile
BASH_XTRACEFD=19
set -x
"libvirt/hooks/qemu.d/bazzite/prepare/begin/start.sh" = {
text = startScript;
mode = "0755";
};
# Load variables we defined
source "/etc/libvirt/hooks/kvm.conf"
# Unload vfio module
modprobe -r vfio-pci
# Attach GPU devices from host
virsh nodedev-reattach $VIRSH_GPU_VIDEO
virsh nodedev-reattach $VIRSH_GPU_AUDIO
# Read nvidia x config
nvidia-xconfig --query-gpu-info > /dev/null 2>&1
# Load NVIDIA kernel modules
modprobe nvidia_drm nvidia_modeset nvidia_uvm nvidia
# Avoid race condition
sleep 5
# Bind EFI Framebuffer
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/bind
# Bind VTconsoles
echo 1 > /sys/class/vtconsole/vtcon0/bind
echo 1 > /sys/class/vtconsole/vtcon1/bind
# Start display manager
systemctl start display-manager.service
# Return host to all cores
systemctl set-property --runtime -- user.slice AllowedCPUs=0-31
systemctl set-property --runtime -- system.slice AllowedCPUs=0-31
systemctl set-property --runtime -- init.scope AllowedCPUs=0-31
# Change to powersave governor
echo powersave | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
'';
"libvirt/hooks/qemu.d/bazzite/release/end/stop.sh" = {
text = stopScript;
mode = "0755";
};
};

View file

@ -28,6 +28,8 @@ in {
zach-pw.file = ./sec/zach-pw.age;
emily-pw.file = ./sec/emily-piccat.age;
smtp-password.file = ./sec/smtpPassword.age;
gitlab-email-pw-hashed.file = ./sec/gitlab-email-pw-hashed.age;
};
@ -39,7 +41,7 @@ in {
loginAccounts = {
"zoey@zoeys.email" = {
hashedPasswordFile = sec.webmaster-pw.path;
aliases = ["zoey@zoeys.cloud" "postmaster@zoeys.email" "abuse@zoeys.email"];
aliases = ["zoey@zoeys.cloud" "errors@zoeys.cloud" "admin@zoeys.cloud" "postmaster@zoeys.email" "abuse@zoeys.email"];
};
"hi@zoeys.computer" = {
hashedPasswordFile = sec.zoeycomputer-pw.path;
@ -57,6 +59,9 @@ in {
hashedPasswordFile = sec.gitlab-email-pw-hashed.path;
aliases = ["noreply@zoeys.cloud"];
};
"no-reply@code.zoeys.cloud" = {
hashedPasswordFile = sec.smtp-password.path;
};
};
certificateScheme = "acme-nginx";

View file

@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 CtmR6w 5VDFuttJ1VBYa4fBxMv/Ws96h3lQMtDtt4kift5TggY
iHhoBRnhFOG7AYWAWcgEbX0ABUNgIWHHUpterkkMunc
-> ssh-ed25519 +be3hg zpo9T3n1X5PipJjEgOqgSJSwhIZu19rLcQP3zPILWRM
SJp+lVPB997tCMucqfGgqXOougiSoMoGMd/tozTTT0Q
--- /uEWB/Q4G4hy0t+hEIeID0Ymqy+qGrnrK5AgwPhs82Y
ýýI?è¢<C3A8>.þ_Q}lïÐ3/˳¨Û3æ<33>9 8J ®KÔÅ™aJ:ký*-Š;5Ê%Ô7£y

View file

@ -19,24 +19,6 @@ in {
enable = cfg.mullvad;
package = nixos-stable.mullvad;
};
#
# # Create a specific network namespace for VPN traffic
# systemd.services.mullvad-daemon = {
# serviceConfig = {
# NetworkNamespacePath = "/run/netns/mullvad";
# };
# };
#
# # Configure transmission to use Mullvad's SOCKS5 proxy
# # Configure transmission to use the Mullvad network namespace
# systemd.services.transmission = mkIf config.services.transmission.enable {
# serviceConfig = {
# NetworkNamespacePath = "/run/netns/mullvad";
# };
# # Make sure Mullvad is running before transmission starts
# requires = ["mullvad-daemon.service"];
# after = ["mullvad-daemon.service"];
# };
services.openvpn = {
servers = {
@ -48,22 +30,5 @@ in {
};
systemd.services.openvpn-work.wantedBy = lib.mkForce [];
# # Add necessary networking tools
# environment.systemPackages = with pkgs; [
# iproute2 # for ip netns commands
# ];
#
# # Setup network namespace
# systemd.services.setup-mullvad-netns = {
# description = "Setup Mullvad Network Namespace";
# before = ["mullvad-daemon.service"];
# serviceConfig = {
# Type = "oneshot";
# RemainAfterExit = true;
# ExecStart = "${pkgs.iproute2}/bin/ip netns add mullvad";
# ExecStop = "${pkgs.iproute2}/bin/ip netns delete mullvad";
# };
# };
};
}

View file

@ -24,6 +24,7 @@ in {
services.nix-serve = {
enable = true;
secretKeyFile = sec.cache_key.path;
port = 12024;
};
services.nginx.virtualHosts."cache.zoeys.computer" = {

View file

@ -0,0 +1,107 @@
{
lib,
config,
pkgs,
inputs,
...
}:
with lib;
with lib.custom; let
cfg = config.sites.forgejo;
frg = config.services.forgejo;
srv = frg.settings.server;
in {
options.sites.forgejo = with types; {
enable = mkBoolOpt false "Enable Forgejo site";
domain = mkStringOpt "code.zoeys.cloud" "The domain for the site";
};
config = mkIf cfg.enable {
services.nginx.virtualHosts.${frg.settings.server.DOMAIN} = {
forceSSL = true;
enableACME = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
};
catppuccin.forgejo.enable = true;
services.gitea-actions-runner = {
package = pkgs.forgejo-actions-runner;
instances.default = {
enable = true;
name = "monolith";
url = "https://code.zoeys.cloud";
# Obtaining the path to the runner token file may differ
# tokenFile should be in format TOKEN=<secret>, since it's EnvironmentFile for systemd
tokenFile = config.age.secrets.forgejo-runner-token.path;
labels = [
"ubuntu-latest:docker://node:16-bullseye"
"ubuntu-22.04:docker://node:16-bullseye"
"ubuntu-20.04:docker://node:16-bullseye"
"ubuntu-18.04:docker://node:16-buster"
## optionally provide native execution on the host:
# "native:host"
];
};
};
services.forgejo = {
enable = true;
database.type = "postgres";
lfs.enable = true;
settings = {
server = {
DOMAIN = cfg.domain;
ROOT_URL = "https://${srv.DOMAIN}";
HTTP_PORT = 7201;
};
service.DISABLE_REGISTRATION = true;
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "github";
};
mailer = {
ENABLED = true;
SMTP_ADDR = "mail.zoeys.cloud";
FROM = "no-reply@${srv.DOMAIN}";
USER = "no-reply@${srv.DOMAIN}";
};
};
secrets = {
mailer = {
PASSWD = config.age.secrets.forgejo-mailer-password.path;
};
};
};
systemd.services.forgejo.preStart = let
adminCmd = "${lib.getExe frg.package} admin user";
pwd = config.age.secrets.forgejo-pw;
user = "zoey";
in ''
${adminCmd} create --admin --email "hi@zoeys.computer" --username ${user} --password "$(tr -d '\n' < ${pwd.path})" || true'';
age.secrets = {
forgejo-mailer-password = {
file = ../sourcehut/sec/smtpPassword.age;
mode = "400";
owner = "forgejo";
};
forgejo-pw = {
file = ./forgejoPw.age;
mode = "400";
owner = "forgejo";
};
forgejo-runner-token = {
file = ./forgejoRunner.age;
mode = "400";
owner = "forgejo";
};
};
};
}

Binary file not shown.

View file

@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 CtmR6w oShhq0zXjjMoDW0+AZx/ro5x3XZ/Smf//Han2rZdA0o
ucJn5M9x66gxKPmkVg1E4F/PsZ7rBTA8MlUAbmIC+2s
-> ssh-ed25519 RMNffg GBNcFhRuZyme2t/yrWDS/lrQzpm1wHUkAhjLz86ZG3I
bpsZdqqP205zT9F7Ca5jtCn/qfKcI/gTxANQOPLWnnA
--- JbJQpU8FaE6TPHMyX4SmDQLEI8b67SaFG73nUc+Ud3s
"'Åx<C385>táoph°ðhç5]Ž|Új1‰_e#mDö~mvŒÈ¢o˜ÊRfúùðfëoÕ<>óÅ"RžÜêf8uuU?¯

View file

@ -57,44 +57,6 @@ in {
boot.kernel.sysctl."net.ipv4.ip_forward" = true; # 1
services.gitlab-runner = {
enable = true;
services = {
nix = with lib; {
authenticationTokenConfigFile = sec.gitlab_runner.path;
dockerImage = "alpine";
dockerVolumes = [
"/nix/store:/nix/store:ro"
"/nix/var/nix/db:/nix/var/nix/db:ro"
"/nix/var/nix/daemon-socket:/nix/var/nix/daemon-socket:ro"
];
dockerDisableCache = true;
preBuildScript = pkgs.writeScript "setup-container" ''
mkdir -p -m 0755 /nix/var/log/nix/drvs
mkdir -p -m 0755 /nix/var/nix/gcroots
mkdir -p -m 0755 /nix/var/nix/profiles
mkdir -p -m 0755 /nix/var/nix/temproots
mkdir -p -m 0755 /nix/var/nix/userpool
mkdir -p -m 1777 /nix/var/nix/gcroots/per-user
mkdir -p -m 1777 /nix/var/nix/profiles/per-user
mkdir -p -m 0755 /nix/var/nix/profiles/per-user/root
mkdir -p -m 0700 "$HOME/.nix-defexpr"
. ${pkgs.nix}/etc/profile.d/nix-daemon.sh
${pkgs.nix}/bin/nix-channel --add https://nixos.org/channels/nixos-24.11 nixpkgs # 3
${pkgs.nix}/bin/nix-channel --update nixpkgs
${pkgs.nix}/bin/nix-env -i ${concatStringsSep " " (with pkgs; [nix cacert git openssh])}
'';
environmentVariables = {
ENV = "/etc/profile";
USER = "root";
NIX_REMOTE = "daemon";
PATH = "/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin";
NIX_SSL_CERT_FILE = "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt";
};
};
};
};
services.gitlab = {
enable = true;
databasePasswordFile = sec.gitlab_db.path;

View file

@ -0,0 +1,204 @@
{
lib,
config,
pkgs,
...
}:
with lib;
with lib.custom; let
cfg = config.sites.sourcehut;
srhtCfg = config.services.sourcehut;
fqdn = "zoeys.cloud";
sec = config.age.secrets;
sourcehutGroup = "sourcehut-secrets";
mkSrhtBindOverrides = serviceNames:
lib.listToAttrs (map (name: {
name = name;
value = {
serviceConfig.BindReadOnlyPaths = lib.mkMerge ["/run/agenix"];
};
})
serviceNames);
metaServices = lib.mkIf srhtCfg.meta.enable (mkSrhtBindOverrides [
"metasrht" # Main web service
"metashrt-daily"
"metasrht-api" # API service
"metasrht-webhooks" # Webhook worker
]);
gitServices = lib.mkIf srhtCfg.git.enable (mkSrhtBindOverrides [
"gitsrht" # Main web service
"gitsrht-api" # API service
"gitsrht-periodic" # Timer service
"gitsrht-webhooks" # Webhook worker
"gitsrht-fcgiwrap" # FCGIWrap for git http backend (might need access if hooks use secrets)
]);
manServices = lib.mkIf srhtCfg.man.enable (mkSrhtBindOverrides [
"mansrht" # Main web service
# Add others if man gains sub-services
]);
in {
options.sites.sourcehut = with types; {
enable = mkBoolOpt false "Enable SRHT";
};
config = mkIf cfg.enable {
users.groups.sourcehut-secrets = {};
users.users.metasrht.extraGroups = ["sourcehut-secrets"];
users.users.gitsrht.extraGroups = ["sourcehut-secrets"];
systemd.services = lib.mkMerge [
metaServices
gitServices
];
age.secrets = {
network-key = {
file = ./sec/networkKey.age;
owner = "root";
group = sourcehutGroup;
mode = "0440";
};
service-key = {
file = ./sec/serviceKey.age;
owner = "root";
group = sourcehutGroup;
mode = "0440";
};
webhook-key = {
file = ./sec/webhookKey.age;
owner = "root";
group = sourcehutGroup;
mode = "0440";
};
smtp-password = {
file = ./sec/smtpPassword.age;
owner = "root";
group = sourcehutGroup;
mode = "0440";
};
pgp-pub-key = {
file = ./sec/pgpPubKey.age;
owner = "root";
group = sourcehutGroup;
mode = "0440"; # Or 0444 if it needs to be world-readable, but 0440 is safer
};
pgp-priv-key = {
file = ./sec/pgpPrivKey.age;
owner = "root";
group = sourcehutGroup;
mode = "0440"; # Private key needs strict permissions
};
git-client-secret = {
file = ./sec/gitClientSecret.age;
owner = "root";
group = sourcehutGroup;
mode = "0440";
};
man-client-secret = {
file = ./sec/gitClientSecret.age;
owner = "root";
group = sourcehutGroup;
mode = "0440";
};
};
services.sourcehut = {
enable = true;
git.enable = true;
git.redis.host = "redis://localhost:6379?db=0";
man.enable = true;
man.redis.host = "redis://localhost:6379?db=0";
meta.enable = true;
meta.redis.host = "redis://localhost:6379?db=0";
# todo.enable = true;
# paste.enable = true;
# lists.enable = true;
nginx.enable = true;
postgresql.enable = true;
redis.enable = true;
postfix.enable = false;
settings = {
"sr.ht" = {
environment = "production";
global-domain = fqdn;
origin = "https://${fqdn}";
owner-email = "admin@${fqdn}";
owner-name = "zoey";
site-name = "zoey's cloud";
network-key = sec.network-key.path;
service-key = sec.service-key.path;
};
webhooks = {
private-key = sec.webhook-key.path;
};
"git.sr.ht" = {
oauth-client-id = "bdd69307-d8b9-4f02-b079-2a1055c3e865";
oauth-client-secret = sec.git-client-secret.path;
};
"man.sr.ht" = {
oauth-client-id = "9c64aac1-51cb-48f0-9ff8-a2af377dd38e";
oauth-client-secret = sec.man-client-secret.path;
};
mail = {
smtp-host = "mail.zoeys.email";
smtp-port = 465;
smtp-user = "srht@${fqdn}";
smtp-password = sec.smtp-password.path;
smtp-from = "no-reply@${fqdn}";
smtp-ssl = true;
pgp-pubkey = sec.pgp-pub-key.path;
pgp-privkey = sec.pgp-priv-key.path;
pgp-key-id = "0xD82899ACCD75CC48";
error-to = "errors@${fqdn}";
error-from = "sourcehut-errors@${fqdn}";
};
"meta.sr.ht::settings" = {
registration = true;
};
};
};
security.acme.certs."${fqdn}".extraDomainNames = [
"meta.${fqdn}"
"man.${fqdn}"
"git.${fqdn}"
];
services.nginx = {
virtualHosts = {
"${fqdn}".enableACME = true;
"meta.${fqdn}".enableACME = true;
"man.${fqdn}".enableACME = true;
"git.${fqdn}".enableACME = true;
};
};
};
}

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 CtmR6w sWwNYqQ3g9UMu35p8kvAXj4uEy35g0///7gpHFO69zs
1lQ0r74sGR+K/ynikwClNB5UZ3ZD1fTpxSdJE5Dk0nM
-> ssh-ed25519 RMNffg vqaQVHXN7yjv10wz2xZCpJ6O7fqXaNYCPqKEdufkdCc
FLFvodvpQGPYbjv8yoyjHE2+a+YyZkBGZZbOx33GpRo
--- H3zEDss69sqnW3LM5GlWR11xx9E8u04/id6jlZqNgfg
J^s=†ÕYЭ_ÂŒü¤/À ÉȤ¸Ziýþ#?Lu—œ”Ú3Ñ~vH¢c9^î™Cù‡²…²üuŸ»ßÚp[ÉcúCS<43>Sv¹S

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 CtmR6w ExpktzFWkofB1qmGIexwu0UAnUeGzQIeeEMHiZNXQkY
YDNPPLtB8N7A0NB0VwVkQAN3DNeknLo3rv+WdcUdLD0
-> ssh-ed25519 RMNffg GFHzl2/nPuIVH4RzUnbUl/LHFmkXQ+pPUGuQzcEZi3o
Z6iMUjgD0K7LCYWV0qZMbyzWmUsbhp0anr3niecdyPs
--- wjP9Fn9/VIrsgwbTVZv/vzbEskwMKmQbHohtNyfF02w
Ýžsý§zš‡<EFBFBD> ÍKQŽÐäb #&™ÖTÆ3v/<2F>ÂÐg¨Õ¨%ë½fõî›\^œj²QÜqh

Binary file not shown.

View file

@ -29,46 +29,85 @@ in {
lexend
jost
dejavu_fonts
iosevka
# iosevka
cantarell-fonts
# (iosevka.override
# {
# set = "Custom";
# privateBuildPlan = ''
# [buildPlans.IosevkaCustom]
# family = "Iosevka"
# spacing = "normal"
# serifs = "sans"
# noCvSs = true
# exportGlyphNames = true
#
# [buildPlans.IosevkaCustom.variants]
# inherits = "ss05"
#
# [buildPlans.IosevkaCustom.variants.design]
# l = "hooky"
#
# [buildPlans.IosevkaCustom.widths.Normal]
# shape = 500
# menu = 5
# css = "normal"
#
# [buildPlans.IosevkaCustom.widths.Extended]
# shape = 600
# menu = 7
# css = "expanded"
#
# [buildPlans.IosevkaCustom.widths.SemiCondensed]
# shape = 456
# menu = 4
# css = "semi-condensed"
#
# [buildPlans.IosevkaCustom.widths.SemiExtended]
# shape = 548
# menu = 6
# css = "semi-expanded"
# '';
# })
(iosevka.override
{
set = "Custom";
privateBuildPlan = ''
# [buildPlans.IosevkaCustom]
# family = "Iosevka"
# spacing = "fontconfig-mono"
# serifs = "sans"
# noCvSs = true
# exportGlyphNames = true
#
# [buildPlans.IosevkaCustom.variants]
# inherits = "ss08"
#
# [buildPlans.IosevkaCustom.widths.Normal]
# shape = 500
# menu = 5
# css = "normal"
#
# [buildPlans.IosevkaCustom.widths.Extended]
# shape = 600
# menu = 7
# css = "expanded"
[buildPlans.IosevkaCustom]
family = "Iosevka"
spacing = "normal"
serifs = "sans"
noCvSs = true
exportGlyphNames = true
[buildPlans.IosevkaCustom.variants]
inherits = "ss17"
[buildPlans.IosevkaCustom.variants.design]
capital-e = "top-left-serifed"
capital-u = "toothed-bottom-right-serifed"
f = "tailed"
m = "short-leg-top-left-and-bottom-right-serifed"
paren = "flat-arc"
[buildPlans.IosevkaCustom.ligations]
inherits = "dlig"
[buildPlans.IosevkaCustom.weights.Regular]
shape = 400
menu = 400
css = 400
[buildPlans.IosevkaCustom.weights.Medium]
shape = 500
menu = 500
css = 500
[buildPlans.IosevkaCustom.weights.SemiBold]
shape = 600
menu = 600
css = 600
[buildPlans.IosevkaCustom.weights.Bold]
shape = 700
menu = 700
css = 700
[buildPlans.IosevkaCustom.slopes.Upright]
angle = 0
shape = "upright"
menu = "upright"
css = "normal"
[buildPlans.IosevkaCustom.slopes.Italic]
angle = 9.4
shape = "italic"
menu = "italic"
css = "italic"
'';
})
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji

View file

@ -30,11 +30,6 @@
hardware.keyboard.qmk.enable = true;
programs.nix-ld.enable = true;
# services.monero.mining.enable = true;
# services.monero.enable = true;
# services.monero.mining.address = "485XKPKG38bSJBUa4SPenAEFt8Wgj2hWC97PNBpFHniwNXnDNZ9xar5hHb6qLQeyK2Kk3Fw2cxxPSLjgyqr5CxXAUkUsDDx";
# services.monero.mining.threads = 4;
hardware.march = {
arch = "znver3";
enableNativeOptimizations = true;

View file

@ -2,9 +2,12 @@
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{
lib,
pkgs,
inputs,
config,
specialArgs,
system,
...
}: {
imports = [
@ -12,6 +15,8 @@
./hardware-configuration.nix
];
# nixpkgs.pkgs = lib.mkForce inputs.nixos-stable.legacyPackages.${system};
nix.settings = {
trusted-users = ["zoey"];
};
@ -97,6 +102,8 @@
minio.enable = true;
immich.enable = true;
polaris.enable = false;
sourcehut.enable = false;
forgejo.enable = true;
zoeycomputer = {
enable = true;
domain = "zoeys.computer";
@ -112,6 +119,8 @@
};
};
catppuccin.flavor = "mocha";
zmio.blog.enable = true;
zmio.blog.domain = "zackmyers.io";