aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/default.nix')
-rw-r--r--hosts/default.nix61
1 files changed, 61 insertions, 0 deletions
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 <benedikt.peetz@b-peetz.de>
+# 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 <https://www.gnu.org/licenses/gpl-3.0.txt>.
+{
+ 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