refactor(wrappers): remove wrapping

As much as I prefer wrappers, I feel like it is too much work to set them up because no one likes standards...
This commit is contained in:
Artur Manuel 2025-02-25 20:53:51 +00:00
commit be97ef1692
Signed by: amadaluzia
SSH key fingerprint: SHA256:Zwg7gBuZyaG48ucAZneJwltiXu0+tJb7c3lYt9AYlLg
25 changed files with 180 additions and 118 deletions

72
flake.lock generated
View file

@ -47,11 +47,11 @@
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
}, },
"locked": { "locked": {
"lastModified": 1740016447, "lastModified": 1740408177,
"narHash": "sha256-96hBRGwuG+CFI5+inRIDCh0Za4LOt1dlbO3pFOokw6Y=", "narHash": "sha256-baFhGvCncDj3zJlDODJESVE83lV5+tGOrvgwQczzp84=",
"owner": "chaotic-cx", "owner": "chaotic-cx",
"repo": "nyx", "repo": "nyx",
"rev": "ed7900391a1969bb0bde432fd3952a6dda37114c", "rev": "62e2d6c89e4310c7cb56ee5f6bbdc280072dd082",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -66,11 +66,11 @@
"nixpkgs": ["nixpkgs"] "nixpkgs": ["nixpkgs"]
}, },
"locked": { "locked": {
"lastModified": 1739841949, "lastModified": 1740485968,
"narHash": "sha256-lSOXdgW/1zi/SSu7xp71v+55D5Egz8ACv0STkj7fhbs=", "narHash": "sha256-WK+PZHbfDjLyveXAxpnrfagiFgZWaTJglewBWniTn2Y=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "15dbf8cebd8e2655a883b74547108e089f051bf0", "rev": "19c1140419c4f1cdf88ad4c1cfb6605597628940",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -104,11 +104,11 @@
"rust-analyzer-src": "rust-analyzer-src" "rust-analyzer-src": "rust-analyzer-src"
}, },
"locked": { "locked": {
"lastModified": 1739946876, "lastModified": 1740292204,
"narHash": "sha256-ek0u5FT5yjqYKjF/0HQKwDH2ISZzyvYwu+My5hmSwbU=", "narHash": "sha256-ZbptkmqaenRhUKsodSEcVzBw+kXZ8DcZpTGutU1HEiI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "fenix", "repo": "fenix",
"rev": "95c1eab59767a3dbb11d6616d4ff736813ce41d2", "rev": "93d59130e3fc121f927c03e406142df8d544b901",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -295,11 +295,11 @@
"treefmt": "treefmt" "treefmt": "treefmt"
}, },
"locked": { "locked": {
"lastModified": 1738699636, "lastModified": 1740382355,
"narHash": "sha256-oboLj7yQAQlaJLSV8OpVpYHErLOVKST5FXtT+cKIjFQ=", "narHash": "sha256-VjShgJy4wCj8JsPmWROv76MgycBTu7i3vahg8hVNVhA=",
"ref": "master", "ref": "master",
"rev": "0a3c3ddf146a74c08e8fd3821e53e2c7d7ac2de2", "rev": "54654d56b149dde2beaa71de35dde549424c1985",
"revCount": 5, "revCount": 6,
"type": "git", "type": "git",
"url": "https://codeberg.org/amadaluzia/hetch.git" "url": "https://codeberg.org/amadaluzia/hetch.git"
}, },
@ -314,11 +314,11 @@
"nixpkgs": ["chaotic", "nixpkgs"] "nixpkgs": ["chaotic", "nixpkgs"]
}, },
"locked": { "locked": {
"lastModified": 1739913864, "lastModified": 1740318342,
"narHash": "sha256-WhzgQjadrwnwPJQLLxZUUEIxojxa7UWDkf7raAkB1Lw=", "narHash": "sha256-fjr9+3Iru6O5qE+2oERQkabqAUXx4awm0+i2MBcta1U=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "97ac0801d187b2911e8caa45316399de12f6f199", "rev": "b5ab2c7fdaa807cf425066ab7cd34b073946b1ca",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -333,11 +333,11 @@
"nixpkgs": ["chaotic", "nixpkgs"] "nixpkgs": ["chaotic", "nixpkgs"]
}, },
"locked": { "locked": {
"lastModified": 1739952453, "lastModified": 1740269380,
"narHash": "sha256-+tyFW6nNj1fJ1VTtLeqe1PMp5F7Fb9zIkT6mUvdQHrM=", "narHash": "sha256-l+zB5a39MJp4Olc4YxP7GChFXmNZIhoXaiSS6QRXa9o=",
"owner": "Jovian-Experiments", "owner": "Jovian-Experiments",
"repo": "Jovian-NixOS", "repo": "Jovian-NixOS",
"rev": "b2ed82d3ff837960df4518308dfe409dda3ae406", "rev": "11ba89d13831cb399194310304fffb025081c674",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -402,11 +402,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1739866667, "lastModified": 1740367490,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=", "narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680", "rev": "0196c0175e9191c474c26ab5548db27ef5d34b05",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -474,11 +474,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1739866667, "lastModified": 1740367490,
"narHash": "sha256-EO1ygNKZlsAC9avfcwHkKGMsmipUk1Uc0TbrEZpkn64=", "narHash": "sha256-WGaHVAjcrv+Cun7zPlI41SerRtfknGQap281+AakSAw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "73cf49b8ad837ade2de76f87eb53fc85ed5d4680", "rev": "0196c0175e9191c474c26ab5548db27ef5d34b05",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -567,11 +567,11 @@
"nvf": "nvf" "nvf": "nvf"
}, },
"locked": { "locked": {
"lastModified": 1740227755, "lastModified": 1740334068,
"narHash": "sha256-pNZF6irEgqVB6QSJptsD9JHyeN2YyYtQ4/o9Yzts8wE=", "narHash": "sha256-9STRcLfu7X06/PjD84yOJ0UfK8UDubutk6pUHp7ZkwY=",
"ref": "master", "ref": "master",
"rev": "b1e95fdc28a2efa79b45bc69a7d32fbb8b51e134", "rev": "73b9963bbc0aeaadaae3c1cbcc5fa5493bde2677",
"revCount": 26, "revCount": 27,
"type": "git", "type": "git",
"url": "https://codeberg.org/amadaluzia/painless-neovim.git" "url": "https://codeberg.org/amadaluzia/painless-neovim.git"
}, },
@ -588,11 +588,11 @@
"parts": "parts" "parts": "parts"
}, },
"locked": { "locked": {
"lastModified": 1738681743, "lastModified": 1740515683,
"narHash": "sha256-RXI9JIFaK9TlqHe2dv/1vH+tcTiIhbSwmsyFSdC0SEE=", "narHash": "sha256-/Pmbmak46IQDjsYzF15b0iE1GAmfT96DyQVWriLGcOc=",
"ref": "main", "ref": "main",
"rev": "a4ae97d6da39c9d3b9cc7a1aaef09b6f5996b059", "rev": "290ed2ea96f667249c9d08fb08ac7db5a05536e8",
"revCount": 89, "revCount": 90,
"type": "git", "type": "git",
"url": "https://codeberg.org/amadaluzia/pankomacs.git" "url": "https://codeberg.org/amadaluzia/pankomacs.git"
}, },
@ -655,11 +655,11 @@
"rust-analyzer-src": { "rust-analyzer-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1739913186, "lastModified": 1740259966,
"narHash": "sha256-7MSzs64dLDgq1wFw2eujZ01qdj9K+TwIlQMyWebotE8=", "narHash": "sha256-FJU9qiELvmJzNRr7wLFtJUy4bSk1PNqsRB7wOQz6zUE=",
"owner": "rust-lang", "owner": "rust-lang",
"repo": "rust-analyzer", "repo": "rust-analyzer",
"rev": "3028f844c5898dcf115f6bc67a5ce793989b04a1", "rev": "9df88ff0f65f8de9f73684d2bb96e1b62669d083",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -12,22 +12,19 @@
statix statix
deadnix deadnix
alejandra alejandra
neovide
; ;
neovim = inputs.painless-neovim.packages.${pkgs.system}.default;
}; };
sessionVariables = {EDITOR = "neovide --no-fork";};
}; };
alqueva = { alqueva = {
programs = { programs = {
swaybg = { swaybg = {
enable = true; enable = true;
wallpaper = inputs.wallpkgs.wallpapers.everforest-mojave_minimal.path; wallpaper = inputs.wallpkgs.wallpapers.everforest-foggy_valley_1.path;
}; };
waybar = { waybar = {
enable = true; enable = true;
package = pkgs.amadaluzian-waybar; package = pkgs.waybar;
}; };
sleep-or-die = { sleep-or-die = {
enable = true; enable = true;
@ -79,6 +76,13 @@
web.enable = false; web.enable = false;
}; };
rsyncd.enable = true; rsyncd.enable = true;
emacs = {
enable = true;
package = inputs.pankomacs.packages.${pkgs.system}.pgtk;
startWithGraphical = true;
install = true;
defaultEditor = true;
};
}; };
programs.git.config = { programs.git.config = {

View file

@ -4,12 +4,13 @@
... ...
}: { }: {
imports = [ imports = [
./users ./users/amadaluzia
./hardware.nix ./hardware.nix
./disks.nix ./disks.nix
./theme.nix ./theme.nix
./apps.nix ./apps.nix
./fonts.nix ./fonts.nix
./forgejo.nix
]; ];
config = { config = {
@ -23,14 +24,6 @@
nixpkgs.overlays = [ nixpkgs.overlays = [
inputs.alqages.overlays.default inputs.alqages.overlays.default
(
final: _prev: (
builtins.mapAttrs (_: v: final.callPackage v {}) {
amadaluzian-waybar = ./wrappers/waybar;
amadaluzian-foot = ./wrappers/foot;
}
)
)
]; ];
console = { console = {

View file

@ -1,14 +1,16 @@
{pkgs, ...}: { {pkgs, ...}: let
comfy = pkgs.iosevka-comfy;
in {
alqueva.system.fonts = { alqueva.system.fonts = {
names = { names = {
sansSerif = ["IBM Plex Sans"]; sansSerif = ["Iosevka Comfy"];
monospace = ["IBM Plex Mono"]; monospace = ["Iosevka Comfy Fixed"];
serif = ["IBM Plex Serif"]; serif = ["IBM Plex Serif"];
emoji = ["Twitter Color Emoji"]; emoji = ["Twitter Color Emoji"];
}; };
packages = { packages = {
sansSerif = [pkgs.ibm-plex]; sansSerif = [comfy.comfy];
monospace = [pkgs.ibm-plex]; monospace = [comfy.comfy-fixed];
serif = [pkgs.ibm-plex]; serif = [pkgs.ibm-plex];
emoji = [pkgs.twemoji-color-font]; emoji = [pkgs.twemoji-color-font];
extra = [ extra = [

51
hosts/python/forgejo.nix Normal file
View file

@ -0,0 +1,51 @@
{config, ...}: let
cfg = config.services.forgejo;
srv = cfg.settings.server;
in {
services.nginx = {
virtualHosts.${cfg.settings.server.DOMAIN} = {
forceSSL = true;
enableACME = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
};
};
services.forgejo = {
enable = true;
database.type = "postgres";
# Enable support for Git Large File Storage
lfs.enable = true;
settings = {
server = {
DOMAIN = "192.168.1.252";
# You need to specify this to remove the port from URLs in the web UI.
ROOT_URL = "http://${srv.DOMAIN}:${toString srv.HTTP_PORT}/";
HTTP_PORT = 3000;
};
# You can temporarily allow registration to create an admin user.
service.DISABLE_REGISTRATION = false;
# Add support for actions, based on act: https://github.com/nektos/act
actions = {
ENABLED = true;
DEFAULT_ACTIONS_URL = "github";
};
# Sending emails is completely optional
# You can send a test email from the web UI at:
# Profile Picture > Site Administration > Configuration > Mailer Configuration
mailer = {
ENABLED = true;
SMTP_ADDR = "mail.example.com";
FROM = "noreply@${srv.DOMAIN}";
USER = "noreply@${srv.DOMAIN}";
PASSWD = "password"; # Locally hosted instance a.k.a. NO ONE CARES.
};
default = {
APP_NAME = "Amadajo";
APP_SLOGAN = "Fun little instance I just have on my config...";
};
};
};
}

View file

@ -147,7 +147,7 @@ layout {
// off // off
// How many logical pixels the ring extends out from the windows. // How many logical pixels the ring extends out from the windows.
width 1 width 2
// Colors can be set in a variety of ways: // Colors can be set in a variety of ways:
// - CSS named colors: "red" // - CSS named colors: "red"
@ -232,13 +232,34 @@ animations {
// off // off
// Slow down all animations by this factor. Values below 1 speed them up instead. // Slow down all animations by this factor. Values below 1 speed them up instead.
slowdown 0.9 slowdown 0.8
} }
// Window rules let you adjust behavior for individual windows. // Window rules let you adjust behavior for individual windows.
// Find more information on the wiki: // Find more information on the wiki:
// https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules // https://github.com/YaLTeR/niri/wiki/Configuration:-Window-Rules
layer-rule {
shadow {
on
softness 10
spread 1
draw-behind-window true
color "#00000030"
}
}
window-rule {
match is-floating=true
shadow {
on
softness 20
spread 10
draw-behind-window true
color "#00000040"
}
}
// Work around WezTerm's initial configure bug // Work around WezTerm's initial configure bug
// by setting an empty default-column-width. // by setting an empty default-column-width.
window-rule { window-rule {
@ -293,7 +314,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 "neovide"; } Mod+T { spawn "emacs"; }
Mod+D { spawn "rofi" "-show" "drun"; } Mod+D { spawn "rofi" "-show" "drun"; }
// Super+Alt+L { spawn "swaylock"; } // Super+Alt+L { spawn "swaylock"; }
@ -464,6 +485,7 @@ binds {
Mod+Shift+R { switch-preset-window-height; } Mod+Shift+R { switch-preset-window-height; }
Mod+Ctrl+R { reset-window-height; } Mod+Ctrl+R { reset-window-height; }
Mod+F { maximize-column; } Mod+F { maximize-column; }
Mod+Ctrl+F { expand-column-to-available-width; }
Mod+Shift+F { fullscreen-window; } Mod+Shift+F { fullscreen-window; }
Mod+C { center-column; } Mod+C { center-column; }
@ -485,6 +507,7 @@ binds {
// Move the focused window between the floating and the tiling layout. // Move the focused window between the floating and the tiling layout.
Mod+V { toggle-window-floating; } Mod+V { toggle-window-floating; }
Mod+Shift+V { switch-focus-between-floating-and-tiling; } Mod+Shift+V { switch-focus-between-floating-and-tiling; }
Mod+W { toggle-column-tabbed-display; }
// Actions to switch layouts. // Actions to switch layouts.
// Note: if you uncomment these, make sure you do NOT have // Note: if you uncomment these, make sure you do NOT have

View file

@ -0,0 +1,42 @@
pkgs: let
json = pkgs.formats.json {};
in {
config = json.generate "waybar.jsonc" {
position = "top";
height = 0;
spacing = 16;
modules-left = ["mpris"];
modules-center = ["niri/workspaces"];
modules-right = ["wireplumber" "clock"];
mpris = {
format = "{player_icon} {dynamic}";
format-paused = "{status_icon} <i>{dynamic}</i>";
interval = 1;
dynamic-len = 64;
player-icons = {
default = "";
mpv = "🎵";
};
status_icons = {
paused = "";
};
};
clock = {
format = " {:%H:%M}";
tooltip-format = "{:%A, %B %d, %Y}";
};
wireplumber = {
format = "{icon} {volume}%";
format-muted = "";
on-click = "helvum";
format-icons = ["" "" ""];
};
};
style =
pkgs.runCommand "waybar.css" {
nativeBuildInputs = [pkgs.sass];
} ''
sass ${./style.scss} > $out
'';
}

View file

@ -3,7 +3,9 @@
pkgs, pkgs,
config, config,
... ...
}: { }: let
waybar = import ./configs/waybar/waybar.nix pkgs;
in {
alqueva.users.artur = { alqueva.users.artur = {
shell = config.alqueva.shells.nushell.package; shell = config.alqueva.shells.nushell.package;
tmpfiles = { tmpfiles = {
@ -18,6 +20,9 @@
".config/dunst/" = ./configs/dunst; ".config/dunst/" = ./configs/dunst;
".config/niri/" = ./configs/niri; ".config/niri/" = ./configs/niri;
".config/rofi/" = ./configs/rofi; ".config/rofi/" = ./configs/rofi;
".config/foot" = ./configs/foot;
".config/waybar/config.jsonc" = waybar.config;
".config/waybar/style.css" = waybar.style;
}; };
packages = builtins.attrValues { packages = builtins.attrValues {
inherit inherit
@ -38,7 +43,7 @@
dunst dunst
gh gh
rofi-wayland rofi-wayland
amadaluzian-foot foot
signal-desktop signal-desktop
dino dino
; ;

View file

@ -1,2 +0,0 @@
{...}: {
}

View file

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

View file

@ -1,37 +0,0 @@
{
symlinkJoin,
waybar,
makeWrapper,
runCommand,
sass,
}: let
styleCss =
runCommand "style.css" {
nativeBuildInputs = [sass];
} ''
sass ${./style.scss} > $out
'';
in
symlinkJoin {
name = "waybar";
paths = [
waybar
];
nativeBuildInputs = [
makeWrapper
];
postBuild = ''
wrapProgram $out/bin/waybar \
--add-flags "--config" \
--add-flags "${./config.jsonc}" \
--add-flags "--style" \
--add-flags "${styleCss}"
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;
};
}