2024-10-20 00:30:58 +02:00
|
|
|
# Common configuration for all hosts
|
2026-03-07 11:44:04 +01:00
|
|
|
{
|
|
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
lib,
|
|
|
|
|
inputs,
|
|
|
|
|
outputs,
|
|
|
|
|
system,
|
|
|
|
|
...
|
|
|
|
|
}: {
|
2024-10-20 00:30:58 +02:00
|
|
|
imports = [
|
|
|
|
|
./extraServices
|
2025-10-05 12:24:27 +02:00
|
|
|
./ports.nix
|
2024-10-20 00:30:58 +02:00
|
|
|
./users
|
|
|
|
|
inputs.home-manager.nixosModules.home-manager
|
|
|
|
|
];
|
|
|
|
|
|
2026-03-07 11:44:04 +01:00
|
|
|
environment.pathsToLink = ["/share/xdg-desktop-portal" "/share/applications"];
|
2025-02-12 11:12:32 +01:00
|
|
|
|
2024-10-20 00:30:58 +02:00
|
|
|
home-manager = {
|
2026-05-02 10:08:50 +02:00
|
|
|
useGlobalPkgs = true;
|
2024-10-20 00:30:58 +02:00
|
|
|
useUserPackages = true;
|
2026-01-03 09:31:59 +01:00
|
|
|
extraSpecialArgs = {
|
2026-05-31 14:10:15 +02:00
|
|
|
inputs = inputs // {agents = null;};
|
|
|
|
|
inherit outputs system;
|
2026-03-07 11:44:04 +01:00
|
|
|
videoDrivers = config.services.xserver.videoDrivers or [];
|
2026-01-03 09:31:59 +01:00
|
|
|
};
|
2024-10-20 00:30:58 +02:00
|
|
|
};
|
2026-01-03 09:31:59 +01:00
|
|
|
|
2024-10-20 00:30:58 +02:00
|
|
|
nixpkgs = {
|
|
|
|
|
# You can add overlays here
|
|
|
|
|
overlays = [
|
|
|
|
|
# Add overlays your own flake exports (from overlays and pkgs dir):
|
2025-10-03 14:55:24 +02:00
|
|
|
#outputs.overlays.additions
|
2026-08-16 12:44:51 +02:00
|
|
|
outputs.overlays.modifications
|
2024-10-20 00:30:58 +02:00
|
|
|
outputs.overlays.stable-packages
|
2026-07-10 15:19:44 +02:00
|
|
|
# outputs.overlays.locked-packages
|
|
|
|
|
# outputs.overlays.pinned-packages
|
2024-11-07 10:50:13 +01:00
|
|
|
outputs.overlays.master-packages
|
2024-10-20 00:30:58 +02:00
|
|
|
|
2025-10-03 14:55:24 +02:00
|
|
|
inputs.m3ta-nixpkgs.overlays.default
|
2026-07-10 15:19:44 +02:00
|
|
|
# inputs.m3ta-nixpkgs.overlays.modifications
|
2026-08-31 11:47:17 +02:00
|
|
|
# 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
|
2024-10-20 00:30:58 +02:00
|
|
|
# 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";
|
2024-11-07 10:50:13 +01:00
|
|
|
cores = 2;
|
|
|
|
|
max-jobs = 8;
|
2024-10-20 00:30:58 +02:00
|
|
|
trusted-users = [
|
|
|
|
|
"root"
|
|
|
|
|
"m3tam3re"
|
|
|
|
|
]; # Set users that are allowed to use the flake command
|
|
|
|
|
};
|
2026-07-07 19:49:53 +02:00
|
|
|
# Garbage collection is handled by programs.nh.clean on each host.
|
|
|
|
|
# Keep nix.gc.automatic disabled to avoid dueling GC timers.
|
2024-10-20 00:30:58 +02:00
|
|
|
optimise.automatic = true;
|
2026-03-07 11:44:04 +01:00
|
|
|
registry =
|
|
|
|
|
(lib.mapAttrs (_: flake: {inherit flake;}))
|
2024-10-20 00:30:58 +02:00
|
|
|
((lib.filterAttrs (_: lib.isType "flake")) inputs);
|
2026-03-07 11:44:04 +01:00
|
|
|
nixPath = ["/etc/nix/path"];
|
2024-10-20 00:30:58 +02:00
|
|
|
};
|
2026-08-23 14:35:18 +02:00
|
|
|
users.defaultUserShell = pkgs.bashInteractive;
|
|
|
|
|
programs.bash = {
|
|
|
|
|
enable = true;
|
|
|
|
|
interactiveShellInit = ''
|
2026-08-31 09:56:13 +02:00
|
|
|
# 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
|
|
|
|
|
exec ${pkgs.nushell}/bin/nu --login
|
|
|
|
|
fi
|
|
|
|
|
unset parent
|
2026-08-23 14:35:18 +02:00
|
|
|
fi
|
|
|
|
|
'';
|
|
|
|
|
};
|
2024-10-20 00:30:58 +02:00
|
|
|
}
|