From 176d9bb96e8923b84bb0bdc731ef707514c0d53e Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 16 May 2025 16:45:40 +0200 Subject: hosts: Move to a `by-name` schema --- hosts/default.nix | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 hosts/default.nix (limited to 'hosts/default.nix') diff --git a/hosts/default.nix b/hosts/default.nix new file mode 100644 index 00000000..35b2d08b --- /dev/null +++ b/hosts/default.nix @@ -0,0 +1,61 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see . +{ + self, + system, + openPRsNixpkgs, + packageSets, + libraries, + modules, + externalDependencies, + externalBinaries, +}: let + hosts = libraries.extra.mkByName { + useShards = false; + baseDirectory = ./by-name; + fileName = "configuration.nix"; + }; + + generateHost = _: path: + self.inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit + libraries + modules + ; + }; + modules = [ + { + _module.args = { + inherit + # extra package sources + openPRsNixpkgs + packageSets + # extra information + system + # nix registry + self + externalDependencies + # bins + # TODO: Integrate these into `pkgs/by-name` <2024-05-22> + externalBinaries + ; + }; + } + path + + ../modules + ../modules/common + ]; + }; + + generatedHosts = builtins.mapAttrs generateHost hosts; +in + generatedHosts -- cgit 1.4.1