From cd9f745ace642152d730ce69ae8edb9ed9c4c8b2 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Tue, 3 Mar 2026 01:23:44 -0500 Subject: [PATCH] ci: fix --- config/nvim/lua/plugins/guard.lua | 68 ++++++++++++++++++++++-- home/modules/editor.nix | 2 + home/modules/hyprland.nix | 72 ++++++++++++-------------- home/modules/terminal.nix | 6 +-- home/modules/ui.nix | 3 -- hosts/xps15/hardware-configuration.nix | 1 - 6 files changed, 100 insertions(+), 52 deletions(-) diff --git a/config/nvim/lua/plugins/guard.lua b/config/nvim/lua/plugins/guard.lua index db32165..27977dc 100644 --- a/config/nvim/lua/plugins/guard.lua +++ b/config/nvim/lua/plugins/guard.lua @@ -51,10 +51,68 @@ return { ft('make'):lint('checkmake') ft('cpp'):lint('cpplint') ft('markdown'):fmt('cbfmt'):append('prettierd') - ft('nix'):fmt({ - cmd = 'nix', - args = { 'fmt', '--' }, - fname = true, - }) + local lint = require('guard.lint') + + ft('nix') + :fmt({ + cmd = 'nix', + args = { 'fmt', '--' }, + fname = true, + }) + :lint({ + cmd = 'deadnix', + args = { '-o', 'json' }, + fname = true, + parse = lint.from_json({ + get_diagnostics = function(raw) + return vim.json.decode(raw).results + end, + attributes = { + lnum = 'line', + col = 'column', + lnum_end = 'line', + col_end = 'endColumn', + message = 'message', + }, + source = 'deadnix', + }), + }) + :lint({ + cmd = 'statix', + args = { 'check', '-o', 'json' }, + fname = true, + parse = lint.from_json({ + get_diagnostics = function(raw) + local data = vim.json.decode(raw) + local results = {} + for _, entry in ipairs(data.report or {}) do + for _, diag in ipairs(entry.diagnostics or {}) do + table.insert(results, { + from_line = diag.at.from.line, + from_col = diag.at.from.column, + to_line = diag.at.to.line, + to_col = diag.at.to.column, + message = entry.note, + severity = entry.severity, + }) + end + end + return results + end, + attributes = { + lnum = 'from_line', + col = 'from_col', + lnum_end = 'to_line', + col_end = 'to_col', + message = 'message', + }, + severities = { + Error = lint.severities.error, + Warn = lint.severities.warning, + Hint = lint.severities.info, + }, + source = 'statix', + }), + }) end, } diff --git a/home/modules/editor.nix b/home/modules/editor.nix index a5ad6fe..fe3ce01 100644 --- a/home/modules/editor.nix +++ b/home/modules/editor.nix @@ -44,6 +44,8 @@ in mypy selene shellcheck + deadnix + statix # runtime/tools nodejs diff --git a/home/modules/hyprland.nix b/home/modules/hyprland.nix index bc0fa40..40757c3 100644 --- a/home/modules/hyprland.nix +++ b/home/modules/hyprland.nix @@ -69,47 +69,43 @@ in }; }; - xdg.configFile."hypr/hyprlock.conf".text = - let - c = config.colors; - in - '' - general { - hide_cursor = true - grace = 0 - } + xdg.configFile."hypr/hyprlock.conf".text = '' + general { + hide_cursor = true + grace = 0 + } - background { - monitor = - path = ${config.xdg.userDirs.pictures}/Screensavers/lock.jpg - } + background { + monitor = + path = ${config.xdg.userDirs.pictures}/Screensavers/lock.jpg + } - animations { - enabled = false - } + animations { + enabled = false + } - input-field { - monitor = - size = 600, 50 - outline_thickness = 0 - dots_text_format = * - dots_size = 0.9 - dots_spacing = 0.3 - dots_center = true - outer_color = rgba(00000000) - inner_color = rgba(00000000) - font_color = rgb(ffffff) - font_family = Berkeley Mono - check_color = rgb(98c379) - fail_color = rgb(ff6b6b) - fail_text = $FAIL - rounding = 0 - placeholder_text = - position = 0, 0 - halign = center - valign = center - } - ''; + input-field { + monitor = + size = 600, 50 + outline_thickness = 0 + dots_text_format = * + dots_size = 0.9 + dots_spacing = 0.3 + dots_center = true + outer_color = rgba(00000000) + inner_color = rgba(00000000) + font_color = rgb(ffffff) + font_family = Berkeley Mono + check_color = rgb(98c379) + fail_color = rgb(ff6b6b) + fail_text = $FAIL + rounding = 0 + placeholder_text = + position = 0, 0 + halign = center + valign = center + } + ''; services.hypridle = { enable = true; diff --git a/home/modules/terminal.nix b/home/modules/terminal.nix index a445484..0625db4 100644 --- a/home/modules/terminal.nix +++ b/home/modules/terminal.nix @@ -1,8 +1,4 @@ -{ pkgs, config, ... }: - -let - c = config.colors; -in +{ config, ... }: { home.sessionVariables = { TERMINAL = "ghostty"; diff --git a/home/modules/ui.nix b/home/modules/ui.nix index 1f3e437..ddb3657 100644 --- a/home/modules/ui.nix +++ b/home/modules/ui.nix @@ -2,13 +2,10 @@ pkgs, lib, config, - hostConfig, ... }: let - c = config.colors; - mkWaybarTheme = palette: '' * { color: ${palette.fg}; } window#waybar { background: ${palette.bg}; border-bottom: 2px solid ${palette.bgAlt}; } diff --git a/hosts/xps15/hardware-configuration.nix b/hosts/xps15/hardware-configuration.nix index d76ab2a..00d9108 100644 --- a/hosts/xps15/hardware-configuration.nix +++ b/hosts/xps15/hardware-configuration.nix @@ -4,7 +4,6 @@ { config, lib, - pkgs, modulesPath, ... }: