Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,13 @@
x86_64-linux = import ./hosts/nixos {
inherit inputs;
username = "shunkakinoki";
stateVersion = "24.05";
};
runner = import ./hosts/nixos {
inherit inputs;
isRunner = true;
username = "runner";
stateVersion = "24.05";
};
matic = import ./named-hosts/matic {
inherit inputs;
Expand Down
11 changes: 11 additions & 0 deletions home-manager/modules/xremap/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ let
"${hyperPrefix}c" = "C-Shift-c";
"${hyperPrefix}v" = "C-Shift-v";
};
# Slack: same mapping as global but isolated so Slack-specific workarounds
# (modifier leak, thread mark-as-read on bare `c`/`Esc`) can be tuned here
# without affecting other apps. See commits e60e0df, 95679b8, 48ad8f5.
slackRemap = globalRemap;
in
{
config = lib.mkMerge [
Expand All @@ -109,6 +113,13 @@ in
application.only = [ "com.mitchellh.ghostty" ];
remap = ghosttyRemap;
}
{
# Slack: isolated block so modifier-leak / thread mark-as-read
# workarounds can be tuned without affecting other apps.
name = "Framework Command (Slack)";
application.only = [ "Slack" ];
remap = slackRemap;
}
{
# Global: no application filter — applies unconditionally so window detection
# failures don't cause raw Hyper events to leak through to apps (e.g. Slack).
Expand Down
18 changes: 0 additions & 18 deletions home-manager/programs/fish/functions/_pixelh_function.fish
Original file line number Diff line number Diff line change
@@ -1,18 +0,0 @@
function _pixelh_function --description "Run Pi headlessly with the local Qwen model"
# Prompt for input and run Pi in print mode with the local Qwen model
# Usage: pixelh

set -l prompt
if test (count $argv) -gt 0
set prompt (string join " " $argv)
else
read -P "Prompt: " prompt
end

if test -z "$prompt"
echo "No prompt provided, aborting." >&2
return 1
end

pi --model 'lmstudio/qwen3.5-0.8b-optiq' -p "$prompt"
end
172 changes: 98 additions & 74 deletions hosts/nixos/default.nix
Original file line number Diff line number Diff line change
@@ -1,134 +1,158 @@
# Shared NixOS system builder.
# All NixOS hosts call this with their specific modules.
# When no modules are passed, includes generic config (x86_64-linux/runner).
{
inputs,
username,
hostname ? "x86_64-linux",
isRunner ? false,
system ? "x86_64-linux",
stateVersion ? "24.11",

@cubic-dev-ai cubic-dev-ai Bot Apr 14, 2026

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.

P2: Default stateVersion changed from "24.05" to "24.11". NixOS stateVersion gates backward-compatibility migrations and should not change after initial installation. The tests/eval.nix evaluations for eval-nixos-default and eval-nixos-runner don't pass stateVersion, so they now evaluate "24.11" while production uses "24.05" — meaning tests no longer match deployed config. Consider keeping the default as "24.05" to match the existing hosts.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At hosts/nixos/default.nix, line 10:

<comment>Default `stateVersion` changed from `"24.05"` to `"24.11"`. NixOS `stateVersion` gates backward-compatibility migrations and should not change after initial installation. The `tests/eval.nix` evaluations for `eval-nixos-default` and `eval-nixos-runner` don't pass `stateVersion`, so they now evaluate `"24.11"` while production uses `"24.05"` — meaning tests no longer match deployed config. Consider keeping the default as `"24.05"` to match the existing hosts.</comment>

<file context>
@@ -1,134 +1,151 @@
   hostname ? "x86_64-linux",
   isRunner ? false,
+  system ? "x86_64-linux",
+  stateVersion ? "24.11",
+  userExtraGroups ? [ ],
+  userInitialPassword ? null,
</file context>
Suggested change
stateVersion ? "24.11",
stateVersion ? "24.05",
Fix with Cubic

userExtraGroups ? [ ],
userInitialPassword ? null,
modules ? null,
specialArgs ? { },
}:
let
inherit (inputs) nixpkgs home-manager;
system = "x86_64-linux";
nixpkgsConfig = import ../../lib/nixpkgs-config.nix {
nixpkgsLib = nixpkgs.lib;
nixpkgsLib = inputs.nixpkgs.lib;
};
overlays = import ../../overlays { inherit inputs; };
pkgs = import nixpkgs {
pkgs = import inputs.nixpkgs {
inherit system overlays;
config = nixpkgsConfig;
};
configuration =

# Shared base: every NixOS host gets this
baseModule =
{ lib, ... }:
{
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
boot.loader.systemd-boot.configurationLimit = 10;

networking.hostName = hostname;
networking.networkmanager.enable = true;

programs.fish.enable = true;

users.users.${username} = {
isNormalUser = true;
extraGroups = [
"wheel"
"networkmanager"
];
]
++ userExtraGroups;
home = "/home/${username}";
hashedPassword = if isRunner then "" else null;
openssh.authorizedKeys.keys = [ ];
shell = pkgs.fish;
}
// lib.optionalAttrs (userInitialPassword != null) {
initialPassword = userInitialPassword;
};

users.users.root.hashedPassword = if isRunner then "" else null;

security.sudo.wheelNeedsPassword = false;

virtualisation = lib.mkIf isRunner {
vmware.guest.enable = true;

libvirtd.enable = true;

virtualbox.guest.enable = false;

vmVariant = {
virtualisation = {
memorySize = 4096;
cores = 2;
};
virtualisation.graphics = false;
virtualisation.sharedDirectories = {
shared = {
source = "$PWD";
target = "/mnt/shared";
};
};
};
};

environment.systemPackages = with pkgs; [
curl
git
home-manager
vim
wget
zellij
];

services.getty.autologinUser = lib.mkIf isRunner "root";

boot.loader.timeout = lib.mkIf isRunner 0;

nix = {
channel.enable = false;
settings = {
experimental-features = [
"nix-command"
"flakes"
];
nix-path = lib.mkForce "nixpkgs=/etc/nix/inputs/nixpkgs";
substituters = [
"https://cache.nixos.org"
];
trusted-users = [
"root"
username
"@wheel"
];
};
package = pkgs.nixVersions.stable;
};

boot.consoleLogLevel = 7;
services.journald.extraConfig = "Storage=volatile";
environment.etc."nix/inputs/nixpkgs".source = "${inputs.nixpkgs}";

system.stateVersion = "24.05";
system.stateVersion = stateVersion;
};
in
nixpkgs.lib.nixosSystem {
inherit system;
inherit (nixpkgs) lib;
specialArgs = {
inherit username isRunner;
};
modules = [
configuration
{
fileSystems."/" = {
device = "/dev/sda1";
fsType = "ext4";
};

nixpkgs.pkgs = pkgs;
# Generic config for x86_64-linux/runner (used when modules == null)
genericModules = [
(
{ lib, ... }:
{
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
boot.loader.systemd-boot.configurationLimit = 10;
Comment on lines +81 to +84

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Conflicting boot loader configuration.

boot.loader.grub.enable = true and boot.loader.systemd-boot.configurationLimit are set together, but GRUB and systemd-boot are mutually exclusive boot loaders. The systemd-boot.configurationLimit setting has no effect when GRUB is enabled.

Either remove line 86 since it's ineffective with GRUB, or clarify the intent if this is meant as a fallback configuration.

Proposed fix
         boot.loader.grub.enable = true;
         boot.loader.grub.device = "/dev/sda";
         boot.loader.grub.useOSProber = true;
-        boot.loader.systemd-boot.configurationLimit = 10;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
boot.loader.systemd-boot.configurationLimit = 10;
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.useOSProber = true;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@hosts/nixos/default.nix` around lines 83 - 86, The file sets both GRUB and a
systemd-boot option; remove or reconcile the conflicting setting by either
deleting the systemd-boot line (boot.loader.systemd-boot.configurationLimit) if
you intend to use GRUB (boot.loader.grub.enable, boot.loader.grub.device,
boot.loader.grub.useOSProber), or conversely disable GRUB and keep the
systemd-boot configuration if you intend to use systemd-boot; update the file so
only the intended boot loader’s options remain.


fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
];
}
home-manager.nixosModules.home-manager
users.users.${username} = {
hashedPassword = if isRunner then "" else null;
openssh.authorizedKeys.keys = [ ];
};

users.users.root.hashedPassword = if isRunner then "" else null;

virtualisation = lib.mkIf isRunner {
vmware.guest.enable = true;
libvirtd.enable = true;
virtualbox.guest.enable = false;
vmVariant = {
virtualisation = {
memorySize = 4096;
cores = 2;
};
virtualisation.graphics = false;
virtualisation.sharedDirectories = {
shared = {
source = "$PWD";
target = "/mnt/shared";
};
};
};
};

services.getty.autologinUser = lib.mkIf isRunner "root";
boot.loader.timeout = lib.mkIf isRunner 0;

boot.consoleLogLevel = 7;
services.journald.extraConfig = "Storage=volatile";

fileSystems."/" = {
device = "/dev/sda1";
fsType = "ext4";
};

fonts.packages = with pkgs; [
nerd-fonts.jetbrains-mono
];
}
)
inputs.home-manager.nixosModules.home-manager
{
home-manager.backupFileExtension = "hm-backup";
home-manager.extraSpecialArgs = { inherit inputs; };
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."${username}" = import ../../home-manager {
inherit inputs username;
inherit (nixpkgs) lib;
inherit (inputs.nixpkgs) lib;
inherit pkgs;
config = { };
};
}
];
in
inputs.nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit
inputs
username
isRunner
;
}
// specialArgs;
modules = [
{ nixpkgs.pkgs = pkgs; }
baseModule
]
++ (if modules == null then genericModules else modules);
}
5 changes: 5 additions & 0 deletions lib/host.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# Detect if running on matic (Framework 13)
isMatic = builtins.getEnv "HOSTNAME" == "matic" || builtins.getEnv "HOST" == "matic";

# Detect if running on viper (VM)
isViper = builtins.getEnv "HOSTNAME" == "viper" || builtins.getEnv "HOST" == "viper";

# Desktop machines with GUI - default false, override in named-hosts
isDesktop = false;

Expand All @@ -23,6 +26,8 @@
"galactica"
else if builtins.getEnv "HOSTNAME" == "matic" || builtins.getEnv "HOST" == "matic" then
"matic"
else if builtins.getEnv "HOSTNAME" == "viper" || builtins.getEnv "HOST" == "viper" then
"viper"
else
"unknown";
}
Loading
Loading