2020-03-25

<clever> Jonathan44: can you modify both default.nix files, to give them a better name
<clever> CMake Error at CMakeLists.txt:138 (install):
<clever> Jonathan44: and where is the source for this project?
<clever> Jonathan44: and what error happens if you run nix-build?
<clever> Jonathan44: i dont see how that ccd derivation would ever work, it has no source, so nix-build has nothing to build
<clever> Jonathan44: did you hit save? and each file needs a unique name
<clever> Jonathan44: just hit edit, and add file
<clever> Jonathan44: you can add multiple files to a single gist, which makes it much easier to read
<clever> Jonathan44: can you put all of the nix files into a gist?
<clever> Bunogi: `nix-channel --update` will upate all by default
<clever> Bunogi: `nixos-rebuild --upgrade` will only update the channel named nixos

2020-03-24

<clever> Jonathan44: just setting it
<clever> /home/clever/apps/nixpkgs/pkgs/applications/misc/albert/default.nix: cmakeFlags = [ "-DBUILD_VIRTUALBOX=OFF" "-DCMAKE_INSTALL_LIBDIR=libs" ];
<clever> either patching it, or
<clever> Jonathan44: nixpkgs itself also has a number of examples of how to deal with it
<clever> /home/clever/apps/nixpkgs/pkgs/development/libraries/hyperscan/default.nix: --replace "libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@" "libdir=@CMAKE_INSTALL_LIBDIR@" \
<clever> Jonathan44: search for CMAKE_INSTALL_LIBDIR in the files...
<clever> Jonathan44: you may need to set CMAKE_INSTALL_LIBDIR yourself, or see what sets it normally
<clever> pistache: though, the hostid part would probably be best to remove from the file when you confirm it works
<clever> pistache: and then you can just `imports = [ ./example.nix ];` to enable it on the main one
<clever> pistache: this builds a machine with zfs support, and a hardened kernel that has 32bit support
<clever> $ nixos-rebuild build-vm -I nixos-config=example.nix
<clever> pistache: but you can also make a smaller module, that only turns on the hardening, and then make a completely seperate "machine" for build-vm, which wont try to mount disks that wont exist
<clever> pistache: yep
<clever> pistache: as an example, my nas starts from nas.nix, and you recursively follow everything listed in imports, to see the full config
<clever> pistache: and thats where a more modular config can help
<clever> pistache: you could try `nixos-rebuild build-vm` with a variant of the config, to boot it under qemu, even on your local box
<clever> pistache: basically, you can use the exact same format in a second file, and then do `imports = [ ./secondfile.nix ];`
<clever> pistache: you may also want to look into breaking your config file up into smaller pieces
<clever> pistache: and maybe try boot.kernelPackages = pkgs.linuxPackages_hardened.extend (self: super: { kernel = super.kernel.override { extraConfig = ''....'';
<clever> pistache: try running modinfo on spl, and a module already loaded (check lsmod), how do they differ about key options?
<clever> Jonathan44: putting everything into one file can also sometimes help
<clever> Jonathan44: you need to load the file with either import or callPackage
<clever> pistache: also, does dmesg say anything more about what is wrong with zfs?
<clever> pistache: this is what i was previously doing, to modify the kernel config
<clever> 297 XXXlinux_4_9 = pkgs.linux_4_9.override {
<clever> 299 NF_CT_PROTO_DCCP n
<clever> 298 extraConfig = ''
<clever> pistache: what if you only use the kernelPackages change, and not the kernelPatches half?
<clever> Jonathan44: now just reference that expresion in the buildInputs of the next thing, maybe using `rec {` or a let block, and nix-build the next thing in line
<clever> pistache: can you pastebin your configuration.nix file?
<clever> atemu12[m]: lib.filter
<clever> Jonathan44: start by getting the dependencies to build with nix-build, not nix-shell
<clever> Jonathan44: the "proper" way to do it, is to build the dependencies with nix, and add them to the buildInputs
<clever> zeta_0: yeah
<clever> zeta_0: every single package in haskellPackages has a .env on it
<clever> zeta_0: once your in the nix-shell, you can mostly use cabal as normal
<clever> lovesegfault: you can also use `--option substituters ssh://10.0.5.155` to make nix treat the remote machine as a binary cache
<clever> Also copy the outputs of store derivations included in the closure.
<clever> --include-outputs
<clever> zeta_0: haskellPackages.darcs.overrideAttrs (old: { src = ./something; })
<clever> lovesegfault: nix-copy-closure can already handle drv files
<clever> zeta_0: nix-build with an override against src, if you want to use it long-term
<clever> zeta_0: `cabal build` inside that shell should do, if you are trying to develop darcs
<clever> zeta_0: on line 62255
<clever> zeta_0: the one that is assigning a value to darcs
<clever> frihetskampen: if you want unstable to be the default for everything
<clever> frihetskampen: use `nix-channel --add` as root, to point the nixos name to nixos-unstable
<clever> zeta_0: it may be on a different line for you, search for darcs
<clever> frihetskampen: can you screenshot the terminal window where you get the error?
<clever> frihetskampen: does dmesg say anything near the end?
<clever> zeta_0: look in both
<clever> zeta_0: channels is for your usr, channels_root is roots channels
<clever> zeta_0: you will also find nixpkgs in ~/.nix-defexpr/
<clever> zeta_0: vi ~/apps/nixpkgs/pkgs/development/haskell-modules/hackage-packages.nix and go down to line 64228
<clever> Tomas69: lets you select an attribute from a set
<clever> Tomas69: without -A, nix-env takes a lot more ram
<clever> ,-A
<clever> zeta_0: its much easyer to see if you format the file better, https://gist.github.com/cleverca22/59209e79811e85c02285dcc704521812
<clever> zeta_0: between the { and }
<clever> zeta_0: it must go inside the attribute set that goes from line 1 to 7
<clever> hpfr[m]: and behind the scenes, nixos-rebuild is just using nix-env to manage the system profile, so you can use this to list/delete generations
<clever> [root@amd-nixos:~]# nix-env --profile /nix/var/nix/profiles/system --list-generations
<clever> hpfr[m]: nixos-rebuild will create generations in the system profile
<clever> hpfr[m]: nix-env -i will create generations in your user profile
<clever> Ilya_G: also, the docs and error, say it should be a list, not a set, systemd.automounts = [ {...} {...} ]; for ex
<clever> Ilya_G: its probably simpler to just add it to fstab via the normal fileSystems."/foo" stuff
<clever> nextloop: not sure why its building then
<clever> nextloop: do you have any overrides to vlc? which channel are you on?
<clever> jonreeve[m]: you must add a `name = "...";` that matches the name of the cabal file
<clever> nextloop: that looks unrelated to vlc, is it something youve installed seperately?
<clever> nextloop: vlc should be available in source form, which jar did you see being downloaded?
<clever> jonreeve[m]: add `name = "annotate-color";` to the args of developPackage
<clever> jonreeve[m]: developPackage runs callCabal2nix for you
<clever> jonreeve[m]: add name = "annotate-color"; to the default.nix file
<clever> jonreeve[m]: you called it annotate-color.cabal, so that fails
<clever> jonreeve[m]: so its looking for color-word-analyzer.cabal
<clever> jonreeve[m]: the problem, is that the default name is color-word-analyzer
<clever> 231 developPackage =
<clever> 233 , name ? builtins.baseNameOf root
<clever> 232 { root
<clever> jonreeve[m]: the problem is likely the name of things
<clever> jonreeve[m]: what args did yo run developPackage with?
<clever> jonreeve[m]: what args did yo run callCabal2nix with?
<clever> jonreeve[m]: its not a caching problem, its a problem with your nix code
<clever> jonreeve[m]: what args did yo run callCabal2nix with?
<clever> jonreeve[m]: thats your problem then, what args did yo run callCabal2nix with?
<clever> jonreeve[m]: thats your problem then, what args did yo run callCabal2nix with?
<clever> jonreeve[m]: and that matches the one you find in /nix/store/fvka3nd7slnqgjvfkjg649v77y10lc89-color-word-analyzer ?
<clever> jonreeve[m]: github does have nix highlighting, but the contents you pasted are json, so its showing red all over the place
<clever> das_j: that appears to be a bug in `nix build`, it did build it, but pointed result to the wrong thing
<clever> das_j: what exactly did you run with `nix build`, the full arg list and output
<clever> das_j: is the last-mod on the result symlink changing?
<clever> das_j: you can run `nix build` on either a storepath or a drv file
<clever> terlar: what overlays do you have?
<clever> jonreeve[m]: what does the cabal file in /nix/store/fvka3nd7slnqgjvfkjg649v77y10lc89-color-word-analyzer look like? can you add that file to the gist?
<clever> jonreeve[m]: its a json output, so if you rename the file in the gist, the syntax highlighting will be a lot more pretty
<clever> terlar: thats reporting only 0.175 sec, which is pretty speedy, weird
<clever> jonreeve[m]: can you pastebin `nix show-derivation /nix/store/02szzrd1w7wqmnkh9is5qlx64m7r6f1z-cabal2nix-color-word-analyzer.drv` ?
<clever> jonreeve[m]: cabal2nix is trying to write to /nix/var while inside a nix sandbox, so there is a problem with the build process
<clever> terlar: yeah, it should return a drv file
<clever> jonreeve[m]: is it nixos or another distro?
<clever> terlar: for reference mine is https://gist.github.com/ecaba1ca3a80a158c8f8941ebe7b2e6b
<clever> terlar: try this, then pastebin the entire profile.json file
<clever> NIX_SHOW_STATS_PATH=profile.json NIX_SHOW_STATS=1 NIX_COUNT_CALLS=1 nix-instantiate '<nixpkgs>' -A hello --arg config '{}' --arg overlays '[]'
<clever> terlar: one min
<clever> terlar: that takes 0.4 seconds on my end, what is your CPU?
<clever> terlar: `time nix-instantiate '<nixpkgs>' -A hello --arg config '{}' --arg overlays '[]'` ?
<clever> terlar: `time nix-instantiate '<nixpkgs>' -A hello` ?
<clever> terlar: what about `time nix-shell -p --run exit` ?
<clever> jluttine: so you would want `..` in the installPhase
<clever> jluttine: the configurePhase for cmake will `mkdir build ; cd build ; cmake ..`
<clever> jluttine: cmake involved?
<clever> jluttine: what does `pwd` print out in the installPhase?
<clever> jluttine: and $NIX_BUILD_TOP always points to it
<clever> jluttine: that should still be the working directory
<clever> bqv[m]: but the above case, is the atime on .nar.xz files in gcs
<clever> bqv[m]: but it is recommended to mount with noatime, for perf
<clever> bqv[m]: i think it just doesnt store it in the nar, but the atime is free to do what it does, once unpacked to the fs
<clever> glittershark: i think i saw a script for this in hydra...
<clever> glittershark: and add `--store gsc://something` to reference that bucket
<clever> and the bucket has no size limit, so we just ignore it for the most part
<clever> but there isnt much to GC the bucket
<clever> hydra does have the ability to upload to an S3 bucket
<clever> glittershark: its random, so it doesnt pick the same thing multiple times
<clever> glittershark: the default algo for `nix-collect-garbage --max-freed 10g` is to delete random un-rooted paths, until they total to 10gig
<clever> bqv[m]: nix will respect the gc roots by default
<clever> glittershark: so you would need to recursively delete many things
<clever> glittershark: it is also invalid for a thing to depend on something that doesnt exist
<clever> leonardp: but if you use nix.binaryCachePublicKeys, nix will concat the lists, and create a single `trusted-public-keys =`
<clever> leonardp: if you use nix.extraOptions, you get 2 `trusted-public-keys =`'s in nix.conf, and only one of them has an effect
<clever> leonardp: you must use nix.binaryCachePublicKeys
<clever> leonardp: yeah, trusted-public-keys = ${pubkey} is what breaks everything
<clever> leonardp: try using nix.binaryCaches or nix.trustedBinaryCaches instead
<clever> leonardp: how did you assign a value to nix.binaryCachePublicKeys?
<clever> leonardp: the default value of nix.binaryCachePublicKeys was lost
<clever> zeta_0: yeah
<clever> zeta_0: basically, anywhere you put a value, you can put a `with expr; value`
<clever> zeta_0: and `with haskellPackages;` can go in several places, after the nixpkgs with, after the old:, or after the buildInputs =
<clever> zeta_0: you need to merge line 1 and 3, you duplicated the darcs.env
<clever> zeta_0: darcs.env.overrideAttrs (old: { buildInputs = old.buildInputs ++ [ something ]; })
<clever> zeta_0: for cabal-install, use .overrideAttrs to add cabal-install to the buildInputs
<clever> zeta_0: if you want to force 865, use haskell.packages.ghc865.dars.env
<clever> zeta_0: it will come with whatever ghc is default for haskellPackages
<clever> organixpear: allowed-users in nix.conf can be used to restrict it
<clever> zeta_0: ignore default.nix entirely
<clever> zeta_0: then just run nix-shell
<clever> zeta_0: create a shell.nix that has only: with import <nixpkgs> {}; haskellPackages.darcs.env
<clever> zeta_0: you could change only the shell.nix file
<clever> zeta_0: you may be able to just ditch compiler.developPackage entirely, and use darcs.env.overrideAttrs by itself
<clever> zeta_0: but you can do darcs.env.overrideAttrs (old: { ... }) to extend the buildInputs further
<clever> zeta_0: you need to point nix-shell directly to darcs.env, not add it to the buildInputs of something else
<clever> zeta_0: no
<clever> colemickens: boot.debug1 and other debug ones (read the script) will also force a false failure at various points, letting you get a shell early
<clever> colemickens: add boot.shell_on_fail to the cmdline, and then a shell will be added to the menu
<clever> 151 boot.shell_on_fail)
<clever> colemickens: it can already do that, but you have to authorize it with a kernel cmdline flag
<clever> colemickens: try getting a shell in the initrd, and then do `ip link`
<clever> colemickens: ive also looked into the hw of it some, and the genet doesnt have any firmware
<clever> colemickens: no need to do anything special then, it should just work in the initrd
<clever> colemickens: so the genet module is present, but if modinfo cant find it, it must be compiled into the kernel
<clever> colemickens: and what about ls /sys/module/genet/ ?
<clever> colemickens: what about `modinfo genet` ?
<clever> colemickens: do you see genet in lsmod?
<clever> yeah
<clever> srid: and what does rib do when you give it the wrong root?
<clever> srid: so root is getting replaced with this
<clever> > pkgs.root
<clever> srid: maybe just `import ./foo {}` then?
<clever> srid: when you use pkgs.callPackage, it will search for each of those args, in pkgs
<clever> zeta_0: thats what nixpkgs is using to compile darcs
<clever> zeta_0: it probably includes everything you need
<clever> srid: the defaults are for when they cant be found under pkgs
<clever> ottidmes: no middle ground where you see half a change
<clever> ottidmes: i'm thinking more in terms of the change either didnt happen, or fully happened
<clever> ottidmes: it will have a different inode and last-mod timestamp
<clever> zeta_0: yes
<clever> ottidmes: you may read the json file in the middle of the json being written, and only get half the json data
<clever> ottidmes: and use writes to a tmp file + rename() to atomicly update the json file
<clever> ottidmes: and re-configure itself dynamically
<clever> ottidmes: and then a thread in haskell (maybe using inotify) that will watch the json for changes
<clever> ottidmes: for that, i would do something close to what hydra does, have a json file that details all machines
<clever> ottidmes: ah, run nix-serve on each machine, then dynamically point cachecache to all of them
<clever> ottidmes: then you just need some means of causing it to update, either errors and timeouts, or a servant+rest api
<clever> ottidmes: but you could change it to be a TVar over a list, and then you can modify it or just read
<clever> ottidmes: and 268 is a hard-coded list of caches
<clever> ottidmes: 344 will try each one in turn, until one of them gives a narinfo, and 358 will try each in turn until one gives a nar.xz
<clever> ottidmes: https://github.com/cleverca22/cachecache/blob/master/cachecache.hs ctrl+f the code for upstreamCaches, and youll see how it currently uses the list of caches
<clever> ottidmes: narinfo files are cached to ram, for faster lookup
<clever> ottidmes: nar.xz files are cached to a dir, and it can query multiple upstream sites to find one
<clever> ottidmes: currently, cachecache is close to just a dumb http cache, with a little bit of inteligence around the http/narinfo protocol
<clever> ottidmes: nix-serve would convert a normal /nix/store into an http cache
<clever> ottidmes: currently, cachecache only supports the http protocol
<clever> ottidmes: you can add ssh://user@host as a substitutors
<clever> Ilya_G: you can see containers.nix using %i everywhere
<clever> Ilya_G: systemd will replace %i with bar within the .service files
<clever> ottidmes: cachecache could be modified to dynamically change the list of upstream caches
<clever> zeta_0: what happens if you simply `nix-shell '<nixpkgs>' -A haskellPackages.darcs.env` and try to `cabal configure` ?
<clever> Ilya_G: basically, systemd.services."foo@" = ...; to define the template, and systemd.services."foo@bar".wantedBy to spawn an instance, i think
<clever> Ilya_G: one minute
<clever> zeta_0: what are you trying to do?
<clever> zeta_0: --pure will stop that inheriting
<clever> zeta_0: nix-shell will inherit vars from whatever shell its ran in, plus the shell.nix/default.nix file

2020-03-23

<clever> deltaryz: if imports references any value that referenced pkgs, then it will be infinite recursion
<clever> deltaryz: imports cant depend on pkgs as well
<clever> energizer: then you need to either use builtins.fetchTarball, or git clone the repo
<clever> linarcx: ive just abandoned all other distros :P
<clever> the magic var for substituteAll, must start with a lowercase letter
<clever> fresheyeball: dATE is accepted
<clever> fresheyeball: DATE is also rejected
<clever> fresheyeball: Date is not accepted by this regex, but foo is
<clever> foo
<clever> [clever@amd-nixos:~]$ foo=bar awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'
<clever> [clever@amd-nixos:~]$ Date=bar awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'
<clever> fresheyeball: also, what is within the entity.nix file?
<clever> fresheyeball: you want .overrideAttrs not .override and makeOverridable
<clever> jluttine: the grub menu only updates after another nixos-rebuild
<clever> fresheyeball: its not clear what .override is doing
<clever> fresheyeball: also, what is the content of mkPDF.nix?
<clever> fresheyeball: focus on the debug output from _allFlags
<clever> fresheyeball: maybe Date doesnt match that regex?, what about date or DATE?
<clever> fresheyeball: it is using this to figure out what "all" is
<clever> 736 for varName in $(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'); do
<clever> fresheyeball: @Date@ is not listed in that debug output
<clever> fresheyeball: try adding `NIX_DEBUG = true;` to the expression, and then update the logs in the snippet
<clever> ,escape'' jluttine
<clever> jluttine: what type of quote is it within?
<clever> linarcx: maybe QT is trying to use opengl to accelerate 2d rendering?
<clever> manveru: yeah, thats the one, thanks
<clever> linarcx: and now your making a hybrid nixos/void :P
<clever> linarcx: and to keep things simple, nix must manage the kernel and xorg
<clever> linarcx: and those libraries, must be compatible with the kernel driver, and the xorg driver
<clever> linarcx: the problem, is that you must use the opengl libraries that nixpkgs provides, and are meant for your card
<clever> linarcx: there are some projects that try to fix that, but they have issues, and depend heavily on which gpu you have
<clever> linarcx: you cant run something thats using opengl, on a non-nixos machine
<clever> linarcx: opengl with nix only works on nixos
<clever> linarcx: then your problem has nothing to do with the qt wrapper stuff
<clever> linarcx: are you on nixos or another arch?
<clever> fresheyeball: can you gist the nix expr and related files?
<clever> linarcx: what about `echo $DISPLAY` and `echo $LD_LIBRARY_PATH` ?
<clever> linarcx: then that wrapper isnt setting the important vars
<clever> linarcx: and if you now run ./kindd, what happens?
<clever> fresheyeball: try @DATE@ ?
<clever> fresheyeball: it might be limited to all-caps things, cant remember exactly
<clever> fresheyeball: it will replace @foo@ with the value of the $foo env var
<clever> linarcx: kindd is now a shell script, that sets the important env vars, run cat on that
<clever> linarcx: what does `ls -ltrha` show as having changed?
<clever> linarcx: youve wrapped the binary, but have you now ran the wrapped binary?
<clever> fresheyeball: or you can `--argstr foo bar` and `{ foo }: import (../things + "/${foo}.nix")`
<clever> fresheyeball: you can either `--arg foo ../things/foo.nix` and `{ foo }: import foo`
<clever> fresheyeball: that would take a string, not a path
<clever> fresheyeball: use --arg
<clever> fresheyeball: argstr will quote it, so it becomes a string
<clever> simpson: the problem is more that direnv is breaking all the bash functions in the nix-shell
<clever> fresheyeball: there is also pkgs.substituteAll
<clever> fresheyeball: its part of the stdenv
<clever> fresheyeball: substituteAll
<clever> all is seamless, and just treated as a normal binary cache
<clever> linarcx: and if i loose anything in the official cache, i have them on a local machine, and can re-download at gigabit speeds
<clever> linarcx: so if i loose the deps for a project, my hydra has them pre-built and rooted for re-download
<clever> linarcx: and i also run cachecache, which is a cache over cache.nixos.org
<clever> linarcx: mostly, i have a local hydra that builds most of my projects, and roots the closure of them
<clever> linarcx: not sure if thats fully possible
<clever> or reading something thats already wrapped in /nix/store/
<clever> probably
<clever> then you dont need to wrap things
<clever> and set those in your shell.nix
<clever> or figure out what env vars the hook is setting
<clever> so the functions may break when used in zsh
<clever> and there are syntax differences between bash and zsh
<clever> unknown, i dont keep a close eye on them
<clever> linarcx: thats just due to how they work, they copy env vars, not functions
<clever> linarcx: direnv and lorri break all bash functions
<clever> linarcx: when nix-shell creates a shell, it changes PS1 to say nix-shell
<clever> linarcx: that was not a shell made by nix-shell
<clever> bqv[m]: nixos-unstable-small is just fast-forwarded to the latest rev that passes a certain set of tests, whenever they pass
<clever> linarcx: can you screenshot the whole terminal?
<clever> linarcx: if you want hooks and functions to work, yes
<clever> you cant just run bash, you must use the bash that nix-shell creates
<clever> direnv breaks all functions that nix-shell and hooks create
<clever> linarcx: nix-shell only works with bash, zsh breaks everything
<clever> linarcx: `wrapQtApp kindd`
<clever> linarcx: like any other binary