2020-08-05

<clever> > :p pkgs.gist.src.urls
<clever> > pkgs.gist.src.urls
<clever> then just `gist -p wayland.nix` to upload
<clever> > pkgs.gist.meta.description
<clever> nix-env -iA nixos.gist
<clever> thats why i always use gist as my pastebin
<clever> throw your entire wayland.nix into a pastebin
<clever> the answer
<clever> let chromium-dev-ozone = import (builtins.fetchTarball "https://github.com/colemickens/nixpkgs-chromium/archive/master.tar.gz); in
<clever> oops
<clever> let chromium-dev-ozone = (builtins.fetchTarball "https://github.com/colemickens/nixpkgs-chromium/archive/master.tar.gz); in
<clever> so you would do something like
<clever> this isnt an overlay, it returns the package directly
<clever> and did you add it to nixpkgs.overlays?
<clever> why do you think its called chromium-dev-ozone ?
<clever> that would tell your pc how to build it with wayland maybe
<clever> depends on if hydra pre-built it with wayland support
<clever> tabs are evil
<clever> newlines also work
<clever> yes
<clever> matthewcroughan: lists dont use comma on nix
<clever> the logs from nixos-rebuild will also show the paths it made
<clever> matthewcroughan: if you build it with nix-build, you can then look at every file it provides
<clever> matthewcroughan: nix-env can search, but only if its loading the overlay, which requires doing something in ~/.local/nixpkgs/overlays i think
<clever> v<tab><tab> and s<tab><tab>
<clever> the binary name may not match the package name
<clever> matthewcroughan: the example only adds a vnc thing to the systemPackages
<clever> because you used sudo, it will be root's home, so /root/.nix-channels
<clever> but `nixos-rebuild --upgrade` will run `nix-channel --update` for you
<clever> the change doesnt take effect until you run `nix-channel --update` as the same user
<clever> it writes to ~/.nix-channels
<clever> yep
<clever> yep
<clever> if the build is failing, then the cache would also fail to build it, and be of no use
<clever> the binary cache only lets you skip building, if the cache already built it in exactly the same way
<clever> thats not how the cache works
<clever> and the cache can only help if you use the exact same channel as the cache was built with
<clever> the cache wont fix any build errors
<clever> terribleArtist: use .overrideAttrs to set doCheck = false;, examples are in the manual
<clever> terribleArtist: just use an override against wicd
<clever> terribleArtist: run `nix-store -q --tree` on the final .drv for nixos, it should be near the bottom of what `nixos-rebuild dry-run` wants to build
<clever> terribleArtist: and also `nix-store -q --tree`
<clever> terribleArtist: and nix why-depends
<clever> terribleArtist: nix-store -qR
<clever> not sure, it has had problems with spam in the past
<clever> matthewcroughan: the faq link says how to get just mesa from unstable, but get the rest from your stable channel
<clever> ,unstable matthewcroughan
<clever> bit busy with other things
<clever> matthewcroughan: the example usage tells you exactly what to add to configuration.nix

2020-08-04

<clever> eyJhb: mkMerge and mkIf return a special set, that the module system will post-process at a later point
<clever> you need to modify something to make it NOT modify PATH, because it nukes everything by default
<clever> been there, pulled my hair out, lol
<clever> cizra: read the build file that scons is using
<clever> if you do `type python` and `type g++`, you should see that they are available
<clever> cizra: oh right, i have seen scons nuke env vars before, breaking nix builds
<clever> cizra: are you using nix-shell?
<clever> fnlaai: all of my experience is with mysql and sqlite, and postgres is just too different
<clever> Alling: try blowing away /var/lib/postgres and /var/lib/nextcloud again?
<clever> Alling: not sure, i try to avoid postgres when possible
<clever> and it will re-make it to fit the new superUser
<clever> but, if you dont have anything in the db, you can just rm -rf it again
<clever> thats what the stateVersion stuff is for, so it wont change when you upgrade nixpkgs
<clever> Alling: changing the superUser will completely break everything in /var/lib/postgresql
<clever> that hides the option from all docs
<clever> Alling: oh wait, line 209, internal = true;
<clever> Alling: what search term did you use?
<clever> Alling: there is a services.postgresql.superUser option, and the default varies, based on stateVersion
<clever> Alling: i believe thats fully automated by the postgres module
<clever> Alling: there is also a /var/lib/nextcloud/
<clever> Alling: nextcloud might be re-creating the databases on startup
<clever> one minute
<clever> Alling: stop the postgresql service, and them kill everything in /var/lib/postgresql/
<clever> it cant make the new one to fix the problem, enless you override it with --option
<clever> the problem is the current /etc/nix/nix.conf
<clever> nixos-update switch --option extra-sandbox-paths ''
<clever> frodo: during the switch
<clever> frodo: did you also `--option extra-sandbox-paths ''` ?
<clever> frodo: having all of that junk in the extra-sandbox-paths could easily break your ability to build anything, `--option extra-sandbox-paths ''` would bypass it temporarily
<clever> frodo: all of the newlines are missing
<clever> frodo: line 27, your nix.extraOptions is a complete mess
<clever> matthewcroughan: did you login from a text console?
<clever> chipb: you can just paste that into your config instead
<clever> chipb: scan/not-detected.nix literally only does 1 thing, hardware.enableRedistributableFirmware = lib.mkDefault true;
<clever> matthewcroughan: if you login from a text console, you get different permissions from if you login via ssh, or change user with su/sudo
<clever> matthewcroughan: polkit and physical terminals come into play
<clever> chipb: ah yeah, since pkgs depends on imports
<clever> chipb: pkgs.path returns the path to nixpkgs also
<clever> kini: there is a grafana monitoring all of that, and reporting alerts to #nixos-dev
<clever> ive not used sway yet, so i cant help much in that area
<clever> matthewcroughan: if you set the provider to geoclue2, then it sets services.geoclue2.enable = true;
<clever> matthewcroughan: if you read the module, youll see why
<clever> the option isnt called services.redshift.location.provider
<clever> no
<clever> location.provider = "geoclue2";
<clever> not sure that will work
<clever> and the example didnt include that
<clever> if you enable redshift, you must tell it where you are located
<clever> the sway.nix you made, or another sway.nix?
<clever> matthewcroughan: does it say where its being used?
<clever> matthewcroughan: there must only be a single imports = [ something ]; in the set
<clever> 2020-08-04 01:33:40 < clever> a set contains multiple key/value pairs, the keys must be unique
<clever> any time you can have a value, you can also have a `let key = expr; in value`
<clever> ,pills matthewcroughan
<clever> matthewcroughan: did you read the nix pills?
<clever> when you do `let a = 42; in a`, the a only exists during the `in a`, and then it stops existing
<clever> the keys from a let block only exist temporarily
<clever> `a` wasnt a number, so you cant subtract from it
<clever> > a
<clever> > 5 * 10
<clever> > 42
<clever> the bot just parses the entire line, and prints the value out
<clever> because print is causing a side-effect, a functional language can only return a value
<clever> the expression after the `in`
<clever> > let a = 42; in a - 10
<clever> > let a = 42; in a
<clever> have you read the nix pills yet?
<clever> that just creates 2 more values, key1 and key2, which the 3rd <expr> can reference
<clever> let key1=<expr>; key2=<expr>; in <expr>
<clever> matthewcroughan: if programs.sway.enable is true, then line 109-133 is put into the config key, but if programs.sway.enable is false, you just get config = {};
<clever> something else (a nixos module) then reads that from the config tree, and acts on it
<clever> matthewcroughan: the function is just returning a set like { programs.enable.sway = true; }
<clever> while imperative has <body> being multiple statements, that can have side-effects and not return something
<clever> the only real difference between functional and imperative, is that functional requires <body> to be an expression returning 1 value
<clever> c for example: int f(int a, int b) { return a + b; }
<clever> its the same in imperative languages too
<clever> args/arg1/arg2 are then in scope, when parsing the <body>
<clever> or `{ arg1, arg2, ... }: <body>`
<clever> a function always looks something like `args: <body>`
<clever> and thats not a number, so it failed to add it with 5
<clever> you didnt say what c was, so it grabbed this c
<clever> > c
<clever> > let f = { a, b }: a + b; in f { b = 1; a = 5; c = 42; }
<clever> matthewcroughan: when the function gets ran, it expects a set, containing (in my example) a and b
<clever> > let f = { a, b }: a + b; in f { b = 1; a = 5; }
<clever> the ... means it ignores any extra args
<clever> > let f = a: a*10; in f 5
<clever> nope, both are functions
<clever> matthewcroughan: that is a single key=value pair, that goes inside a set, the value is a list
<clever> if you do that, then nixos will merge the sway stuff for you
<clever> 2020-08-04 01:19:30 < clever> matthewcroughan: mostly personal preference, i prefer a seperate file and then `imports = [ ./sway.nix ];` so i can turn that whole thing off with 1 comment
<clever> a set contains multiple key/value pairs, the keys must be unique
<clever> > { a=1; b=2; }
<clever> but the imports key makes it much simpler to merge things
<clever> a nixos module is almost always in the form of `{ pkgs, config, ... }: { stuff = things; }`
<clever> matthewcroughan: thats defining a function that takes a set as an argument, and the set must contain a pkgs attribute
<clever> matthewcroughan: i just read nixos modules
<clever> daddy_james[m]: when done properly, youll find it in `ls /run/current-system/firmware/`
<clever> daddy_james[m]: hardware.firmware = [ (pkgs.callPackage ./something.nix {}) ]; maybe
<clever> daddy_james[m]: only a package put into the `hardware.firmware` of `configuration.nix` can have an effect on firmware loading
<clever> daddy_james[m]: so undoing nix-build is pointless
<clever> daddy_james[m]: the kernel cant find anything that nix-build created
<clever> daddy_james[m]: why does testing involve removing?
<clever> daddy_james[m]: never try to modify /nix/store directly
<clever> daddy_james[m]: nix-build just creates a result symlink, it doesnt install it anywhere
<clever> daddy_james[m]: `rm result`
<clever> yeah
<clever> and you can also reuse it on other machines more easily
<clever> matthewcroughan: mostly personal preference, i prefer a seperate file and then `imports = [ ./sway.nix ];` so i can turn that whole thing off with 1 comment
<clever> also called imperative in some contexts
<clever> mutable users will persist until you disable mutable users in configuration.nix
<clever> yes
<clever> yeah, the name your going to login as
<clever> matthewcroughan: users.users.<name?>.openssh.authorizedKeys.keys
<clever> matthewcroughan: host pubkeys?
<clever> matthewcroughan: doesnt look like a channel to me
<clever> matthewcroughan: hydra is more about just pre-building packages, nixops is for building a specific configuration.nix and then deploying it to hw
<clever> that lets you trivially build on one machine, then run on another
<clever> matthewcroughan: ive used nixops to deploy nixos to an eeepc 701 netbook
<clever> rewrite it in haskell? :D
<clever> but its not aware of / being part of tank-root via zfs
<clever> infinisil: lsblk clearly shows that my tank-root is part of an lvm block on root, which is a luks block
<clever> infinisil: i think its using lsblk to track things thru the lvm and luks blocks
<clever> matthewcroughan: what did you set it to in each file?
<clever> ornxka: and nixos-install itself, just runs nixos-enter to run things in /mnt/
<clever> NIXOS_INSTALL_BOOTLOADER=1 nixos-enter --root "$mountPoint" -- /run/current-system/bin/switch-to-configuration boot
<clever> ornxka: nixos-enter is a script to deal with all of the bind mounts for you
<clever> matthewcroughan: why does that seem wrong? its the uuid for p1?
<clever> yeah
<clever> so it should be visible once the nvme drivers load
<clever> matthewcroughan: the nixos label is on whatever is in partition 1 of the nvme disk
<clever> i think you also need a `zpool import zpool` in the middle first
<clever> matthewcroughan: which is why label is simpler, you know what the label is, because you picked it
<clever> matthewcroughan: you have to run blkid to find the uuid that was randomly generated
<clever> ornxka: zfs tends to just use the pool name, which is in the metadata of each vdev
<clever> labels are simpler, because you will know what the label is

2020-08-03

<clever> zfs crypto also wont encrypt the names of datasets
<clever> a second example, more baked into a module
<clever> packageOverrides, can only be set once
<clever> lejonet: overlays also let you specify multiple, in different nixos modules, and they chain together sanely
<clever> lejonet: overlays let you easily access super (the previous pkgs tree) and self (the final, after applying every overlay)
<clever> lejonet: id recomend always using overlays
<clever> but now you can try building that one
<clever> yep, because you changed zfs-user in a different way
<clever> lejonet: this will apply your sudo override, and force zfs to not depend on sudo, then you can use -A to pick any package, and see what the effect is
<clever> [root@amd-nixos:~]# nix-instantiate -E 'import (builtins.fetchTarball https://github.com/NixOS/nixpkgs/archive/d971fd7cbaa7794b4cb632ad17ecbfbe3c17f8ee.tar.gz) { config = {}; overlays = [ (self: super: { sudo = super.sudo.override { withInsults = true; withSssd = true; }; zfs-user = super.zfs-user.override { sudo = null; }; }) ]; }' -A sudo
<clever> you can also test things without involving nixops, one sec
<clever> it would isolate sudo from ceph more, so the sssd cant leak in
<clever> maybe, but that will still make zfs-user and ceph rebuild
<clever> its dependency on sudo, breaks its ability to actually use sudo
<clever> correct
<clever> only the sudo in /run/wrappers/bin can function
<clever> that PATH thing will make it worse, not better
<clever> but the sudo in $PATH isnt setuid, so it will never work
<clever> the shell script calls sudo, and shoves a sudo into $PATH
<clever> 83 raw_out=$(eval "sudo $smartctl_path -a $VDEV_UPATH")
<clever> [root@amd-nixos:~]# nix why-depends /nix/store/7pmjm9wzqchwbh43pi82mmq3rv0jdxkf-zfs-user-0.8.4 /nix/store/n0k7kk82jjg6aw6n8rb7k5izzs0yj5wx-sudo-1.8.31p1
<clever> ╚═══libexec/zfs/zpool.d/ata_err: …j-sysstat-12.3.2/bin:/nix/store/n0k7kk82jjg6aw6n8rb7k5izzs0yj5wx-sudo-1.8.31p1/bin.#.# Show SMAR…
<clever> /nix/store/n0k7kk82jjg6aw6n8rb7k5izzs0yj5wx-sudo-1.8.31p1
<clever> [root@amd-nixos:~]# nix-store -qR /nix/store/7pmjm9wzqchwbh43pi82mmq3rv0jdxkf-zfs-user-0.8.4 | grep sudo
<clever> so zfs-user wont rebuild, and then ceph wont rebuild either
<clever> you could override zfs-user, and force it to use the old sudo
<clever> lejonet: if you stop changing sudo, then ceph wont have to rebuild
<clever> lejonet: you used an overlay to change sudo, which then changes zfs-user, which then triggered the rebuild of ceph
<clever> lejonet: now run nix-diff on both of those drv files
<clever> lejonet: does /nix/store/sn40r4qg1crwnyflgbqk55m67iv8hdqz-ceph-14.2.10.drv also exist?
<clever> what was the path to that drv?
<clever> lejonet: do you have the .drv thats failing?
<clever> lejonet: where is ceph being referenced in the nixos configs?
<clever> lejonet: oh, `nixops info -d FOO --no-eval` into a pastebin
<clever> lejonet: can you pastebin the full output from `nixops deploy --build-only` ?
<clever> lejonet: and nix-diff the 2 drv files
<clever> lejonet: use nix-instantiate instead of nix-build on what srhb last gave, then `nix-instantiate -A ceph` against your release-20.03 tag
<clever> matthewcroughan: the nix-daemon binary
<clever> cole-h: but if you tell fetchFromGitHub to fetchSubmodules, it cheats and uses fetchgit instead

2020-08-02

<clever> wucke13: removing things is a bit more tricky, often simpler to just clone nixpkgs, and edit the file
<clever> thats how pkgs.bash magically knows which binary to run
<clever> > pkgs.bash.shellPath
<clever> higemaru: looks like most of the magic, is to add a shellPath attr to the derivation
<clever> higemaru: try looking up that option in the docs
<clever> /home/clever/apps/nixpkgs/nixos/modules/programs/zsh/zsh.nix: environment.shells =
<clever> wucke13: then just run nix-build on the right linux attr, skip the whole nixos layer
<clever> wucke13: what are you trying to do? (also, line 293)
<clever> Thra11_: i moved the hydra to another domain, https://hydra.angeldsis.com/ but its not building very much armvl right now
<clever> mog: it might be simpler to use -I nixpkgs=
<clever> mog: with mkForce, maybe, but youll also need to find the xml file
<clever> kraeXen: you can still get fully free software, if you just leave allowUnfree at the default of false
<clever> kraeXen: you can still make your own openrc based distro around nix, like i did with runit (not-os)
<clever> i never use the graphical iso, i just ssh in from an already working machine
<clever> ah, about all i can think of there is `ssh -X` to run gparted remotely
<clever> install once, then use nixos-rebuild on that, to iterate until it works
<clever> hpfr[m]: if you install from CLI, then you can better iterate on the install, to find the solution
<clever> or chvt 7?
<clever> try ctrl+alt+f7 ?
<clever> what does the journal say?
<clever> yeah
<clever> hpfr[m]: systemd-boot has its own option of the same name
<clever> hpfr[m]: this option can set a cap on how many generations get copied to /boot/
<clever> boot.loader.grub.configurationLimit
<clever> Maximum of configurations in boot menu. GRUB has problems when there are too many entries.
<clever> 256mb would let you hold ~11 generations
<clever> a kernel is 4mb for me, and initrd is 15mb, so lets say 20mb per generation worst case (if you change the kernel on every rebuild)
<clever> hpfr[m]: depends on how many generations you have, and if things like the kernel/initrd differ between each one
<clever> christianbundy: *doh*, forgot the builder.sh, its in the new master commit
<clever> but it relies on busybox to provide ash, mkdir, chmod, and cat
<clever> christianbundy: you can now just `nix-build -A bcc` and it will run thru every stage in the blog, and spit out a bcc binary
<clever> i'll just use pkgs.busybox initially
<clever> christianbundy: guessing i need a custom busybox with cp added in?
<clever> seems i only have ash, mkdir, tar, unxz, and zxcat
<clever> ok, this could be fun!
<clever> cp: applet not found
<clever> let me see if i can wrap bcompiler in nix, just for fun!
<clever> christianbundy: but i cant see why nixpkgs cant just "steal" the entire guix bootstrap process, and just translate it into a nix expr
<clever> christianbundy: bcompiler ultimately ends at a weird c-like language: https://github.com/certik/bcompiler/blob/master/bcc.bc
<clever> christianbundy: the biggest problem i can see with such a thing, is making it capable enough that it can compile a "real" compiler
<clever> christianbundy: it even has a bcompiler github link!
<clever> christianbundy: https://bootstrapping.miraheze.org/wiki/Main_Page is also in the same folder
<clever> christianbundy: heh, now that i look closer, i have a 2017 archive.org in my bookmarks
<clever> metasyntactic: coredumpctl
<clever> maybe archive.org has it...
<clever> let me check my bookmarks...
<clever> the blog has since vanished from the internet
<clever> then used that to make an assembler with symbol and back-reference support
<clever> and then used that to make an assembler that lacked symbol support
<clever> he picked opcodes that could be represented with ascii, to write a hex editor
<clever> christianbundy: it is of interest to me, i saw a blog once, where a crazy guy bootstraped from a text editor, not even a hex editor
<clever> i think for that, you would want to look at the git history, and ask the people who are working on this part of the code, i see matthewbauer and gchristensen have made changes to it recently
<clever> (and all other binaries)
<clever> and 28 will then use the unpatched patchelf to patchelf patchelf!
<clever> line 22 will use the runtime linker as an interpreter, to run an unpactched cp, to copy patchelf
<clever> lines 9-18 find the runtime linker
<clever> because all of the bootstrap-tools are expecting libraries in a certain dir, and wont function when you unpack them to the wrong place
<clever> this shell script gets ran by busybox, and its job is to redo the patchelf on the bootstrap-tools
<clever> ive not been involved with changes to the bootstrap, i just read the nix code when i got curious
<clever> ive heard a bit about it