rtl8723cs-wowlan: remove dependency on moreutils

This commit is contained in:
2023-10-11 22:36:47 +00:00
parent 7d63960e6f
commit d6c5580fc3
3 changed files with 6 additions and 24 deletions

View File

@@ -7,7 +7,6 @@
# - portfolio -> {glib,cairo,pygobject}-dev
# - komikku -> python3.10-brotlicffi -> python3.10-cffi
# - many others. python3.10-cffi seems to be the offender which infects 70% of consumers though
# - 2023/10/10: moreutils pulls in unnecessarily many emulated deps
# - 2023/10/11: build ruby is pulled in by `neovim`:
# - nix why-depends --all /nix/store/rhli8vhscv93ikb43639c2ysy3a6dmzp-nixos-system-moby-23.11.20231011.30c7fd8 /nix/store/5xbwwbyjmc1xvjzhghk6r89rn4ylidv8-ruby-3.1.4
# - 2023/10/11: build coreutils pulled in by rpm
@@ -1234,13 +1233,6 @@ in {
# # '';
# });
moreutils = prev.moreutils.override {
# depends on perl IPC-Run -> IO-Tty, the latter does not cross
# - IO-Tty stands very small chance of ever compiling w/o straight up emulation.
# N.B. only perl+perlPackages have to be emulated, but emulating stdenv actually reduces the closure
inherit (emulated) perl perlPackages stdenv;
};
mpv-unwrapped = prev.mpv-unwrapped.overrideAttrs (upstream: {
# 2023/10/10: upstreaming is easiest to do after the next staging -> master merge
# otherwise the result will still have a transient dep on python.

View File

@@ -1,6 +1,6 @@
{ static-nix-shell
, hostname-debian
, iw
, moreutils
, wirelesstools
}:
@@ -8,7 +8,7 @@ static-nix-shell.mkPython3Bin {
pname = "rtl8723cs-wowlan";
src = ./.;
pkgs = {
inherit iw moreutils wirelesstools;
inherit hostname-debian iw wirelesstools;
};
}

View File

@@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p iw -p moreutils -p wirelesstools
#!nix-shell -i python3 -p "python3.withPackages (ps: [ ])" -p hostname-debian -p iw -p wirelesstools
# vim: set filetype=python :
# common operations:
@@ -7,8 +7,6 @@
# arp --dest-ip A.B.C.D
# tcp --source-port N
KNOWN_INTERFACES = ("wlan0", "wlp3s0", "enp5s0")
import argparse
import logging
import subprocess
@@ -21,17 +19,9 @@ def octet_to_hex(o: int) -> str:
def get_ipaddrs() -> list['IpAddr']:
''' return the IP address of all known interfaces '''
addrs = []
for iface in KNOWN_INTERFACES:
try:
# errors if interface isn't known, or ip addr fails to parse (e.g. 'NON-IP')
maybe_addr = subprocess.check_output(['ifdata', '-pa', iface]).decode('utf-8')
addr = IpAddr(maybe_addr)
except: pass
else:
addrs.append(addr)
logger.debug(f'get_ipaddrs got: {[str(a) for a in addrs]}')
return addrs
addrs = subprocess.check_output(['hostname', '--all-ip-addresses']).decode('utf-8').strip().split(' ')
logger.debug(f'get_ipaddrs got: {addrs}')
return [ IpAddr(a) for a in addrs ]
class Encodable: