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

  inputs = {

    # - Nixpkgs ----------------------------------
    nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";

    # - Home Manager -----------------------------
    home-manager.url = "github:nix-community/home-manager/release-24.11";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    # - Agenix -----------------------------------
    agenix.url = "github:ryantm/agenix";
    agenix.inputs.nixpkgs.follows = "nixpkgs";
    # optionally choose not to download darwin deps (saves some resources on Linux)
    agenix.inputs.darwin.follows = "";

    # - NUR --------------------------------------
    nur.url = "github:nix-community/NUR";

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

    # - Themeing ---------------------------------
    nix-colors.url = "github:misterio77/nix-colors";

    # - Hyprland ---------------------------------
    hyprcursor-rose-pine.url = "github:ndom91/rose-pine-hyprcursor";
  };

  outputs = inputs @ { self, nixpkgs, home-manager, ... }:
    let
      system = "x86_64-linux";

      pkgs = import nixpkgs {
        inherit system;
        config.allowUnfree = true;
        overlays = import ./overlays { inherit inputs; };
      };

      lib = nixpkgs.lib.extend
        (self: super: { my = import ./lib { inherit pkgs inputs; lib = self; }; });

      mkHost = hostPath: lib.nixosSystem {
        inherit system;
        inherit pkgs;
        specialArgs = { inherit lib inputs system; };
        modules = [
          hostPath
          {
            imports =
              [
                inputs.home-manager.nixosModules.home-manager
                inputs.nix-colors.homeManagerModule
                # Agenix
                inputs.agenix.nixosModules.default
                {
                  environment.systemPackages = [
                    inputs.agenix.packages.${system}.default
                    pkgs.age
                  ];
                }
              ]
              # All my personal modules
              ++ (lib.my.mapModulesRec' (toString ./modules) import);
          }
          ];
        };

    in {
      nixosConfigurations = lib.my.mapModules ./hosts mkHost;
    };
}
