2020-04-12

<clever> monokrome: and if your not prepared for those changes, you just leave it as-is
<clever> monokrome: the idea, is that you manually fix those things, before you upgrade the stateVersion
<clever> monokrome: various things, like postgresql not starting, or your ssh hostkeys changing
<clever> virtusviri7321[m: and proton works fine too
<clever> > (import <nixpkgs/nixos> { configuration = { system.stateVersion = "19.03"; }; }).config.system.stateVersion
<clever> cole-h: ^
<clever> > (import <nixpkgs/nixos> { configuration = {}; }).config.system.stateVersion
<clever> and uses the default if configuration.nix didnt set it
<clever> energizer: nixos-option
<clever> sshow: yeah
<clever> sshow: ssh opens its own ports for you, so thats the one thing you dont need
<clever> sshow: nixos options append lists automatically for you
<clever> hoplaahei: totally safe
<clever> sshow: config.services
<clever> sounds likely
<clever> gchristensen: i also got an expr for that in nixos-configs/nixops-managed.nix
<clever> brb
<clever> dsal: if they use the same nixpkgs and config, it will just copy everything over
<clever> dsal: the FHS envs in nix do that, for things like steam
<clever> dsal: namespacing is very flexible, and you can change only the root and nothing else
<clever> dsal: docker is the most common thing using namespaces on linux
<clever> dsal: namespaces let you have a different set of mounted fs's, and root point
<clever> energizer: you must chroot to make them work (or proot)
<clever> energizer: that lets you write to ~/my-nix/nix/store, but the binaryes in there assume the libs are at /nix/store and will fail to execute
<clever> and proot has a performance cost
<clever> dsal: namespaces and user chroot give the same thing
<clever> manveru: if you move /nix on darwin, you also break the ability to deploy with nixops
<clever> zeta_0: the change likely isnt in 19.09, try unstable
<clever> zeta_0: are you using a recent nixpkgs?
<clever> pie_: ncdu
<clever> AmandaC: nix-shell -p '(callPackage ./. {})' asciinema
<clever> AmandaC: ah, thats the reverse of what i gave
<clever> AmandaC: do you want the compiled default.nix or the env for building default.nix?
<clever> AmandaC: nix-shell -E 'with import <nixos> { }; (callPackage ./default.nix { }).overrideAttrs (old: { buildInputs = old.buildInputs ++ []; })'
<clever> pie_: NIX_BUILD_TOP is only set for nix-build, not nix-shell
<clever> pie_: and the build will begin with you cd'd into it
<clever> pie_: $NIX_BUILD_TOP is the temp dir nix made in /tmp for you
<clever> pie_: $NIX_BUILD_TOP ?
<clever> pie_: if you do ${toString ./.} youll get the absolute path of the dir the nix file is in
<clever> ornxka: yeah, binwalk is one good solution
<clever> ornxka: linux can deal with the concating, but its tricky, since you have to parse it, and then re-parse with gunzip at an offset
<clever> ornxka: it might be that you have 2 initrd's concated together, one uncompressed, one compressed
<clever> ornxka: what is the filename?
<clever> ornxka: where did the file come from?
<clever> ornxka: what does file say?
<clever> ornxka: [clever@amd-nixos:/tmp/t2]$ cat /run/current-system/initrd | gunzip | cpio -i
<clever> > pkgs.any-nix-shell.src.urls
<clever> 12 repo = "zsh-nix-shell";
<clever> 11 owner = "chisui";
<clever> 10 src = fetchFromGitHub {
<clever> > pkgs.zsh-nix-shell.meta.position
<clever> atemu12[m]: so you return a function, that will then run func, and then merge
<clever> atemu12[m]: you could do `foo: {} // (func foo)`
<clever> atemu12[m]: you need to run the function first, and get the return value
<clever> bkv: you would have to modify the nix-shell source, and possibly rewrite every single nix expression in nixpkgs
<clever> bkv: and the sandbox restricts where you can write to, so state can only persist on the network
<clever> bkv: yeah, you cant control the side-effects, only that $out has a given hash when its done
<clever> bkv: and its still pure, if you dont meet the hash you claimed you where going to produce, the build fails
<clever> vika_nezrimaya: and you also need a outputHashMode
<clever> vika_nezrimaya: it will only auto-detect the hash if you have a hash name at the start of the hash, like "sha256-something"
<clever> vika_nezrimaya: just add an outputHash to it
<clever> bkv: thats for system wide env vars, not nix-shell
<clever> (Discord:6354): dconf-WARNING **: 14:03:40.905: failed to commit changes to dconf: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files
<clever> cole-h: nope, didnt help, it resets back to recent every time i open the dialog
<clever> bkv: i dont think functions can be inherited like that, for security reasons, and fish has a different syntax
<clever> [clever@amd-nixos:~]$ GDK_BACKEND=x11 Discord
<clever> cole-h: let me see...
<clever> cole-h: havent tried it yet
<clever> bkv: but youll loose all of the phase functions
<clever> ornxka: the grub stuff is only for when /boot is encrypted
<clever> ornxka: but you can always clone nixpkgs at the same rev your currently using, edit stage-1-init.sh to make things simpler (add fail in a few places) and build from that
<clever> ornxka: if your luks is bare on a partition, your basically screwed, but if the luks is inside an lvm array, then debug1devices will work
<clever> ornxka: and the preLVMCommands is where luks gets inserted
<clever> ornxka: you need line ~200 to get the drivers for the usb keyboard
<clever> __monty__: check `ls -ltrha`
<clever> __monty__: oh, that, it modifies the .bash_profile or something, and you need to copy it to the .fishrc
<clever> __monty__: i think it has most of the needed deps baked into it
<clever> __monty__: i believe it has a #!/bin/bash at the top, so it will force itself to run under bash
<clever> morgrimm: .override is for the args on the 1st line of the file, .overrideAttrs is for the stuff passed to stdenv.mkDerivation
<clever> nschoe_: 97434 lines long
<clever> nschoe_: i think the simplest is to just boot 20.03 and run `man configuration.nix`
<clever> nschoe_: i think with brottli
<clever> nschoe_: its compressed
<clever> ixxie: yeah
<clever> ixxie: the best i can think of is to have a program reading the stdout of ssh, and killing the process after a short delay
<clever> ixxie: systemd fails once more, lol
<clever> ixxie: but it doesnt look like they really found a solution
<clever> ixxie: an older version of systemd didnt
<clever> ixxie: this does accurately describe your problem
<clever> hyper_ch: because ssh hangs when you `kexec -e` and there is no easy way to script around it
<clever> ixxie: not sure then
<clever> ixxie: and what are the contents of each?
<clever> ixxie: what about the /lib/systemd/system/ dir, anything in there?
<clever> Orbstheorem: builtins.placeholder
<clever> ixxie: prepare-kexec.service?
<clever> ixxie: its prepare-kexec
<clever> ixxie: `systemctl cat kexec.target` and related cmds
<clever> ixxie: what does the kexec-prepare.service look like on ubuntu?
<clever> ixxie: from `systemd.special`
<clever> Applications wanting to reboot the system should not start this unit directly, but should instead execute systemctl kexec (possibly with the --no-block option) or call systemd(1)'s org.freedesktop.systemd1.Manager.KExec D-Bus method directly.
<clever> ixxie: i believe systemd will run that script when its done shutting down, and wants to "kexec" the machine, and this part will actually load the kernel, but line 21 will detect one already loaded and skip
<clever> ixxie: not sure then
<clever> hyper_ch: trying to make it work with `systemctl kexec`
<clever> ixxie: anything in the journals after it boots back up?
<clever> monokrome: any files leftover in the bin dir?
<clever> ixxie: are there any interesting logs on the display in virtualbox?
<clever> buildPhase = "buildPhase"; pre-sets the variable to contain the name of a function
<clever> the setup hook for scons will set buildPhase (the bash variable) to sconsBuildPhase (the bash function) if it isnt set
<clever> monokrome: what is line 13 of the default.nix?
<clever> but make is part of the stdenv, so you dont need it in the inputs
<clever> > pkgs.gnumake
<clever> monokrome: because make isnt called make!
<clever> > pkgs.make
<clever> monokrome: make is part of the stdenv, dont need it on line 13
<clever> monokrome: not really
<clever> monokrome: try `buildPhase = "buildPhase"; dontUseSconsInstall = true;` ?
<clever> and there is no off switch for the buildPhase one...
<clever> monokrome: when you add scons to the buildInputs, this shell code gets ran, which will overwrite the buildPhase and installPhase variables
<clever> > scons.meta.position
<clever> monokrome: one minute
<clever> monokrome: scons should work in nix-build too
<clever> monokrome: what happens if you just `nix-shell` and then `make` seperately?
<clever> ixxie: how much ram does the machine have, how big was the initrd?
<clever> ixxie: kexec_load failed: Invalid argument
<clever> ixxie: yep
<clever> zeta_0: it updates the channel called nixos, but not any other channel
<clever> depends on what your goal was
<clever> you could maybe also do that to systemd
<clever> and then it wont cascade up too far
<clever> bqv: you can use an override to force util-linux to depend on the old systemd
<clever> bqv: ah, that will do it
<clever> bqv: nix-shell -p uses whatever <nixpkgs> is mapped to
<clever> bqv: it also appears to be working fully on nixos-unstable
<clever> bqv: nix-build /nix/store/2vwic9njn2i3zzgk3dhv080vvs95a50a-nix-diff-1.0.9
<clever> ah
<clever> bqv: what says what is broken?
<clever> bqv: try using nix-diff to compare the drv to the one from nixos-rebuild
<clever> bqv: what does it give for you?
<clever> bqv: you can only get the drv by evaling the expr, try the nix-instantiate i gave above?
<clever> > "${nixos-unstable.linuxPackages_latest.kernel}"
<clever> bqv: you have to run it on an output, not the drv file
<clever> bqv: just run nix-build on a storepath
<clever> /nix/store/hbf3ls4p86v546qw4cw7gzbi4mpk7ivy-linux-5.6.2.drv
<clever> $ nix-instantiate channel:nixos-unstable -A linuxPackages_latest.kernel
<clever> bqv: which channel are you on?
<clever> ack, the .git is missing
<clever> > nixos-unstable.lib.version
<clever> cole-h: every time i open the file picker in discord, it forgets the sort order and last dir
<clever> cole-h: the gdk backend fix you have in there
<clever> cole-h: oh, maybe that will fix the file browser loosing its config constantly
<clever> cole-h: lol

2020-04-11

<clever> its a cmd within nix-index
<clever> buggymcbugfix: i used nix-locate locally
<clever> ,locate
<clever> ah, and there is also pkgs.inconsolata and pkgs.inconsolata-lgc too
<clever> > pkgs.inconsolata
<clever> inconsolata-lgc.out 53,852 r /nix/store/51c7i9wk41wwn63p8v5wd3ymhd9y9886-inconsolata-lgc-git-2015-04-18/share/fonts/truetype/Inconsolata-LGC.ttf
<clever> buggymcbugfix: its also in fontforge, so thats what you would add
<clever> fontforge.out 84,868 x /nix/store/8nkmkg8dm4khchrqcabli1gp0gjp6awp-fontforge-20160404/share/fontforge/pixmaps/Inconsolata-Regular.ttf
<clever> wut? lol
<clever> ,locate Inconsolata
<clever> buggymcbugfix: for timezones, i just run tzselect and it gives an answer
<clever> buggymcbugfix: for fonts, its any package that contains a font file, so its a bit fuzzy
<clever> energizer: if you want nixos to use the home-manager module, then the channel must exist on root
<clever> peelz: yep
<clever> peelz: nixpkgs-unstable isnt meant for nixos use, so it doesnt test grub
<clever> peelz: nixos-unstable tests things, and didnt update, protecting users
<clever> peelz: thats why you use the nixos channels on nixos
<clever> peelz: but then half a dozen people running nixos from nixpkgs-unstable came out of the woodwork, because it bricked their machines
<clever> peelz: somebody made a mistake in the grub config generation, and nixos-unstable correctly didnt update
<clever> peelz: na, its something that happened several years ago
<clever> peelz: hydra tests all of that in qemu, and only if it passes, will nixos-unstable update
<clever> peelz: it could be a bug in grub itself, or it could be a bug in the code that generates the grub config file
<clever> peelz: being on master can also corrupt your grub, and leave it unable to boot
<clever> energizer: yes
<clever> lovesegfault: internally, `-p foo` translates into `-E 'with import <nixpkgs> {}; stdenv.mkDerivation { name = "name"; buildInputs = [ (foo) ]; }`
<clever> lovesegfault: you likely want `nix-shell -p '(import ./nix).crate2nix'
<clever> lovesegfault: -p and giving a file dont mix right
<clever> peelz: it checks mapped files, file descripors, env vars, and the cmdline
<clever> peelz: yeah
<clever> peelz: its part of how nix checks if any running program is using any store path
<clever> peelz: when you `sudo foo /nix/store/bar` then sudo is depending on /nix/store/bar until sudo quits
<clever> peelz: because it was in the cmdline of sudo
<clever> peelz: also, --delete never needs root, so you dont have to sudo the --delete
<clever> peelz: you must use `sudo -i` and then run -q --roots without the sudo infront of it
<clever> peelz: its in sudo's env vars
<clever> peelz: running as root will reveal all secrets
<clever> peelz: that happens if its in the env vars of a process running as another user
<clever> fydai: but it looses all dynamic/expression features at that point, its just a static build plan
<clever> fydai: basically, the functional language boils down to calls to builtins.derivation, giving it a flat key=value; set, which then gets hashed to create the $out, and serialized into a .drv file
<clever> fydai: ah, the drv files are sort of that
<clever> fydai: not currently
<clever> energizer: and the function returns that path
<clever> but you can also ${foo} instead, like etu said
<clever> `inherit foo` would make a $foo env var
<clever> buildInputs just adds it to PATH
<clever> Athas: cp $(which whatever) $out/bin/whatever
<clever> Athas: yeah, static would be fine
<clever> oh, verify, yeah, one-time code then
<clever> fydai: well, at least changing the pw will be easy, its not registered yet!
<clever> jeromelanteri: i'm always paranoid about missing files, so i tend to just use plain `mv`, it deletes after copying, so it only deletes if the copy finished
<clever> jeromelanteri: then you could skip the usb, just shutdown, losetup -P the disk image, and mount both FS's, and mv the files
<clever> jeromelanteri: but it will be simpler if booted from a usb stick
<clever> jeromelanteri: and if you mount the / device a second time, you can see the /home under the real /home, to rm
<clever> jeromelanteri: you could mount the new one to the "wrong" place like /mnt, then copy everything over, and reboot
<clever> jeromelanteri: you may need to boot into single-user or use a bootable usb, to move everything from the old /home to the new fs
<clever> pikajude: not sure what they actually do though
<clever> jeromelanteri: fsType
<clever> and those then get mapped to those vars, on line 342
<clever> local -ri hostOffset="$2"
<clever> local -ri targetOffset="$3"
<clever> pikajude: native is -1 0, while normal is 0 1
<clever> pikajude: line 442 is the native inputs, and 452 is the normal inputs
<clever> Athas: of note, any ELF binaries you build with nix, will fail if you just copy them to a non-nix machine
<clever> Athas: yeah, that can be done
<clever> Athas: and then reference that result in pkgs.runCommand "name.tar" {} "tar -cvf $out ${theapp}"
<clever> Athas: you can build the program normally with stdenv.mkDerivation
<clever> Athas: you can just run tar in a derivation using pkgs.runCommand
<clever> hyperfekt: ah
<clever> hyperfekt: what was the issue?
<clever> visl: yeah
<clever> avn: and auto will test if you can write to something under /nix, then decide between local and daemon
<clever> avn: if NIX_DAEMON isnt set, it defaults to auto
<clever> avn: NIX_REMOTE=daemon
<clever> avn: but if you run nix-build as root, it wont use the daemon
<clever> avn: when using nix-daemon, its the daemons TMPDIR, not nix-build's
<clever> ixxie: find a pre-installed virtualbox image
<clever> jeromelanteri: yep
<clever> jeromelanteri: yeah, the nixos channel is just a specific version of the nixpkgs repo
<clever> jeromelanteri: that channel contains both nixos and nixpkgs
<clever> jeromelanteri: run `nix-channel --list` as each user
<clever> jeromelanteri: you may want to add a channel then, if its using nix-daemon, then the channel should probably be on root
<clever> jeromelanteri: you usually have a channel setup to manage the version of <nixpkgs> in use
<clever> jeromelanteri: nix eval nixpkgs.lib.version
<clever> hyperfekt: libredirect
<clever> ixxie: just boot the ubuntu iso in something like virtualbox
<clever> ixxie: try running it in an ubuntu vm locally?
<clever> ixxie: what happens when you run it? what do you see on the console?
<clever> ixxie: yeah, but now it relies on the target being systemd based
<clever> ixxie: systemd will then do a full and clean shutdown, causing ssh to get killed, and when its fully stopped, it will `kexec -e` for you
<clever> ixxie: i believe you do the `kexec -l`, skip doing `kexec -e`, and instead do `systemctl kexec`
<clever> ixxie: have you seen `systemctl kexec` ?
<clever> ixxie: there is also `systemctl kexec`
<clever> ixxie: you may need a script that wraps ssh, or use something like screen+nohup to launch something on the remote end, which keeps running after you close the ssh
<clever> CptCaptain: yeah, that should work just fine
<clever> ixxie: <enter>~. will force the ssh client to hang up
<clever> CptCaptain: what exactly are you trying to set in the nix?
<clever> CptCaptain: you want types.str not types.string
<clever> vika_nezrimaya: probably a bug then
<clever> vika_nezrimaya: try `--to local?root=/mnt` ?
<clever> CptCaptain: so you can do ./. + "/foo}
<clever> CptCaptain: path + string results in a path
<clever> srxl[m]: its part of the stdenv, so all derivations have it
<clever> ixxie: then the getEnv didnt work right, repeat until it does show up
<clever> ixxie: run nix-store -r on that, then look at the result
<clever> zeorin36: yeah, it no longer contains noto
<clever> vika_nezrimaya: + and listToAttrs is probably cheaper then //
<clever> vika_nezrimaya: the duplicates will be ignored
<clever> vika_nezrimaya: just concat everything up and listToAttrs
<clever> zeorin36: can you confirm the final value, with nixos-option?
<clever> ixxie: also, why are you trying to delete the file?
<clever> zeorin36: you can confirm using nixos-option
<clever> zeorin36: i think you just want `= [ "Twitter Color Emoji" ]`
<clever> ixxie: nix-store -q --roots
<clever> MichaelRaskin: any non-default value, causes the default to be list
<clever> MichaelRaskin: the default value is "Noto Color Emoji" so if you simply `fonts.fontconfig.defaultFonts.emoji = [];` it will loose the default value
<clever> ixxie: if you watch the build output, you should see it building a root-authorized_keys file, double-check the contents to make sure they are correct
<clever> jordandoyle: when the job linked in here goes green
<clever> jordandoyle: https://status.nixos.org/
<clever> ixxie: how did you authorize the ssh key?
<clever> DamienCassou: nixos containers are probably the simplest
<clever> DamienCassou: yeah
<clever> ixxie: and its asking for a pw over ssh? on which user?
<clever> DamienCassou: you can also use nixos containers in configuration.nix
<clever> ixxie: what config did you build it from?
<clever> jakobrs: id say open a pr, and people can comment on if it should be fixed or not
<clever> esclear: if you want the product in /nix/store, then you have to restart the entire build from scratch
<clever> esclear: run `nix-shell` on the drv that failed, then cd into what --keep-failed left behind and run `make`
<clever> esclear: that wouldnt be pure, but you can continue it under nix-shell
<clever> jakobrs: probably
<clever> if nothing depends on either, you can reduce the minimal closure size further
<clever> jakobrs: ive been wanting to be able to remove perl and python entirely from nixos
<clever> evertedsphere: you probably need to use the copy from nixpkgs or patchelf the binary
<clever> jakobrs: `nix-store -q --deriver` and `nix show-derivation`
<clever> jakobrs: * is just an alias to __mul
<clever> yourfate: this file for example, sets a bunch of settings including systemPackages
<clever> yourfate: i just use sudo