2019-11-03

<clever> because its read-only
<clever> ilya-fedin: nerdfonts will never be written to .ro-store
<clever> ilya-fedin: the size is fixed when the image was made, and it never has free space
<clever> ilya-fedin: you cant, its read-only
<clever> JonReed: ${my-var} should work in bash
<clever> pie_: and all-packages.nix has an area where it calls that function a bunch
<clever> pie_: the result of linuxPackagesFor is a linuxPackages set
<clever> pie_: yeah, there should be a block in all-packages.nix, that generates things like linux_5_2 with callPackage
<clever> inkbottle: nix-shell gets the dev stuff automatically
<clever> ,library inkbottle
<clever> pie_: you probably want to start by adding a kernel under os-specific/linux, callPackage'ing in all-packages.nix, and then run linuxPackagesFor linuxSurface; to generate a linuxPackages set
<clever> pie_: the stuff in all-packages mostly deals with building modules for every kernel
<clever> inkbottle: probably, start with `nix-shell -p cairo` and see what fails next
<clever> yeah
<clever> which only updates the nixos channel
<clever> `nixos-rebuild --upgrade` will automatically do `nix-channel --update nixos` for you
<clever> and sudo should be setting the new $HOME correctly
<clever> probably just nix-channel --update
<clever> sudo chown brad -R /home/brad/.cache/
<clever> you should own everything in your ~/.cache
<clever> ah
<clever> the permissions on your /nix/var/nix/profiles/per-user/brad may be broken
<clever> nix-channel --update also shouldnt need root
<clever> bdju: and there should now be a home-manager in `ls -lh /home/brad/.nix-defexpr/channels/`
<clever> i would just delete the symlink and remake it, pointing to the right path
<clever> it should look like this
<clever> lrwxrwxrwx 1 clever users 44 Oct 11 2015 channels_root -> /nix/var/nix/profiles/per-user/root/channels
<clever> lrwxrwxrwx 1 clever users 46 Jun 6 2018 channels -> /nix/var/nix/profiles/per-user/clever/channels
<clever> $ ls -lh ~/.nix-defexpr/
<clever> thats probably whats wrong
<clever> bdju: oh. /home/brad/.nix-defexpr/channels should be pointing to brad's channels, not roots
<clever> bdju: nix-channel --update ?
<clever> bdju: ls -lh /home/brad/.nix-defexpr/channels/
<clever> bdju: ls -lh /home/brad/.nix-defexpr/channels
<clever> bdju: what is the current value of NIX_PATH?
<clever> bdju: typically, NIX_PATH will include a dir managed by nix-channel, is it present in `nix-channel --list` ?

2019-11-02

<clever> hodapp: pkgs.pkgsi686Linux.stdenv
<clever> don_quijote[m]: its probably video driver issues, you can just ignore them and keep installing, then figure things out after its installed
<clever> dhess: yeah
<clever> dhess: i think gchristensen solves host keys by just publishing the public on bootup
<clever> (as pure as darwin can be)
<clever> ah, i was thinkign about the darwin images, since they are also pure, lol
<clever> dhess: oh, are you talking about pure nixos images, or darwin images?
<clever> dhess: any secrets that happen to be in thi dir during boot, will be on the cdrom while apply.sh is running
<clever> default = "/var/lib/macos-vm-persistent-config";
<clever> dhess: line 24 put the ssh host keys into persistentConfigDir
<clever> dhess: this will merge persistentConfigDir and guestConfigDir together, to make the cdrom image
<clever> dhess: the ssh host keys already have an escape hatch for that, which iohk is using for secrets
<clever> gchristensen: i would try to run it as a dedicated user, preferably one per app
<clever> don_quijote[m]: `journalctl -u display-manager`
<clever> don_quijote[m]: any errors in the journal for display-manager?
<clever> don_quijote[m]: what is the error?
<clever> don_quijote[m]: does it give an error?
<clever> it will fail the same way inside an FHS
<clever> your using the wrong version of libnw
<clever> FHS isnt the answer
<clever> hpfr: gdb time!
<clever> hpfr: run nix-store -r on that path, to make it exist
<clever> hpfr: that appears to be shipping its own copy of libnw, which isnt the best solution
<clever> hpfr: that should work....
<clever> hpfr: what does patchelf --print-rpath say?
<clever> hpfr: what error?
<clever> hpfr: you need to use ${nwjs}/share/nwjs/lib in the RPATH
<clever> its in share/nwjs/lib
<clever> hpfr: autoPatchElf only works for libraries in $out/lib/
<clever> hpfr: and what is the extra column for the package you picked?
<clever> hpfr: try without -1 and -w
<clever> hpfr: where did nix-locate say libnw.so was?
<clever> hpfr: run `file opt/Onlykey/nw` in a terminal
<clever> hpfr: yes
<clever> hpfr: run the file program on that binary
<clever> hpfr[m]: is the binary your patching 32bit or 64bit?
<clever> Ericson2314: yeah
<clever> 2019-11-02 12:49:12 < clever> Ericson2314: https://github.com/cleverca22/nixpkgs/tree/vc4 is what ive got so far
<clever> 2019-11-02 13:14:37 < clever> https://gist.github.com/cleverca22/8a8958521dd57995b32a40ac2c4e1628 is what i wrote before integrating it properly into nixpkgs
<clever> Ericson2314: the problems i can remember having, is getting c++ support in the gcc, and getting the gcc to be able to find crt0 and newlib
<clever> this seems to at least start to eval, and now its building something
<clever> [clever@amd-nixos:~/apps/nixpkgs-vc4]$ nix-build -A vc4-gcc-stage1
<clever> Ericson2314: i think its trying to cross-compile the binutils to the target?
<clever> [clever@amd-nixos:~/apps/nixpkgs-vc4]$ nix-build test.nix -A vc4-binutils
<clever> error: Package ‘binutils-vc4’ in /home/clever/apps/nixpkgs-vc4/pkgs/development/misc/vc4/binutils.nix:4 is not supported on ‘vc4-none’, refusing to evaluate.
<clever> no idea then
<clever> magnetophon: what about `type pinentry` ?
<clever> magnetophon: and then try signing again?
<clever> magnetophon: and if you restart the agent with gpg-agent /bye ?
<clever> magnetophon: sounds dbus related, any differences if ran as root?
<clever> and then anything using glib stuff must wrapGApps all of its own binaries
<clever> nschoe: where is a wrapGApps function already, it may need to be modified to also persist GIO_MODULE_DIR
<clever> nschoe: and there are helper functions in the stdenv to add to a : seperated list
<clever> nschoe: then something else will just use wrapProgram to persist the current value of GIO_MODULE_DIR
<clever> nschoe: your setup hook likely just needs to add @out@ to GIO_MODULE_DIR
<clever> infinisil: there is a pkgs.substituteAll that does almost that
<clever> nschoe: addEnvHooks will run your thing for every buildInput, but you likely want to just export a var and not define any function
<clever> wedens[m]: not currently, but it could be written, callCabal2nix basically does the same thing, it just uses cabal2nix to generate an expr, then callPackage to load it, and whatever it referenced
<clever> pkgconfig has an example of a setup hook
<clever> yeah
<clever> but nothing that uses glib-networking later on
<clever> nschoe: thats only wrapping the programs under libexec, for glib-networking itself
<clever> so if you put glib-networking into the buildInputs, then the glib-networking setup hook gets ran
<clever> a setup hook behaves similar to a shellHook, but works one derivation later
<clever> wrapProgram just creates a shell script to wrap a program, 100's of examples are in nixpkgs
<clever> nschoe: for setup hooks, look at things like pkgconfig
<clever> nschoe: at build and shell time, you can use a setup hook to set that var, then something else needs to wrapProgram the final binaries
<clever> but i havent found where yet
<clever> i expect its there, because systemd can report it when services stop
<clever> something ive been wanting to do, is see how much network a given cgroup or pid is using
<clever> and then include it into the FHS, like any other library
<clever> just make a normal package, that has a library in $out/lib/
<clever> and you dont need to use the extra commands any
<clever> so just throw the libraries into $out/lib and it should work out
<clever> i checked under `steam-run bash`, and /lib and /usr/lib have identical contents
<clever> why?
<clever> wrl: does it even need to be using an FHS env?
<clever> wrl: try adding files to $out/lib/dssi and see what happens
<clever> wrl: i think /usr is just a symlink
<clever> wrl: try putting it at /lib/dssi instead

2019-11-01

<clever> __marlene__: you can also use --option key value, to change flags
<clever> __marlene__: probably needs a restart
<clever> __marlene__: `nix show-config | grep time`
<clever> yeah
<clever> __marlene__: what happens if you run wget on that url?
<clever> __marlene__: and does it fail after the retry?
<clever> __marlene__: can you paste the exact error it gives?
<clever> does it fail on the same url?
<clever> __marlene__: try re-running nixos-install
<clever> __marlene__: does it have internet access?
<clever> bdju: yes
<clever> bdju: either define a set of packages in config.nix and install it with nix-env, or use home-manager
<clever> zeta_0: thats weird
<clever> zeta_0: you can use sessionCommands to activate it also
<clever> here, i can see 4 points in time, when nixos-unstable changed to the next major release
<clever> lrwxrwxrwx 1 root root 82 Dec 31 1969 /nix/var/nix/profiles/per-user/root/channels-77-link/nixos -> /nix/store/509nw45vaf71nmr5h3dgjg6khqnxwbkf-nixos-20.03pre196201.07d4df59626/nixos
<clever> lrwxrwxrwx 1 root root 82 Dec 31 1969 /nix/var/nix/profiles/per-user/root/channels-73-link/nixos -> /nix/store/2x5aj7gn0chswlnaqfxknk8wqz4rz9y0-nixos-19.09pre171786.34aa254f9eb/nixos
<clever> lrwxrwxrwx 2 root root 82 Dec 31 1969 /nix/var/nix/profiles/per-user/root/channels-67-link/nixos -> /nix/store/yjzlzz7n7fa6007wkdfcvkg0abfd1064-nixos-19.03pre154487.0a7e258012b/nixos
<clever> lrwxrwxrwx 2 root root 82 Dec 31 1969 /nix/var/nix/profiles/per-user/root/channels-66-link/nixos -> /nix/store/hy71ggl1nahcj0wpinm746dr3rxiyxnd-nixos-18.09pre150708.083220867c7/nixos
<clever> zeta_0: then this will show what version of nixpkgs is within each
<clever> [root@amd-nixos:~]# ls -l /nix/var/nix/profiles/per-user/root/channels*/nixos
<clever> zeta_0: and this will show every generation
<clever> [root@amd-nixos:~]# nix-env --profile /nix/var/nix/profiles/per-user/root/channels --list-generations
<clever> erba: long-term, you want the fix for https://github.com/NixOS/nix/issues/3142 which i think is only in nix master, and not in a channel yet
<clever> erba: short term, add `sandbox = false` to nix.conf or use `--option sandbox false`
<clever> and you can always `nix-channel --rollback` to undo, and instantly fix things
<clever> you will only notice things are broken after a `nix-channel --update`
<clever> zeta_0: varies, depends on when people make breaking changes
<clever> ajs124: -small is why, hydra doesnt wait for everything to finish building
<clever> ajs124: which channel are you on?
<clever> bbarker: its under systemd.services.NAME.serviceConfig
<clever> ajs124: when it starts building, it also tells you the drv path
<clever> ajs124: nix-store --query --deriver /nix/store/foo
<clever> ajs124: nix-diff the 2 drv files
<clever> bbarker: yes, you put it into the .serviceConfig of a service, in a nixos module
<clever> bbarker: those flags can go under the .serviceConfig
<clever> bbarker: `man systemd.exec`
<clever> kolaente: for postgresql, you would pgdump the DB's, upgrade things, then re-import the DB's
<clever> bbarker: all systemd services
<clever> kolaente: nixos uses the stateVersion to keep you on an older postgresql, until you read the release notes, and follow the migration directions
<clever> nixos has no way to do that
<clever> so, you must repair the ~/.ssh/known_hosts for every remote machine
<clever> updating to the new type, results in mitm warnings for every remote machine that ssh's into the nixos box
<clever> kolaente: openssh host keys for example, changed the default type
<clever> kolaente: that not currently implemented, and sometimes the actions you must take extend to other machines
<clever> any attempt to change stateVersion (automated or manual) will result in postgresql loosing the database
<clever> and nixos uses stateVersion to figure out what format you used when you first installed, so it can keep using that format
<clever> for example, postgresql likes to change the on-disk format of the db's with every version
<clever> zeta_0: the stateVersion shouldnt be changing, and the whole point is to record what version your "state" is
<clever> ,stateVersion kolaente
<clever> kolaente: pretty much
<clever> so youll only start to notice it as you update again in the future
<clever> zeta_0: the difference is more that unstable updates often, and may sometimes break your configuration
<clever> zeta_0: all nix-channel --list does, is cat ~/.nix-channels
<clever> zeta_0: yes, each user has its own channel list
<clever> bbarker: security.pam.loginLimits
<clever> wrl: the import function will take the path to a file, and return whatever nix expr is in that file
<clever> 100's of examples are in nixpkgs
<clever> yes
<clever> then use wrapProgram to add a LD_LIBRARY_PATH to the main binary, that is loading the plugins
<clever> you can just use a bash for loop, to apply the patchelf to everything automatically
<clever> wrl: even if you fix LD_LIBRARY_PATH, the interperter is wrong, so you cant run any binaries
<clever> wrl: why do you not want to use patchelf?
<clever> enteee: nix-shell can test everything except for the copy to /nix/store/
<clever> enteee: if you want to test things, you either need to re-export $out to point somewhere else, or use nix-build to test
<clever> enteee: installPhase will never work in nix-shell, since only nix-build gives you write access to $out
<clever> enteee: yes, and if you lack +w access, it will do it via nix-daemon
<clever> enteee: nix-build should just work on non-root without any env vars
<clever> CMCDragonkai: and if you use too much, then allocations will just begin to fail, causing all kinds of problems
<clever> CMCDragonkai: if you try to write too much to a tmpfs, it will swap out the same as normal app ram, whatever was used the least
<clever> yep
<clever> i should get to bed, its now 3am
<clever> and `devnull` in this context, is a python file handle, that results from opening /dev/null on the host
<clever> so it will still EOF shortly
<clever> and if stdin is not devnull, nixops will write a string to the pipe, then immediately close it
<clever> as long as you dont stumble upon any setuid binaries (the setuid bit will just silently not work)
<clever> of note, you can also strace things like systemd-run and nsenter, and it will seamlessly trace into the child namespace in most cases
<clever> if cat was blocking for user input, you would see it in the process list
<clever> it looks like it will ssh into root on itself, and then do `nixos-container run ...`
<clever> ah, generating the stateVersion on first boot
<clever> stderr may be a pipe or stdout of something
<clever> stdout is always a pipe
<clever> stdin is either devnull or a pipe that will later be written to
<clever> Miyu-saki: all of stdin/out/err are pipes, likely going to the parent process
<clever> CMCDragonkai: the dhcp config in here tells machines to run boot.php (legacy name, lol) which then says to chainload netboot.ipxe (which release.nix is generating for you)
<clever> CMCDragonkai: and for more productiony usage: https://github.com/cleverca22/nixos-configs/blob/master/netboot_server.nix#L44-L48
<clever> Miyu-saki: 0/1/2 are stdin/out/err
<clever> Miyu-saki: also check `ls -l /proc/17720/fd/`, that shows all open file handles
<clever> Miyu-saki: with the strace still attached, try the ctrl+d and see what happens?
<clever> CMCDragonkai: that generates a bash script to run the netboot image in qemu, with the right flags
<clever> Miyu-saki: then its waiting for something to happen, which it previously registered in epoll
<clever> CMCDragonkai: it auto-generates an ipxe script that will handle that for you, which you can chainload
<clever> CMCDragonkai: and how did it not work?
<clever> Miyu-saki: what does `strace -p 17720 -f` say?
<clever> CMCDragonkai: are you doing rebuild switch or editing the config and building a new image?
<clever> Miyu-saki: pastebin the output of `ps -eH x`
<clever> CMCDragonkai: you can also make .rw-store larger then the total amount of ram, if you provide swap
<clever> CMCDragonkai: and the unionfs is used to make that squashfs writeable,
<clever> Miyu-saki: check `ps -eH x` and see what the child of nsenter is, then try to strace that
<clever> CMCDragonkai: then mounted to .ro-store (line 39)
<clever> CMCDragonkai: a squashfs is generated (line 68) and baked into the initrd (line 79)
<clever> CMCDragonkai: yeah
<clever> Miyu-saki: but maybe the child (cat) is just cat'ing stdin? ...
<clever> Miyu-saki: i dont think nsenter should ever terminate on eof, it should waitpid() for the child to exit
<clever> CMCDragonkai: yep, its a union of .ro-store and .rw-store, so you want to add a size fo .rw-store, if you want more room on /nix/store/
<clever> CMCDragonkai: of note, the nix store is not put on /
<clever> CMCDragonkai: that works
<clever> CMCDragonkai: you can also set it on the fileSystems entry too
<clever> CMCDragonkai: but you can freely `mount -o remount,size=1234g /path/to/mount` to resize it
<clever> CMCDragonkai: by default, a tmpfs will set its size to 50% of your ram
<clever> they went the open-source route, and just opted for no gpu
<clever> likely due to unfree driver problems
<clever> the motherboard clearly has a GPU option, but system76 didnt offer any gpu options
<clever> i believe system76 resells other laptop hardware, after testing that it has good linux support, and sells it with linux pre-installed
<clever> system76 kudu
<clever> you could almost halve the size of the thing, with little changes
<clever> Miyu-saki: another thing of note, is how empty the laptop is
<clever> Miyu-saki: https://imgur.com/dXfM51B
<clever> Miyu-saki: and the 4 groupings around it, are where the gpu ram went
<clever> Miyu-saki: yeah
<clever> Miyu-saki: https://imgur.com/TWsIo7J my gpu is distinctly missing, lol
<clever> Miyu-saki: ah, i last saw that under the name bumblebee, and none of my hardware supports it
<clever> Miyu-saki: hadnt heard of it
<clever> Miyu-saki: weird
<clever> zeta_0: looks right at a glance, try it and see what happens
<clever> drakonis1: HDCP is used to encrypt video as its sent over an HDMI cable, so only approved devices (tv's) can play the content, and un-approved devices (capture cards) cant
<clever> notgne2: hdcp has also been cracked wide open, so the only thing stopping you is law suits if you try to sell a product to strip crypto
<clever> probably
<clever> notgne2: so any drm riddled player wont trust the kernel, and wont give it a copy of the video stream
<clever> notgne2: yeah, if i load an unsigned kernel module (anything built with nix), then the kernel is tainted and could be sniffing the video stream
<clever> notgne2: it does things like refuses to playback content until the kernel can proove that the kernel hasnt been modified, and the hdmi channel is encrypted
<clever> slack1256: yes, see https://lwn.net/Articles/740916/
<clever> notgne2: digital rights management
<clever> one stops piracy, the other improves gpu performance
<clever> infinisil: for extra confusion, linux has both drm, and drm (digital rights management, and direct rendering manager)
<clever> zeta_0: yep
<clever> that involves an application negotiating a secure channel, from the app to the display, and ensuring its protected along the entire path
<clever> infinisil: this mentions how linux has hdcp support, so it can do hdmi crypto on chromebooks
<clever> zeta_0: revision, its a sha1 hash of a git commit object
<clever> zeta_0: rev is not a revision
<clever> infinisil: its probably open-source code, to support drm, which is still optional (normal config flags)
<clever> infinisil: DRM (the other drm) is already in the kernel
<clever> co1or: there is an allowUnfree = true; flag, that just blanket turns on all unfree stuff
<clever> steam is marked as unfree for example, since the source isnt available and some components (games) must be paid for
<clever> co1or: by default, unfree software is hidden and disabled, and you have to opt-in to use it
<clever> its own thing
<clever> co1or: ive got chromium (and youtube), plus steam (and via proton, many windows games) working just fine on nixos
<clever> zeta_0: click on the most recent commit in the github repo
<clever> zeta_0: use github to look up the current revision
<clever> zeta_0: rev should be a git revision
<clever> zeta_0: you want to use pkgs.fetchFromGitHub { owner = "gibiansky"; repo = "IHaskell"; rev = "something"; sha256 = "something"; }
<clever> zeta_0: there is no builtins.fetchFromGitHub
<clever> zeta_0: it would be better to use pkgs.fetchFromGitHub
<clever> but you have the option to tell the firmware to omit this boot stub, and then you can prepend your own to the kernel
<clever> samueldr: i think the SCR register stuff is to do with locking out the trustzone layer, before it jmp's into the linux kernel
<clever> samueldr: for the rpi, you have the option of booting while in the trustzone, so you can make use of it yourself
<clever> zeta_0: they should all be in the nix manual
<clever> GlennS: then just shove that into systemPackages like any other package, and nixops will copy it along
<clever> > pkgs.runCommand "chamber-2.7.3" {} "mkdir -p $out/bin ; cp ${./chamber-v2.7.3-linux-amd64} $out/bin/chamber"
<clever> then you just need a package that drops it into $out/bin
<clever> GlennS: if you run `file` on the binary, what does it say?
<clever> GlennS: static or dynamic elf?

2019-10-31

<clever> m3thos: i have had cuda work before on nixos, not sure what would happen if you try to use it under a container though
<clever> m3thos: and once the configuration.nix is copied, just nixos-install as normal, which will remake the whole system, and update the bootloader
<clever> m3thos: nixos-generate-config will handle the fstab level stuff
<clever> m3thos: depending on how it boots, you may need to fix the boot.loader.grub.device in configuration.nix, to point to the new device
<clever> m3thos: if you just want to install the same software, all you have to copy is configuration.nix