orivej has quit [Ping timeout: 245 seconds]
zupo has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zupo has joined #nixos-aarch64
zupo has quit [Ping timeout: 246 seconds]
zupo_ has joined #nixos-aarch64
kvaster has quit [Ping timeout: 258 seconds]
zupo_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jtojnar has quit [Quit: jtojnar]
orivej has joined #nixos-aarch64
t184256 has left #nixos-aarch64 ["Error from remote client"]
t184256 has joined #nixos-aarch64
kvaster has joined #nixos-aarch64
zupo has joined #nixos-aarch64
zupo_ has joined #nixos-aarch64
zupo has quit [Ping timeout: 252 seconds]
zupo_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zupo has joined #nixos-aarch64
zupo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
samueldr has quit [Ping timeout: 245 seconds]
samueldr has joined #nixos-aarch64
Guest77 has joined #nixos-aarch64
<gchristensen> is it possible to tell a SoC to act like a keyboard?
<andi-> usb gadget support should be able to do that
<ToxicFrog> I would expect so; even if its onboard USB controller can't act as a USB peripheral you can always do it in software with GPIO.
<andi-> https://www.rmedgar.com/blog/using-rpi-zero-as-keyboard-setup-and-device-definition came up after a brief search. the guide seems generic enough
<samueldr> yes, look for usb gadget and maybe usb duckie
<samueldr> though, this assumes the board has usb OTG or gadget mode enabled, which isn't for every board
<samueldr> the raspberry pi zero might be a better choice, though lacks 64 bitness
<samueldr> ah, by making a USB port on your GPIO lines
<DigitalKiwi> also do you need a SoC or would a microcontroller work? there are even more options if you do that
<DigitalKiwi> (i think)
<samueldr> pretty sure you're right
<DigitalKiwi> hiduino
<samueldr> the rpi 4's usb type-c plug is OTG enabled, and should thus be possible to be used as a Linux Gadget
<samueldr> some android phones can be used as gadgets, in fact, I would bet most, if not all, due to how adb works
<samueldr> though only those on which you can run your own software might be usable as custom gadgets
<DigitalKiwi> i've only looked around for stuff for the purposes of a midi controller but i think they could work for a keyboard too? there's another one i can't think of right now that has good hid support
<samueldr> most of the time, if it works as a usb gadget, it can be any usb gadget
<clever> samueldr: adb and picture sync all rely on the phone being a usb slave
* DigitalKiwi always thinks it's named tiny not teensy and has to ddg until finds
<clever> samueldr: usb otg is the more rare part (my 1st tablet didnt support it) and thats where the tablet can also be a usb host, and accept a usb stick or even a mouse!
<samueldr> clever: yeah, why "most, if not all", edging my bets against bad implementations
<samueldr> using a mouse on my phone annoys some people :)
<clever> samueldr: the rpi 1-3 all support usb otg at the cpu level, but the modem B's all have a usb hub in the way, so you cant do it at all
<clever> samueldr: and the model A's dont have the otg detect pin routed, so software cant detect if it should be in host or device mode
<samueldr> (I know all that)
<clever> samueldr: from what i saw of the pics of the rpi4, the usb-c isnt the otg port
<clever> there is a seperate micro-usb beside the usb-c
<clever> my guess, is that they just took the existing crappy usb controller they always had, and properly gave it a usb-otg port
<clever> and the new 3.0 usb is on the pci-e bus
<samueldr> clever: [citation needed]
<DigitalKiwi> maybe saw the two HDMI and thought one was usb?
<clever> DigitalKiwi: exactly
<clever> my bad :P
<samueldr> type-c power in also has data lines, Dx_N and Dx_P
<DigitalKiwi> that video i linked earlier. the whole computer system they sell comes with a usb keyboard with a hub
<DigitalKiwi> i wonder if you could use usb c hub?
<clever> i'm guessing that the gpu firmware may temporarily take over that usb port, and ask the remote charger for permission to draw enough current?
<clever> would need my hands on one to confirm
<samueldr> clever: what do you mean?
<samueldr> the raspi4 has its PD_SENSE line hooked to a static resistor, draws up to 3A from dumb chargers and PD chargers that way
<clever> samueldr: ah, havent seen the PD_SENSE line much before
<gchristensen> this is cool stuff
<clever> used to usb 2 where you either negotiate over the data lines, or slap resistors on the data lines
<gchristensen> the reason I'm interested in this is I'd like to be able to use `pass` on one computer to type in passwords on another
<gchristensen> one of my clients requires long passwords and rotating every few months, and I can't keep track of it
<clever> gchristensen: ive got an android app for doing that, it can open encrypted pasword databases, and then type them in
<clever> gchristensen: but it needs root
<gchristensen> yikes :)
<samueldr> gchristensen: there's a project on hackaday, maybe a bit like that, mooltipass IIRC
<samueldr> though not entirely sure if related
<samueldr> needs root because of that usb gadget switching thing :)
<gchristensen> gotcha
<samueldr> that would be neat, a daemon on mobile-nixos allowing some access to usb gadgets for lesser privileged software
<clever> this turns your phone into a mass-storage device
<clever> so you could download the nixos iso from your phone, and then just plug it into a pc
<samueldr> (drivedroid is simialar non-OSS software)
<samueldr> I used drivedroid before knowing about usbmountr to, exactly, mount the nixos iso :)
<clever> samueldr: 90% of what it does, is just writting strings to /proc
<clever> so if you can get a root shell, you can manually configure it
<samueldr> yeah, and you can
<clever> and using this as a reference, you can now try doing it on an rpi4, when it arrives
<samueldr> usb networking and usb adb both working on mobile-nixos
<gchristensen> clever: wait so does it type it in to the android device, or out the otg?
<clever> gchristensen: it makes the android device act like a usb keyboard, and type it into another machine
<DigitalKiwi> does barrier/synergy meet your needs https://wiki.archlinux.org/index.php/Synergy
<gchristensen> very cool
<gchristensen> DigitalKiwi: no, I can't install synergy
<samueldr> clever: the reasoning behind the daemon is that the daemon would allow the software not to worry about getting root privs
<DigitalKiwi> oh :(
<gchristensen> and also I need it to work at the decryption screen and login screen
<clever> samueldr: yeah, we just need to convince android to allow more otg features
<samueldr> no need to if you don't target android :D
<gchristensen> "need" -> an ideal solution would also support this
<DigitalKiwi> KVM?
<gchristensen> the point would be to not have to type the password, but just let `pass` send it somehow
<clever> gchristensen: net.tjado.passwdsafe does just that
<DigitalKiwi> oh right *slaps head*
<gchristensen> once I'm logged in, I can just use SSH :)
<samueldr> all that security and they allow random usb things to be plugged in the computers?
<clever> gchristensen: oh, interesting, it even does keyboard over bluetooth
<clever> gchristensen: that may not need root?
<DigitalKiwi> samueldr: *chortle*
<gchristensen> oh cool
<gchristensen> I can definitely use bluetooth :)
<clever> and now i cant unlock the pw file in my phone, lol
<clever> bluetooth mode requires android 28 or higher
<clever> i have 24 or 25
<clever> thats names pretty clearly!
<clever> it does something with /dev/hidg0
<clever> (facepalm)
<clever> it runs `printf x > /dev/hidg0` for every character
<clever> is you scrape `ps aux` you can see bits of the password
<clever> (but modern android uses process namespacing)
kvaster has quit [Ping timeout: 245 seconds]
<samueldr> oof, shelling out should be removed from all footguns^W languages
<clever> gchristensen: but this version doesnt need root, and properly opens the device
<clever> samueldr: the problem is more that this code isnt ran as root
<clever> and they need to open a handle to a protected char device
<clever> i would have used su to chmod it
<samueldr> if they can't shell out, they won't make 'printf whatever' availble into ps
<samueldr> or at least, will be harder to do it that way
<clever> samueldr: but then they also cant run `su chmod` to fix the permissions
<samueldr> so likely they would open a pipe or a file
<samueldr> I didn't say "not allowed to run software", but "not shelling out"
<clever> if you can execute something, you can just run /bin/sh
<clever> idiots will find a way :P
<samueldr> shelling out is when you write a command to a string that in the end a shell will run, which is the biggest footgun
<samueldr> most commands injections come from feeling it's fine since it's not sh, it's Kernel#exec
<samueldr> so why would it expand $() to command substitution?
<samueldr> (Kernel#exec being the ruby one)
<clever> //String command = String.format("echo %s | xxd -r -p > %s\n", scancodesHex, devicePath);
<clever> // Using printf instead of echo with xxd - this should provide a better compability
<clever> scancodesHex = scancodesHex.replaceAll("(.{2})", "\\\\x$1");;
<clever> String command = String.format("printf '%s' > %s\n", scancodesHex, devicePath);
<samueldr> shelling out has never been, imo, worth it compared to passing argv1-n to a new process independently
<clever> samueldr: worse, they where echo'ing into xxd to convert to hex!!!
<samueldr> sloppy!
<clever> boolean cr = ExecuteAsRootUtil.execute( command );
<clever> dear dog!
<clever> god* lol
<clever> they just execute "su"
<clever> then write the command to its stdin!!!
<clever> at that point, you already have all the pieces to do it right!!!
<clever> su 'sh -c cat > /dev/hidg0'
<clever> then just write the hex to stdin as needed
<clever> oh, neat, this app even supports OTP codes
<DigitalKiwi> i can't tell if you like this app or don't like this app
<clever> *weeps*, nothing calls OutputUsbKeyboard (the non-root one)
<clever> DigitalKiwi: i would fork it and fix the problems, if my phone was rooted enough to be able to use it :P
<t184256> OTP over Bluetooth HID? Now I definitely gotta buy a dedicated work phone.
<DigitalKiwi> makes sense
ryantrinkle has joined #nixos-aarch64
ryantrinkle has quit [Ping timeout: 252 seconds]
ryantrinkle has joined #nixos-aarch64
kvaster has joined #nixos-aarch64
<Guest77> I've used "nixpkgs.crossSystem" to build an sd-card. I copied the closure for the sd-card to the booted machine. However, when I run 'nixos-rebuild' it seems to ignore the store and re-download everything. Any hints for making it "work offline"?
<gchristensen> Guest77: the problem is things built cross are not "the same" as things built locally
<gchristensen> because they werebuilt using different instructions
<Guest77> Damn, I guessed that. The host target tuple right?
<gchristensen> yeah
<Guest77> So the derivation is different :(
<gchristensen> yeah
<gchristensen> a fairly annoying thing in general
<Guest77> It's not something that can really be solved because the compiler outputs will likely be different?
<samueldr> exactly
<gchristensen> I wonder if early cut-off (CAS/intensional store) could possibly help for this
<Guest77> Oh Bananas! Oh well, it got me somewhere faster than compiling on a poor little machine. So I'm still glad it exists.
<gchristensen> probably not, I assume the compilers built would retain something annoying like what it was compiled on/for
<samueldr> yeah, I would assume so unless verified and verifiable
<samueldr> e.g. if there was a hydra process to take for an eval X the pkgscross and native build outputs and compare them to be the same bytewise
<samueldr> (should reproducible builds technically include cross builds too?)
<gchristensen> I don't see why not :)
<Guest77> Could you cheat the derivations and say use a pointer to an item, that says this cross compiled thing is "the same" as what the real thing is?
<samueldr> as of right now, I don't think so, since that would still be a different input
<samueldr> unless you went somehow outside nix and manipulated the outputs?
<Guest77> I would expect a mechanisim in nix, that says "it's ok to use this instead of that". An alias of sorts for the binaries.
<samueldr> that would be breaking one of the strong guarantees :/
<gchristensen> yes
<samueldr> (but sure would be useful)
<gchristensen> or it would have to be extremely manual/extremely specific
<Guest77> Yes. I know. That's why it's a cheat.
<gchristensen> yeah
<Guest77> It would almost be like an overlay that overrides all the outputs? Does that make sense? I'm a nix noob.
<gchristensen> right someting like that
<gchristensen> A batch more of our c2.large.arm Ampere servers have come online in our AMS1 data center. These systems are not reserved and are in our public cloud. <- on packet
jackdk has quit [Quit: Connection closed for inactivity]
<sphalerite> Guest77: you might be able to set nixpkgs.crossSystem to the system that the device actually is and nixpkgs.system to "x86-64-linux" in the system config, and add your x86_64 machine as a remote builder, then always build your system using that
<sphalerite> ymmv though, I haven't tried this myself.
<gchristensen> interesting
<DigitalKiwi> gchristensen: what's that mean?
<DigitalKiwi> (about packet)
<gchristensen> it means you can get 32 cores at 3.3GHz with 128G of RAM, 480G of SSD, and 2x10Gbps NICs for $1.00/h (or less on spot) in the AMS1 datacenter of Packet
<gchristensen> of armv8
<DigitalKiwi> nice
<gchristensen> before they were 100% spoken fore
<gchristensen> you could'nt just *get* one because they were all in use
<gchristensen> for the ~first time, you can just get one
<samueldr> IIRC the ampere ones are those that support armv7, so VMs can be made
<gchristensen> oh maybe not?
<samueldr> the community box isn't the ampere one?
* samueldr forgot
<gchristensen> I don't remember
<gchristensen> (I'd look, but the portal is down atm)
<samueldr> >> On-line CPU(s) list: 0-63
<samueldr> twice what's expected
<gchristensen> I don't remember if they have 2threads per core
<samueldr> >> up 16 days
<gchristensen> yeah
<samueldr> gchristensen: was the auto-reboot thing pushed?
<gchristensen> yeah it was
<samueldr> oh well :)
<gchristensen> but my tmpfiles.d rule not working properly broke my automation
<samueldr> ah, no it's the taishan (5280?) one that is the community box
<samueldr> 2280
<gchristensen> oh yeah hisilicon?
<samueldr> yeah
<samueldr> though I *think* at least one eMAG cpu was supposed to be 32 bit friendly too
wildtrees has joined #nixos-aarch64
srk has quit [Ping timeout: 258 seconds]
srk has joined #nixos-aarch64
srk has joined #nixos-aarch64
srk has quit [Changing host]
Guest77 has quit [Quit: Textual IRC Client: www.textualapp.com]
zupo has joined #nixos-aarch64
Thra11 has joined #nixos-aarch64
Thra11 has quit [Quit: WeeChat 1.9.1]
zupo has quit [Ping timeout: 272 seconds]
jackdk has joined #nixos-aarch64
ryantrinkle has quit [Ping timeout: 268 seconds]
ryantrinkle has joined #nixos-aarch64
ryantrinkle has quit [Ping timeout: 246 seconds]