# Putting wifi ssid in networkmanager secrets

**URL:** https://discourse.nixos.org/t/putting-wifi-ssid-in-networkmanager-secrets/80494
**Category:** Help
**Created:** [October 9, 2026, 1:17pm UTC](https://discourse.nixos.org/t/putting-wifi-ssid-in-networkmanager-secrets/80494 "2026-10-09T13:17:46Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![yushi](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/y/8e7dd6/32.png) [@yushi](https://discourse.nixos.org/u/yushi)
#### Post date: [October 9, 2026, 1:17pm UTC](https://discourse.nixos.org/t/putting-wifi-ssid-in-networkmanager-secrets/80494/1 "2026-10-09T13:17:46Z")

</div>

I have already put wifi password in secrets with `networking.networkmanager.ensureProfiles.secrets.entries`. But if I do the same thing for wifi ssid, it doesn’t seem to work.

I got this warning `keyfile: load: "/var/run/NetworkManager/system-connections/home-wifi.nmconnection": failed to load connection: invalid connection: 802-11-wireless.ssid: property is missing` from `NetworkManager.service`.

Does anyone have any idea?

Here is my config

```auto
networking.networkmanager = {
  enable = true;

  ensureProfiles.profiles = {
    home-wifi = {
      connection = {
        id = "home-wifi";
        type = "wifi";
        uuid = "xxxx-xxxx-xxxx-xxxx-xxxx";
      };

      wifi = {
        mode = "infrastructure";
      };

      wifi-security = {
        auth-alg = "open";
        key-mgmt = "wpa-psk";
      };

      ipv4 = {
        method = "auto";
      };

      ipv6 = {
        addr-gen-mode = "default";
        method = "auto";
      };

      proxy = {};
    };
  };

  ensureProfiles.secrets.entries = [
    {
      matchId = "home-wifi";
      matchType = "802-11-wireless";
      matchSetting = "802-11-wireless-security";
      key = "psk";
      file = config.sops.secrets.wifi-password.path;
    }
    {
      matchId = "home-wifi";
      matchType = "802-11-wireless";
      matchSetting = "802-11-wireless";
      key = "ssid";
      file = config.sops.secrets.wifi-name.path;
    }
  ];
};

```

---

<div class="post-metadata">

### Author: ![adomixaszvers](https://discourse.nixos.org/user_avatar/discourse.nixos.org/adomixaszvers/32/3531_2.png) [@adomixaszvers](https://discourse.nixos.org/u/adomixaszvers)
#### Post date: [October 9, 2026, 1:55pm UTC](https://discourse.nixos.org/t/putting-wifi-ssid-in-networkmanager-secrets/80494/2 "2026-10-09T13:55:42Z")

</div>

Could you try changing it to

```auto
{
      matchId = "home-wifi";
      matchType = "wifi"; # connection.type
      matchSetting = "wifi-security";
      key = "psk";
      file = config.sops.secrets.wifi-password.path;
    }
    {
      matchId = "home-wifi";
      matchType = "wifi";
      matchSetting = "wifi";
      key = "ssid";
      file = config.sops.secrets.wifi-name.path;
    }

```

?

I still use `environmentFiles` and my config looks like this

```auto
{ config, ... }:
{
  sops = {
    secrets =
      let
        secretConf = {
          sopsFile = ../common-secrets/wifi.yaml;
        };
      in
      {
        "wifi/home/ssid" = secretConf;
        "wifi/home/bssid" = secretConf;
        "wifi/home/password" = secretConf;
      };
    templates."wifi.env".content = ''
      HOME_SSID="${config.sops.placeholder."wifi/home/ssid"}"
      HOME_BSSID="${config.sops.placeholder."wifi/home/bssid"}"
      HOME_PASSWORD="${config.sops.placeholder."wifi/home/password"}"
    '';
  };
  networking.networkmanager.ensureProfiles = {
    environmentFiles = [config.sops.templates."wifi.env".path];
    profiles = {
      "Home Wifi" = {
        connection = {
          autoconnect-priority = "98";
          id = "Greitas 5GHz";
          timestamp = "1770138378";
          type = "wifi";
          uuid = "af842002-436e-4893-9314-ed7d6e0bae2f";
        };
        ipv4 = {
          address1 = "192.168.1.184/24";
          dns = "192.168.1.150;9.9.9.9;";
          dns-search = "lan;";
          gateway = "192.168.1.254";
          method = "manual";
          route1 = "10.6.0.6/32,192.168.1.150";
        };
        ipv6 = {
          addr-gen-mode = "stable-privacy";
          method = "auto";
        };
        proxy = { };
        wifi = {
          band = "a";
          bssid = "$HOME_BSSID";
          mac-address = "C8:94:02:DD:EE:B3";
          mode = "infrastructure";
          ssid = "$HOME_SSID";
        };
        wifi-security = {
          key-mgmt = "wpa-psk";
          psk = "$HOME_PASSWORD";
        };
      };
    };
  };
}
```

---

<div class="post-metadata">

### Author: ![yushi](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/y/8e7dd6/32.png) [@yushi](https://discourse.nixos.org/u/yushi)
#### Post date: [October 9, 2026, 2:32pm UTC](https://discourse.nixos.org/t/putting-wifi-ssid-in-networkmanager-secrets/80494/3 "2026-10-09T14:32:15Z")

</div>

> Could you try changing it to
> 
> ```auto
> {
> matchId = "home-wifi";
> matchType = "wifi"; # connection.type
> matchSetting = "wifi-security";
> key = "psk";
> file = config.sops.secrets.wifi-password.path;
> }
> {
> matchId = "home-wifi";
> matchType = "wifi";
> matchSetting = "wifi";
> key = "ssid";
> file = config.sops.secrets.wifi-name.path;
> }
> 
> ```
> 
> ?

Thanks for your reply. Unfortunately, this doesn’t work either with the same warning.

---

<div class="post-metadata">

### Author: ![adomixaszvers](https://discourse.nixos.org/user_avatar/discourse.nixos.org/adomixaszvers/32/3531_2.png) [@adomixaszvers](https://discourse.nixos.org/u/adomixaszvers)
#### Post date: [October 9, 2026, 2:52pm UTC](https://discourse.nixos.org/t/putting-wifi-ssid-in-networkmanager-secrets/80494/4 "2026-10-09T14:52:03Z")

</div>

I’ve changed my config to

```auto
{ config, ... }:
{
  sops = {
    secrets =
      let
        secretConf = {
          sopsFile = ../common-secrets/wifi.yaml;
        };
      in
      {
        "wifi/home/ssid" = secretConf;
        "wifi/home/bssid" = secretConf;
        "wifi/home/password" = secretConf;
      };
  };
  networking.networkmanager.ensureProfiles = {
    secrets.entries =
      let
        matchType = "wifi";
        matchUuid = "af842002-436e-4893-9314-ed7d6e0bae2f";
      in
      [
        {
          inherit matchUuid matchType;
          file = config.sops.secrets."wifi/home/ssid".path;
          key = "ssid";
          matchSetting = "wifi";
        }
        {
          inherit matchUuid matchType;
          file = config.sops.secrets."wifi/home/bssid".path;
          key = "bssid";
          matchSetting = "wifi";
        }
        {
          inherit matchUuid matchType;
          file = config.sops.secrets."wifi/home/password".path;
          key = "psk";
          matchSetting = "wifi-security";
        }
      ];
    profiles = {
      "Home Wifi" = {
        connection = {
          autoconnect-priority = "98";
          id = "Greitas 5GHz";
          timestamp = "1770138378";
          type = "wifi";
          uuid = "af842002-436e-4893-9314-ed7d6e0bae2f";
        };
        ipv4 = {
          address1 = "192.168.1.184/24";
          dns = "192.168.1.150;9.9.9.9;";
          dns-search = "lan;";
          gateway = "192.168.1.254";
          method = "manual";
          route1 = "10.6.0.6/32,192.168.1.150";
        };
        ipv6 = {
          addr-gen-mode = "stable-privacy";
          method = "auto";
        };
        proxy = { };
        wifi = {
          band = "a";
          mac-address = "C8:94:02:DD:EE:B3";
          mode = "infrastructure";
        };
        wifi-security = {
          key-mgmt = "wpa-psk";
        };
      };
    };
  };
}

```

The connection works but I also get similar warnings

```auto
spal. 09 17:39:43 adomo-t14 systemd[1]: Starting Network Manager...
spal. 09 17:39:43 adomo-t14 NetworkManager[54744]: <warn> [1791556783.5793] keyfile: load: "/var/run/NetworkManager/system-connections/Home Wifi.nmconnection": failed to load connection: invalid connection: 802-11-wireless.ssid: property is missing
spal. 09 17:39:43 adomo-t14 systemd[1]: Started Network Manager.
spal. 09 17:39:43 adomo-t14 NetworkManager[54744]: <warn> [1791556783.6922] device (0C:02:BD:18:2C:15): error setting IPv4 forwarding to '1': Resource temporarily unavailable
spal. 09 17:39:43 adomo-t14 NetworkManager[54744]: <warn> [1791556783.7312] device (p2p-dev-wlp3s0): error setting IPv4 forwarding to '1': Success
spal. 09 17:47:49 adomo-t14 NetworkManager[54744]: <warn> [1791557269.8173] keyfile: load: "/var/run/NetworkManager/system-connections/Home Wifi.nmconnection": failed to load connection: invalid connection: 802-11-wireless.ssid: property is missing

```

---

<div class="post-metadata">

### Author: ![yushi](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/y/8e7dd6/32.png) [@yushi](https://discourse.nixos.org/u/yushi)
#### Post date: [October 9, 2026, 3:19pm UTC](https://discourse.nixos.org/t/putting-wifi-ssid-in-networkmanager-secrets/80494/5 "2026-10-09T15:19:41Z")

</div>

I just want to confirm that you have Internet connection despite the warning?

---

<div class="post-metadata">

### Author: ![adomixaszvers](https://discourse.nixos.org/user_avatar/discourse.nixos.org/adomixaszvers/32/3531_2.png) [@adomixaszvers](https://discourse.nixos.org/u/adomixaszvers)
#### Post date: [October 9, 2026, 3:35pm UTC](https://discourse.nixos.org/t/putting-wifi-ssid-in-networkmanager-secrets/80494/6 "2026-10-09T15:35:44Z")

</div>

Yes. I even tried to restart NetworkManager. But maybe there is some state remaining from the previous config.

---

<div class="post-metadata">

### Author: ![yushi](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/y/8e7dd6/32.png) [@yushi](https://discourse.nixos.org/u/yushi)
#### Post date: [October 9, 2026, 3:56pm UTC](https://discourse.nixos.org/t/putting-wifi-ssid-in-networkmanager-secrets/80494/7 "2026-10-09T15:56:31Z")

</div>

I see. I think I have to further investigate into it. Thanks again!
