{
  description = "System configuration for all machines in samfélag";

  inputs = {

    nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";

    home-manager.url = "github:nix-community/home-manager/release-22.05";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    emacs-overlay.url  = "github:nix-community/emacs-overlay";

  };

  outputs = { self, nixpkgs, home-manager, ... }:
    let
      system = "x86_64-linux";
      pkgs = import nixpkgs {
        inherit system;
        config.allowUnfree = true;
      };
      lib = nixpkgs.lib;
    in {
      nixosConfigurations = {

        # - Kopavogur ----------------------------
        kopavogur = lib.nixosSystem {
          inherit system;
          modules = [

            ./system/modules
            ./system/profiles
            ./system/hosts/kopavogur

            home-manager.nixosModules.home-manager {
              home-manager.useGlobalPkgs = true;
              home-manager.useUserPackages = true;
              home-manager.users.marc = {
                imports = [
                  ./home/modules
                  ./home/profiles
                  ./home/hosts/kopavogur.nix
                ];
              };
            }

          ];
        };

        # - Reykjavik ----------------------------
        reykjavik = lib.nixosSystem {
          inherit system;
          inherit pkgs;
          modules = [

            ./system/modules
            ./system/profiles
            ./system/hosts/reykjavik

            home-manager.nixosModules.home-manager {
              home-manager.useGlobalPkgs = true;
              home-manager.useUserPackages = true;
              home-manager.users.marc = {
                imports = [
                  ./home/modules
                  ./home/profiles
                  ./home/hosts/reykjavik.nix
                ];
              };
            }

          ];
        };

      };
    };
}
