Skip to content

Instantly share code, notes, and snippets.

@thpham
Forked from fadenb/configuration-snippet.nix
Created June 21, 2019 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thpham/c9efae629bba89fa38923f5e0288b02a to your computer and use it in GitHub Desktop.
Save thpham/c9efae629bba89fa38923f5e0288b02a to your computer and use it in GitHub Desktop.
Change wireless network interface MAC at boot using macchanger on NixOS
systemd = {
services = {
"macchanger-wireless" = {
description = "Changes MAC of my wireless interface for privacy reasons";
wants = [ "network-pre.target" ];
wantedBy = [ "multi-user.target" ];
before = [ "network-pre.target" ];
bindsTo = [ "sys-subsystem-net-devices-wlp3s0.device" ];
after = [ "sys-subsystem-net-devices-wlp3s0.device" ];
script = ''
${pkgs.macchanger}/bin/macchanger -e wlp3s0
'';
serviceConfig.Type = "oneshot";
};
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment