Thanks to visit codestin.com
Credit goes to github.com

Skip to content

wifi systemd-udev-trigger workaround - investigate #17

@colemickens

Description

@colemickens

is this really needed still ?

nixcfg/mixins/common.nix

Lines 172 to 194 in b8accd1

workaroundWifi = {
# dude, bash and linux are just real pieces of shit sometimes
# uptime is unparseable garbage
# well, so is /proc/uptime too, fucking returning floats that I have to cut apart
# seriously, I know some of this is old stuff but were they even thinking?
# then again lots of unix types seem to love "cutting" everywhere instead of real, explicit safe CLI APIs
# UGGGGGGGGGGGGGH
# it'd be cool to see a nulib stdlib that alleviated some of this bullshit
text = ''
(
set -x
uptime_ms="$(cat /proc/uptime | cut -d ' ' -f 1)"
uptime_ms="$(echo $uptime_ms | cut -d '.' -f 1)"
if [[ ''${uptime_ms} -gt ${ toString (60 * 2) } ]]; then
echo "workaround_wifi_issue: trigger"
${pkgs.systemd}/bin/systemctl restart systemd-udev-trigger
else
echo "workaround_wifi_issue: skip"
fi
)
'';
deps = [ ];
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions