Compare commits

...

3 commits

Author SHA1 Message Date
49f7a9acc1 fix: formatting 2023-12-15 11:59:16 -08:00
db08e595c1 feat: Docker prune automation 2023-12-15 11:58:49 -08:00
6033a0ce5d feat: Add initial prometheus support 2023-12-15 11:58:31 -08:00
9 changed files with 486 additions and 434 deletions

View file

@ -8,18 +8,19 @@
nixpkgs.config.packageOverrides = pkgs: {
steam = pkgs.steam.override {
extraPkgs = pkgs: with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
];
extraPkgs = pkgs:
with pkgs; [
xorg.libXcursor
xorg.libXi
xorg.libXinerama
xorg.libXScrnSaver
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
];
};
};

View file

@ -11,6 +11,7 @@
./users.nix
./locale.nix
./smart.nix
# ./prometheus.nix
../../common/style/stylix.nix
];
#

View file

@ -12,8 +12,15 @@
options = ["x-systemd.automount" "noauto" "soft"];
};
virtualisation.docker.enable = true;
virtualisation.docker.liveRestore = false;
virtualisation.docker = {
enable = true;
liveRestore = false;
autoPrune = {
enable = true;
flags = ["--all"];
};
};
users.users.kdb424.extraGroups = ["docker"];
networking.firewall.enable = false;

View file

@ -0,0 +1,42 @@
{
config,
lib,
pkgs,
...
}: {
services.prometheus = {
port = 9001;
scrapeConfigs = [
{
job_name = "node";
static_configs = [
{
targets = ["localhost:${toString config.services.prometheus.exporters.node.port}"];
}
];
}
];
exporters = {
node = {
enable = true;
enabledCollectors = [
"diskstats"
"filesystem"
"loadavg"
"meminfo"
"netdev"
"netstat"
"stat"
"time"
"vmstat"
"systemd"
"logind"
"interrupts"
"ksmd"
"zfs"
];
port = 9002;
};
};
};
}

View file

@ -1,7 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}: {
services.smartd = {
enable = true;
notifications.wall.enable = true;

View file

@ -1,8 +1,6 @@
{pkgs, ...}:
let
vimix-cursors = (pkgs.callPackage ./vimix-cursors.nix { });
in
{
{pkgs, ...}: let
vimix-cursors = pkgs.callPackage ./vimix-cursors.nix {};
in {
stylix = {
image = pkgs.fetchurl {
url = "https://git.kdb424.xyz/kdb424/wallpapers/raw/branch/main/wallhaven-7p3we9.png";

View file

@ -1,8 +1,8 @@
{ stdenvNoCC
, fetchFromGitHub
, lib
{
stdenvNoCC,
fetchFromGitHub,
lib,
}:
stdenvNoCC.mkDerivation rec {
pname = "vimix-cursor-theme";
version = "9bc292f40904e0a33780eda5c5d92eb9a1154e9c";

View file

@ -1,8 +1,11 @@
{ config, lib, pkgs, stylix, ... }:
with config.lib.stylix.colors.withHashtag;
let
{
config,
lib,
pkgs,
stylix,
...
}:
with config.lib.stylix.colors.withHashtag; let
background = base00;
altBackground = base01;
selBackground = base03;
@ -16,472 +19,470 @@ let
boarder = base0D;
fonts = {
names = [ config.stylix.fonts.sansSerif.name ];
names = [config.stylix.fonts.sansSerif.name];
size = config.stylix.fonts.sizes.desktop + 0.0;
};
colors = config.lib.stylix.colors.withHashtag;
opacity = lib.toHexString ((((builtins.ceil (config.stylix.opacity.popups * 100)) * 255) / 100));
in
{
opacity = lib.toHexString (((builtins.ceil (config.stylix.opacity.popups * 100)) * 255) / 100);
in {
home.packages = with pkgs; [
swaynotificationcenter
];
# man 5 swaync
home.file.".config/swaync/config.json".text = ''
{
"positionX": "right",
"positionY": "top",
"layer": "overlay",
"control-center-layer": "top",
"layer-shell": true,
"cssPriority": "application",
"control-center-margin-top": 0,
"control-center-margin-bottom": 0,
"control-center-margin-right": 0,
"control-center-margin-left": 0,
"notification-2fa-action": true,
"notification-inline-replies": true,
"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,
"relative-timestamps": true,
"control-center-width": 500,
"control-center-height": 600,
"notification-window-width": 500,
"keyboard-shortcuts": true,
"image-visibility": "when-available",
"transition-time": 200,
"hide-on-clear": true,
"hide-on-action": true,
"script-fail-notify": true,
{
"positionX": "right",
"positionY": "top",
"layer": "overlay",
"control-center-layer": "top",
"layer-shell": true,
"cssPriority": "application",
"control-center-margin-top": 0,
"control-center-margin-bottom": 0,
"control-center-margin-right": 0,
"control-center-margin-left": 0,
"notification-2fa-action": true,
"notification-inline-replies": true,
"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,
"relative-timestamps": true,
"control-center-width": 500,
"control-center-height": 600,
"notification-window-width": 500,
"keyboard-shortcuts": true,
"image-visibility": "when-available",
"transition-time": 200,
"hide-on-clear": true,
"hide-on-action": true,
"script-fail-notify": true,
"notification-visibility": {
"sonixd": {
"state": "muted",
"urgency": "Low",
"app-name": "Sonixd"
}
"notification-visibility": {
"sonixd": {
"state": "muted",
"urgency": "Low",
"app-name": "Sonixd"
}
},
"widgets": [
"inhibitors",
"title",
"volume",
"buttons-grid",
"dnd",
"notifications"
],
"widget-config": {
"inhibitors": {
"text": "Inhibitors",
"button-text": "Clear All",
"clear-all-button": true
},
"widgets": [
"inhibitors",
"title",
"volume",
"buttons-grid",
"dnd",
"notifications"
],
"widget-config": {
"inhibitors": {
"text": "Inhibitors",
"button-text": "Clear All",
"clear-all-button": true
},
"title": {
"text": "Notifications",
"clear-all-button": true,
"button-text": "󰆴 Clear All"
},
"dnd": {
"text": "Do Not Disturb"
},
"volume": {
"show-per-app": true
},
"buttons-grid": {
"actions": [
{
"label": "󰌾",
"command": "${pkgs.swaylock-effects}/bin/swaylock"
},
{
"label": "󰍃",
"command": "${pkgs.wlogout}/bin/wlogout"
},
{
"label": "󰕾",
"command": "${pkgs.ponymix}/bin/ponymix toggle"
},
{
"label": "󰖩",
"command": "${pkgs.alacritty}/bin/alacritty -e ${pkgs.networkmanager}/bin/nmtui"
},
{
"label": "󰂯",
"command": "${pkgs.blueman}/bin/blueman-manager"
}
]
}
"title": {
"text": "Notifications",
"clear-all-button": true,
"button-text": "󰆴 Clear All"
},
"dnd": {
"text": "Do Not Disturb"
},
"volume": {
"show-per-app": true
},
"buttons-grid": {
"actions": [
{
"label": "󰌾",
"command": "${pkgs.swaylock-effects}/bin/swaylock"
},
{
"label": "󰍃",
"command": "${pkgs.wlogout}/bin/wlogout"
},
{
"label": "󰕾",
"command": "${pkgs.ponymix}/bin/ponymix toggle"
},
{
"label": "󰖩",
"command": "${pkgs.alacritty}/bin/alacritty -e ${pkgs.networkmanager}/bin/nmtui"
},
{
"label": "󰂯",
"command": "${pkgs.blueman}/bin/blueman-manager"
}
]
}
}
}
'';
home.file.".config/swaync/style.css".text = ''
@define-color ${colors.base00};
@define-color ${colors.base00};
@define-color noti-border-color ${boarder};
@define-color noti-bg ${background};
@define-color noti-bg-darker ${background};
@define-color noti-bg-hover ${selBackground};
@define-color noti-bg-focus ${selBackground};
@define-color noti-close-bg ${colors.base00};
@define-color noti-close-bg-hover ${colors.base00};
@define-color noti-border-color ${boarder};
@define-color noti-bg ${background};
@define-color noti-bg-darker ${background};
@define-color noti-bg-hover ${selBackground};
@define-color noti-bg-focus ${selBackground};
@define-color noti-close-bg ${colors.base00};
@define-color noti-close-bg-hover ${colors.base00};
@define-color text-color ${text};
@define-color text-color-disabled ${text};
@define-color text-color ${text};
@define-color text-color-disabled ${text};
@define-color bg-selected ${selBackground};
@define-color bg-selected ${selBackground};
.notification-row {
outline: none;
}
.notification-row {
outline: none;
}
.notification-row:focus,
.notification-row:hover {
background: @noti-bg-focus;
}
.notification-row:focus,
.notification-row:hover {
background: @noti-bg-focus;
}
.notification {
border-radius: 12px;
margin: 6px 12px;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7),
0 2px 6px 2px rgba(0, 0, 0, 0.3);
padding: 0;
}
.notification {
border-radius: 12px;
margin: 6px 12px;
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7),
0 2px 6px 2px rgba(0, 0, 0, 0.3);
padding: 0;
}
/* Uncomment to enable specific urgency colors
.low {
background: yellow;
padding: 6px;
border-radius: 12px;
}
/* Uncomment to enable specific urgency colors
.low {
background: yellow;
padding: 6px;
border-radius: 12px;
}
.normal {
background: {};
padding: 6px;
border-radius: 12px;
}
*/
.normal {
background: {};
padding: 6px;
border-radius: 12px;
}
*/
.critical {
background: ${urgent};
padding: 6px;
border-radius: 12px;
}
.critical {
background: ${urgent};
padding: 6px;
border-radius: 12px;
}
.notification-content {
background: transparent;
padding: 6px;
border-radius: 12px;
}
.notification-content {
background: transparent;
padding: 6px;
border-radius: 12px;
}
.close-button {
background: @noti-close-bg;
color: @text-color;
text-shadow: none;
padding: 0;
border-radius: 100%;
margin-top: 10px;
margin-right: 16px;
box-shadow: none;
border: none;
min-width: 24px;
min-height: 24px;
}
.close-button {
background: @noti-close-bg;
color: @text-color;
text-shadow: none;
padding: 0;
border-radius: 100%;
margin-top: 10px;
margin-right: 16px;
box-shadow: none;
border: none;
min-width: 24px;
min-height: 24px;
}
.close-button:hover {
box-shadow: none;
background: @noti-close-bg-hover;
transition: all 0.15s ease-in-out;
border: none;
}
.close-button:hover {
box-shadow: none;
background: @noti-close-bg-hover;
transition: all 0.15s ease-in-out;
border: none;
}
.notification-default-action,
.notification-action {
padding: 4px;
margin: 0;
box-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
color: @text-color;
transition: all 0.15s ease-in-out;
}
.notification-default-action,
.notification-action {
padding: 4px;
margin: 0;
box-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
color: @text-color;
transition: all 0.15s ease-in-out;
}
.notification-default-action:hover,
.notification-action:hover {
-gtk-icon-effect: none;
background: @noti-bg-hover;
}
.notification-default-action:hover,
.notification-action:hover {
-gtk-icon-effect: none;
background: @noti-bg-hover;
}
.notification-default-action {
border-radius: 12px;
}
.notification-default-action {
border-radius: 12px;
}
/* When alternative actions are visible */
.notification-default-action:not(:only-child) {
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
/* When alternative actions are visible */
.notification-default-action:not(:only-child) {
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
}
.notification-action {
border-radius: 0px;
border-top: none;
border-right: none;
}
.notification-action {
border-radius: 0px;
border-top: none;
border-right: none;
}
/* add bottom border radius to eliminate clipping */
.notification-action:first-child {
border-bottom-left-radius: 10px;
}
/* add bottom border radius to eliminate clipping */
.notification-action:first-child {
border-bottom-left-radius: 10px;
}
.notification-action:last-child {
border-bottom-right-radius: 10px;
border-right: 1px solid @noti-border-color;
}
.notification-action:last-child {
border-bottom-right-radius: 10px;
border-right: 1px solid @noti-border-color;
}
.inline-reply {
margin-top: 8px;
}
.inline-reply-entry {
background: @noti-bg-darker;
color: @text-color;
caret-color: @text-color;
border: 1px solid @noti-border-color;
border-radius: 12px;
}
.inline-reply-button {
margin-left: 4px;
background: @noti-bg;
border: 1px solid @noti-border-color;
border-radius: 12px;
color: @text-color;
}
.inline-reply-button:disabled {
background: initial;
color: @text-color-disabled;
border: 1px solid transparent;
}
.inline-reply-button:hover {
background: @noti-bg-hover;
}
.inline-reply {
margin-top: 8px;
}
.inline-reply-entry {
background: @noti-bg-darker;
color: @text-color;
caret-color: @text-color;
border: 1px solid @noti-border-color;
border-radius: 12px;
}
.inline-reply-button {
margin-left: 4px;
background: @noti-bg;
border: 1px solid @noti-border-color;
border-radius: 12px;
color: @text-color;
}
.inline-reply-button:disabled {
background: initial;
color: @text-color-disabled;
border: 1px solid transparent;
}
.inline-reply-button:hover {
background: @noti-bg-hover;
}
.image {
}
.image {
}
.body-image {
margin-top: 6px;
background-color: white;
border-radius: 12px;
}
.body-image {
margin-top: 6px;
background-color: white;
border-radius: 12px;
}
.summary {
font-size: 16px;
font-weight: bold;
background: transparent;
color: @text-color;
text-shadow: none;
}
.summary {
font-size: 16px;
font-weight: bold;
background: transparent;
color: @text-color;
text-shadow: none;
}
.time {
font-size: 16px;
font-weight: bold;
background: transparent;
color: @text-color;
text-shadow: none;
margin-right: 18px;
}
.time {
font-size: 16px;
font-weight: bold;
background: transparent;
color: @text-color;
text-shadow: none;
margin-right: 18px;
}
.body {
font-size: 15px;
font-weight: normal;
background: transparent;
color: @text-color;
text-shadow: none;
}
.body {
font-size: 15px;
font-weight: normal;
background: transparent;
color: @text-color;
text-shadow: none;
}
.control-center {
background: @cc-bg;
}
.control-center {
background: @cc-bg;
}
.control-center-list {
background: transparent;
}
.control-center-list {
background: transparent;
}
.control-center-list-placeholder {
opacity: 0.5;
}
.control-center-list-placeholder {
opacity: 0.5;
}
.floating-notifications {
background: transparent;
}
.floating-notifications {
background: transparent;
}
/* Window behind control center and on all other monitors */
.blank-window {
background: alpha(black, 0.25);
}
/* Window behind control center and on all other monitors */
.blank-window {
background: alpha(black, 0.25);
}
/*** Widgets ***/
/*** Widgets ***/
/* Title widget */
.widget-title {
margin: 8px;
font-size: 1.5rem;
}
.widget-title > button {
font-size: initial;
color: @text-color;
text-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
border-radius: 12px;
}
.widget-title > button:hover {
background: @noti-bg-hover;
}
/* Title widget */
.widget-title {
margin: 8px;
font-size: 1.5rem;
}
.widget-title > button {
font-size: initial;
color: @text-color;
text-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
border-radius: 12px;
}
.widget-title > button:hover {
background: @noti-bg-hover;
}
/* DND widget */
.widget-dnd {
margin: 8px;
font-size: 1.1rem;
}
.widget-dnd > switch {
font-size: initial;
border-radius: 12px;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
}
.widget-dnd > switch:checked {
background: @bg-selected;
}
.widget-dnd > switch slider {
background: @noti-bg-hover;
border-radius: 12px;
}
/* DND widget */
.widget-dnd {
margin: 8px;
font-size: 1.1rem;
}
.widget-dnd > switch {
font-size: initial;
border-radius: 12px;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
}
.widget-dnd > switch:checked {
background: @bg-selected;
}
.widget-dnd > switch slider {
background: @noti-bg-hover;
border-radius: 12px;
}
/* Label widget */
.widget-label {
margin: 8px;
}
.widget-label > label {
font-size: 1.1rem;
}
/* Label widget */
.widget-label {
margin: 8px;
}
.widget-label > label {
font-size: 1.1rem;
}
/* Mpris widget */
.widget-mpris {
/* The parent to all players */
}
.widget-mpris-player {
padding: 8px;
margin: 8px;
}
.widget-mpris-title {
font-weight: bold;
font-size: 1.25rem;
}
.widget-mpris-subtitle {
font-size: 1.1rem;
}
/* Mpris widget */
.widget-mpris {
/* The parent to all players */
}
.widget-mpris-player {
padding: 8px;
margin: 8px;
}
.widget-mpris-title {
font-weight: bold;
font-size: 1.25rem;
}
.widget-mpris-subtitle {
font-size: 1.1rem;
}
/* Buttons widget */
.widget-buttons-grid {
font-size: x-large;
padding: 5px;
margin: 10px 10px 5px 10px;
border-radius: 5px;
background-color: @noti-bg;
}
/* Buttons widget */
.widget-buttons-grid {
font-size: x-large;
padding: 5px;
margin: 10px 10px 5px 10px;
border-radius: 5px;
background-color: @noti-bg;
}
.widget-buttons-grid>flowbox>flowboxchild>button{
background: @noti-bg;
border-radius: 12px;
}
.widget-buttons-grid>flowbox>flowboxchild>button{
background: @noti-bg;
border-radius: 12px;
}
/* style given to the active toggle button */
.widget-buttons-grid>flowbox>flowboxchild>button.toggle:checked {
}
/* style given to the active toggle button */
.widget-buttons-grid>flowbox>flowboxchild>button.toggle:checked {
}
.widget-buttons-grid>flowbox>flowboxchild>button:hover {
}
.widget-buttons-grid>flowbox>flowboxchild>button:hover {
}
/* Menubar widget */
.widget-menubar>box>.menu-button-bar>button {
border: none;
background: transparent;
}
/* Menubar widget */
.widget-menubar>box>.menu-button-bar>button {
border: none;
background: transparent;
}
/* .AnyName { Name defined in config after #
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
/* .AnyName { Name defined in config after #
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
.AnyName>button {
background: transparent;
border: none;
}
.AnyName>button {
background: transparent;
border: none;
}
.AnyName>button:hover {
background-color: @noti-bg-hover;
} */
.AnyName>button:hover {
background-color: @noti-bg-hover;
} */
.topbar-buttons>button { /* Name defined in config after # */
border: none;
background: transparent;
}
.topbar-buttons>button { /* Name defined in config after # */
border: none;
background: transparent;
}
/* Volume widget */
/* Volume widget */
.widget-volume {
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
.widget-volume {
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
.widget-volume>box>button {
background: transparent;
border: none;
}
.widget-volume>box>button {
background: transparent;
border: none;
}
.per-app-volume {
background-color: @noti-bg-alt;
padding: 4px 8px 8px 8px;
margin: 0px 8px 8px 8px;
border-radius: 12px;
}
.per-app-volume {
background-color: @noti-bg-alt;
padding: 4px 8px 8px 8px;
margin: 0px 8px 8px 8px;
border-radius: 12px;
}
/* Backlight widget */
.widget-backlight {
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
/* Backlight widget */
.widget-backlight {
background-color: @noti-bg;
padding: 8px;
margin: 8px;
border-radius: 12px;
}
/* Title widget */
.widget-inhibitors {
margin: 8px;
font-size: 1.5rem;
}
.widget-inhibitors > button {
font-size: initial;
color: @text-color;
text-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
border-radius: 12px;
}
.widget-inhibitors > button:hover {
background: @noti-bg-hover;
}
/* Title widget */
.widget-inhibitors {
margin: 8px;
font-size: 1.5rem;
}
.widget-inhibitors > button {
font-size: initial;
color: @text-color;
text-shadow: none;
background: @noti-bg;
border: 1px solid @noti-border-color;
box-shadow: none;
border-radius: 12px;
}
.widget-inhibitors > button:hover {
background: @noti-bg-hover;
}
'';
}

View file

@ -33,7 +33,7 @@ in {
margin = "2px 2px 0px 2px";
modules-left = ["hyprland/workspaces"];
modules-center = ["hyprland/window" "gamemode"];
modules-right = ["network" "cpu" "temperature" "memory" "disk" "pulseaudio" "battery" "tray" "clock" "privacy" "custom/notification" ];
modules-right = ["network" "cpu" "temperature" "memory" "disk" "pulseaudio" "battery" "tray" "clock" "privacy" "custom/notification"];
"hyprland/window" = {
format = "<span color='${primaryColor}'>{}</span>";
@ -197,7 +197,7 @@ in {
"inhibited-none" = "";
"dnd-inhibited-notification" = "<span foreground='red'><sup></sup></span>";
"dnd-inhibited-none" = "";
};
};
"return-type" = "json";
"exec-if" = "${pkgs.swaynotificationcenter}/bin/swaync-client";
"exec" = "${pkgs.swaynotificationcenter}/bin/swaync-client -swb";