From c8806e367669f4861a1be5a251bd253194f99b04 Mon Sep 17 00:00:00 2001 From: Kabbone Date: Sat, 25 Apr 2026 10:59:21 +0200 Subject: [PATCH] add templates for host specific and global overlays --- hosts/configuration_desktop.nix | 3 +-- hosts/default.nix | 26 ++++++++++++++------------ hosts/desktop/default.nix | 12 +++++++++++- hosts/home.nix | 2 +- hosts/jupiter/default.nix | 15 ++++++++++----- hosts/kabtop/default.nix | 2 +- 6 files changed, 38 insertions(+), 22 deletions(-) diff --git a/hosts/configuration_desktop.nix b/hosts/configuration_desktop.nix index 6b30db1..7c7b0b0 100644 --- a/hosts/configuration_desktop.nix +++ b/hosts/configuration_desktop.nix @@ -3,7 +3,7 @@ # Host-specific window manager and hardware configs are imported per-host. # -{ config, lib, pkgs, pkgs-stable, inputs, user, location, agenix, ... }: +{ config, lib, pkgs, inputs, user, location, agenix, ... }: { imports = [ @@ -32,7 +32,6 @@ sbctl ausweisapp e2fsprogs - ] ++ (with pkgs-stable; [ orca-slicer ]); diff --git a/hosts/default.nix b/hosts/default.nix index cd1ad54..29b5d13 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -21,21 +21,23 @@ let system = "x86_64-linux"; - pkgs = import nixpkgs { - inherit system; - config.allowUnfree = true; - }; - pkgs-unstable = import nixpkgs-unstable { inherit system; config.allowUnfree = true; }; - pkgs-stable = pkgs; - pkgs-kabbone = import ../packages { inherit system; - inherit pkgs; + pkgs = import nixpkgs { inherit system; config.allowUnfree = true; }; + }; + + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + # Prefer host-specific overlays over a global one here. + # Set nixpkgs.overlays inside the host's own module (e.g. hosts/desktop/default.nix) + # so only that host's pkgs is affected. Packages can be imported inline — + # no specialArgs needed. See hosts/desktop/default.nix for an example. }; # Helper: returns [hm-module, config-attrset] for the modules list. @@ -55,7 +57,7 @@ in { hades = lib.nixosSystem { # Desktop profile inherit system; - specialArgs = { inherit inputs pkgs-stable user location nixos-hardware agenix microvm nixpkgs lanzaboote pkgs-kabbone; }; + specialArgs = { inherit inputs user location nixos-hardware agenix microvm nixpkgs lanzaboote; }; modules = [ agenix.nixosModules.default microvm.nixosModules.host @@ -71,7 +73,7 @@ in lifebook = lib.nixosSystem { # Laptop profile inherit system; - specialArgs = { inherit inputs pkgs-stable user location nixos-hardware agenix lanzaboote; }; + specialArgs = { inherit inputs user location nixos-hardware agenix lanzaboote; }; modules = [ agenix.nixosModules.default lanzaboote.nixosModules.lanzaboote @@ -84,7 +86,7 @@ in steamdeck = nixpkgs-unstable.lib.nixosSystem { # steamdeck profile inherit system; - specialArgs = { inherit inputs pkgs-stable user location nixos-hardware agenix jovian-nixos lanzaboote; }; + specialArgs = { inherit inputs pkgs user location nixos-hardware agenix jovian-nixos lanzaboote; }; modules = [ agenix.nixosModules.default jovian-nixos.nixosModules.default @@ -121,7 +123,7 @@ in jupiter = lib.nixosSystem { # Server profile inherit system; - specialArgs = { inherit inputs user location nixos-hardware agenix pkgs-kabbone; }; + specialArgs = { inherit inputs user location nixos-hardware agenix; }; modules = [ agenix.nixosModules.default ./jupiter diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index 1b95c9b..d4549c5 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -2,9 +2,19 @@ # Hades desktop — system configuration # -{ lib, pkgs, pkgs-kabbone, ... }: +{ lib, pkgs, inputs, ... }: { + # Example: host-specific overlays — only hades gets these packages in its pkgs. + # nixpkgs.overlays = [ + # (final: prev: { + # # pull a single package from unstable (no specialArgs needed) + # firefox = inputs.nixpkgs-unstable.legacyPackages.${prev.system}.firefox; + # # pull a package from pkgs-kabbone (inline import, no specialArgs needed) + # corosync-qdevice = (import ../../packages { pkgs = prev; }).corosync-qdevice; + # }) + # ]; + imports = [ ./hardware-configuration.nix ../../modules/desktop diff --git a/hosts/home.nix b/hosts/home.nix index 9dd4783..bcabc74 100644 --- a/hosts/home.nix +++ b/hosts/home.nix @@ -15,7 +15,7 @@ # └─ default.nix # -{ config, lib, pkgs, user, pkgs-stable, ... }: +{ config, lib, pkgs, user, ... }: { imports = diff --git a/hosts/jupiter/default.nix b/hosts/jupiter/default.nix index 5a24cdb..cb7b889 100644 --- a/hosts/jupiter/default.nix +++ b/hosts/jupiter/default.nix @@ -17,7 +17,7 @@ # └─ default.nix # -{ config, pkgs, user, pkgs-kabbone, ... }: +{ config, pkgs, inputs, user, ... }: { imports = # For now, if applying to other ssystem, swap files @@ -39,12 +39,17 @@ }; }; +# Example: host-specific overlay — only jupiter gets these packages in its pkgs. +# nixpkgs.overlays = [ +# (final: prev: { +# corosync-qdevice = (import ../../packages { pkgs = prev; }).corosync-qdevice; +# firefox = inputs.nixpkgs-unstable.legacyPackages.${prev.system}.firefox; +# }) +# ]; +# # environment = { -# systemPackages = with pkgs-kabbone; [ +# systemPackages = with pkgs; [ # corosync-qdevice -### simple-scan -### intel-media-driver -### alacritty # ]; # }; diff --git a/hosts/kabtop/default.nix b/hosts/kabtop/default.nix index 4416df0..30dcb1d 100644 --- a/hosts/kabtop/default.nix +++ b/hosts/kabtop/default.nix @@ -17,7 +17,7 @@ # └─ default.nix # -{ config, pkgs, pkgs-unstable, user, agenix, impermanence, ... }: +{ config, pkgs, user, agenix, impermanence, ... }: { imports = # For now, if applying to other system, swap files