fix(nixos): replace removed light option and harden char-count script

Restore flake checks by removing deprecated `programs.light` from sunken-ship and switching to brightnessctl guidance. Also clean up flake formatting and make the Raycast char-count script safer for empty input.

Made-with: Cursor
This commit is contained in:
DannyDannyDanny 2026-03-24 12:58:40 +01:00
parent befe2f8a5b
commit 463249961e
3 changed files with 10 additions and 10 deletions

View file

@ -1,8 +1,5 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nixos-wsl.url = "github:nix-community/NixOS-WSL/main"; nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
vscode-server.url = "github:nix-community/nixos-vscode-server"; vscode-server.url = "github:nix-community/nixos-vscode-server";

View file

@ -22,8 +22,7 @@ in
boot.kernelParams = [ "consoleblank=60" ]; # blank TTY after 60s to reduce burn-in boot.kernelParams = [ "consoleblank=60" ]; # blank TTY after 60s to reduce burn-in
# Turn off panel backlight after boot so the screen actually dims (consoleblank only blanks framebuffer). # Turn off panel backlight after boot so the screen actually dims (consoleblank only blanks framebuffer).
# At the console, run: light -S 100 (or any 0100) to restore brightness. # At the console, run: brightnessctl set 100% (or `brightnessctl max`) to restore brightness.
programs.light.enable = true;
systemd.services.server-backlight-off = { systemd.services.server-backlight-off = {
description = "Turn off panel backlight after console idle (reduce burn-in)"; description = "Turn off panel backlight after console idle (reduce burn-in)";
after = [ "multi-user.target" ]; after = [ "multi-user.target" ];
@ -42,7 +41,7 @@ in
users.users.danny = { users.users.danny = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "video" ]; # video: backlight control via light(1) extraGroups = [ "wheel" "video" ]; # video: backlight control via sysfs / brightnessctl
# SSH keys: push via scp, don't commit. NixOS does not manage authorized_keys so scp'd keys persist. # SSH keys: push via scp, don't commit. NixOS does not manage authorized_keys so scp'd keys persist.
# Example: scp ~/.ssh/id_ed25519_sunken_ship.pub danny@server:/tmp/ then on server: mkdir -p ~/.ssh; cat /tmp/*.pub >> ~/.ssh/authorized_keys # Example: scp ~/.ssh/id_ed25519_sunken_ship.pub danny@server:/tmp/ then on server: mkdir -p ~/.ssh; cat /tmp/*.pub >> ~/.ssh/authorized_keys
}; };
@ -59,7 +58,10 @@ in
# Passwordless sudo for wheel. # Passwordless sudo for wheel.
security.sudo.wheelNeedsPassword = false; security.sudo.wheelNeedsPassword = false;
environment.systemPackages = [ pkgs.git ]; # for clone/bootstrap and timer environment.systemPackages = with pkgs; [
git # clone/bootstrap and dotfiles-rebuild timer
brightnessctl # manual backlight; replaces removed `light` from nixpkgs
];
# Pull dotfiles and rebuild if the repo has new commits. # Pull dotfiles and rebuild if the repo has new commits.
systemd.services.dotfiles-rebuild = { systemd.services.dotfiles-rebuild = {

View file

@ -1,4 +1,5 @@
#!/bin/bash #!/usr/bin/env bash
set -euo pipefail
# Required parameters: # Required parameters:
# @raycast.schemaVersion 1 # @raycast.schemaVersion 1
@ -7,11 +8,11 @@
# Optional parameters: # Optional parameters:
# @raycast.icon 🤖 # @raycast.icon 🤖
# @raycast.argument1 { "type": "text", "placeholder": "Placeholder" } # @raycast.argument1 { "type": "text", "placeholder": "Text to count" }
# Documentation: # Documentation:
# @raycast.description counts chars in selected text # @raycast.description counts chars in selected text
# @raycast.author DannyDannyDanny # @raycast.author DannyDannyDanny
# @raycast.authorURL https://raycast.com/DannyDannyDanny # @raycast.authorURL https://raycast.com/DannyDannyDanny
echo -n "$1" | wc -c printf '%s' "${1:-}" | wc -c | awk '{ print $1 }'