summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..15d4326
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,31 @@
+{
+ description = "System environment of Adrian Kummerlaender";
+
+ inputs = {
+ nixpkgs.url = github:NixOS/nixpkgs/nixos-23.11;
+ pkgs-personal.url = github:KnairdA/pkgs/master;
+ };
+
+ outputs = { self, nixpkgs, pkgs-personal, ... }: let
+ config = hostname: nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ specialArgs = {
+ inherit pkgs-personal;
+ inherit hostname;
+ };
+ modules = [ ./configuration.nix ];
+ };
+
+ hostnames = builtins.map
+ (h: builtins.replaceStrings [ ".nix" ] [ "" ] h)
+ (builtins.filter
+ (h: h != "")
+ (nixpkgs.lib.mapAttrsToList
+ (name: type: if type == "regular" then name else "")
+ (builtins.readDir ./host)));
+
+ in {
+ nixosConfigurations = builtins.listToAttrs
+ (map (h: { name = h; value = config h; }) hostnames);
+ };
+}