feat(wrappers): start wrapping configs

thanks to @fdncred for the ls function with nushell
This commit is contained in:
Artur Manuel 2025-01-31 21:38:32 +00:00
commit c4a290ae63
13 changed files with 136 additions and 26 deletions

View file

@ -24,6 +24,10 @@
enable = true;
wallpaper = inputs.wallpkgs.wallpapers.nord-03.path;
};
waybar = {
enable = true;
package = pkgs.amadaluzian-waybar;
};
libvirt.enable = true;
direnv.enable = true;
git.enable = true;

View file

@ -1,10 +1,11 @@
{pkgs, ...}: {
imports = [
./users
./wrappers
./hardware.nix
./disks.nix
./theme.nix
./apps.nix
./users
./fonts.nix
];

View file

@ -1,18 +1,17 @@
{pkgs, ...}: {
alqueva.system.fonts = {
names = {
sansSerif = ["Fira Sans"];
monospace = ["Fira Mono"];
serif = ["ETBembo"];
sansSerif = ["IBM Plex Sans"];
monospace = ["IBM Plex Mono"];
serif = ["IBM Plex Serif"];
emoji = ["Twitter Color Emoji"];
};
packages = {
sansSerif = [pkgs.fira-sans];
monospace = [pkgs.fira-mono];
serif = [pkgs.etBook];
sansSerif = [pkgs.ibm-plex];
monospace = [pkgs.ibm-plex];
serif = [pkgs.ibm-plex];
emoji = [pkgs.twemoji-color-font];
extra = [
pkgs.fira-go
pkgs.noto-fonts
pkgs.nerd-fonts.symbols-only
];

View file

@ -20,7 +20,7 @@ input {
// Next sections include libinput settings.
// Omitting settings disables them, or leaves them at their default values.
touchpad {
/-touchpad {
// off
tap
// dwt
@ -40,7 +40,7 @@ input {
// scroll-method "no-scroll"
}
trackpoint {
/-trackpoint {
// off
// natural-scroll
// accel-speed 0.2
@ -99,7 +99,7 @@ output "HDMI-A-1" {
// https://github.com/YaLTeR/niri/wiki/Configuration:-Layout
layout {
// Set gaps around windows in logical pixels.
gaps 8
gaps 10
// When to center a column when changing focus, options are:
// - "never", default behavior, focusing an off-screen column will keep at the left
@ -155,10 +155,10 @@ layout {
// - CSS-like notation: "rgb(255, 127, 0)", rgba(), hsl() and a few others.
// Color of the ring on the active monitor.
active-color "#7fc8ff"
active-color "#88C0D0"
// Color of the ring on inactive monitors.
inactive-color "#505050"
inactive-color "#5E81AC"
// You can also use gradients. They take precedence over solid colors.
// Gradients are rendered the same as CSS linear-gradient(angle, from, to).
@ -272,8 +272,8 @@ window-rule {
// Example: enable rounded corners for all windows.
// (This example rule is commented out with a "/-" in front.)
/-window-rule {
geometry-corner-radius 12
window-rule {
geometry-corner-radius 6
clip-to-geometry true
}
@ -293,7 +293,7 @@ binds {
Mod+Shift+Slash { show-hotkey-overlay; }
// Suggested binds for running programs: terminal, app launcher, screen locker.
Mod+T { spawn "kitty"; }
Mod+T { spawn "foot"; }
Mod+D { spawn "rofi" "-show" "drun"; }
// Super+Alt+L { spawn "swaylock"; }

View file

@ -35,12 +35,10 @@
qutebrowser
dunst
gh
kitty
rofi-wayland
swaybg
amadaluzian-foot
;
inherit (inputs.hetch.packages.${pkgs.system}) hetch;
waybar = pkgs.callPackage ./waybar.nix {};
};
groups = [
"wheel"

View file

@ -0,0 +1,10 @@
{
nixpkgs.overlays = [
(
final: _prev: {
amadaluzian-waybar = final.callPackage ./waybar {};
amadaluzian-foot = final.callPackage ./foot {};
}
)
];
}

View file

@ -0,0 +1,19 @@
{
foot,
symlinkJoin,
makeWrapper,
}:
symlinkJoin {
name = "foot";
paths = [
foot
];
nativeBuildInputs = [
makeWrapper
];
postBuild = ''
wrapProgram $out/bin/foot \
--add-flags "--config" \
--add-flags ${./foot.ini}
'';
}

View file

@ -0,0 +1,29 @@
[main]
pad=6x6
font=monospace:size=15
[colors]
foreground=e5e9f0
background=2e3440
regular0=3b4252
regular1=bf616a
regular2=a3be8c
regular3=ebcb8b
regular4=81a1c1
regular5=b48ead
regular6=88c0d0
regular7=eceff4
bright0=434c5e
bright1=bf616a
bright2=a3be8c
bright3=ebcb8b
bright4=81a1c1
bright5=b48ead
bright6=88c0d0
bright7=8fbcbb
16=d08770
17=5e81ac
18=3b4252
19=434c5e
20=d8dee9
21=eceff4

View file

@ -9,7 +9,7 @@
runCommand "style.css" {
nativeBuildInputs = [sass];
} ''
sass ${./configs/waybar/style.scss} > $out
sass ${./style.scss} > $out
'';
in
symlinkJoin {
@ -23,13 +23,13 @@ in
postBuild = ''
wrapProgram $out/bin/waybar \
--add-flags "--config" \
--add-flags "${./configs/waybar/config.jsonc}" \
--add-flags "${./config.jsonc}" \
--add-flags "--style" \
--add-flags "${styleCss}"
mv $out/lib/systemd/user/waybar.service $out/lib/systemd/user/.waybar-wrapped.service
substitute $out/lib/systemd/user/.waybar-wrapped.service $out/lib/systemd/user/waybar.service \
--replace-fail ${waybar}/bin/waybar $out/bin/waybar
rm $out/lib/systemd/user/waybar.service
substitute ${waybar}/lib/systemd/user/waybar.service $out/lib/systemd/user/waybar.service \
--replace-fail ${waybar}/bin/waybar $out/bin/waybar \
'';
meta = {
inherit (waybar.meta) mainProgram;

21
hosts/shared/waybar.nix Normal file
View file

@ -0,0 +1,21 @@
{
lib,
pkgs,
config,
...
}: let
cfg = config.alqueva.programs.waybar;
in {
options.alqueva.programs.waybar = {
enable = lib.mkEnableOption "waybar, a highly customizable Wayland bar for Sway and Wlroots based compositors";
package = lib.mkPackageOption pkgs "waybar" {};
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [cfg.package];
systemd = {
packages = [cfg.package];
user.services.waybar.wantedBy = ["graphical-session.target"];
};
};
}