2018-12-31

<clever> siraben: edit it to include CLI args?
<clever> siraben: it handles fetching the node_modules via package.json, and then builds it
<clever> siraben: you probably want yarn2nix

2018-12-30

<clever> so use +, rather the "${var}"
<clever> in general, i try to keep paths as the path type as long as possible
<clever> not sure
<clever> which copies a lot more
<clever> but, let var = ./.; in "${var}/foo" copies ./. to the store, and then gives you /nix/store/hash-something/foo
<clever> so if you do ./. + "/foo", its the same as ./foo, and only foo gets copied to the store
<clever> and path + string == path
<clever> pie_: do you want to reference it from nix or something else?
<clever> and then show the errors/warnings
<clever> iqubic: ghcid will :r the repl automatically every time a file is modified
<clever> vim
<clever> you only need to change shell.nix if you dont want ghcid installed
<clever> and `ghcid -c "foo"` will run foo to get a ghci, then :r automatically for you
<clever> `cabal repl` runs ghci, with the flags defined in your cabal file
<clever> `runhaskell Setup.hs` == cabal
<clever> then `ghcid -c "runhaskell Setup.hs repl"`
<clever> this shell.nix overrides the project, that can be used to add ghcid to the deps
<clever> iqubic: one sec
<clever> dont know about that

2018-12-29

<clever> ivan: try quering that file, on every binary cache you have
<clever> msuperdock: you want [ (pkgs.callPackage ./brother.nix {}) ]
<clever> msuperdock: lists are weird in nix, that is a list containing a function and whatever was in brother.nix
<clever> the one i cant link, is a sqlite backed filesystem
<clever> samueldr: oh dang, i made the other one a private github repo
<clever> that lets you mount a dir full of .nar files, as a nix store
<clever> samueldr: ive done 2.5 things with fuse
<clever> samueldr: heh, darwin much? :P
<clever> like change perms, owners, and add an overlay
<clever> pie_: you could make a fuse layer that does whatever you want
<clever> pie_: you should look into fuse
<clever> pie_: lol

2018-12-28

<clever> pie__: look into nix_user_chroot from nix-bundle, that lets you setup mount namespaces without root
<clever> docker will then tar up the changes, and create a new layer for those changes
<clever> basically, you take a list of layers, merge them into a single fs, then run a command like "apt-get install build-essentials"
<clever> docker thing
<clever> docker layers do the same kind of thing
<clever> pie__: trying to dockerize wine? lol
<clever> or open, delete dest, and rename
<clever> but that depends on how wine overwrites things, either open(foo), or open(foo.tmp) + rename foo.tmp -> foo
<clever> pie__: you can also symlink things in $HOME
<clever> there was several attempts to package windows stuff in nixpkgs, and it has been rejected repeatedly
<clever> pie__: why not just rsync the data to ~/.something/ on first start?
<clever> yeah
<clever> pie__: i linked the unionfs setup, which does the same thing as overlayfs
<clever> yep
<clever> Guest17278: which also requires __noChroot = true; on the derivation itself

2018-12-27

<clever> pie__: some is in use with the livecd and netboot images
<clever> Uma_: `sudo -l` can also help
<clever> there was an old wiki guide on installing nixos from a rescue env, which used nix-env to install nixos-rebuild
<clever> config.system.build.nixos-rebuild
<clever> Uma_: one min...

2018-12-25

<clever> Anton-Latukha: read the cmake setup hook

2018-12-24

<clever> > if true then 1 else 2
<clever> Guanin: same way you would in nearly every language
<clever> > "foo" == "foo"
<clever> after every concat, it will turn it into an absolute path, and strip any redundant elements
<clever> and path + "/" is a no-op
<clever> simpson: ./subdir is another absolute path
<clever> > /abs/path + ("/" + "subdir")

2018-12-23

<clever> and if the secrets are missing, some sane (and not secret) defaults are used
<clever> its in .gitignore, and i manually sync it around
<clever> Orbstheorem: i just dont put my secrets in git, simple
<clever> Orbstheorem: and fileExists
<clever> Orbstheorem: what if you just use the name to detect that, secrets.nix vs secrets.nix.bin ?
<clever> Dandellion[m]: yes
<clever> Orbstheorem: why are you using readFile? and not just a path
<clever> obadz: i just `ls -ltrh /tmp`
<clever> dgarzon: oh, and nix only needs a nixbld group if ran as root, if you drop root, but keep +w to /nix/store/, it will run in single-user mode
<clever> dgarzon: so it happens much later on, at runtime
<clever> dgarzon: the main way to cheat around that perf issue, is to have something like .bashrc do that initial setup when the user tries to open a shell inside the vm
<clever> dgarzon: also, runAsRoot makes the performance of generating the docker image much worse
<clever> samueldr: wow
<clever> fyuuri: if your on the nixos livecd, `passwd ; systemctl start sshd`
<clever> fyuuri: can you pastebin the output of `fdisk -l /dev/sda ; blkid /dev/sda*` and your configuration.yaml?
<clever> so you must now create a partition to define where stage 1.5 goes, and clearly mark it as in-use
<clever> but the GPT tables are bigger, and extend into that region, and ban such ugly practices :P
<clever> with MBR disks, grub puts stage 1.5 in the "unused" space between sector 1 and partition 1
<clever> 1mb in size, no fs, not mounted, not formatted
<clever> fyuuri: if you want legacy booting on gpt, you must have a bios boot partition
<clever> the <cardano_pkgs> has higher priority
<clever> Orbstheorem: that will either use <cardano_pkgs> or the result of fetch-nixpkgs.nix
<clever> Orbstheorem: one sec
<clever> Myrl-saki: https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix#L122-L125 is how ive always done my luks setup
<clever> develCuy: outputs = [ "out" "junk" ];, then put some stuff in $junk/foo and the rest in $out/bin
<clever> develCuy: you could put them into a second derivation, that the bin-only one depends on, or use split outputs
<clever> develCuy: then only create a bin in $out ?
<clever> Myrl-saki: it should, just run cryptsetup
<clever> develCuy: it may help to put that string into its own nix file, so you dont have to retype it
<clever> nix-build -E 'with import <nixpkgs> {}; callPackage ./foo.nix {}'
<clever> develCuy: you need to load it with callPackage
<clever> siraben: sent a PM as well
<clever> develCuy: nix-env -f foo.nix -iA bar
<clever> and its 1am now, i should get some sleep
<clever> nix-build will use default.nix when no file is given
<clever> siraben: oh, and it also helps to rename tilem.nix to default.nix
<clever> yep
<clever> `nix-build tilem.nix -A runit` will build only the bash script for running it
<clever> and number them semi-randomly
<clever> if you dont tell nix-build which attribute to build (via -A), it will just build every attribute
<clever> works identically to the rom you previously gave!
<clever> so it should work better when you run the nix file on your recent code
<clever> ah
<clever> either the source differs, or something malfunctioned during the build
<clever> also, when i built forth.rom, it didnt have the same text at the top
<clever> you can also duplicate the forth = ...; region, to add other custom roms
<clever> yeah
<clever> which could be upgraded in the future and break something
<clever> it will use the current nixpkgs on the machine
<clever> gist updated to include that
<clever> and they never have to repeat the above again
<clever> and they can play with your forth code in the emulator
<clever> so now you can just tell people to 1: install nix, 2: `nix-build tilem.nix -A runit && ./result`
<clever> by changing line 1 of the file to this, i can force all people using the nix file, to use my version of nixpkgs
<clever> 1 with import (builtins.fetchTarball https://github.com/nixos/nixpkgs/archive/6141939d6e0.tar.gz) {};
<clever> which i know works
<clever> thats the version of my current nixpkgs
<clever> [clever@system76:~/apps/zkeme80]$ nix eval nixpkgs.lib.version
<clever> "19.03pre158246.6141939d6e0"
<clever> let me tweak it a bit more...
<clever> so you could just add it to that repo, and then its set
<clever> the file expects to live inside zkeme80
<clever> then run it!
<clever> siraben: this will compile everything, including the emulator, and the rom, and generate a bash script, that just opens the rom in the emulator
<clever> [clever@system76:~/apps/zkeme80]$ nix-build tilem.nix -A runit && ./result
<clever> and on to phase 2!
<clever> oh, i see a new err
<clever> i updated the gist to include the new tilem.nix
<clever> [clever@system76:~/apps/zkeme80]$ nix-build tilem.nix -A forth
<clever> thats nix, it creates a /build/ and cd's into it
<clever> ;;; failed to create path for auto-compiled file "/build/smiley-os.scm"
<clever> ;;; WARNING: compilation of /build/smiley-os.scm failed:
<clever> i did clone your zkeme80
<clever> siraben: does smiley-os have to be built first? or have a .scm tacked on the end?
<clever> ;;; In procedure stat: No such file or directory: "/build/smiley-os"
<clever> ;;; Stat of /build/smiley-os failed:
<clever> ;;; <stdin>:1:26: warning: possibly unbound variable `make-rom'
<clever> what would the exact shell command be, to build a rom from that scm file?
<clever> ${./forth.scm} is the path of the source, from the current dir
<clever> it should create $out and put results in there
<clever> the part inside ''here'' is just bash code
<clever> runCommand "foo" { buildInputs = [ guile ]; } ''guile -e "make-rom forth.rom"'' or something
<clever> it will be something in the form of:
<clever> siraben: your next challenge, should you accept it, is to build that rom, with nix!!
<clever> it left some things in ~/.config/tilem2/
<clever> seems all buttons make it draw the squares, then power off
<clever> ah, screen changes color when "off"
<clever> saw the sqaures when i hit enter, but now the screen is blank
<clever> i see your forth-based os and a smiley, when i click the power button
<clever> i think its asking me for a rom file when i run it
<clever> then it will be in $PATH
<clever> you could also: nix-env -f tilem.nix -iA tilem
<clever> [clever@system76:~]$ ./result/bin/tilem2 --help
<clever> [clever@system76:~]$ nix-build tilem.nix -A tilem
<clever> /nix/store/00lys342ajzdwq5n99gajg9p60ds7p8s-tilem
<clever> siraben: it builds!
<clever> most packages are far simpler
<clever> siraben: making progress here with tilem!
<clever> gist updated
<clever> so thats 2 configure flags it needs to build, and doesnt enable by default
<clever> aha, --enable-iconv
<clever> wedens: it looks like its not building its own libs, and then going right to tests
<clever> wedens: ticables builds, its ticonv that fails now
<clever> gist updated
<clever> one down!
<clever> --enable-libusb10 got cables to build!
<clever> siraben: last post on https://www.omnimaga.org/general-calculator-help/tilp-isn't-working!/ looks helpful
<clever> siraben: nativeBuildInputs = [ autoreconfHook ];
<clever> that includes the error i got, but no obvious fix
<clever> ticables fails to link due to libusb issues...
<clever> i'm filling in the inter-package deps now
<clever> nope
<clever> gist updated again
<clever> siraben: the symbol its failing on is over here, but it didnt build that file
<clever> /tmp/nix-build-libticonv.drv-0/libticonv-1.1.5/src/iconv.c:TIEXPORT4 ticonv_iconv_t TICALL ticonv_iconv_open (const char *tocode, const char *fromcode)
<clever> wedens: i believe it is
<clever> the tests dont link right
<clever> yeah
<clever> gist updated again
<clever> its similar to `rec { ... }` but opens up the option to do things better in the future, without having to fix a dozen things
<clever> which allows you to do self.tilibs2
<clever> lib.fix will call that function, with its own return value
<clever> self: { ... } defines a function, that takes 1 argument called self
<clever> siraben: fixing that now...
<clever> simpson: the default unpackPhase uses that
<clever> updated the gist again
<clever> yeah
<clever> siraben: refresh the gist i linked before
<clever> will need some custom code, let me write it
<clever> what URL do you get libticalcs2 from?
<clever> nix expressions for those will also hve to be written
<clever> then just `nix-build tilem.nix`
<clever> siraben: in a new nix file, let me pastebin an example
<clever> it makes things much simpler to repeat later on
<clever> its all in the nixpkgs manual
<clever> siraben: all libraries must be installed via nix, or nix based builds wont find them
<clever> and thats when inside the shell command i gave above?
<clever> which ones are missing?
<clever> ,library siraben
<clever> siraben: nix-shell -p gnome2.gtk pkgconfig glib
<clever> siraben: you must do the build inside nix-shell, and you cant `make install`

2018-12-21

<clever> need to reboot, bbl
<clever> ive used it to generate nix attrsets, from pure haskell data records
<clever> it should also have a pretty printer
<clever> hnix i think
<clever> so it tried to open it twice
<clever> user123: ah, sounds like you had it defined twice
<clever> either in the nix (set it to true) or in bash (set it to 1)
<clever> jomik: setting dontInstall=1 will cause genericBuild to just not install
<clever> jomik: yeah
<clever> you could also tell genericBuild to not install
<clever> after launching nix-shell, before running genercBuild
<clever> yeah, best way for interactive and incremental testing
<clever> jomik: nix-shell doesnt make /nix/store writable, it just sets the env vars that nix-build would have given you
<clever> jomik: i usually do `export out=$HOME/fake-out/` for situations like that
<clever> ilya-fedin: the relevant entries under boot.loader arent set
<clever> ilya-fedin: /run/current-system/bin/switch-to-configuration will reference the compiled copy of it
<clever> its not installed normally
<clever> ilya-fedin: systemd-boot?
<clever> read /etc/systemd/system/modem-manager.service
<clever> ilya-fedin: you could also override openresolv = null;, like with nano
<clever> that script should delete old kernels too
<clever> ilya-fedin: but you then need to run the install-bootloader script in the current nixos, to re-sync /boot with that
<clever> ilya-fedin: if you told it to delete profiles (with either -d or --delete-older-than), then it will delete the generations from /nix/var/nix/profiles/system
<clever> nixos-rebuild is the only way to update that
<clever> so the old kernels will remain, but the top-level nixos will be missing in /nix/store/ and they will fail to boot
<clever> GC wont delete anything in /boot/
<clever> slabity: you must nixos-rebuild after a GC, to regenerate the grub config
<clever> if a module lacks both config and options, nixos will automatically wrap it in a config = { ... }; for you
<clever> all config must be in the config attribute
<clever> i also try to avoid with, it defers "variable not in scope" type errors until much later, and i suspct it harms performance slightly
<clever> or put `with lib;` near the top
<clever> ilya-fedin: lib.mkOption
<clever> or an echo
<clever> which might just be a kernel param
<clever> so you just need to change the default scheduler
<clever> ilya-fedin: using this nixos option, you can force nixos to load it before mounting the rootfs
<clever> boot.initrd.kernelModules
<clever> List of modules that are always loaded by the initrd.
<clever> [none] mq-deadline kyber bfq
<clever> it is now a valid choice
<clever> [root@system76:/etc/nixos/nixos-configs]# cat /sys/block/nvme0n1/queue/scheduler
<clever> [root@system76:/etc/nixos/nixos-configs]# modprobe -v bfq
<clever> ilya-fedin: and if you `modprobe bfq` on nixos?
<clever> /run/current-system/kernel-modules/lib/modules/4.14.79/kernel/block/bfq.ko.xz
<clever> [root@system76:/etc/nixos/nixos-configs]# find -L /run/current-system/kernel-modules | grep bfq
<clever> it might just need a modprobe
<clever> ilya-fedin: same options on my laptop
<clever> ilya-fedin: at least on my machine, its empty by default
<clever> [ ]
<clever> nix-repl> config.boot.kernelPatches
<clever> # nix repl '<nixpkgs/nixos>'
<clever> ilya-fedin: boot.kernelPatches requires the kernel rebuilding in full, but if you can build it out-of-tree, you can use boot.kerenelPackages
<clever> but you still need -lfoo to make it link to libfoo.so
<clever> the stdenv deals with -L flags, which affect where -lfoo searches
<clever> you need to pass the right -l flags, -lcl or -lopencl i'm guessing
<clever> -p will have g++ by default
<clever> ,overlays
<clever> ottidmes: wut! :D
<clever> ilya-fedin: make an overlay that just sets nano = null; ?
<clever> you want to either highprio resolvconf, or use an overlay to affect pkgs.openresolv
<clever> ilya-fedin: that will add a 2nd openresolv that is at low prio, but not affect the 1st openresolv
<clever> ottidmes: the backtraces give better locations, and its easier to manage when you want to share it between several files
<clever> imports is often far simpler
<clever> then query the metadata on that rev
<clever> the most you can do, is to brute-force eval "${pkgs.hello}" from every revision of nixpkgs, until you find one that matches your current hello binary (and pray it lacks overrides)
<clever> and once its turned into a .drv file, all metadata is lost
<clever> then realization turns drv files into compiled products
<clever> the nix-instantiate pass turns nix expressions into .drv files (visible with nix show-derivation)
<clever> nDuff: .meta is not stored in along with storepaths
<clever> nDuff: what kind of metadata?
<clever> lokado: if possible, try just running the electron binary from pkgs.electron on that packages dir
<clever> spacetato: yeah
<clever> its either an entry from pkgs.vscode-extensions, or an attrset
<clever> which is documented there
<clever> spacetato: it just calls .override on vscode-with-extensions, and sets vscodeExtensions
<clever> spacetato: pull up the home-manager source, and see how that var is used
<clever> Baughn: i nix-instantiate both, then nix-diff the drv's

2018-12-20

<clever> bbl
<clever> s/hand/handy/
<clever> s/remove/remote/
<clever> and that will undo it
<clever> for example, i sometimes delete /etc/nix/machines to stop all remove builds