2020-09-16

<clever> zanc: i believe its a set of every channel in ~/.nix-defexpr/
<clever> mvnetbiz_: it may only work on nix-instantiate, ive not looked at `nix eval` in depth yet
<clever> mvnetbiz_: --arg only applies when loading files from disk
<clever> NieDzejkob: it has to eval every single package in nixpkgs, to see if they depend on what you changed
<clever> cransom: not directly, youll need to look at how nixos containers work, and set i think boot.isContainer = true;
<clever> mvnetbiz_: i think it would need to be `{ num }:` and then use `--arg num`
<clever> cole-h: now it also has the iso-image.nix in the imports
<clever> cole-h: import "${inputs.nixpkgs}/nixos" { configuration = { imports = [ "${nixpkgs}/nixos/modules/installer/cd-dvd/iso-image.nix" ./stuff ]; }
<clever> cole-h: now its using flakes
<clever> cole-h: import "${inputs.nixpkgs}/nixos" { configuration = ./stuff.nix }
<clever> cole-h: <nixpkgs/nixos> calls evalModules for you, and passes it the right args
<clever> cole-h: then it will only affect builds that use extra-configuration.nix
<clever> cole-h: you could make a extra-configuration.nix, that has `imports = [ ./configuration.nix /path/to/iso-image.nix ];`
<clever> cole-h: `import <nixpkgs/nixos> { configuration = ./configuration.nix; }` would let you change the path to it
<clever> cole-h: you must import <nixpkgs/nixos> and put iso-image.nix into the imports of your configuration.nix

2020-09-15

<clever> matthuszagh: `sudo -i`
<clever> nerdypepper: thats the nixos module framework

2020-09-14

<clever> energizer: the build environment i believe
<clever> yep
<clever> vifon: ive had trouble debugigng things too, because the steam DRM stops you from running the game outside of steam
<clever> vifon: if you want to run it without the gui, youll either need steam-run or patchelf
<clever> thats normal
<clever> yeah
<clever> does it show errors in the terminal when you try to run it from steam?
<clever> then i get the whole steam gui and things just work
<clever> vifon: just `steam` and nothing more
<clever> it uses a chroot env to avoid the need to patchelf
<clever> vifon: i have been running steam on nixos without too many issues
<clever> vifon: you have to patchelf it, like any other binary you get from outside of nixos
<clever> Ankhers: the compilers in nix arent meant to really work like that, you need to load into a nix-shell for the target you want to build for
<clever> NieDzejkob: nix-shell -p 'python.withPackages (ps: [ ps.z3 ])'
<clever> Ankhers: pkgsi686Linux.stdenv would give you a 32bit env
<clever> Ankhers: did you tell nix to give a cross compiler?
<clever> Ankhers: how are you doing the cross-compile? to which arch?
<clever> vifon: its possibly that you didnt have any /boot mounted at all, that is a common problem
<clever> vifon: 'fileSystems."/" = …' and 'fileSystems = { "/" = … }' are identical
<clever> astro: yeah, that sounds about right
<clever> vifon: i always use grub, even on efi
<clever> it may require them to be on the fat32
<clever> does systemd-boot even have ext4 support?
<clever> correct
<clever> vifon: then your EFI partition must be at /boot/
<clever> vifon: depends on other config, what did you set your efi mount point to in configuration.nix?
<clever> vifon: is /boot mounted correctly?
<clever> astro: ^
<clever> { a = 1; b = 2; }
<clever> trace: ["a","b"]
<clever> nix-repl> let input = { a=1; b=2; }; in builtins.trace (builtins.toJSON (builtins.attrNames input)) input>
<clever> try dumping builtins.attrNames on an input
<clever> if you try to treat it as a string, you wind up with the source instead
<clever> > let set = { outPath = "foo"; }; in "${set}"
<clever> astro: i believe they are a set, with an outPath
<clever> fetchGit doesnt keep the .git by default
<clever> GolDDranks: which fetcher are you using?
<clever> eyJhb: ah, then you do need that
<clever> eyJhb: if system is set right, you wont need -j0, because nothing can run on the x86 host
<clever> pjt_tmp: you must also import nixpkgs with system set, or it will just do a native build for the host
<clever> pjt_tmp: which is needed any time your mixing x86 and arm
<clever> pjt_tmp: i prefer using /etc/nix/builders, that lets you clearly specify what arch the remote cpu is
<clever> joehh1: you must use { config, pkgs, lib, ... }: to get a lib that doesnt depend on the results
<clever> joehh1: thats because pkgs depends on the result of that
<clever> then it will work a lot nicer
<clever> so you just do `imports = [ /path/to/module ];` and then `something.enable = true;`
<clever> you probably want a custom nixos module
<clever> just put it one let block higher
<clever> or, its already in the same file
<clever> just fetch it with import and dont involve the overlay
<clever> it would be a lot simpler if buildScheduledTask wasnt inside pkgs
<clever> the nixos module framework as a whole
<clever> but, the keys of { ... } must still be known ahead of time
<clever> that will inteligently merge the 2 for you
<clever> for example, mkMerge [ { environment.systemPackages = [ xx ]; nixpkgs.overlays = [ myOverlay ]; } { ... } ]
<clever> you must use mkMerge
<clever> yep
<clever> joehh1: and yz depends on pkgs, which depends on .nixpkgs
<clever> joehh1: nix cant figure out what keys you return (.environment .nixpkgs and ????) until it knows what yz.service is
<clever> joehh1: yeah, // in modules is very bad
<clever> joehh1: *looks*
<clever> shouldnt be
<clever> i looked for the exact file you wanted, so fftw wasnt in my results
<clever> fftw and fftwFloat have different libraries available
<clever> libfftw3f_omp.la libfftw3f_omp.so.3 libfftw3f.so libfftw3f.so.3.5.8 libfftw3f_threads.so libfftw3f_threads.so.3.5.8
<clever> [root@system76:~]# ls result/lib//
<clever> [root@system76:~]# nix-build '<nixpkgs>' -A fftwFloat
<clever> fftwFloat.out 0 s /nix/store/ya5akklsw0in27x51lf8s2425pwv1g99-fftw-single-3.3.6-pl1/lib/libfftw3f.so
<clever> the f variant is in fftwFloat
<clever> [clever@amd-nixos:~]$ nix-locate libfftw3f
<clever> its not in that derivation
<clever> oh, the f variant
<clever> which does have a libfftw3.so
<clever> [nix-shell:~]# echo $NIX_LDFLAGS
<clever> -L/nix/store/lxnwq0gqmbx94y7vq3cfjcm8fc1vj4l6-fftw-double-3.3.8/lib -L/nix/store/lxnwq0gqmbx94y7vq3cfjcm8fc1vj4l6-fftw-double-3.3.8/lib
<clever> Graypup_: that only has the compile flags, not the link flags
<clever> Graypup_: you dont want fftw in nativeBuildInputs
<clever> ornxka: can you pastebin your nix expression?
<clever> Graypup_: NIX_CFLAGS_COMPILE, which gcc (a bash script) will inject into the CLI as it runs gcc (the elf binary)
<clever> ornxka: buildInputs = [ fftwFloat ]; and it should just work
<clever> Graypup_: nix adds the /lib folder of every buildInput to -L automatically, so you dont even have to mess with pkgconfig for basic stuff
<clever> ornxka: it sounds like you need to add a library to the buildInputs
<clever> ,locate
<clever> iwq: nix-locate can also be used to figure out the library -> package names
<clever> > autoPatchelfHook

2020-09-13

<clever> immae: `{ inherit foo; }`
<clever> immae: correct, you just have to `inherit foo;` somewhere
<clever> immae: args wont contain the default args
<clever> Henson: you want imports not plain import, then you can use { config, ... }: and just define your own config options
<clever> got a flashlight? check the headphone port for damage?
<clever> try an older one?
<clever> you can read the grub.conf in /boot/
<clever> that one
<clever> colemickens: you must disable the display with a nixos option
<clever> and check alsamixer again, on the older versions?
<clever> did you reboot after doing rollbacks?
<clever> not sure then
<clever> try the speaker channel too
<clever> master, headphone, headphone, headphone .... headset mic, headset mic, internal mic ...
<clever> andrewrk: there are 3 more headphone on the left
<clever> andrewrk: you have 2 headphone bars at 2, try cranking them up?
<clever> and then the alsamixer?
<clever> andrewrk: what does the output devices tab in pavucontrol show?
<clever> 2020-09-12 22:13:26 < clever> andrewrk: run alsamixer, switch to the alsa device (not pulse), and check if its muted?
<clever> thats because you are on the pulse device still
<clever> try un-mute and turning up various things
<clever> headphone may have its own meter, seperate from master
<clever> it can also happen when drivers upgrade
<clever> the alsa behind pulse sometimes goes on mute
<clever> andrewrk: run alsamixer, switch to the alsa device (not pulse), and check if its muted?
<clever> but if you want to set config, you do need to make it
<clever> colemickens: it has defaults for when the config is missing

2020-09-12

<clever> hexa-: ./secrets + "/${config.networking.hostName}/foo"
<clever> 55ms is still pretty quick
<clever> 30ms v4, 55ms v6
<clever> est31: ~25ms slower, since i have to bounce off an american tunnel
<clever> ipv6 randomly breaks for me
<clever> that should be fine
<clever> est31: how did you put the nixos image onto the usb?
<clever> siraben: then you need to check the journal with something like `journalctl -f -u pulseaudio --user` maybe
<clever> est31: you must first boot via efi, to be able to configure an efi bootloader properly
<clever> thats likely unrelated, how exactly is it broken, is it just on mute?
<clever> siraben: you should see grub instead of systemd-boot when its booting
<clever> siraben: you also want nixos-rebuild --install-bootloader switch
<clever> siraben: boot.loader.grub.device = "nodev";
<clever> siraben: and turn systemd off, the same way
<clever> siraben: boot.loader.grub.enable = true;
<clever> siraben: systemd-boot has lost its mind, ive seen it before a few weeks ago, only solution i know is to switch to grub (it still supports efi)
<clever> moet: yep
<clever> moet: nix already censors out the hostname within the sandbox
<clever> more*
<clever> vifon: you want something lore like `nix-env -f . -iA foo`, which says to load default.nix, then install .foo
<clever> vifon: -i without a path, will treat the string as regex, and search nixpkgs
<clever> vifon: nix-env -i ./result or add it as an overlay and put it into systemPackages
<clever> vifon: you can just run it from the result link if you want testing, result/bin/cantana
<clever> vifon: or ~/.nix-defexpr/channels_root/nixos/
<clever> vifon: nix-instantiate --find-file nixpkgs
<clever> find out where the default.nix was being loaded
<clever> [nix-shell:~/apps/rpi/lk]$ grep -r --color cantata ~/apps/nixpkgs-hasura/pkgs/
<clever> vifon: yeah, you want libsForQt5.callPackage rather then bare callPackage
<clever> /home/clever/apps/nixpkgs-hasura/pkgs/top-level/all-packages.nix: cantata = libsForQt5.callPackage ../applications/audio/cantata {
<clever> sid`: the problem will likely just move to another dep
<clever> vifon: you have to use the right callPackage when loading it, look at where that file was being referenced in nixpkgs
<clever> vifon: is it a haskell package?

2020-09-11

<clever> sid`: ~/foo works in nix directly
<clever> buffet: you want extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
<clever> simonpe^^: whats it going to do with the mirror if it doesnt have network?
<clever> simonpe^^: defining out= yourself isnt valid
<clever> you can add that attr to any fixed-output derivation, and then those vars can leak in
<clever> > hello.src.impureEnvVars
<clever> simonpe^^: is it a fixed-output derivation?
<clever> {} is an empty set of overrides
<clever> redmp: callPackage takes the path to a package, and a set of overrides for the args on line 1 of the package

2020-09-09

<clever> galagora: that looks like an overflow error somewhere
<clever> > (17592186044416).toString(16)
<clever> '100000000000'
<clever> the benefits will vary, depending on how much duplication you have
<clever> siraben: but --optimize lets you hardlink the duplicate .h files together, so your not paying for holding 2 copies
<clever> siraben: multiple-outputs lets you GC the .h files while keeping the .so for example

2020-09-08

<clever> its already enabled
<clever> then you dont have to go into the bios
<clever> zeta_0: does /dev/kvm exist?
<clever> zeta_0: i find qemu is better for automation and complex tasks, while virtualbox is better if you just want to run windows or ubuntu without any fuss
<clever> zeta_0: i dont know how libvirtd will interact with everything
<clever> zeta_0: qemu-kvm will force use of kvm, so it will fail if kvm isnt available
<clever> it should just work
<clever> zeta_0: nope
<clever> ,locate kvm-ok
<clever> mjrosenb: you generally dont want nix installed on each user, only on root, and inherit it from root
<clever> mjrosenb: it does exist in newer versions of nix, you may need ot update the nix-daemon
<clever> evanjs: if it looks like vim, it adds args to jump to the right offset in the file
<clever> evanjs: one minor issue there, is that `nix edit` changes the args to the editor dynamically
<clever> [clever@amd-nixos:~]$ EDITOR=echo nix edit -f '<nixpkgs>' hello
<clever> /nix/store/6q0j9q6pkl6fxll32dr988jnbnvb6ji2-nixos-20.09pre237606.b50ef9afa11/nixos/pkgs/applications/misc/hello/default.nix
<clever> evanjs: oh, also, nix edit just runs $EDITOR, so you could set EDITOR to a shell script, maybe even echo?
<clever> evanjs: and even `nix edit -f '<nixpkgs>' hello`
<clever> evanjs: there is also builtins.unsafeGetAttrsPos
<clever> evanjs: have you seen this?
<clever> > pkgs.hello.meta.position
<clever> > pkgs.hello.meta.loc
<clever> > pkgs.hello.meta.location

2020-09-07

<clever> GolDDranks: you want to clone nixpkgs, and then copy the file
<clever> GolDDranks: copy/paste will destroy the tabs
<clever> GolDDranks: if you run diff on the diffs, what is the diff between the diffs?
<clever> GolDDranks: yep
<clever> GolDDranks: make 2 copies of the src, edit one, and then `diff -ru old new` to get a patch
<clever> GolDDranks: i just use `diff -ru` to generate patch files, its much simpler
<clever> brb
<clever> GolDDranks: the source thats being patched may differ enough to make it work
<clever> GolDDranks: nix didnt build it, it failed
<clever> GolDDranks: 2020-09-07 11:14:05 < GolDDranks> But somehow this package still builds when nix does it
<clever> jluttine[m]: not sure, i dont use python much
<clever> siraben: yeah, it should also have examples in the repo
<clever> GolDDranks: and the full output of the build?
<clever> jluttine[m]: if you run nix-shell on that drv, it will give you an env suitable for building the package, not using it, so the src will be sitting in $src un-compiled/optimized
<clever> jluttine[m]: that will depend a lot on what is within the shell.nix
<clever> GolDDranks: can you pastebin the nix file?
<clever> GolDDranks: what does the error say?
<clever> jluttine[m]: if your not using $src, then src = ./.; means nothing
<clever> jluttine[m]: `src = ./.;` will set $src, but nix-shell then leaves the working directory as-is
<clever> GolDDranks: and then i just shove the path to the patch in the patches list in nix
<clever> GolDDranks: i tend to use either `git diff` or `diff -r -u` to generate a patch
<clever> jluttine[m]: relative paths in a nix file are always relative to where the file itself lives
<clever> yeah, naersk is the fully declarative way
<clever> probably, irc logs dont show any other gains
<clever> when did i gain 2 more points without noticing? heh
<clever> weird, it was only 500 lastnight
<clever> pkgsCross.armv7l-hf-multiplatform.pkgsStatic.stdenv.mkDerivation
<clever> exactly as i just showed
<clever> siraben: if you mix pkgsCross and pkgsStatic, it may staticly link automatically
<clever> > pkgsCross.armv7l-hf-multiplatform.pkgsStatic.hello
<clever> siraben: or use static linking
<clever> siraben: then you need to install nix, or get ugly and just copy that .so file to the right path
<clever> siraben: the kernel will always run the interpreter instead
<clever> siraben: the interpreter on a dynamic ELF is basically like the #! on a shell script
<clever> siraben: it was in the output of `file` you pasted earlier
<clever> siraben: nix-copy-closure --to user@target /nix/store/0bv4ygzd45bwbhc0wni6z4asqz84apmr-glibc-2.31-armv7l-unknown-linux-gnueabihf
<clever> siraben: because /nix/store/0bv4ygzd45bwbhc0wni6z4asqz84apmr-glibc-2.31-armv7l-unknown-linux-gnueabihf/lib/ld-linux-armhf.so.3 is missing
<clever> musl might work to make it static
<clever> youll need readelf then, dump the DT_NEEDED and the RPATH
<clever> ah, ldd wont work on arm binaries
<clever> static linking would be the simplest, but result in a larger binary
<clever> getting it to properly build with naersk would make that simpler
<clever> run ldd on the binary to figure out which deps it has, and then `nix-copy-closure --to user@host /nix/store/dep` each dep
<clever> so you need to nix-copy-closure the dependencies over too
<clever> also, it relies on things being in /nix/store to function
<clever> result is from nix-build
<clever> if its in a result dir, it ignores rustup entirely
<clever> note that nix-build under nix-shell doesnt do the build any differently
<clever> sounds like you did a native build, not a cross-build
<clever> > pkgs.file
<clever> run `file` on the binary, what does it report?
<clever> just swap out the name in the pkgsCross area, and get the new $CC and $LD
<clever> aarch64-multiplatform is 64bit arm
<clever> raspberryPi is armv6
<clever> armv7l-hf-multiplatform is armv7
<clever> siraben: ah, then you dont want the embeded one
<clever> siraben: are you trying to compile a program that runs under linux or is its own kernel?
<clever> siraben: then that is the compiler and linker you want
<clever> siraben: if you `echo $LD and $CC` in that shell, what does it say?
<clever> to change what hello is
<clever> but you can callPackage ./foo.nix { hello = pkgs.goodbye; }
<clever> so when you run callPackage on { stdenv, hello }: it passes you pkgs.stdenv and pkgs.hello
<clever> yeah, for anything you dont specify, it gets a default from pkgs
<clever> and it then returns whatever was in the file you gave it
<clever> callPackage takes 2 arguments, the path to a package, and some overrides for the package args
<clever> you also dont need an override, nix-build -E 'with import <nixpkgs> {}; callPackage ./dropbear_from_scratch.nix {}'
<clever> GolDDranks: you forgot the {} at the end
<clever> GolDDranks: you want pkgs.callPackage ./dropbear_from_scratch.nix {}
<clever> not sure, maybe give github.com/nmattia/naersk a try?
<clever> ive done similar in the past with `rustup target add x86_64-pc-windows-msvc`
<clever> you have to tell cargo to fetch the std crate for arm first
<clever> but you can then run whatever you want, and ignore the makefile
<clever> nix-shell just drops you into an env suitable for building the thing
<clever> mkDerivation can be used with both shell and build
<clever> 2020-09-07 10:14:47 < siraben> Then I do, nix-shell shell.nix --run "cargo build --target=armv7-unknown-linux-gnueabihf"
<clever> you want nix-shell, not nix-build
<clever> what command did you run to get the error?
<clever> its pointless with nix-shell
<clever> src = ./.; only matters if your using nix-build
<clever> > pkgs.pkgsCross.arm-embedded.stdenv.mkDerivation { name = "foo"; }
<clever> siraben: its part of pkgsCross
<clever> mkShell just calls mkDerivation for you
<clever> why cant it?
<clever> the internal name for arm without a kernel
<clever> and skip mkShell, just use mkDerivation
<clever> pkgsCross.arm-embedded.stdenv.mkDerivation will give you a cross gcc
<clever> siraben: that will give a gcc that targets linux, instead of arm-none
<clever> siraben: there is also github.com/nmattia/naersk which is supposed to fully automate cross-compiling rust
<clever> siraben: that one wont be a cross build
<clever> yeah, nix will setup all of the tools in all-caps vars, $CC, $CXX, $OBJCOPY, $LD and more
<clever> that would give you the cross gcc for arm-none
<clever> siraben: you would run nix-shell against a derivation like: pkgsCross.arm-embedded.stdenv.mkDerivation { name = "foo"; }
<clever> siraben: are you in a nix-shell that includes that linker?
<clever> damjan: the nativeBuildInputs for the build that needs the tool
<clever> damjan: add a thing to nativeBuildInputs

2020-09-06

<clever> and define it within options, options.custom.isVM = lib.mkOption { type = lib.types.bool; default = false; };
<clever> tobiasBora: you want to use config.custom.isVM
<clever> tobiasBora: imports cant depend on config, you must use config = lib.mkIf (expr) { ... }; inside the thing in imports
<clever> probably
<clever> the big 500! lol
<clever> numkem: boot.loader.grub.device = "nodev";
<clever> that should still be true