2018-03-09
21:22
<
clever >
so when anything tries to import <nixpkgs> it loads your dummy
21:22
<
clever >
boomshroom: you may need a dummy default,nix in NIX_PATH, that does import <realnixpkgs> { crossSysstem = foo; };
21:22
<
clever >
boomshroom: i dont think there is any way to set the right flags in config.nix
21:15
<
clever >
genesis: nice
20:56
<
clever >
which uploads from the console
20:56
<
clever >
you can also run `gist -p default.nix` after `nix-env -iA nixos.gist`
20:56
<
clever >
so it uses the mkDerivation from qt
20:55
<
clever >
genesis: try removing the stdenv. from that
20:54
<
clever >
can you gist your current nix expressions?
20:54
<
clever >
what about qt510.mkDerivation ?
20:53
<
clever >
genesis: and which callPackage are you using?
20:52
<
clever >
script is part of the qtscript attr
20:52
<
clever >
qt5.qtscript.dev 894 r /nix/store/mwhscavyy74qan5yanjspagpnxixdxjv-qtscript-5.8.0-dev/mkspecs/modules/qt_lib_scripttools.pri
20:51
<
clever >
qt510.qtbase i think
20:50
<
clever >
thats a library, not part of creator
20:48
<
clever >
nix-env -iA nixos.qtcreator
20:48
<
clever >
genesis: i see it in nixpkgs still
19:42
<
clever >
hakujin: _module.args.pkgs is how the pkgs argument got there in the first place
19:17
<
clever >
boomshroom: did you check the nix-store man page?
19:16
<
clever >
boomshroom: usually hostname-1, and when you remake the key, it becomes hostname-2
19:06
<
clever >
Lisanna: but libcurl may obey ~/.netrc
19:05
<
clever >
boomshroom: is the daemon 1.11 or 2.0?
19:04
<
clever >
Lisanna: its using libcurl in this file, so it depends on what libcurl reads by default
19:00
<
clever >
and now that nix-channel has been redone in c++, you cant use curl flags directly
19:00
<
clever >
it normally fetches ~2 files from a dir, and to make it atomic, it first follows the redir, then appends the names to that
18:59
<
clever >
Lisanna: when it follows the redirect, it looses the auth info, because you didnt give it --user and --pass
18:59
<
clever >
Lisanna: oh, its the http redir
05:39
<
clever >
or native-build random parts, including the entire gcc and glibc toolchain
05:39
<
clever >
so you must either cross-compile everything, always
05:39
<
clever >
nix believes the cross-built glibc is different from the native build glibc
05:39
<
clever >
this is a problem that cross-compiling will always have
05:37
<
clever >
you may be better off building manually with nix-build on an external machine, running `nix copy`, and then `nix-store -i /nix/store/path`
05:37
<
clever >
but it will still want to download the x86 compiler to the phone, then upload it to the build slave
05:37
<
clever >
boomshroom: always pass crossSystem to <nixpkgs> and it should always cross-compile on an x86 machine
05:34
<
clever >
boomshroom: so you can safely use any machine as the build slave, as long as the cpu can run the compiler
05:34
<
clever >
boomshroom: there is no way for nix to get versions crossed like that
05:30
<
clever >
mutantmell: i'm thinking its not cleaning up self.reply_buffer[request_metadata.response_id] when requests fail
05:22
<
clever >
boomshroom: oops, meant to send that to mutantmell
05:16
<
clever >
boomshroom: i think its polling the json endpoint that returns 27mb
05:12
<
clever >
mutantmell: maybe that sharing isnt it, still fails, i'll try to debug more...
05:09
<
clever >
mutantmell: the slack admin has to approve the wee-slack app first
05:08
<
clever >
it may not like that
05:07
<
clever >
resulting in 3 sessions
05:07
<
clever >
mutantmell: aha, that might be it, i "stole" the auth token out of my browser session, and then launched 2 weechats from that token
05:06
<
clever >
i suspect its repeatedly hitting a certain endpoint
05:04
<
clever >
and this slack is free, so it has a max of 10k messages total
05:04
<
clever >
mutantmell: it seems to wait until you focus the channel
05:02
<
clever >
1gig of ram
05:01
<
clever >
ERROR: Failed connecting to Slack with token xxx ratelimited
05:01
<
clever >
mutantmell: upgraded the server to 2.0, its using 500mb of ram and 100% cpu, and is still forking
04:53
<
clever >
the un-configured one is sitting at 3mb
04:52
<
clever >
2, but 1 is un-configured
04:51
<
clever >
depending on your nix channel, you may not need this
04:51
<
clever >
adjusting my expression to force that version
04:51
<
clever >
thats the machine where it works fine
04:50
<
clever >
"18.03pre129076.831ef4756e3"
04:50
<
clever >
[clever@amd-nixos:~/apps/slack-irc-gateway]$ nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion
04:50
<
clever >
2.0 is behaving better
04:49
<
clever >
1.9 on the server
04:49
<
clever >
1.9 vs 2.0
04:49
<
clever >
on the server, its up to 1.6gig
04:49
<
clever >
on my desktop, its idling at 500mb, and isnt forking
04:48
<
clever >
note, this slack has 16,000 users, and i had to adjust a timeout to even connect, because the very first API call returns a 27mb blob of JSON
04:47
<
clever >
mutantmell: ehgads!, weechat is using up a gig of ram already, and is forking like crazy
04:45
<
clever >
Lisanna: some people try to mount a tmpfs to /tmp!!
04:44
<
clever >
and i just realized some absurdity, i was connecting to tmux to set it up, while inside screen, lol
04:44
<
clever >
all of the state lands in the home directory, which is over here
04:43
<
clever >
[root@router:~]# ls -ltrh /var/lib/weechat-example/.weechat/
04:41
<
clever >
and you also gain the ability to control it
04:41
<
clever >
yeah, weechat requires a tty to even start
04:40
<
clever >
mutantmell: /slack register gives help on how to find it
04:39
<
clever >
mutantmell: it also includes the slack plugin, with the patches i previously mentioned, so it needs a different token
04:38
<
clever >
`sudo -u example -i` and `tmux a -t example` to connect to tmux and control it, ^bd to disconnect
04:37
<
clever >
mutantmell: that will generate several (based on line 43) systemd services&users, each running a weechat inside tmux
04:34
<
clever >
Lisanna: i think thats systemd, what is it set to outside nix-shell?
04:27
<
clever >
mutantmell: dang, tmux also wants a tty!
04:26
<
clever >
the -i asks before overwriting, the -v tells me exactly what it just did, and the trailing / causes it to fail, it cant rename a file to directory/
04:26
<
clever >
thats why i always do `mv -vi file1 file2 directory/`
04:26
<
clever >
if directory doesnt exist, it renames file1->directory, then renames file2->directory
04:25
<
clever >
`mv file1 file2 directory`
04:25
<
clever >
it can also fail in other fun ways
04:22
<
clever >
`mv file1 file2 file3` renames 1->3, then 2->3
04:22
<
clever >
except, its dumb, when you give it 3 files
04:22
<
clever >
jtojnar: it will assume your trying to rename file1 to file2, like `mv file1 file2`
04:16
<
clever >
(which overwrites the last file with the 2nd last, and deletes all overs)
04:16
<
clever >
jtojnar: did you try to `mv *`?
04:16
<
clever >
yeah, i think it demands a tty
04:16
<
clever >
Mar 09 04:16:01 router weechat[22621]: Error opening terminal: unknown.
04:15
<
clever >
oh wait no
04:14
<
clever >
i think systemd tried to run the service before the user/home where created
04:14
<
clever >
Mar 09 04:14:00 router systemd[21983]: weechat-example2.service: Failed at step CHDIR spawning /nix/store/0jpaib26q5qgshva3v3pzxnlm5n6r57b-unit-script/bin/weechat-example2-pre-start: No such file or directory
04:13
<
clever >
ah, createHome didnt give it permission to the parent of home
04:13
<
clever >
yet it does exist
04:12
<
clever >
Mar 09 04:12:16 router weechat-example-pre-start[21394]: mkdir: cannot create directory ‘/var/lib/weechat’: Permission denied
04:11
<
clever >
oh, i forgot to set User=
04:11
<
clever >
jeaye: do you happen to have any experience running weechat under systemd?
04:11
<
clever >
Mar 09 04:11:11 router weechat[20956]: Error: unable to get HOME directory
04:10
<
clever >
chown -R $[name} /var/lib/weechat/example
04:10
<
clever >
Mar 09 04:09:51 router weechat-example-pre-start[20432]: /nix/store/s1wkdni2rn51jz7chh0r5fr0f1viki50-unit-script/bin/weechat-example-pre-start: line 4: unexpected EOF while looking for matching `]'
04:09
<
clever >
mutantmell: and now to test it!
04:03
<
clever >
i could have also used map over configs, but its simpler to just merge the 2 operations
04:02
<
clever >
i'll post the full file in a few minutes, but thats an example of what the fn has to return
04:02
<
clever >
17 "${name}" = {
04:02
<
clever >
16 mkUser = name: {
04:01
<
clever >
and each gets his own user!
04:01
<
clever >
users.extraUsers = lib.foldl' (state: name: state // (mkUser name)) {} configs;
04:00
<
clever >
so you give it a list of configs, and it generates a list of systemd services, allowing you to run several weechats at once
04:00
<
clever >
systemd.services = lib.foldl' (state: name: state // (mkService name)) {} configs;
04:00
<
clever >
i can never remember the order of the params, had to experiment in nix-repl
03:59
<
clever >
{ a = 1; b = 1; }
03:59
<
clever >
mutantmell: a handy function that i'm using...
03:59
<
clever >
nix-repl> lib.foldl' (state: n: state // { "${n}" = 1; }) {} [ "a" "b" ]
03:52
<
clever >
yeah, i'll need to experiment and see what it does
03:51
<
clever >
though the type=oneshot will cause problems...
03:48
<
clever >
boomshroom: for the moment, just rsync over a copy of nixpkgs and ignore channels
03:47
<
clever >
boomshroom: ah, i havent gotten to bed yet
03:47
<
clever >
and if possible, i want to connect to it from a normal irc client
03:46
<
clever >
currently, i'm running it in a terminal, but i want to switch it over to being a service
03:46
<
clever >
so you can use it without approval from the workspace admin
03:46
<
clever >
wee_slack.patch changes it from needing an official api token, to re-using the websocket token from your browser session
03:45
<
clever >
if you run nix-build on this file, it will patch wee_slack.py to work on nixos, and also adjust the type of api token you need
03:45
<
clever >
ah, then youll want what i just wrote
03:44
<
clever >
also, any way to control it when its in that mode?
03:44
<
clever >
on to phase 2, setting it up as a service so it can log without me having to pay any attention
03:43
<
clever >
but ~/logs didnt exist until i just ran mkdir on it
03:43
<
clever >
the config says its logging and that it writes to "%h/logs/"
03:42
<
clever >
i have a plugin connecting to slack, and i want it to simply log things
03:40
<
clever >
do you know much about how the logging works in weechat?
03:39
<
clever >
and you dont even have to create the user or homedir, this section auto-generates a user
03:38
<
clever >
mutantmell: in the pre-start for your service, you create a symlink to the config in the users home directory
03:37
<
clever >
ah, then youll want something more like hydra
03:37
<
clever >
though it may also try to write files there, which could cause issues
03:37
<
clever >
mutantmell: this lets you point it to a directory where the config probably lives
03:37
<
clever >
-d, --dir <path> set WeeChat home directory (default: ~/.weechat)
03:37
<
clever >
[clever@amd-nixos:~/Downloads]$ weechat --help
03:36
<
clever >
mutantmell: ive also just recently started using weechat for a plugin, and am wondering how to get its logging to work right
03:36
<
clever >
nix works better when you do it that way
03:36
<
clever >
mutantmell: its better to pass it on the cmd line
03:35
<
clever >
boomshroom: search for the config.nix file inside nix, and check if the paths in it are arm executables
03:35
<
clever >
boomshroom: i'm going to be heading to bed soon
03:35
<
clever >
boomshroom: i'm guessing that the config.nix inside the nix package has some wrong paths in it
03:33
<
clever >
boomshroom: can you paste the error?
03:33
<
clever >
though, if you want to be able to run it in a terminal, you will need to install it, either seperately, or by adding environment.systemPackages = [ pkgs.weechat ]; between lines 25&26 of my example
03:32
<
clever >
line 21 automatically downloads it
03:32
<
clever >
no need to install the application
03:31
<
clever >
just put that file into /etc/nixos/ and add imports = [ ./snmpd.nix ]; to your configuration.nix
03:31
<
clever >
lines 11-14 is some SNMP config, and line 21 runs snmpd against that file
03:30
<
clever >
mutantmell: ah, then my snmp module would be a perfect example
03:29
<
clever >
mutantmell: what arguments is weechat ran with when acting as a server?
03:20
<
clever >
boomshroom: you man need to manualy run unxz on it, some tar's are not smart enough to figure it out
03:19
<
clever >
this region, modifies the arx package nix-bundle generates, so that the installer script can access your $HOME
03:18
<
clever >
and i'm calling it directly, from a helper script, after everything has been unpacked to ~/nix-install
03:18
<
clever >
thoughtpolice: this uses the ./nix directory for /nix, exposes /home directly, and maps the host /etc to /host-etc, along with passing 3 env vars thru and wiping the rest
03:18
<
clever >
exec .${nix-bundle.nix-user-chroot}/bin/nix-user-chroot -n ./nix -c -m /home:/home -m /etc:/host-etc -m etc:/etc -p DISPLAY -p HOME -p XAUTHORITY -- /nix/var/nix/profiles/profile/bin/enter-phase2
03:17
<
clever >
thoughtpolice: about 2 weeks ago, i redid a large chunk of nix-user-chroot, to allow customizing the chroot env more
03:16
<
clever >
boomshroom: yeah
03:15
<
clever >
boomshroom: the other major feature of this, is that you can run an update-runner inside the namespace, to upgrade itself
03:13
<
clever >
you run that, and it sets up the entire ~/nix-install/
03:13
<
clever >
also, this uses nix-bundle and arx, so the whole thing compiles down to a single 146mb "bash" script
03:13
<
clever >
this will give you an installation that includes the daedalus wallet
03:12
<
clever >
and installedPackages is the primary use right now, other derivations that are pre-installed into it
03:12
<
clever >
line 1 accepts an installationSlug argument, which lets you change the directory
03:11
<
clever >
that manages setting up a mount namespace in ~/nix-install/
03:11
<
clever >
boomshroom: yep
03:09
<
clever >
i just finished a far more complex nix expression
03:07
<
clever >
these paths will be fetched (109.31 MiB download, 751.06 MiB unpacked):
03:07
<
clever >
rewrote it to be a bit more pretty
03:06
<
clever >
i would expect it to have failed by now if it didnt
03:05
<
clever >
i assumed it only did the first step, auto-calling the <nixpkgs> function
03:05
<
clever >
and i'm a pretty advanced user
03:05
<
clever >
i didnt even know it recursed like that until i read the source
03:04
<
clever >
repeat until you run out of -A parts
03:04
<
clever >
if that attr contains a function, it is called with all --arg and --argstr
03:04
<
clever >
it will then index into the .b attribute
03:03
<
clever >
if that attr contains a function, it is called with all --arg and --argstr
03:03
<
clever >
if you supplied -A a.b.c, it will index into the .a attribute
03:03
<
clever >
if that file contains a function, it is called with all --arg and --argstr
03:03
<
clever >
nix-build '<nixpkgs>' searches the search path, nix-build alone tries default.nix in the current dir, and nix-build whatever.nix opens that directly
03:02
<
clever >
when you give a filename to nix-build, it will import that filename
03:02
<
clever >
i didnt notice the 3rd until i got thar far, and didnt feel like optimizing it in a single-line edit box
03:02
<
clever >
and then you need a pkgs.callPackage for make-tar, where you can reuse the 2nd nixpkgs
03:02
<
clever >
then you need a 2nd nixpkgs for the value of crossSystem (which you already had)
03:01
<
clever >
its a bit more complex then that, one min
03:01
<
clever >
you need one nixpkgs with crossSystem set, for the cross compile
03:01
<
clever >
2 of those can be merged
03:01
<
clever >
(import <nixpkgs> { config = { allowUnfree = true; }).google-chrome
03:01
<
clever >
nix-build '<nixpkgs>' --arg config '{ allowUnfree = true; }' -A google-chrome
03:00
<
clever >
it translates very simply, let me type an example
03:00
<
clever >
storeContents = [ { object = nix; symlink = "/nix"; }]; }
03:00
<
clever >
let nix = (import <nixpkgs> { crossSystem = (import <nixpkgs> {}).lib.systems.examples.armv7l-hf-multiplatform; }).nixUnstable in (import <nixpkgs> {}).callPackage <nixpkgs/nixos/lib/make-system-tarball.nix> {
02:59
<
clever >
boomshroom: create a nix file that does
02:55
<
clever >
mduggie: id make it a single PR
02:55
<
clever >
but it will be empty
02:55
<
clever >
it will auto-generate a db.sqlite any time its missing
02:54
<
clever >
which makes every path in that tar valid
02:54
<
clever >
run `nix-store --load-db < nix-path-registration` to restore the db backup
02:54
<
clever >
it will also generate a nix-path-registration file in the root of the tar
02:54
<
clever >
it will generate a tar file with symlink (in my case, /kexec_nixos) pointing to object, and everything object depends on
02:53
<
clever >
object points to the nix 2.0 derivation, and symlink is just a path of your choosing
02:52
<
clever >
boomshroom: so nothing you copied over with tar is "valid"
02:52
<
clever >
boomshroom: you didnt load the db.sqlite backup
02:50
<
clever >
boomshroom: run realpath on it to resolve every level
02:45
<
clever >
just copy whatever you got and see what happens
02:44
<
clever >
boomshroom: these 2 files need to exist, just steal them from a nixos machine for the moment
02:43
<
clever >
ca-bundle.crt ca-certificates.crt
02:43
<
clever >
[clever@amd-nixos:~/Downloads]$ ls /etc/ssl/certs/
02:39
<
clever >
because it wants to use the x86 bash for echo
02:39
<
clever >
and the device will NEVER be able to compile its own files, even a simple "echo foo > $out"
02:38
<
clever >
boomshroom: then nix will know that the compiler needs x86, and will force you to setup build slaves
02:38
<
clever >
boomshroom: if its a proper cross-compiler, then you need to pass the cross-compile flags to nixpkgs when you import <nixpkgs> { ... };
02:31
<
clever >
otherwise it will fail to create things in /nix/store/
02:30
<
clever >
whole thing
02:29
<
clever >
the oposite of useradd is userdel
02:28
<
clever >
adduser or useradd?
02:28
<
clever >
how did you create them?
02:27
<
clever >
thats how single-user nix works on most linux distros
02:27
<
clever >
then you can just omit build users and give the primary user full ownership
02:26
<
clever >
if it never gets root, and it has +w to the store, it works without build users
02:25
<
clever >
you only need build users if nix is being ran as root
02:21
<
clever >
then you have dbus that crashes the entire program if /etc/machine-id is missing, lol
02:21
<
clever >
-qR just automagically knows what it depends on (if its written right), and just works
02:20
<
clever >
yeah, thats the magic of nix
02:19
<
clever >
nix will try to delete itself pretty quickly if you do anything like a GC
02:19
<
clever >
make-system-tarball includes a "backup" of the db.sqlite you can restore, because your nix doesnt believe itself to be a valid store path
02:19
<
clever >
boomshroom: ah, you wanted `nix-store -qR` or the `make-system-tarball` previously mentioned
02:18
<
clever >
boomshroom: nice, which route worked?
2018-03-08
23:16
<
clever >
gemishhood: what error did npm give?
23:08
<
clever >
tinco: the doc i just linked, is auto-generated via javascript, so it cant really be indexed
23:00
<
clever >
gemishhood: "works", but the css is missing, and the title bar is gone, the window can only be moved with alt+left drag
22:56
<
clever >
gemishhood: also, use a pastebin service, or risk the wrath of gchristensen :P
22:55
<
clever >
gemishhood: ah, you have to run `npm install .` i think, to download those deps
22:55
<
clever >
gemishhood: and does electron work there?
22:54
<
clever >
gemishhood: is there a package.json file in the git directory?
22:53
<
clever >
gemishhood: what happens if you just run "electron ." in the soundnode directory?
22:51
<
clever >
rawtaz: xfce4-settings-editor
22:51
<
clever >
rawtaz: i had to boot the backup xterm "desktop env" and manually run the xfce version of regedit to delete the resolution config
22:50
<
clever >
rawtaz: somewhere in $HOME
22:50
<
clever >
even if that resolution config causes Xorg to segfault, lol
22:50
<
clever >
rawtaz: i use xfce, and it restores all of my resolutions at login
22:49
<
clever >
rawtaz: .xprofile could be used for that, since nixos will source it and then continue booting X up
22:43
<
clever >
johnhamelink: and nixos uses ~/.xprofile (sourced) and ~/.xsession (executed) for its x init stuff
22:41
<
clever >
johnhamelink: one min
22:38
<
clever >
manveru: i genrally ignore systemd warnings like that
22:38
<
clever >
rawtaz: and keep in mind, nixos uses the nixos channel, which currently points to 17.09
22:37
<
clever >
rawtaz: and did you run nix-channel --update as root?
22:37
<
clever >
rawtaz: does `sudo nix-channel list` show channel called nixos?
22:25
<
clever >
you run it on the directory
22:25
<
clever >
gemishhood: you dont run it on the ELF file
22:24
<
clever >
gemishhood: you have to run electron, not Soundnode
22:12
<
clever >
joepie91: dynamic
22:11
<
clever >
joepie91: static builds are actually more likely to work on nixos
22:10
<
clever >
gemishhood: try running the electron from nixpkgs on the directory with package.json, you can get it via `nix-build '<nixpkgs>' -A electron`
22:02
<
clever >
or was it 4000 PR's?
22:02
<
clever >
a few days ago i think?, when ryan was making about 400 PR's
21:14
<
clever >
Judson: and you can play with the value of NIX_PATH and -I on that command, to see how it works
21:14
<
clever >
Judson: basically, run nix-instantiate --find-file nixpkgs, and echo $NIX_PATH
21:12
<
clever >
Judson: then youll want import /home/clever/.nix-defexpr/channels/nixpkgs {} or similar
21:11
<
clever >
Judson: so nix-channel --list shows nixpkgs?
21:11
<
clever >
boomshroom: the issue with current master, is that it needs nix2 to even parse release.nix
21:10
<
clever >
boomshroom: ah, maybe it was one of the 12pre versions i had tested it on
21:10
<
clever >
Judson: which depends on which user that channel is on, did you add it with or without sudo?
21:10
<
clever >
Judson: replace <nixpkgs> on line 3 of your default.nix with the full path to nixpkgs
21:09
<
clever >
so there is no way to access the channel called nixpkgs using <brackets>
21:08
<
clever >
Judson: but <nixpkgs> maps to the nixos channel on nixos
21:08
<
clever >
Judson: nix-env directly uses the channels, so you can access both seperately
21:08
<
clever >
boomshroom: try an older nix branch, maybe 1.11.15
21:07
<
clever >
Judson: so one of your channels is newer then the other
21:07
<
clever >
Judson: kubectl is only on nixpkgs, and is not on nixos
21:07
<
clever >
Judson: ah, i checked the gist
21:06
<
clever >
Judson: what is the exact nix-env command that works, and nix-shell that fails?