{ pkgs, lib, config, inputs, sources, ... }: {
  options.mods.unfree.valheim = {
    enable = lib.mkEnableOption {
      default = false;
      description = "enables valheim server";
    };
    packages = lib.mkOption {
      default = [ "valheim-server" "steamworks-sdk-redist" ];
      description = "unfree packages";
    };
  };

  imports = [ inputs.valheim-server.nixosModules.default ];

  config = lib.mkIf config.mods.unfree.valheim.enable {
    services.valheim = {
      enable = true;
      serverName = "Smorld";
      worldName = "Smorld";
      openFirewall = true;
      password = "notbeempty";
      adminList = [ "76561198032854097" "76561198120039992" ];
      bepinexMods = lib.mapAttrsToList (name: value: value.src)
        (lib.attrsets.filterAttrs (n: v: lib.strings.hasPrefix "valheim." n)
          sources);
    };
  };
}
