From a468935722b85beef588ab313f2adfe0159564e2 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 19 Aug 2021 12:10:30 +0200 Subject: Basic flakeification --- flake.nix | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..37a54de --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = "System environment of Adrian Kummerlaender"; + + inputs = { + nixpkgs.url = github:NixOS/nixpkgs/nixos-21.05; + 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); + }; +} -- cgit v1.2.3