1 { config, lib, pkgs, ... }:
3 cfg = config.services.create_ap;
4 configFile = pkgs.writeText "create_ap.conf" (lib.generators.toKeyValue { } cfg.settings);
8 enable = lib.mkEnableOption "setting up wifi hotspots using create_ap";
9 settings = lib.mkOption {
10 type = with lib.types; attrsOf (oneOf [ int bool str ]);
13 Configuration for `create_ap`.
14 See [upstream example configuration](https://raw.githubusercontent.com/lakinduakash/linux-wifi-hotspot/master/src/scripts/create_ap.conf)
18 INTERNET_IFACE = "eth0";
20 SSID = "My Wifi Hotspot";
21 PASSPHRASE = "12345678";
27 config = lib.mkIf cfg.enable {
30 services.create_ap = {
31 wantedBy = [ "multi-user.target" ];
32 description = "Create AP Service";
33 after = [ "network.target" ];
34 restartTriggers = [ configFile ];
36 ExecStart = "${pkgs.linux-wifi-hotspot}/bin/create_ap --config ${configFile}";
37 KillSignal = "SIGINT";
38 Restart = "on-failure";
45 meta.maintainers = with lib.maintainers; [ onny ];