2019-11-25

<clever> nh2: though .extend deletes .override
<clever> nh2: i also prefer haskellPackages.extend rather then .override + lib.composeExtensions, it just feels cleaner
<clever> nh2: the same as extend
<clever> there is both `xorg.overrideScope (super: self: {})` and `xorg.overrideScope' (self: super: {})`
<clever> nh2: you want xorg.overrideScope'
<clever> nh2: if i'm reading this right, i think your overlay is against pkgs.haskellPackages.X11, not pkgs.X11
<clever> nh2: try using pkgsWithArchiveFiles.extend (overlay) instead of overlays=[overlay] ?
<clever> nh2: and if you find the libXTst in the drv for tutorial, and check its lib dir, what files are present?
<clever> which gets routed thru nss
<clever> nh2: i think its related to how haskell tries to lookup the protocol# for tcp in /etc/protocols
<clever> nh2: i think thats only haskell networking, plain c networking works mostly
<clever> nh2: ive also used glibc static, but i dont think its officially supported
<clever> nh2: can you pastebin the entire error when it fails?
<clever> nh2: yeah, that should be a good work-around
<clever> xel: you would also have to restore the RPATH to /lib:/usr/lib, and instruct the user to install the right libs
<clever> nh2: sometimes, its simpler to edit a fork of nixpkgs, and once its working, transition to overrides
<clever> nh2: yeah, thats what i would have done as well
<clever> xel: there is also nix-bundle, which will ship a nix closure, and automatically chroot for you
<clever> nh2: due to the // going on, you might need to override both?
<clever> that will make all binaries static
<clever> xel: use pkgs.pkgsStatic instead of plain pkgs
<clever> then it works anywhere, and your still using the libc defined in nixpkgs
<clever> just tell nix to build a static executable
<clever> your basically throwing away half the benefits of nix when you do it
<clever> and you could use patchelf to do the reverse, but you may run into compatability problems
<clever> monty: thats exactly what patchelf does, to make non-nix stuff work under nixos
<clever> xel: if you run `file` on the binary, youll see the path to the dynamic linker, and that must exist for it to run
<clever> and i think they omited letters needed for certain words, so you cant spell bad words
<clever> 72 // omitted: E O U T
<clever> 73 const string base32Chars = "0123456789abcdfghijklmnpqrsvwxyz";
<clever> sondr3: its not just that it cant start with an e, but it wont have an e anywhere in the hash
<clever> src/libutil/hash.cc:const string base32Chars = "0123456789abcdfghijklmnpqrsvwxyz";

2019-11-24

<clever> it would make a lot more sense to only search pkgs
<clever> i have no idea why it does that
<clever> basically, pkgs.callPackage will search (pkgs.xorg // pkgs) for attrs when trying to fill things in
<clever> nh2: pkgs/top-level/splice.nix: newScope = extra: lib.callPackageWith (splicedPackagesWithXorg // extra);
<clever> nh2: thats due to how callPackage is created, i'm searching for it...
<clever> nh2: its not actually in the top-level scope
<clever> > pkgs.libXtst
<clever> so you need to override xorg.libXtst
<clever> nh2: i think pkgs.libXtst is a reference to pkgs.xorg.libXtst
<clever> ah
<clever> monty: then you can just go to bed and know it wont brick itself overnight
<clever> monty: you could `nixos-rebuild build` to build/download everything, but not activate
<clever> --check-contents will compare the hashes of everything to the ones when they where first made
<clever> monty: garbage collection may have also fixed things already
<clever> yeah
<clever> just --delete it
<clever> monty: `nix-store --verify --check-contents`, but you mau not need to repair it since your changing channels
<clever> monty: yeah
<clever> monty: i would start with a further garbage collection, --repair would just re-download the missing ghc and run out of space
<clever> and since all GUI's claim it doesnt exist normally, you never set a pw on it!
<clever> windows has similar, their is a hidden admin account, that all GUI's claim doesnt exist, but if you boot into safemode, you can still login as that user
<clever> monty: that is also basically how you can hijack any linux machine if you have physical access
<clever> monty: that should work fine
<clever> something went wrong updating them, due to lack of free space
<clever> monty: `the root account is locked` pretty much confirms that the passwd/shadow files got borked
<clever> monty: something may have crashed with /etc/passwd and wiped all passwords, use single mode to run passwd and set new passwords
<clever> its needed more when you dont have a way to properly shutdown
<clever> (a shell command)
<clever> NAME
<clever> sync - flush file system buffers
<clever> verify can be done later, after you reboot
<clever> monty: and then try a sync and reboot, that should be enough to get a shell and be able to gc more normally
<clever> monty: try deleting the ghc with rm then
<clever> monty: you can then run `nix-store --delete` on that path
<clever> monty: you may need to `export PATH=/nix/var/nix/profiles/system/sw/bin` to make things simpler
<clever> monty: then run `nix-store --query --roots` on that fat thing, to see why it cant be deleted
<clever> monty: `du -hc --max=1 /nix/store | sort -h`, find the path to the fattest thing in the nix store
<clever> monty: export HOME=/root, not sure why it needs it
<clever> monty: /nix/var/nix/profiles/system/sw/bin/nix-collect-garbage --max-freed 10m
<clever> monty: thats a bug in stage-1, tell it to continue anyways
<clever> monty: because /bin/bash doesnt exist on nixos, you need init=/bin/sh
<clever> vandenoever: `nix-shell -A libreoffice` will open a shell for wrapper.nix, so it must build libreoffice first
<clever> vandenoever: try just `nix-shell -A libreoffice-fresh.libreoffice`
<clever> vandenoever: your opening a shell suitable for building the wrapper, which depends on the real libreoffice
<clever> 19724 libreoffice = callPackage ../applications/office/libreoffice
<clever> 19723 libreoffice-fresh = lowPrio (callPackage ../applications/office/libreoffice/wrapper.nix {
<clever> vandenoever: then run nix-shell on that attribute, `nix-shell -A libreoffice`
<clever> vandenoever: you can run that on a .drv file for the expression, which nix-instantiate can generate
<clever> vandenoever: nix-store -qR
<clever> then systemd should boot directly to a root prompt
<clever> monty: add `single` to the kernel cmd line at the bootloader
<clever> inf: yeah, that looks good
<clever> monty: start with `nix-collect-garbage --max-freed 10m`
<clever> monty: you usually want to use a --max-freed to limit how much you GC when in this situation
<clever> inf: check the systemd docs (and nixpkgs for examples) on RequiresMountsFor
<clever> i would just do what you did, and maybe also set requires mounts for
<clever> there is a systemd mount generated for zfs, but ive not looked into it yet
<clever> but there is a flag you can add to fstab, to make things non-fatal
<clever> yeah
<clever> yeah
<clever> systemd has a nasty habbit of having a complete panic if local-fs.target fails
<clever> inf: `filesystems."/tank" = { device = "tank"; fsType = "zfs"; };` requires `mountpoint=legacy` on the dataset
<clever> (but havent started yet)
<clever> and thats why i have plans to make rollback options work remotely!
<clever> inf: and thats why you have rollback options at grub!
<clever> theduke: propagated inputs only appear at build time, for things depending on your package
<clever> dmj`: undmg should do exactly what i said you need
<clever> dmj`: did you read what tilpner said?
<clever> red[evilred]: usually, start by finding out how to run any linux on it, usually u-boot, kernel config, and such, and then see what happens if you try to boot a kernel nixos made
<clever> dmj`: step 1, find a command-line tool that can unpack a dmg without root
<clever> dminuoso: ah
<clever> red[evilred]: aarch64?
<clever> i just run nixos as the host os on my nas
<clever> dminuoso: the scsi subsystem in linux may be wonky, where it blame sd_mod for all "scsi" devices, even if the backend is virtio_scsi
<clever> and here comes the scary part of my migration!
<clever> [root@nas:/mnt/nix]# rm -rf store/
<clever> you would need to check what your disk shows as, under the guest
<clever> dminuoso: in my case, sda is handled by sd_mod
<clever> [root@amd-nixos:~]# ls -lh /sys/class/block/sda/device/driver/module
<clever> lrwxrwxrwx 1 root root 0 Nov 24 11:46 /sys/class/block/sda/device/driver/module -> ../../../../module/sd_mod
<clever> dminuoso: it will loop over every block device on line 252, and try to scrape together the drivers being used
<clever> sounds likely
<clever> dminuoso: nixos-generate-config usually gets that
<clever> dminuoso: and is the virtio driver for it included in the initrd?
<clever> dminuoso: (as far as the guest is concerned)
<clever> dminuoso: is the root disk nvme or sata?
<clever> arianvp: crypto-coin stuff, was just curious if the card even supported it for development purposes
<clever> evils: any more generic opencl stuff in the amdgpu-pro area?
<clever> evils: ah
<clever> arianvp: for general opencl stuff
<clever> i tried getting things to work on it before, but didnt have much luck
<clever> evils: do you know if this card is supported?
<clever> 01:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Bonaire XTX [Radeon R7 260X/360]
<clever> raboof: about all you can do is to copy them to $out, or make it fail at the end
<clever> it just doesnt make any sense :P
<clever> i dont really like the idea of using systemd.tmpfiles for non-temp files
<clever> manveru: in general, i just use users.users.foo.createHome to setup state for my services
<clever> so you need systemd to make it, and pass the name/uid to you
<clever> ahh, ! would be if you dont know what user to chown to
<clever> if you are using systemd.services.foo.preStart, you can even have nixos add the + for you, if we had a preStartAsRoot flag
<clever> that should be a perfect replacement
<clever> │ │ privileges. In this mode privilege restrictions configured with User=, Group=, │
<clever> │"+" │ If the executable path is prefixed with "+" then the process is executed with full │
<clever> too much indirection in the docs!
<clever> `Syntax is the same as for ExecStart=`
<clever> manveru: i think you can get the same effect via that?
<clever> > but with the new approach we actually have to write characters in front of ExecStartPre lines and so on.
<clever> :'(
<clever> :'(
<clever> manveru: PermissionStartOnly is being removed?
<clever> ogle: after nixos buildEnv's all of the module packages together, it will run that depmod to regen the cache
<clever> let me find the source...
<clever> ogle: it will either be a warning or an error, and the order should be constant, just dont know which way it is yet
<clever> ogle: i think you should start by trying to get the duplicates at the same path, so nixos overwrites things
<clever> ogle: do you see duplicate module files in /run/current-system/kernel-modules ?
<clever> yeah
<clever> nix-build and nix-env are using the same logic when they handle url's
<clever> srid: seems to be building just fine fo rme
<clever> nix-build https://github.com/obsidiansystems/obelisk/archive/master.tar.gz -A haskellPackageSets.ghc.aeson
<clever> srid: what command did you try exactly?
<clever> srid: nix-build ... -A blah

2019-11-23

<clever> i just forgot about things
<clever> nvm
<clever> nas.nix: "/var/lib/deluge" = { device = "naspool/deluge"; fsType = "zfs"; };
<clever> but i did make a zfs fs, and set the mountpoint
<clever> i didnt make this entry
<clever> i think the zfs generator is already active
<clever> naspool/deluge /var/lib/deluge zfs defaults 0 0
<clever> [root@nas:~]# cat /etc/fstab
<clever> edef: how does stage-1 mount the rootfs?
<clever> elvishjerricco: yeah, nixos-generate-config would need to only configure things that are using legacy
<clever> (and anything else with neededForBoot = true)
<clever> elvishjerricco: i think we need to use mountpoint=legacy for / and /nix/store, but then everything else can be left up to systemd and stage-2
<clever> elvishjerricco: you would have to make a single environment.etc for all of zed.d, and then decide what goes within it using runCommand
<clever> infinisil: then you cant just nix-instantiate from the wrong arch, it would have to build at eval time, and cant build in parallel
<clever> elvishjerricco: you would need to read the dir listing in a runCommand, and handle things within that
<clever> infinisil: probably wont be, it would force building zfs before you can instantiate
<clever> can always fork the fork and then finish it
<clever> but you could just have a runCommand that will cp ${zfs}/etc/zed.d/* $out/ and then use normal bash to replace/edit certain files
<clever> not really
<clever> though it wont be the normal environment.etc api anymore
<clever> there is a buildEnv flag to allow collisions, so you just need the order right
<clever> and then put the buildEnv into source
<clever> elvishjerricco: only thing i can think of, is to buildEnv the zfs files with an override derivation
<clever> elvishjerricco: youll need to set a var that is being inserted into that string, or modify the module to allow editing what you want changed
<clever> srid: home.nix needs to be the one setting _module.args
<clever> yeah
<clever> srid: also, fetchFromGitHub does the same thing
<clever> so you may need to add it to a home-manager module
<clever> srid: home-manager modules are seperate from nixos modules
<clever> srid: it should, what error did it give?
<clever> so you can just _module.args.something = ...; in any module, and then { something, config, pkgs, ... }: in others
<clever> srid: any attributes you add to _module.args are visible to all nixos modules
<clever> yeah, outputs=[...];
<clever> and those outputs can be files, directories, or symlinks
<clever> yeah
<clever> asymmetric: ah
<clever> asymmetric: and what does current-system point to? just ls -lh it?
<clever> asymmetric: what did nixos-rebuild test print?
<clever> theduke: boot.loader.grub.extraEntries can be used to add extra things to it
<clever> asymmetric: current-system is updated any time you activate a new nixos
<clever> asymmetric: also, if you pick an older profile at grub, current-system points to what you picked, but profile/system doesnt
<clever> asymmetric: if you nixos-rebuild test, the profile isnt updated
<clever> and then its just a string inside ${...}
<clever> which turns it into a string
<clever> jtojnar: because it parses as a url
<clever> > hookName:-
<clever> not sure what will be used for partitioning yet, but thats one option
<clever> pistache: and then certain backend plugins, like hetzner would just tell hetzner to boot the iso, to meet that requirement
<clever> pistache: you just need a way to give nixops root ssh to a nixos running from ram (or an iso), and it will do the install for you and deploy
<clever> pistache: yeah, the idea is that it should work on pretty much anything, cloud providers, baremetal providers, and even baremetal you have physical access to
<clever> pistache: my general plan with the above, is to be able to support custom fs layout, on all cloud providers, with a single api to control it
<clever> pistache: then phase1 of https://github.com/NixOS/nixops/issues/1189 is already supported upstream by Hetzner Cloud
<clever> OmnipotentEntity: id say that should be fixed to just pyc them when nix builds
<clever> kexec lets you ditch whatever partition layout you started with
<clever> pistache: stateVersion should be set to release, when nixos-generate-config first makes the config, and then left at that value
<clever> :q
<clever> pistache: this one always has the release for the nixpkgs building nixos
<clever> nix-repl> config.system.nixos.release
<clever> "20.03"
<clever> [root@amd-nixos:~]# nix repl '<nixpkgs/nixos>'
<clever> pistache: not really
<clever> Ericson2314: i need to test the vc4 stuff today
<clever> Ericson2314: ah, i was just wondering why plex is broken on master, i thought somebody had fixed the qt stuff, now i see lua is broken, and you just fixed it
<clever> OmnipotentEntity: run `nix-store --verify --check-contents` ?
<clever> OmnipotentEntity: strace it and see what files its touching?
<clever> OmnipotentEntity: is it possible to pre-compile that code when nix is building the python library?
<clever> ah, not $TMP
<clever> XDG_RUNTIME_DIR=/run/user/1000
<clever> OmnipotentEntity: thats usually $TMP doing it, check `env | grep --color user`
<clever> mojjo: so your things have priority over what the user had
<clever> mojjo: yep, i would put $PATH at the end though
<clever> mojjo: it will get the .bin or .out of each thing in the list, then shove a /bin on the end, and : seperate things
<clever> > lib.makeBinPath [ hello ]
<clever> mojjo: lib.makeBinPath
<clever> das_j: there is also mapAttrsFlatten
<clever> das_j: i sometimes use mapAttrs + attrValues
<clever> mojjo: i also do `cp ${./foo} foo` a lot
<clever> mojjo: you can also use builtins.filterSource to copy ./. and filter what it copies
<clever> mojjo: fixed-output derivations just define the hash upfront, and then download later, and nix enforces it matching that hash
<clever> mojjo: then use that hash to compute the outputs of things that depended on foo
<clever> mojjo: when you do src = ./foo, nix will copy ./foo to /nix/store/hash-foo, and hash it as it copies
<clever> mojjo: only if you declare upfront what the hash of $out will be
<clever> i sometimes play with loopback modules in my pulse, and i'm pretty sure systemwide blocks all module loading
<clever> you could also use $lib for libs, and $out for any text content
<clever> neat
<clever> dont code while bored :P
<clever> once i got it all working, i never used it, never upstreamed the patches, and just commented out the package override! lol
<clever> so i patched pulse to support that, lol
<clever> and the pulse config file format, didnt support configuring them by index
<clever> however, all 3 muxes have the identical name (due to alsa drivers), and they only differ by index#
<clever> and you can either expose the mux's to the user (via pavucontrol) or pre-configure them with the config file
<clever> but you can define a config file to describe all of the above to PA, so it can enable capturing on each seperately
<clever> out of the box, pulseaudio only supports a single capture channel
<clever> and 3 muxes, to select any jack for any ADC
<clever> it has 3 ADC channels, and 3 physical inputs (front&rear line-in, and a mic jack)
<clever> avn: that reminds me, my desktop sound card is a bit weird
<clever> because i really dont want compiler tools in my global env, but i use strings a lot
<clever> yeah, ive done that to extract `strings` from binutils
<clever> nix-env and systemPackages will usually ignore .data
<clever> avn: one option is to just make it split output, outputs = [ "out" "data" ]; then tell cmake to shove all of the data into $data, and the binary in $out/bin/
<clever> das_j: lib.mapAttrsRecursive might help
<clever> avn: yeah, and there is the unknowns of how the binary will try to find the other files, and the icky problem of it creating a $out/Etterna/ dir, which will show up in places like ~/.nix-profile and /run/current-system/sw/
<clever> avn: out of the box, cmake wont install anything, and needs some install() statements added
<clever> evils: that also works
<clever> evils: youll need to reverse engineer how the game finds its own files, and finish the install by copying things to the right places
<clever> so if you try on linux, you wind up with half an install, the stuff that windows&apple happened to share
<clever> and linux install support was never added
<clever> i suspect lines 42-53 are only meant to be used on windows and apple, but where shared between the 2
<clever> you may want to just toss in a postInstall to copy it yourself, but how will it find the other bits...
<clever> evils: i notice that only windows and apple will install the Etterna binary, weird
<clever> evils: dont you just love windows style paths? :D
<clever> string(REGEX REPLACE "/" "\\\\\\\\" CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP "${CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP}")
<clever> evils: aha, and that has all of the install() calls!
<clever> evils: i think this is the bulk of the cpack stuff
<clever> that adds custom platform specific libs to the binary
<clever> target_link_libraries(Etterna ${X11_LIBRARIES})
<clever> evils: this says that there should be a binary named Etterna
<clever> add_executable(Etterna)
<clever> include(CMake/Helpers/CMakeLinux.cmake)
<clever> havent heard of it before
<clever> but if you read the CMakeLists.txt, what do the install directives do?
<clever> evils: or perhaps the `make install` rules in `CMakeLists.txt` isnt even installing an executable
<clever> so the question, is what is the real binary to start it all?
<clever> evils: i see the same thing, many things in that one dir
<clever> [clever@amd-nixos:~/apps/nixpkgs-hasura]$ nix build -f . etterna
<clever> das_j: yeah, i also saw a pr to backport
<clever> das_j: the libva thing is already fixed on nixos-unstable
<clever> steam for example, is 32bit, so they dont have to deal with shipping 2 versions
<clever> das_j: some upstream software is only shipped as a 32bit library
<clever> das_j: heh, you can always pick an older generation at grub to undo things?
<clever> das_j: nix uses `unzip -qq` when unpacking
<clever> unzip -qq "$curSrc"
<clever> pkgs/tools/archivers/unzip]$ cat setup-hook.sh
<clever> das_j: have you checked the directory listing of the zip for anything fishy?
<clever> evils: its mainly a safety, to make the code harder to be exploited, so they are doing something "wrong" but it will work
<clever> evils: thats the format security warnings being turned into errors, youll want to check nixpkgs for examples of how to disable format security
<clever> maybe the version is too old?
<clever> mananamenos_: it may be cachix use --nixos?