Files
nixos-config/hosts/common/default.nix
T
m3ta-chiron 839697e21c feat(opencode): pin top-level opencode to v2 from llm-agents
- new ai-agents overlay (applied after m3ta-nixpkgs, which re-exports
  opencode-desktop from its own older v1 flake input):
  * opencode -> llm-agents.opencode2 (2.0.16), binary renamed back to
    'opencode' so keybinds/wrappers keep working
  * opencode-desktop -> llm-agents.opencode-desktop (1.18.32, newest
    existing desktop release; no v2 desktop app upstream)
- bump llm-agents lock to 8bec0ce1 (opencode2 2.0.16)
- m3-hermes keeps llm-agents.opencode (v1) for now
2026-09-24 12:58:42 +02:00

115 lines
3.7 KiB
Nix

# Common configuration for all hosts
{
config,
pkgs,
lib,
inputs,
outputs,
system,
...
}: {
imports = [
./extraServices
./ports.nix
./users
inputs.home-manager.nixosModules.home-manager
];
environment.pathsToLink = ["/share/xdg-desktop-portal" "/share/applications"];
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
inputs = inputs // {agents = null;};
inherit outputs system;
videoDrivers = config.services.xserver.videoDrivers or [];
};
};
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
#outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.stable-packages
# outputs.overlays.locked-packages
# outputs.overlays.pinned-packages
outputs.overlays.master-packages
inputs.m3ta-nixpkgs.overlays.default
# inputs.m3ta-nixpkgs.overlays.modifications
# Top-level pins for opencode/opencode-desktop from llm-agents. Must
# come AFTER m3ta-nixpkgs' overlay, which re-exports opencode-desktop
# from its own (older, v1) `opencode` flake input.
outputs.overlays.ai-agents
# llm-agent packages under the `pkgs.llm-agents.*` namespace, built
# against this system's nixpkgs (needed for qmd.override cudaSupport
# with allowUnfree). Do NOT flatten to top-level attrs — see
# overlays/default.nix.
inputs.llm-agents.overlays.shared-nixpkgs
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
nix = {
settings = {
experimental-features = ["nix-command flakes"];
cores = 2;
max-jobs = 8;
trusted-users = [
"root"
"m3tam3re"
]; # Set users that are allowed to use the flake command
};
# Garbage collection is handled by programs.nh.clean on each host.
# Keep nix.gc.automatic disabled to avoid dueling GC timers.
optimise.automatic = true;
registry =
(lib.mapAttrs (_: flake: {inherit flake;}))
((lib.filterAttrs (_: lib.isType "flake")) inputs);
nixPath = ["/etc/nix/path"];
};
users.defaultUserShell = pkgs.bashInteractive;
programs.bash = {
enable = true;
interactiveShellInit = ''
# Interactive bash -> nushell, unless started deliberately from
# nu/bash (parent check — an exported env marker would leak into
# zellij/zed/herdr children). Non-interactive bash (ssh command
# exec, Mosh app bootstrap) stays bash.
if [[ $- == *i* ]]; then
parent=""
[[ -r /proc/$PPID/comm ]] && IFS= read -r parent < /proc/$PPID/comm
if [[ "$parent" != "nu" && "$parent" != "bash" ]]; then
# First TTY login -> Hyprland (login-manager replacement).
# Only for non-root users with no graphical session running,
# and only on hosts where start-hyprland exists (desktops).
# Servers/laptops without Hyprland fall through to nushell.
if [[ "$(tty)" == "/dev/tty1" && $EUID -ne 0 \
&& -z "''${WAYLAND_DISPLAY:-}" && -z "''${DISPLAY:-}" ]] \
&& command -v start-hyprland >/dev/null 2>&1; then
exec start-hyprland
fi
exec ${pkgs.nushell}/bin/nu --login
fi
unset parent
fi
'';
};
}