Skip to content

fix kolide - #1475

Merged
shunkakinoki merged 10 commits into
mainfrom
fix/add-go
Apr 14, 2026
Merged

fix kolide#1475
shunkakinoki merged 10 commits into
mainfrom
fix/add-go

Conversation

@shunkakinoki

@shunkakinoki shunkakinoki commented Apr 14, 2026

Copy link
Copy Markdown
Owner
  • chore: update
  • fix(matic): Move Falcon start limit to unit config
  • fix(matic): Stabilize Falcon and Kolide services
  • fix(llm-update): write to tempfile to prevent truncation on sed failure
  • feat(rofi): add Battery Settings desktop entry for auto-cpufreq-gtk
  • chore: update
  • fix(matic): create /opt/auto-cpufreq for GUI turbo override support
  • fix(hyprland): use libexec path for hyprpolkitagent
  • fix(matic): enable fingerprint auth for polkit-1 PAM service
  • chore: update

Summary by cubic

Stabilizes Kolide and CrowdStrike Falcon on matic by fixing service ordering and start limits, and hardens ISO and LLM update tooling. Adds small UX improvements: Battery Settings entry, fingerprint auth, better uv globals, and host build shortcuts.

  • Bug Fixes

    • Falcon: move start-limit to unit config and set restartIfChanged=false to prevent flapping during nixos-rebuild switch.
    • Kolide: add dpkg and glib to service PATH; start after falcon-sensor.service when installed to avoid boot races.
    • LLM update: write via tempfile and check required commands (jq, sed, etc.); add tests.
    • Hyprland: run hyprpolkitagent from /libexec.
    • ISO build: new scripts/find-built-iso.sh and integrate into build-iso; add tests.
  • New Features

    • Power UI: add rofi “Battery Settings” for auto-cpufreq-gtk and provision /opt/auto-cpufreq.
    • Security: enable fingerprint auth for polkit-1 PAM.
    • Dev UX: make uv globals idempotent with per-tool python3-<tool> and a python3 dispatcher; add _pixelh_function fish helper for local Qwen via pi.
    • Makefile: add build-<host> and build-<host>-iso targets for matic and viper.

Written for commit 2ce2be6. Summary will update on new commits.

shunkakinoki and others added 10 commits April 14, 2026 21:31
Place StartLimitIntervalSec under unitConfig so systemd reads the directive instead of warning about an unknown [Service] key.

Co-authored-by: Codex <noreply@openai.com>
Keep falcon-sensor running across nixos-rebuild switch so vendor processes do not block activation. Add gsettings to Kolide's PATH and order Kolide after Falcon so the CrowdStrike compliance check has the tools and startup sequencing it expects on NixOS.

Co-authored-by: Codex <noreply@openai.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mesa-dot-dev

mesa-dot-dev Bot commented Apr 14, 2026

Copy link
Copy Markdown

You do not have enough credits to review this pull request. Please purchase more credits to continue.

@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 296317cd-0ee1-4e00-8f5c-1b23dd9de481

📥 Commits

Reviewing files that changed from the base of the PR and between f54622b and 2ce2be6.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (14)
  • Makefile
  • config/hyprland/default.nix
  • config/rofi/default.nix
  • home-manager/modules/uv-globals/install-uv-globals.sh
  • home-manager/programs/fish/functions/_pixelh_function.fish
  • home-manager/services/make-updater/default.nix
  • named-hosts/matic/default.nix
  • named-hosts/matic/falcon.nix
  • named-hosts/matic/kolide.nix
  • scripts/find-built-iso.sh
  • scripts/llm-update.sh
  • spec/coverage_spec.sh
  • spec/find_built_iso_spec.sh
  • spec/llm_update_spec.sh

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added convenience build targets for specific hosts
    • Introduced Battery Settings option in application launcher
    • Added AI prompt function for shell workflows
    • Enabled fingerprint authentication support
  • Improvements

    • Enhanced error handling and robustness in build and update scripts
    • Improved service dependency management and startup behavior
    • Better Python tool management with automated symlink creation
    • Refined ISO discovery mechanism
  • Tests

    • Added comprehensive test coverage for ISO discovery and script validation

Walkthrough

This pull request adds infrastructure improvements, enhanced error handling in build scripts, introduces new automation targets in the Makefile, updates NixOS host configurations for the matic node (enabling fingerprint authentication and system services), adds a new Fish function for LLM interactions, and introduces corresponding test specifications for new shell utilities.

Changes

Cohort / File(s) Summary
Makefile Build Automation
Makefile
Added named-host lists (NIXOS_NAMED_HOSTS, ISO_NAMED_HOSTS) and macro-generated targets (build-matic, build-viper, build-matic-iso, build-viper-iso). Updated build-iso recipe to use set -e and new ISO discovery script. Modified help target regex to include % character.
ISO Discovery Infrastructure
scripts/find-built-iso.sh, spec/find_built_iso_spec.sh, spec/coverage_spec.sh
New Bash script for locating built ISO files with fallback resolution via symlinks; includes comprehensive test spec validating shebang, strict mode, and various ISO discovery scenarios.
Script Robustness & Testing
scripts/llm-update.sh, spec/llm_update_spec.sh
Added preflight require_command checks for jq, sed, mktemp, mv; refactored jq output handling and atomic file updates via temporary file pattern. Added tests for command availability, template wrapper generation, and failure handling.
NixOS Host Configuration (matic)
named-hosts/matic/default.nix, named-hosts/matic/falcon.nix, named-hosts/matic/kolide.nix
Enabled fingerprint PAM authentication for polkit; created /opt/auto-cpufreq directory via systemd tmpfiles; disabled falcon-sensor restart on config changes and relocated start-limit to unit level; updated kolide-launcher service to conditionally order after falcon-sensor when installed and added glib to service PATH.
Fish Functions & Home Manager
home-manager/programs/fish/functions/_pixelh_function.fish, home-manager/modules/uv-globals/install-uv-globals.sh, home-manager/services/make-updater/default.nix
Added _pixelh_function Fish function for LLM prompting; improved uv-globals installer to create per-tool symlinks and python3 dispatcher; added jq to make-updater service PATH on both macOS and Linux.
Desktop & Window Manager Config
config/hyprland/default.nix, config/rofi/default.nix
Updated hyprpolkitagent invocation path in Hyprland config; added battery-settings desktop entry (launching auto-cpufreq-gtk) to rofi configuration under System/Settings categories.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

bug

Poem

🐰 Scripts now find their ISO with care,
Fingerprints unlock, and fish functions declare—
Matic builds faster, with targets so fine,
Error-checked scripts draw a safety line!
Better tests bloom in specs, here and there! 🌿

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mesa-dot-dev

mesa-dot-dev Bot commented Apr 14, 2026

Copy link
Copy Markdown

Mesa Description

TL;DR

A collection of fixes and minor features across various system configurations, including matic host and hyprland settings, alongside general updates.

What changed?

  • chore: update
  • fix(matic): Move Falcon start limit to unit config
  • fix(matic): Stabilize Falcon and Kolide services
  • fix(llm-update): write to tempfile to prevent truncation on sed failure
  • feat(rofi): add Battery Settings desktop entry for auto-cpufreq-gtk
  • chore: update
  • fix(matic): create /opt/auto-cpufreq for GUI turbo override support
  • fix(hyprland): use libexec path for hyprpolkitagent
  • fix(matic): enable fingerprint auth for polkit-1 PAM service
  • chore: update

Description generated by Mesa. Update settings

@shunkakinoki
shunkakinoki merged commit ac93c8b into main Apr 14, 2026
25 of 31 checks passed
@shunkakinoki
shunkakinoki deleted the fix/add-go branch April 14, 2026 15:41

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces dynamic build targets for named hosts and ISOs in the Makefile, a new ISO discovery script, and a Python dispatcher for isolated uv tools. It also refactors llm-update.sh for atomic updates and updates service configurations for falcon-sensor and kolide-launcher. Feedback identifies portability and logic issues in the Python dispatcher, suggests ensuring directory existence for symlinks, and notes that dynamic targets are missing from the make help output.

Comment on lines +78 to +93
# Write a dispatcher so `python3 -m <tool>` uses that tool's isolated Python
cat > "${HOME}/.local/bin/python3" << 'EOF'
#!/usr/bin/env bash
prev=""
for arg in "$@"; do
if [ "$prev" = "-m" ]; then
per_tool="${HOME}/.local/bin/python3-${arg}"
if [ -x "$per_tool" ]; then
exec "$per_tool" "$@"
fi
break
fi
prev="$arg"
done
exec /etc/profiles/per-user/"${USER}"/bin/python3 "$@"
EOF

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The dispatcher logic has two main issues:

  1. Portability: The fallback path /etc/profiles/per-user/"${USER}"/bin/python3 is NixOS-specific and will fail on other platforms (like macOS, which the Makefile suggests is supported).
  2. Correctness: The loop through all arguments might incorrectly trigger if a script being run happens to have a -m argument (e.g., python3 script.py -m arg).

A more robust approach is to check for -m as the first argument and use a portable way to find the 'real' python3 by temporarily excluding the wrapper's directory from PATH.

Suggested change
# Write a dispatcher so `python3 -m <tool>` uses that tool's isolated Python
cat > "${HOME}/.local/bin/python3" << 'EOF'
#!/usr/bin/env bash
prev=""
for arg in "$@"; do
if [ "$prev" = "-m" ]; then
per_tool="${HOME}/.local/bin/python3-${arg}"
if [ -x "$per_tool" ]; then
exec "$per_tool" "$@"
fi
break
fi
prev="$arg"
done
exec /etc/profiles/per-user/"${USER}"/bin/python3 "$@"
EOF
# Write a dispatcher so python3 -m <tool> uses that tool's isolated Python
cat > "${HOME}/.local/bin/python3" << 'EOF'
#!/usr/bin/env bash
# If the first argument is -m, check if we have an isolated tool for it
if [[ "$1" == "-m" && -n "$2" ]]; then
per_tool="${HOME}/.local/bin/python3-$2"
if [[ -x "$per_tool" ]]; then
exec "$per_tool" "$@"
fi
fi
# Fallback to the real python3 (excluding this wrapper from PATH)
REAL_PYTHON3=$(PATH=$(echo "$PATH" | tr ':' '\n' | grep -vx "${HOME}/.local/bin" | paste -sd: -) command -v python3)
if [[ -n "$REAL_PYTHON3" ]]; then
exec "$REAL_PYTHON3" "$@"
else
echo "python3 not found in PATH (excluding wrapper)" >&2
exit 1
fi
EOF

Comment thread Makefile
@echo "Usage: make <target>"
@echo
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_%-]+:.*?## / {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The help target parses $(MAKEFILE_LIST) (the files on disk) using awk. Since the new host-specific targets (e.g., build-matic) are generated dynamically using eval (lines 656-657), they do not exist as literal lines in the Makefile and will not be captured by this awk command. Consequently, they won't appear in the make help output. If you want them to be discoverable, consider using pattern rules (e.g., build-%:) instead of eval, or manually adding a help entry.

Comment on lines +71 to +75
# Symlink each tool's python3 for per-tool access: `python3-<tool> -m <tool>`
tool_python="${HOME}/.local/share/uv/tools/${name}/bin/python3"
if [ -f "$tool_python" ]; then
ln -sf "$tool_python" "${HOME}/.local/bin/python3-${name}"
fi

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Ensure the target directory ${HOME}/.local/bin exists before attempting to create symlinks. Also, consider removing 2>/dev/null from the uv tool install command (line 64) to allow error messages to be visible if a tool fails to install, which is helpful for troubleshooting.

Suggested change
# Symlink each tool's python3 for per-tool access: `python3-<tool> -m <tool>`
tool_python="${HOME}/.local/share/uv/tools/${name}/bin/python3"
if [ -f "$tool_python" ]; then
ln -sf "$tool_python" "${HOME}/.local/bin/python3-${name}"
fi
# Symlink each tool's python3 for per-tool access: python3-<tool> -m <tool>
mkdir -p "${HOME}/.local/bin"
tool_python="${HOME}/.local/share/uv/tools/${name}/bin/python3"
if [ -f "$tool_python" ]; then
ln -sf "$tool_python" "${HOME}/.local/bin/python3-${name}"
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant