summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..f13e326
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,36 @@
+{
+ description = "System environment of Adrian Kummerlaender";
+
+ inputs = {
+ nixpkgs.url = github:NixOS/nixpkgs/nixos-25.11;
+ pkgs-personal.url = github:KnairdA/pkgs/master;
+ snm = {
+ url = gitlab:simple-nixos-mailserver/nixos-mailserver/nixos-25.11;
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs = { self, nixpkgs, pkgs-personal, snm, ... }: let
+ config = hostname: nixpkgs.lib.nixosSystem {
+ system = "x86_64-linux";
+ specialArgs = {
+ inherit pkgs-personal;
+ inherit hostname;
+ inherit snm;
+ };
+ 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);
+ };
+}