Improve wrapper structure

This commit is contained in:
SebastianStork 2024-05-20 11:41:01 +02:00
parent 83433f81ea
commit 30c546b57f
20 changed files with 170 additions and 212 deletions

View file

@ -1,4 +1,7 @@
{ assembleWrapper, pkgs, ... }:
{ assembleWrapper, moduleArgs, ... }:
let
inherit (moduleArgs) pkgs;
in
assembleWrapper {
basePackage = pkgs.bottom;
flags = [ "--group" ];

View file

@ -3,7 +3,7 @@
pkgs,
lib,
...
}:
}@moduleArgs:
let
assembleWrapper =
wrapperConfig:
@ -17,7 +17,7 @@ in
(lib.filterAttrs (name: value: name != "default.nix"))
(lib.concatMapAttrs (
name: _: {
${lib.removeSuffix ".nix" name} = import ./${name} { inherit assembleWrapper pkgs lib; };
${lib.removeSuffix ".nix" name} = import ./${name} { inherit assembleWrapper moduleArgs; };
}
))
];

View file

@ -1,23 +0,0 @@
{ assembleWrapper, pkgs, ... }:
assembleWrapper {
basePackage = pkgs.hyprlock;
flags =
let
hyprlock-config = pkgs.writeText "hyprlock-config" ''
background {
monitor =
path = screenshot
blur_size = 4
blur_passes = 1
}
input-field {
monitor =
}
'';
in
[
"--config"
hyprlock-config
];
}

View file

@ -0,0 +1,11 @@
{ assembleWrapper, moduleArgs, ... }:
let
inherit (moduleArgs) pkgs;
in
assembleWrapper {
basePackage = pkgs.hyprlock;
flags = [
"--config"
./hyprlock.conf
];
}

View file

@ -0,0 +1,9 @@
background {
monitor =
path = screenshot
blur_size = 4
blur_passes = 1
}
input-field {
monitor =
}

View file

@ -1,17 +0,0 @@
{ assembleWrapper, pkgs, ... }:
assembleWrapper {
basePackage = pkgs.hyprpaper;
flags =
let
hyprpaper-config = pkgs.writeText "hyprpaper-config" ''
preload = ~/Pictures/.wallpaper
wallpaper = , ~/Pictures/.wallpaper
splash = false
'';
in
[
"--config"
hyprpaper-config
];
}

View file

@ -0,0 +1,11 @@
{ assembleWrapper, moduleArgs, ... }:
let
inherit (moduleArgs) pkgs;
in
assembleWrapper {
basePackage = pkgs.hyprpaper;
flags = [
"--config"
./hyprpaper.conf
];
}

View file

@ -0,0 +1,3 @@
preload = ~/Pictures/.wallpaper
wallpaper = , ~/Pictures/.wallpaper
splash = false

View file

@ -1,45 +0,0 @@
{
assembleWrapper,
pkgs,
lib,
...
}:
{
theme ? "dark",
}:
assembleWrapper {
basePackage = pkgs.kitty;
flags =
let
toKittyConfig = lib.generators.toKeyValue {
mkKeyValue =
key: value:
let
value' = (if lib.isBool value then lib.hm.booleans.yesNo value else toString value);
in
"${key} ${value'}";
};
kitty-config = pkgs.writeText "kitty-config" (toKittyConfig {
font_family = "JetBrainsMono Nerd Font";
confirm_os_window_close = 0;
background_opacity = "0.85";
enable_audio_bell = false;
update_check_interval = 0;
cursor_shape = "beam";
});
kitty-theme = pkgs.writeText "kitty-theme" "include ${pkgs.kitty-themes}/share/kitty-themes/themes/${
{
dark = "default.conf";
light = "GitHub_Light.conf";
}
.${theme}
}";
in
[
"--config"
kitty-config
"--config"
kitty-theme
];
}

View file

@ -0,0 +1,27 @@
{ assembleWrapper, moduleArgs, ... }:
let
inherit (moduleArgs) pkgs;
in
{
theme ? "dark",
}:
assembleWrapper {
basePackage = pkgs.kitty;
flags =
let
theme-file =
{
dark = "default.conf";
light = "GitHub_Light.conf";
}
.${theme};
kitty-theme = pkgs.writeText "kitty-theme" "include ${pkgs.kitty-themes}/share/kitty-themes/themes/${theme-file}}";
in
[
"--config"
./kitty.conf
"--config"
kitty-theme
];
}

View file

@ -0,0 +1,6 @@
font_family JetBrainsMono Nerd Font
background_opacity 0.85
cursor_shape beam
confirm_os_window_close 0
enable_audio_bell no
update_check_interval 0

View file

@ -1,4 +1,7 @@
{ assembleWrapper, pkgs, ... }:
{ assembleWrapper, moduleArgs, ... }:
let
inherit (moduleArgs) pkgs;
in
assembleWrapper {
basePackage = pkgs.marktext;
flags = [ "--disable-gpu" ];

View file

@ -1,4 +1,7 @@
{ assembleWrapper, pkgs, ... }:
{ assembleWrapper, moduleArgs, ... }:
let
inherit (moduleArgs) pkgs;
in
assembleWrapper {
basePackage = pkgs.obsidian;
flags = [ "--disable-gpu" ];

View file

@ -1,9 +1,7 @@
{
assembleWrapper,
pkgs,
lib,
...
}:
{ assembleWrapper, moduleArgs, ... }:
let
inherit (moduleArgs) pkgs;
in
{
theme ? "dark",
}:

View file

@ -1,4 +1,7 @@
{ assembleWrapper, pkgs, ... }:
{ assembleWrapper, moduleArgs, ... }:
let
inherit (moduleArgs) pkgs;
in
assembleWrapper {
basePackage = pkgs.spotify;
flags = [ "--disable-gpu" ];

View file

@ -1,114 +0,0 @@
{ assembleWrapper, pkgs, ... }:
assembleWrapper {
basePackage = pkgs.waybar;
flags =
let
waybar-config = (pkgs.formats.json { }).generate "waybar-config" {
layer = "top";
position = "bottom";
spacing = 10;
modules-left = [ "clock" ];
modules-center = [ "hyprland/workspaces" ];
modules-right = [
"tray"
"network"
"wireplumber"
"backlight"
"battery"
];
"hyprland/workspaces" = {
active-only = false;
all-outputs = true;
};
clock = {
format = " {:%H.%M}";
tooltip-format = "{:%d.%m.%Y}";
};
network = {
interval = 10;
format = "";
format-wifi = "{icon}";
format-icons = [
"󰤟"
"󰤢"
"󰤥"
"󰤨"
];
tooltip-format-wifi = "{essid} 󰇚 {bandwidthDownBits} 󰕒 {bandwidthUpBits}";
format-ethernet = "󰌗";
tooltip-format-ethernet = "󰇚 {bandwidthDownBits} 󰕒 {bandwidthUpBits}";
format-disconnected = "󰪎";
tooltip-format-disconnected = "Disconnected";
};
wireplumber = {
format = "{icon} {volume}%";
format-muted = "󰝟";
format-icons = [
"󰕿"
"󰖀"
"󰕾"
];
scroll-step = "5";
};
tray = {
icon-size = 20;
spacing = 6;
};
backlight = {
device = "amdgpu_bl1";
format = "{icon} {percent}%";
format-icons = [
"󰃞"
"󰃟"
"󰃠"
];
};
battery = {
states = {
warning = 15;
critical = 5;
};
format = "{icon} {capacity}%";
format-icons = [
"󰂎"
"󰁺"
"󰁻"
"󰁼"
"󰁽"
"󰁾"
"󰁿"
"󰂀"
"󰂁"
"󰂂"
"󰁹"
];
};
};
waybar-style = pkgs.writeText "waybar-style" ''
* {
border: none;
border-radius: 0px;
font-family: "Open Sans, Symbols Nerd Font Mono";
font-size: 15px;
}
'';
in
[
"--config"
waybar-config
"--style"
waybar-style
];
}

View file

@ -0,0 +1,58 @@
{
"layer": "top",
"position": "bottom",
"spacing": 10,
"modules-left": ["clock"],
"modules-center": ["hyprland/workspaces"],
"modules-right": ["tray", "network", "wireplumber", "backlight", "battery"],
"clock": {
"format": " {:%H.%M}",
"tooltip-format": "{:%d.%m.%Y}"
},
"hyprland/workspaces": {
"active-only": false,
"all-outputs": true
},
"tray": {
"icon-size": 20,
"spacing": 6
},
"network": {
"format": "",
"format-disconnected": "󰪎",
"format-ethernet": "󰌗",
"format-icons": ["󰤟", "󰤢", "󰤥", "󰤨"],
"format-wifi": "{icon}",
"interval": 10,
"tooltip-format-disconnected": "Disconnected",
"tooltip-format-ethernet": "󰇚 {bandwidthDownBits} 󰕒 {bandwidthUpBits}",
"tooltip-format-wifi": "{essid} 󰇚 {bandwidthDownBits} 󰕒 {bandwidthUpBits}"
},
"wireplumber": {
"format": "{icon} {volume}%",
"format-icons": ["󰕿", "󰖀", "󰕾"],
"format-muted": "󰝟",
"scroll-step": "5"
},
"backlight": {
"device": "amdgpu_bl1",
"format": "{icon} {percent}%",
"format-icons": ["󰃞", "󰃟", "󰃠"]
},
"battery": {
"format": "{icon} {capacity}%",
"format-icons": ["󰂎", "󰁺", "󰁻", "󰁼", "󰁽", "󰁾", "󰁿", "󰂀", "󰂁", "󰂂", "󰁹"],
"states": {
"critical": 5,
"warning": 15
}
}
}

View file

@ -0,0 +1,13 @@
{ assembleWrapper, moduleArgs, ... }:
let
inherit (moduleArgs) pkgs;
in
assembleWrapper {
basePackage = pkgs.waybar;
flags = [
"--config"
./config.jsonc
"--style"
./style.css
];
}

View file

@ -0,0 +1,6 @@
* {
border: none;
border-radius: 0px;
font-family: "Open Sans, Symbols Nerd Font Mono";
font-size: 15px;
}

View file

@ -1,4 +1,7 @@
{ assembleWrapper, pkgs, ... }:
{ assembleWrapper, moduleArgs, ... }:
let
inherit (moduleArgs) pkgs;
in
assembleWrapper {
basePackage = pkgs.webcord;
flags = [ "--disable-gpu" ];