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; enable = true;
wallpaper = inputs.wallpkgs.wallpapers.nord-03.path; wallpaper = inputs.wallpkgs.wallpapers.nord-03.path;
}; };
waybar = {
enable = true;
package = pkgs.amadaluzian-waybar;
};
libvirt.enable = true; libvirt.enable = true;
direnv.enable = true; direnv.enable = true;
git.enable = true; git.enable = true;

View file

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

View file

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

View file

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

View file

@ -35,12 +35,10 @@
qutebrowser qutebrowser
dunst dunst
gh gh
kitty
rofi-wayland rofi-wayland
swaybg amadaluzian-foot
; ;
inherit (inputs.hetch.packages.${pkgs.system}) hetch; inherit (inputs.hetch.packages.${pkgs.system}) hetch;
waybar = pkgs.callPackage ./waybar.nix {};
}; };
groups = [ groups = [
"wheel" "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" { runCommand "style.css" {
nativeBuildInputs = [sass]; nativeBuildInputs = [sass];
} '' } ''
sass ${./configs/waybar/style.scss} > $out sass ${./style.scss} > $out
''; '';
in in
symlinkJoin { symlinkJoin {
@ -23,13 +23,13 @@ in
postBuild = '' postBuild = ''
wrapProgram $out/bin/waybar \ wrapProgram $out/bin/waybar \
--add-flags "--config" \ --add-flags "--config" \
--add-flags "${./configs/waybar/config.jsonc}" \ --add-flags "${./config.jsonc}" \
--add-flags "--style" \ --add-flags "--style" \
--add-flags "${styleCss}" --add-flags "${styleCss}"
mv $out/lib/systemd/user/waybar.service $out/lib/systemd/user/.waybar-wrapped.service rm $out/lib/systemd/user/waybar.service
substitute $out/lib/systemd/user/.waybar-wrapped.service $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 --replace-fail ${waybar}/bin/waybar $out/bin/waybar \
''; '';
meta = { meta = {
inherit (waybar.meta) mainProgram; 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"];
};
};
}

View file

@ -17,8 +17,37 @@
# You can remove these comments if you want or leave # You can remove these comments if you want or leave
# them for future reference. # them for future reference.
# alias the built-in ls command to ls-builtin
alias ls-builtin = ls
# List the filenames, sizes, and modification times of items in a directory.
def ls [
--all (-a), # Show hidden files
--long (-l), # Get all available columns for each entry (slower; columns are platform-dependent)
--short-names (-s), # Only print the file names, and not the path
--full-paths (-f), # display paths as absolute paths
--du (-d), # Display the apparent directory size ("disk usage") in place of the directory metadata size
--directory (-D), # List the specified directory itself instead of its contents
--mime-type (-m), # Show mime-type in type column instead of 'file' (based on filenames only; files' contents are not examined)
--threads (-t), # Use multiple threads to list contents. Output will be non-deterministic.
...pattern: glob, # The glob pattern to use.
]: [ nothing -> table ] {
let pattern = if ($pattern | is-empty) { [ '.' ] } else { $pattern }
(ls-builtin
--all=$all
--long=$long
--short-names=$short_names
--full-paths=$full_paths
--du=$du
--directory=$directory
--mime-type=$mime_type
--threads=$threads
...$pattern
) | sort-by type name -i
}
alias nos = nh os
mkdir ($nu.data-dir | path join "vendor/autoload") mkdir ($nu.data-dir | path join "vendor/autoload")
starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu") starship init nu | save -f ($nu.data-dir | path join "vendor/autoload/starship.nu")
zoxide init nushell | save -f ($nu.data-dir | path join "vendor/autoload/zoxide.nu") zoxide init nushell | save -f ($nu.data-dir | path join "vendor/autoload/zoxide.nu")
alias nos = nh os