2019-06-11

<clever> li_matrix: does it need to be a rich format? could it just be a dumb space seperated string?
<clever> li_matrix: there is no way to convert a nix value back into a nix expression, with current nix
<clever> li_matrix: nix-build and most parts of nix-instantiate cant function inside a nix sandbox
<clever> ashkitten: it might also work to just give nix-channel a path to a .tar.gz directly
<clever> so you control when that happens
<clever> ashkitten: and then it will update whenever you run nix-channel --update
<clever> ashkitten: a channel is just a directory with a nixexprs.tar.gz and a binary-cache-url (both are files)
<clever> ashkitten: exactly 1 hour, but you can change it with a nix.conf entry, or --option
<clever> [root@system76:~]# nix show-config | grep tarball-ttl
<clever> tarball-ttl = 3600
<clever> ashkitten: it will check it again about an hour after the last time it checked
<clever> m1cr0man: can you update the target branch on your PR?

2019-06-10

<clever> find -name '*foo*'
<clever> it supports *
<clever> m1cr0man: that will automatically run a qemu vm that does the entire test
<clever> m1cr0man: [clever@amd-nixos:~/apps/nixpkgs]$ nix-build nixos/tests/bind.nix
<clever> m1cr0man: one min
<clever> store*
<clever> so the profiles/db are on the same FS as the stoe
<clever> i would put the entire /nix onto that LV
<clever> oh, biggest limitation, zfs cant shrink, so you cant reclaim space for things like swap if you wanted
<clever> (just 2 partitions)
<clever> but with recent changes to nixos, you can now do (zfs on luks) + (swap on luks)
<clever> swap on zfs has issues, which is why i previously did zfs+swap on lvm on luks
<clever> and then all filesystems share the free space within the pool
<clever> the zfs pool is basically the lvm vg
<clever> joepie91[m]: you can basically think of it like, what if every single file, was an LV within lvm? lol
<clever> joepie91[m]: then you dont have to staticly decide how much space to give to each FS
<clever> joepie91[m]: i would just go with zfs on all installs
<clever> joepie91[m]: the grub config on line 17/18 assumes that you are mounting a partition directly to /boot/ and will misbave if you happen to be using /boot on / or other weird things
<clever> so zfs would stop snapshotting /nix/store/
<clever> i used that on my laptop, to move /nix from the / dataset to its own zfs dataset
<clever> so you can then boot that any time you want, to perform major changes or repair-work
<clever> joepie91[m]: this module dumps an entire nixos installer in /boot/, and adds a grub option for it
<clever> joepie91[m]: that will leave plenty of room for this if you choose to use it
<clever> joepie91[m]: i would make the ESP 512mb or maybe even 1g
<clever> joepie91[m]: yep
<clever> joepie91[m]: ESP gets mounted to /boot/ so all kernels land in it
<clever> joepie91[m]: so you would have 1 partition for ESP, and then 1 for the lvm PV
<clever> joepie91[m]: the ESP must be its own partition, with just the vfat in it
<clever> joepie91[m]: but about the only reason i can see to do that is to be able to resize it easily
<clever> joepie91[m]: ive never ran into problems with swap on lvm
<clever> export NIX_PATH=nixpkgs=https://github.com/nixos/nixpkgs-channels/archive/nixos-unstable.tar.gz
<clever> ashkitten: you can put the URL to a tar in NIX_PATH
<clever> gchristensen: any idea why ofborg didnt flag the original PR? it looks like the build timed out, so it flagged it as good?
<clever> yeah, should be a pretty simple PR
<clever> m1crOman: and somebody is already asking whats wrong, you can now answer them!
<clever> and pr #61619
<clever> ctrl+f reveals bind: 9.12.4-P1 -> 9.14.2
<clever> https://hydra.nixos.org/build/94525202 is the first failing build, click on the rev pair under `changes` and youll see the diff for nixpkgs
<clever> so this leaked into nixos-unstable
<clever> but bind isnt configured to block channel updates
<clever> and the tests did catch it!
<clever> m1crOman: bc94dcf5002 is the git rev of my current nixpkgs
<clever> "19.09pre179307.bc94dcf5002"
<clever> [clever@amd-nixos:~/notes]$ nix eval nixpkgs.lib.version
<clever> i wonder why the tests didnt catch that
<clever> fix should be easy then
<clever> lol
<clever> m1crOman: against which command/process?
<clever> ah
<clever> m1crOman: where did you see the error then?
<clever> m1crOman: journalctl -u bind -f -n30
<clever> m1crOman: can you pastebin the journal logs?
<clever> m1crOman: systemd should run prestart before starting the service, and auto-gen one
<clever> yeah, if i'm reading the above page right, windows just natively supports running from disk images, neat
<clever> if i'm reading this right, you can just drop a .vmdk file onto a harddrive, and tell windows to boot from it
<clever> without any way to write disk images to disks
<clever> i went nuts and researched how to boot linux from windows :P
<clever> and the crazy rabbit hole i ran down is entirely un-needed, lol
<clever> joepie91[m]: nixos-install is installed on all nixos machines, just format the new disk, mount it to /mnt, and proceed as normal
<clever> joepie91[m]: then you dont even need netboot
<clever> joepie91[m]: what OS?
<clever> joepie91[m]: is there any existing OS on the target desktop?
<clever> joepie91[m]: yeah, i wrote it ages ago
<clever> joepie91[m]: git submodule init ; git submodule update
<clever> so after you netboot, you can just --add and --update to any channel you want
<clever> nixos-install just uses whatever <nixpkgs> is when it is ran
<clever> joepie91[m]: yep
<clever> joepie91[m]: but as with the iso/usb, you can mess with nix-channel before you nixos-install, and it will use the new channel
<clever> joepie91[m]: yeah
<clever> yep, it should just work
<clever> joepie91[m]: just tell the bios to network boot, and plug it into the laptop's ethernet port
<clever> joepie91[m]: and nixos-rebuild switch that laptop
<clever> joepie91[m]: you would need to take an existing nixos laptop, clone my repo, and add /path/to/netboot_server.nix to the imports of configuration.nix
<clever> joepie91[m]: thats how i setup my current nvme+efi laptop
<clever> joepie91[m]: you can also do a `boot.loader.grub.efiInstallAsRemovable = true;` after booting via legacy pxe
<clever> joepie91[m]: i have uefi netboot code on line 93, but ive not really had much luck getting it to work before
<clever> and the laptop will share its wifi to that device over the ethernet
<clever> joepie91[m]: anything you plug into the ethernet can now netboot
<clever> joepie91[m]: add this to the imports section of a laptop's configuration.nix, point the wan option on line 54 to the wifi card, and the lan option to the ethernet
<clever> joepie91[m]: one min
<clever> gchristensen: did --query --roots reveal anything?
<clever> gchristensen: it deleted just fine, what does `nix-store --query --roots` say for your path?
<clever> gchristensen: let me check your original script closer...
<clever> gchristensen: dang, it can eval an expr, but it wont build it!
<clever> error: path '/nix/store/1d2hm2z1922m7yah8m5bjjxyricpg5p5-hi' is not valid
<clever> [clever@amd-nixos:~]$ nix copy '(with import <nixpkgs> {}; writeText "hi" (writeText "there" "lmao"))' --to file:///home/clever/cache2/
<clever> gchristensen: i would expect that to work, but nix copy has weird behaviour you can take advantage of, let me see
<clever> gchristensen: it also cant be an argument to the script
<clever> gchristensen: dont export the variable
<clever> Henson: nix-store --query --roots
<clever> your nixpkgs is old and lacks that feature
<clever> NYXT: yeah, the ... is what allows it to ignore other arguments
<clever> NYXT: and what is line 56 of /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/build-support/appimage/default.nix ?
<clever> NYXT: can you pastebin your code and the exact error?
<clever> NYXT: all other arguments are passed to buildFHSUserEnv
<clever> NYXT: at a minimum, it needs name, src, and optionally extraPkgs
<clever> > appimageTools.wrapType2
<clever> mpickering: can you paste your full nix expr?
<clever> mpickering: it looks like the configure script is using #!/bin/bash, which doesnt exist
<clever> mpickering: can you paste your full nix expr?
<clever> mpickering: did you set buildCommand?
<clever> mpickering: looks like unpack phase doesnt have a disable flag, you just want unpackPhase = ":";
<clever> mpickering: your thinking of dontUnpack i believe
<clever> m1crOman: :D
<clever> you can just set interfaces = []; in configuration.nix for testing
<clever> Henson: yeah, you can try setting it to [] to just force it to figure it out, and maybe file a pr if you think thats worth being the real default
<clever> Henson: ah, that will do it
<clever> Henson: and thats 2 examples of how i configure dhcpd
<clever> Henson: yeah
<clever> Henson: did you check the journal?
<clever> pie_: i would just keep home in /home, and swap things around when not booted into the os
<clever> pie_: try blkid and lsblk
<clever> pie_: and for your home= problem, you need to use mountpoint=legacy and fileSystems.whatever.neededForBoot = true; to make nixos mount it early enough, or it may createHome before it mounts
<clever> and nvme is always at a path like nvme0n1p?
<clever> Gopal[m]: the wrapped binary uses a shell script to add plugins
<clever> zfnmxt: what part of it is broken and needs to be changed
<clever> but then it wont regenerate properly
<clever> zfnmxt: and there is things to insert things into the generated modules and display sections and stuff
<clever> zfnmxt: youll also want to look at the config nixos generates after playing with those options
<clever> region*
<clever> and others in that regon
<clever> you can abuse the 1st fact to just change $HOME and have a 2nd set of config, without a 2nd user
<clever> the few that dont, will look it up in /etc/passwd
<clever> pie__: nearly all programs just obey $HOME

2019-06-09

<clever> pie__: i would just set home= right in configuration.nix
<clever> windowed*
<clever> karetsu: you can also install the same package and just run it without those flags, to get a windows native player
<clever> so you can just set-it, and forget-it
<clever> and it runs that on bootup, without any login prompt
<clever> karetsu: the --tv --fullscreen, makes it behave like the plex app on a lot of embedded devices
<clever> karetsu: i'm running this on a dedicated machine, hooked up to my tv
<clever> karetsu: i notice you you also have plex enabled, one min
<clever> cabal install wont really help either
<clever> that should just work
<clever> yeah, GHCPKG is doing it
<clever> karetsu: and then NIX_GHC should be a shell script that changes the package-db path?
<clever> karetsu: what is it doing?
<clever> karetsu: is /run/current-system/sw/bin/xmonad a shell script?
<clever> karetsu: its not in nix-env, that would have shown ~/.nix-profile from `type`
<clever> karetsu: is xmonad in your systemPackages?
<clever> karetsu: what does `type xmonad` return?
<clever> karetsu: how are you trying to compile xmonad?
<clever> karetsu: you must install xmonad by enabling it here, that will configure xmonad to be able to find XMonad.hs
<clever> mac10688: yeah, just put haskellPackages.xmobar into the systemPackages
<clever> mac10688: thats the way i prefer doing it, so you can just save the config file and get everything back in an instant later on
<clever> m1crOman: nixops doesnt know about the remote config, so you have to copy the remote hardware-configuation.nix and configuration.nix over, and merge them all into your nixops files
<clever> m1crOman: i'm managing my nas like that
<clever> m1crOman: nixops doesnt support using zfs at install time, but if you have an existing install on zfs, and use the "none" backend, you can just shove all the zfs config into your nixops files
<clever> m1crOman: nixops also makes managing remote servers a lot simpler
<clever> since grub lacks zfs write support
<clever> also, /boot cant be on zfs when doing this
<clever> pie__: it may be broken too badly to be able to safely edit /boot/
<clever> and then when it successfully boots, undo that
<clever> its much simpler to change the default right as you choose the current option
<clever> samueldr: exactly
<clever> its hard to react to something failing like that
<clever> and then if boot sucessfully finishes, it undoes that
<clever> so when you boot it, it changes the default, and saves it to the grubenv file
<clever> basically, in each menu entry, ou want to mess with the default boot entry
<clever> pie__: read the first 20 lines of grub.cfg
<clever> pie__: the loadenv part in the cfg
<clever> pie__: ive thought of that, and there is some support for it in grub
<clever> and the automation prevents mistakes
<clever> so you can boot into any linux rescue shell, upload a tar, kexec into the installer, and then justdoit
<clever> m1crOman: i had originally written this for installing nixos on remote boxes you lack access to
<clever> installer image*
<clever> m1crOman: the only pain point, is that the script is baked into the installed image, and you have to make a new installer for every test
<clever> m1crOman: but you are free to edit line 94 before building the installer image
<clever> m1crOman: it currently doesnt support raid though, only single-device setups
<clever> so you simply boot the installer, and type in `justdoit`, and your done, lol
<clever> m1crOman: ive got this script to automate the entire zfs install, it compiles down to a bash script in PATH called justdoit
<clever> PyroLagus: but then editing it may fail at runtime, maybe copy over it? but then all changes are undone at reboot
<clever> PyroLagus: yep
<clever> so i always go with an ext4 /boot
<clever> i currently dont trust grub with /boot on zfs, and my testing in a VM today shows it to be very buggy
<clever> my desktop has the rootfs on nvme, with /boot on spinning rust
<clever> my laptop boots with only an nvme
<clever> but id need to check if the firmware supports that
<clever> m1crOman: i have since added an nvme device to the nas, and am considering making it handle /boot duties
<clever> m1crOman: thats plain ext4, on a 64mb usb stick from over a decade ago, lol
<clever> m1crOman: currently, the only thing not in the raidz1, is the /boot partition, because i didnt want to mismatch the partition sizes and waste space
<clever> m1crOman: all on the same raidz1 array
<clever> m1crOman: and most of my other machines have a tank/nix dataset for /nix
<clever> m1crOman: my nas just has /nix/store in the same zfs pool as everything else
<clever> m1crOman: nixos-generate-config will create the right setup in hardware-configuration.nix
<clever> m1crOman: you can put /nix on any device you want, as long as its present when booting
<clever> in this example, i have an exec at the end, so i hijacked the script and the real DM never launches
<clever> PyroLagus: session commands are ran before starting the full DM
<clever> PyroLagus: you could probably make a systemd one-shot service to just run that on bootup
<clever> mac10688: if you reboot, does the user still exist in /etc/passwd ?
<clever> mac10688: it normally shouldnt
<clever> i dont really use the gui file browser much
<clever> i just run evince directly on the pdf file
<clever> Matthieu`: i typically just dont install duplicate tools, so there is only one choice for most file types
<clever> PyroLagus: not sure, havent really looked into it
<clever> PyroLagus: most of my machines are single-user, so i just set it system-wide
<clever> gyroninja: yep
<clever> gyroninja: yeah, but you usually want to load <nixpkgs> once and pass it to both of them
<clever> that sets the variable, and sets up some aliases so vi maps to vim
<clever> Matthieu`: for console texit editors, you can set the env var EDITOR easily
<clever> and then load the default.nix in that channel, and expect it to return an attrset containing hello=
<clever> gyroninja: nix-env -iA foo.hello will search for a channel called foo
<clever> gyroninja: dont think they need to be
<clever> gyroninja: all of your nix files
<clever> gyroninja: just make an http server that contains 2 files, nixexprs.tar.xz and binary-cache-url
<clever> mac10688: is /boot correctly mounted when you run nixos-rebuild switch?
<clever> and (hd0,gpt3)/@/ is just the root of the dataset
<clever> it must be using @ to clearly seperate dataset path from fs path
<clever> and the more obvious (hd0,gpt3)/root/boot/ doesnt exist
<clever> yeah, (hd0,gpt3)/root/@/boot/ exists, but spews 4 errors
<clever> pie__: weird, reading the grub config, it looks like i want (hd0,gpt3)/root/@/boot/
<clever> pie__: ah yeah, grub can read a file with a given name, but cant actually list the contents of a directory, lol
<clever> the zfs source agrees that only 0-15 are valid compression types, wut?
<clever> which only has index 0-15!
<clever> so it was going to index 69 in this array
<clever> it said 69, so that was the %u on 1885, not the %s on 1889
<clever> but strangely, grub does have lz4 support, since at least 2016
<clever> aristid: its just a VM, whose entire purpose is to test the install script
<clever> reinstalling without lz4
<clever> pie__: i used lz4, oops!
<clever> so i dont get dups when im recovering the drive in another box
<clever> i set the pool name to the hostname
<clever> my NAS (with multiple tb of storage) still has /boot on a 64mb usb stick, lol
<clever> and the bios will then try the next boot device in your config
<clever> pie__: the bootloader will `int 0x18` to signal that the boot failed, i believe
<clever> pie__: so you could add a "try next bios entry" option to the grub menu
<clever> pie__: if you `exit` at the grub command line, it will signal to the bios that the boot has failed on this device, and the bios will just move on to the next entry in the boot order
<clever> pie__: yeah, and nixos-rebuild boot --install-bootloader
<clever> m1crOman: special to any default.nix that returns multiple packages
<clever> pie__: --install-bootloader will force it to
<clever> pie__: nixos will reinstall grub if any variable in /boot/grub/state doesnt match up
<clever> m1crOman: you also need to add the version here
<clever> /home/clever/apps/nixpkgs/pkgs/top-level/all-packages.nix: minecraft-server_1_14
<clever> /home/clever/apps/nixpkgs/pkgs/top-level/all-packages.nix- inherit (callPackages ../games/minecraft-server { })
<clever> > minecraft-server_1_14
<clever> i think you want -A minecraft-server_1_14_2
<clever> m1crOman: what changes did you do to nixpkgs?
<clever> lol
<clever> that will disable both
<clever> nix-build $NIXPKGS -A minecraft --arg config '{}' --arg overlays '[]'
<clever> baring config.nix and overlays
<clever> no need to search when the name is known
<clever> m1crOman: nix-build $NIXPKGS -A minecraft
<clever> my brain is just weird
<clever> Profpatsch: and also remember the context from hours ago, and i have slept since then, lol
<clever> exactly 10 seconds on this end
<clever> 2019-06-09 17:22:03 < clever> pie__: lsof should show working dirs
<clever> 2019-06-09 17:21:53 < pie__> clever, finally managed to unmount the luks, i think i had a bash open somewhere maybe
<clever> Profpatsch: fast typer
<clever> pie__: and bash would be holding an FS open, so it would have shown in mount
<clever> pie__: lsof should show working dirs
<clever> bbl
<clever> but havent tried warframe
<clever> ive found proton to work well within steam
<clever> nix-shell --pure -p 'winetricks.override { wine = wineWowPackages.stable; }'
<clever> > winetricks.override { wine = wineWowPackages.stable; }
<clever> it will add regular wine to its own PATH
<clever> yeah, check `nix edit nixpkgs.winetricks`
<clever> laalf: that is the 64bit wine, i suspect that winetricks is running the 32bit wine on you
<clever> $ WINEARCH=win32 WINEPREFIX="/home/clever/test-prefix" ./result/bin/winecfg
<clever> wine: WINEARCH set to win32 but '/home/clever/test-prefix' is a 64-bit installation.
<clever> WINEARCH=win64 WINEPREFIX="/home/clever/test-prefix" ./result/bin/winecfg