2018-08-28

<clever> > pkgs.substituteAll
<clever> it must be another nix file
<clever> depends on if you want something that can be added to PATH or something to just run
<clever> ekleog: writeScript puts it in $out, and scriptbin puts it in $out/bin/$name
<clever> ekleog: yeah, i also tried to avoid systemd
<clever> thats why i avoid dbus :P
<clever> yeah, but it just never got implemented
<clever> ekleog: pretty sure the problem is that nixos-rebuild doesnt want to iterate over every single user
<clever> there is a special reload that is needed to make it re-read service files
<clever> ldlework: use writeScript to create your own script
<clever> > writeScript "name" ''#!/bin/sh .... ''
<clever> > writeScript "name" ''#!/bin/sh .... '
<clever> ldlework: use writeScript to create your own script
<clever> you can also just "echo $DISPLAY" in the script
<clever> something in nixos modifies the logind env vars to set that up
<clever> but i dont use them much
<clever> i think so
<clever> user services run per user, as the right user, wtih things like your DISPLAY set right
<clever> system services run even if xorg isnt open, and your not logged in
<clever> ldlework: you probably want a systemd user service, not a system service
<clever> ldlework: $DISPLAY isnt set, so the service cant connect to xorg
<clever> ldlework: is this a GUI app?
<clever> ldlework: is gdb in PATH?
<clever> ldlework: did you run `coredumpctl gdb <PID>` ?
<clever> pastebin the output of bt
<clever> yeah
<clever> ldlework: you may need to add a `ulimit -c unlimited` to the script
<clever> and bt
<clever> then run coredumpctl gdb <pid>
<clever> it should list the coredumps and pid's
<clever> ldlework: now run coredumpctl as root
<clever> Enzime: nope
<clever> which is why we need a coredump
<clever> ldlework: the if statement on 8 checks to see if enable is set, so you dont have to set it again
<clever> ldlework: it sounds like the binary is crashing, try turning on systemd-coredump to get a coredump
<clever> ldlework: line 16 only enables the service if the service is already enabled

2018-08-27

<clever> gentoo was my main OS, prior to discovering nixos
<clever> jonge: i have previously seen a bug in the livecd that broke binary caches, and sometimes a user just thinks a rebuild-the-world style gentoo install is normal, lol

2018-08-26

<clever> dhess: but that can cause problems if you try to build it on a real aarch64, it will demand an x86-64 build slave
<clever> dhess: and maybe also do something with config and overlays
<clever> dhess: but you wont import <nixpkgs> but instead `import pkgs.path { system = builtins.currentSysstem; }`
<clever> dhess: hydra would eval it on an x86-64, so currentSystem will be x86-64
<clever> daveo_: iftop is just a much simpler form of the same thing, it uses pcap to gather the data
<clever> that will always be for the current system, then you need to grab the dhall-nix from it
<clever> dhess: import <nixpkgs> { system = builtins.currentSystem; }
<clever> dhess: but then it introduces an impurity
<clever> dhess: re-importing nixpkgs with builtins.currentSystem can get that effect
<clever> daveo_: yep
<clever> dhess: oops, ^^^
<clever> daveo_: dhallToNix would need to be modified to accept 2 system params, then import nixpkgs twice, with those 2 values
<clever> daveo_: though iftop can show more details, and tell you which domain is doing it all
<clever> daveo_: ah, that also does the same job as vnstat
<clever> the nix-env one doesnt really help any, and will stop nixos-rebuild from ever updating what is in $PATH
<clever> bigvalen: probably, but its not a good idea to install postfix twice like that
<clever> there is a bug in nix-env, that dead symlinks break nix-env -i
<clever> bigvalen: oh!, nix-env -q
<clever> bigvalen: yeah, all of that looks perfect, where did you get the /nix/store/r0z0z67cav0yffbpdpcz2f12b3vd9dwj-postfix-3.0.3/sbin path from?
<clever> daveo: you can also check `iftop` to see what ip its going to
<clever> daveo: run `vnstat -l -i enp3s0` and check if its doing any kind of upload
<clever> bigvalen: can you post your configuration.nix to a gist?
<clever> services.postfix is the nixos option
<clever> bigvalen: do you have any packageOverrides or overlays?
<clever> bigvalen: ls -l /root/.nix-defexpr/channels/nixos
<clever> bigvalen: version 3.3.1 doesnt have this issue, so it may already be fixed, what does `nix-channel --list` report?
<clever> bigvalen: you need to add an override to fix postfix
<clever> bgamari: oops, yeah
<clever> bgamari: you want to fix the postfix derivation and then nixos-rebuild again
<clever> bgamari: let me check what i did...
<clever> bgamari: mkDerivation cant be wrapped like that
<clever> > backblaze-b2.meta.description
<clever> daveo: pkgs/top-level/python-packages.nix
<clever> daveo: youll also need to add it to another file
<clever> daveo: i dont see b2 in python2Packages
<clever> daveo: thats the same link twice
<clever> daveo: the nix expression for the package will need to be fixed to include B2
<clever> sphaugh: not sure, i try to avoid mixing them
<clever> so that wont make any difference
<clever> daveo: nix ignores whatever you have currently installed while building
<clever> daveo: nix-env -f . -iA duplicity
<clever> you would need to look at the hackage docs for the problem function, and see how it has changed
<clever> the types in tensorflow-proto have changed
<clever> yeah
<clever> also of use, you can just run `git clone` on the above URL
<clever> blankhart: https://gist.github.com/cleverca22/025a197a47f6d21b0af27457b4b5d542 how about with these changes?
<clever> it must explicitely be listed in the inputs of tensorflow
<clever> every package is built in its own sandbox, even if you install it before tensorflow, it wont be visible to tensorflow
<clever> blankhart: editing that now
<clever> blankhart: you only added protoc to project
<clever> blankhart: tensorflow-proto is failing due to lack of protoc
<clever> blankhart: can you pastebin the error?
<clever> nix-shell shouldnt try building anything
<clever> blankhart: what error does nix-shell give?
<clever> blankhart: oh, the .env used by nix-shell omits the tools
<clever> blankhart: did you re-launch the shell? what does `type protoc` return?
<clever> pi3r_: i try to put it all in an overrides, because it makes it simpler to access the deps if you need them, and when the project grows, more things can depend on that package
<clever> pi3r_: yeah, i think those are the same
<clever> blankhart: with nix-build or nix-shell?
<clever> pikajude: oops, wrong tab-complete
<clever> pikajude: add protobuf to line 28 of the pastebin, to remap it the same way pkgconfig is remaped
<clever> pikajude: due to how callPackage works, you are getting the hackage protobuf, not the c++ protobuf
<clever> > haskellPackages.protobuf
<clever> blankhart: can you pastebin your nix files?
<clever> pikajude: and the main thing i want to use it on, is ~20 cabal projects depending on eachother
<clever> pikajude: ive heard that snack doesnt support multiple cabal projects at once
<clever> blankhart: does the haskell package contain a library?
<clever> blankhart: pkgs.protobufc also contains a protoc symlink
<clever> yep
<clever> > pkgs.fetchFromGitHub
<clever> > pkgs.fetchFromGithub
<clever> ldlework: callPackage can send anything that is an attribute of pkgs
<clever> that wont change the bootup default, so you can just reboot the VM to undo the change
<clever> callipygous: also to speed up testing, use `nixos-rebuild test`
<clever> try without enabling i3
<clever> callipygous: try changing absolutely nothing, and onyl nixos-rebuild switch
<clever> callipygous: what if you dont add unstable?
<clever> then the update broke something, try nix-channel --rollback to undo the update
<clever> the xserver sometimes crashes if you try to update things without rebooting
<clever> that defers the update until you reboot
<clever> try using `nixos-rebuild boot` instead, and then reboot
<clever> callipygous: did you do nix-channel --update at any point?
<clever> ldlework: so you must import (fetchFromGithub { ... })
<clever> ldlework: but nothing is currently loading THAT file
<clever> callipygous: try using grub to switch to the previous generation, then run `sudo journalctl -b -1` to read the logs from the previous boot
<clever> it just fetches, from github
<clever> correct
<clever> it only happens when you run import or callPackage
<clever> ldlework: you need to import the source to run its default.nix
<clever> ldlework: 17 installs the SOURCE, not the result of running that nix
<clever> oops, missed a word
<clever> ldlework: 6 fetches the source, and 17 installs the source

2018-08-25

<clever> ixxie: then you have to run `nixops modify` to tell it where the file has moved
<clever> ixxie: when you run `nixops deploy`, it will just eval every deployment file it was configured to use, and build the whole system based on them
<clever> LnL: only with grub, configurationLimit
<clever> thblt: but you can still run it with --install-bootloader
<clever> thblt: to be safe, i would only delete the larger files, and keep the core parts of grub
<clever> thblt: you need to manually delete some initrds, nix-collect-garbage never updates /boot, only nixos-rebuild does
<clever> ldlework: yep
<clever> ldlework: when hydra fetches release.nix, it also gets the source
<clever> ldlework: if the release.nix is in the right dir, it can always do ./.
<clever> endformationage: add .debug to the -A flag
<clever> with import <nixpkgs> {}; callPackage ./foo.nix {}
<clever> qyliss: this creates a /run/current-system/nixcfg, that points to a copy of nixos-configs
<clever> mudri[m]: just do ./xkeyboard-config-james.patch, unquoted, and ignore the relative function
<clever> the sandbox is on by default, you must use paths properly
<clever> ah, thats your problem
<clever> mudri[m]: what is the definition of relative?
<clever> mudri[m]: what is the definition of relative?
<clever> mudri[m]: which file? and how did you refer to it?
<clever> aldkgj: and is systemd too late?
<clever> callipygous: most driver things do, simpler to just accept the driver the usb has and finish the install
<clever> owickstrom: yeah
<clever> owickstrom: callCabal2nix "foo" "${src}/foo" {}
<clever> callipygous: correct, the live usb doesnt save anything
<clever> callipygous: nix-env -iA nixos.irssi
<clever> sphalerite: evtest can even detect headphones being (un)plugged
<clever> sphalerite: run evtest as root
<clever> sphalerite: there is something related, that can hijack any input device and receive inputs
<clever> sphalerite: uinput, let me find the test thing
<clever> its more likely that nixos-rebuild wont even work, if the types are broken
<clever> jD91mZM2: after you dd it over, you can add another partition in the empty space
<clever> techieAgnostic: i dont think cabal supports system libraries
<clever> jD91mZM2: the ISO already has partitions on it, just dd it directly to the usb stick
<clever> dukedave: the defaults are usually fine
<clever> dukedave: if you pipe it into sh, then sh cant use stdin to ask things, if you save the script to a file and then run sh on it, it can ask you questions
<clever> techieAgnostic: did you nix-shell into the .env attribute?
<clever> Ashy: `man configuration.nix`
<clever> Ashy: linuxPackages_latest
<clever> Ashy: now just set boot.kernelPackages = pkgs.linuxPackages_4_17; and nixos-rebuild switch
<clever> techieAgnostic: add it to the librarySystemDepends field of mkDerivation
<clever> Ashy: run `nix repl '<nixpkgs>'` and then just try tab-completing linuxPackages
<clever> Ashy: you can probably get a newer kernel while staying on 18.03
<clever> mog: yep
<clever> fresheyeball: ive not really used ghcjs, so i'm not sure what else to do
<clever> mog: you could also do: with (import <nixpkgs> { crossSystem = (import <nixpkgs/lib>).systems.examples.riscv64; }); stdenv.mkDerivation { ... } in a foo.nix file, then use it with nix-build or nix-shell
<clever> mog: this nix expression will build hello-world for riscv64
<clever> mog: (import <nixpkgs> { crossSystem = (import <nixpkgs/lib>).systems.examples.riscv64; }).hello
<clever> mog: one min
<clever> fresheyeball: you may need to disable haddock
<clever> fresheyeball: and what happens if you simply remove ghcjs-base?
<clever> fresheyeball: try removing the restriction on base from your cabal file?
<clever> yeah, i am
<clever> fresheyeball: maybe i'm mixing you up with somebody else, let me re-read your pastebins
<clever> fresheyeball: yeah, you need to look into why latex needs a home set
<clever> fresheyeball: and -I cant set env vars at all
<clever> fresheyeball: the problem is not with -I
<clever> fresheyeball: but nix-shell leaves $HOME at a sane value, and the writes suceed, and you never notice them
<clever> fresheyeball: so when latex tries to write to $HOME it fails
<clever> fresheyeball: the nix-build has HOME=/homeless-shelter
<clever> growpotkin: most of that is in the nix pills series and the nix manual
<clever> fresheyeball: nix-sssshell hhhhhas $HOME set, ssssssssssssssssso it wont trrry to make one
<clever> my systemPackages also detect if gui is enabled, and then installs the gui capable git
<clever> which depends on some compilers, causing several gig of extra usage
<clever> i have a programs.vim.fat option, that controls youcompleteme support
<clever> and then set it to true or false
<clever> Ashy: you could create a custom.desktopApps = true; option
<clever> Ashy: instead of choosing to include a certain desktop-apps.nix file in the imports list
<clever> Ashy: one option is to just run `git init` in that dir, and start to commit things, and push it somewhere
<clever> then it will be more reproducible
<clever> philippD: first thing i would recomend is to pin the nixpkgs, and not use <nixpkgs>
<clever> philippD: why is it trying to put config in that location?
<clever> mktexfmt: /homeless-shelter/.texlive2017/texmf-config/web2c/fmtutil.cnf
<clever> mktexfmt: mktexfmt is using the following fmtutil.cnf file for writing changes:
<clever> philippD: its probably an issue within the latex binaries
<clever> philippD: something is trying to mkdir $HOME
<clever> and the profile itself is also in the store
<clever> yeah

2018-08-24

<clever> eqyiel: for each item in $buildInputs, check its nix-support dir for a propagated inputs file
<clever> its usually simport to just put them into a configuration.nix, and run `nix repl '<nixpkgs/nixos>' -I nixos-config=./configuration.nix`
<clever> growpotkin: you need to put them into a nixos module, and run the module framework over it
<clever> fresheyeball: nix-shell -p '(haskell.packages.ghcjs.callCabal2nix "name" ./. {}).env'
<clever> fresheyeball: nix-shell -p 'haskell.packages.ghcjs.ghcWithPackages (ps: [])'
<clever> rnhmjoj[m]: so the pre-start has root and can do chown/chmod
<clever> rnhmjoj[m]: if you set PermissionsStartOnly, then the User= only applies to ExecStart, and ExecPreStart wont obey User=
<clever> kalbasit[m]: its more that darwin nixpkgs doesnt have gcc by default, and you must obey $CC to use clang
<clever> mkShell is just a helper function to call mkDerivation, and give giant errors if you try to nix-build it
<clever> kalbasit[m]: you need to use gccStdenv.mkDerivation
<clever> kalbasit[m]: i suspect line 42 is to blame, that wont configure gcc correctly
<clever> kalbasit[m]: what args did you give to nix-shell, and is it using gcc or /usr/bin/gcc ?
<clever> kalbasit[m]: is this inside nix-shell or nix-build?
<clever> > toString 42
<clever> jonreeve: yeah, i would just rm channels like you said above
<clever> you may need to `nix-env -iA nixos.gist` and `gist --login`
<clever> jonreeve: strace -o logfiles -ff nix-channel --update, then upload all the logfiles to gist with `gist -p logfiles*`
<clever> but nix-channel --update should have removed it
<clever> ls -l /nix/var/nix/profiles/per-user/jon/channels/
<clever> ls -l /nix/var/nix/profiles/per-user/jon/channels
<clever> jonreeve: ls -l ~/.nix-defexpr
<clever> jonreeve: what about the output of `echo $NIX_PATH` and `nix-instantiate --find-file nixpkgs` ?
<clever> jonreeve: yeah
<clever> tertle||eltret: mount it and chown the dir
<clever> ij: the cc-wrapper radds it
<clever> yeah
<clever> hmmm, nix-store --verify --check-contents
<clever> --update reads ~/.nix-channels and updates the channels profile
<clever> empty is normal
<clever> and you definetly did --update as jon?
<clever> 0 bytes, empty file
<clever> jonreeve: cat ~/.nix-channels
<clever> jonreeve: ls -l ~/.nix-defexpr/channels/nixpkgs
<clever> jonreeve: nix-channel --update, eithout sudo
<clever> darwin even sets the wrong $HOME and acts on the wrong user
<clever> i avoid that, and just keep a root shell open
<clever> it runs bash in a different mode
<clever> jonreeve: use `sudo -i` and then `nix-channel --update`
<clever> lrwxrwxrwx 1 clever users 44 Oct 29 2017 channels_root -> /nix/var/nix/profiles/per-user/root/channels
<clever> the channels_root is missing
<clever> jonreeve: and `ls -l ~/.nix-defexpr/` ?
<clever> thats normal
<clever> jonreeve: what does `nix-channel --list` report for each user?
<clever> and if you do understand whats wrong, you can just fix it
<clever> jonreeve: if you dont understand what is wrong, your likely to just break it again after you reinstall
<clever> jonreeve: that maps <nixpkgs> back to the nixos channel
<clever> nbathum: what about `touch /root/foo` ?
<clever> nbathum: nothing oviously wrong, nix-channel --update should just work
<clever> slabity: ive seen it on a trelo
<clever> nbathum: the db is in /nix/var/
<clever> nbathum: thats normal, the db is not in store
<clever> rfold: nothing obviously wrong there :(
<clever> sphalerite: not sure, but i think that the php-fpm daemon is able to run multiple pools with unique configs on its own, and nixos just lacks the ability to start 2 of those daemons
<clever> nbathum: can you pastebin the output of mount and df -h?
<clever> rfold: can you pastebin configuration.nix?
<clever> nbathum: dmesg | tail, does it mention anything about ro or read-only?
<clever> but you probably want to update roots channels anyways
<clever> each user has its own set of channels, not sure why its breaking for non-root
<clever> nbathum: what does `type nix-store` report?
<clever> nbathum: nixos or another distro? single or multiuser install?
<clever> yeah, i forgot about the symlinkjoin
<clever> nothing would refer to that image
<clever> nope
<clever> ah, that could be an issue
<clever> sphalerit: nixos-rebuild should also work inside the netboot image, provided the configuration.nix is right
<clever> why?
<clever> what nastyness do you want?
<clever> ah
<clever> failing to remount the store to nixos-install
<clever> sphalerite: i fixed that a while ago
<clever> fresheyeball: some tests i was doing for generating zone and dhcpd files: https://github.com/cleverca22/nix-tests/tree/master/ip-magic
<clever> fresheyeball: nixops can update route53
<clever> sphalerite: actually, line 48
<clever> sphalerite: i copied this into its own nix file, to generate a dir in the tftp root
<clever> sphalerite: oh, one min
<clever> i'm thinking the new `nix build` is broken, try again with `nix-build`
<clever> sphalerite: you only want the ipxe script, that depends on the ramdisk already
<clever> timj1: i think this was enough to get a shell working in a sane manner: https://github.com/input-output-hk/cardano-sl/blob/develop/docker.nix#L32
<clever> timj1: but i have gotten less working i believe
<clever> not sure
<clever> vmandela: you need to get kvm working inside the virtualbox vm, look up nested virtualization
<clever> echo $NIX_PATH
<clever> that can also work