Files
nixpkgs/nixos/tests/samba-wsdd.nix
Zhong Jianxin 752a5ad36d treewide: libressl.nc -> netcat
Quote from NixOS 25.11 release notes:

> `meta.mainProgram` is now used to determine the `NIX_MAIN_PROGRAM` environment variable. This means that changing it can now lead to a package rebuild.

And `netcat` is:

```
 netcat = libressl.nc.overrideAttrs (old: { 
   meta = old.meta // { 
     description = "Utility which reads and writes data across network connections — LibreSSL implementation"; 
     mainProgram = "nc"; 
   }; 
 });
```

`netcat` and `libressl.nc` are 2 different derivations now, use just one
 of them in nixpkgs for consistency.

This also fixes lots of warnings if `virtualisation.libvirtd.enable = true`:

```
pkgs.buildEnv warning: colliding subpath (ignored): `/nix/store/1mcayh9rmxmjcbmm6swkkyr59rjl66vc-libressl-4.2.1-nc/bin/nc' and `/nix/store/x1vmfpisbd494yykmvjkhvh3dplsnjhg-libressl-4.2.1-nc/bin/nc'
...
```
2025-12-13 00:34:51 +08:00

47 lines
997 B
Nix

{ pkgs, ... }:
{
name = "samba-wsdd";
meta.maintainers = with pkgs.lib.maintainers; [ izorkin ];
nodes = {
client_wsdd =
{ pkgs, ... }:
{
services.samba-wsdd = {
enable = true;
openFirewall = true;
interface = "eth1";
workgroup = "WORKGROUP";
hostname = "CLIENT-WSDD";
discovery = true;
extraOptions = [ "--no-host" ];
};
};
server_wsdd =
{ ... }:
{
services.samba-wsdd = {
enable = true;
openFirewall = true;
interface = "eth1";
workgroup = "WORKGROUP";
hostname = "SERVER-WSDD";
};
};
};
testScript = ''
client_wsdd.start()
client_wsdd.wait_for_unit("samba-wsdd")
server_wsdd.start()
server_wsdd.wait_for_unit("samba-wsdd")
client_wsdd.wait_until_succeeds(
"echo list | ${pkgs.netcat}/bin/nc -N -U /run/wsdd/wsdd.sock | grep -i SERVER-WSDD"
)
'';
}