2018-02-26
06:30
<
clever >
i believe the --dry-run stops it from actualy deleting anything, so you can preview the action first
06:29
<
clever >
sophiag: which will just set a cut-off point in time
06:29
<
clever >
sophiag: not directly, but there is `nix-collect-garbage --delete-older-than 30d --dry-run`
06:28
<
clever >
and i use them enough that its all automatic
06:28
<
clever >
mfiano: nope, i just type really fast
06:28
<
clever >
comes to 3gig on my router
06:28
<
clever >
3.0G total
06:28
<
clever >
578M /nix/store/c1lqq2yd6xgk2m940m6ldhlnbwgj0vah-clang-4.0.1
06:28
<
clever >
254M /nix/store/haa62nc1zz7327d2l6iyghi8lsbwjr08-go-1.9.2
06:28
<
clever >
but a very large chunk of that, is ahred with 392, 391, and a couple of others
06:28
<
clever >
mfiano: this is the total size of everything that generation 393 used
06:27
<
clever >
[root@router:~]# du -hc --max=0 $(nix-store -qR /nix/var/nix/profiles/system-393-link) | sort -h
06:27
<
clever >
mfiano: and you can also `nix-store --delete` just one of those, so you dont ruin the cache
06:26
<
clever >
279M total
06:26
<
clever >
192M /nix/store/8fchpdqskkzlwjamvb5lvyqw8zwzm9x8-systemd-237
06:26
<
clever >
23M /nix/store/2kcrj1ksd2a14bm5sky182fv2xwfhfap-glibc-2.26-131
06:26
<
clever >
du will now sum up how big every piece of garbage is
06:26
<
clever >
[root@router:~]# du --max=0 -hc $(nix-store --gc --print-dead) | sort -h
06:25
<
clever >
you have to know the full path to use it
06:25
<
clever >
but nothing refers to it, so it wont be used automatically
06:25
<
clever >
mfiano: yeah, it doesnt call it cache, but it is caching a copy of chrome, incase you want it again
06:24
<
clever >
sophiag: [root@system76:~]# ls -l /nix/var/nix/profiles/
06:24
<
clever >
mfiano: simpler to just use that directly
06:24
<
clever >
mfiano: thats basically what nix-collect-garbage does
06:22
<
clever >
i think this just lists all garbage
06:22
<
clever >
sophiag: also, nix-store --gc --print-dead
06:21
<
clever >
so its a balance between how much space you want, and how much bandwidth you want to waste re-downloading lesser used things
06:21
<
clever >
sophiag: it will just delete all un-rooted things, freeing up a ton of space, and ruining your cache, so you have to redownload a lot for nix-shell or nix-build
06:20
<
clever >
mfiano: nix-env --delete-generations
06:20
<
clever >
i get obsessed with knowing how things work, and consume source code like its food :P
06:20
<
clever >
it builds <nixpkgs/nixos> -A system, and then stores that in the newest generation
06:19
<
clever >
behind the scenes, nixos-rebuild is just a wrapper for nix-env -p /nix/var/nix/profiles/system
06:19
<
clever >
and from the man page, nix-env --delete-generations generations...
06:18
<
clever >
sophiag: `nix-env --list-generations` as each user that has used nix-env, and also `nix-env --list-generations -p /nix/var/nix/profiles/system` for the nixos generations
06:17
<
clever >
it will still obey roots, and refuse to delete anything you might need
06:17
<
clever >
also, if you know a particular store path that is rather fat, you can just `nix-store --delete /nix/store/that-path`
06:17
<
clever >
and the rollbacks are all gc roots
06:17
<
clever >
nix refuses to delete anything that is rooted
06:16
<
clever >
sophiag: then just stops when it hits the requested number
06:16
<
clever >
sophiag: it only deletes things that are un-rooted, and it counts the bytes as it deletes things
06:15
<
clever >
it will still preserve all GC roots, so rollbacks are un-affected
06:14
<
clever >
that will delete 2gig worth of garbage, and stop
06:14
<
clever >
sophiag: one handy trick, nix-collect-garbage --max-freed 2g
05:19
<
clever >
mfiano: xserver.desktopManager.xfce.enable = true; and dont touch anything related to window managers
05:19
<
clever >
mfiano: xfce is the one i prefer
05:06
<
clever >
mfiano: try another WM and see if it still happens?
04:06
<
clever >
disasm: overrides/overlays
03:56
<
clever >
disasm: in my case, i pinned the deployment to a rev on github, so it doesnt care about local nixpkgs at all
03:23
<
clever >
because nix tries to singlequote the entire thing
03:22
<
clever >
oh, and the singles will need \'s
03:22
<
clever >
mfiano: try ''quotes'' instead
03:11
<
clever >
fragamus: clone that, and then just run `nix-build -A swift` in the root directory
03:10
<
clever >
mfiano: and just confirming the syntax is valid without doing a full build
03:09
<
clever >
mfiano: its a lot more handy when it comes to smaller strings
03:09
<
clever >
copy, echo -e <paste>, lol
03:09
<
clever >
i think the only way around that is to throw it at `echo -e`, lol
03:08
<
clever >
nix-repl escapes linebreaks
03:06
<
clever >
or add nix-repl to systemPackages
03:06
<
clever >
nix-env -iA nixos.nix-repl
03:06
<
clever >
mfiano: with just that, you can see how nix parses your configuration.nix to generate its shellInit
03:06
<
clever >
mfiano: and :r to reload everything
03:06
<
clever >
then eval config.environment.shellInit
03:06
<
clever >
for example, try nix-repl '<nixpkgs/nixos>'
03:06
<
clever >
its massively useful
03:04
<
clever >
mfiano: i also did nix-repl '<nixpkgs>' and tab-completed gitAnd then .h and .git-e
03:04
<
clever >
mfiano: git-extras was the hint i needed to also find hub
03:03
<
clever >
[clever@system76:~/nixops]$ grep -r --color git-extras ~/nixpkgs/
03:03
<
clever >
nix-repl> gitAndTools.hub
03:03
<
clever >
nix-repl> gitAndTools.git-extras
03:03
<
clever >
/home/clever/nixpkgs/pkgs/applications/version-management/git-and-tools/default.nix: git-extras = callPackage ./git-extras { };
03:02
<
clever >
mfiano: at a quick glance, i dont see it
02:59
<
clever >
fearlessKim[m]: id add a checkPhase to the derivation that manages the vim config, that runs vim against the config file
02:56
<
clever >
using the giant nix-diff incantation above, to diff 2 nix files
02:56
<
clever >
my router is getting a similar overhaul
02:55
<
clever >
at the bash layer
02:55
<
clever >
maybe it never needed escaping in the first place
02:54
<
clever >
mfiano: so you may need to "\\?" it
02:54
<
clever >
mfiano: oh, but the bash that this generates might be invalid then
02:50
<
clever >
mfiano: i think you can just environment.shellAliases."?" = "man";
02:46
<
clever >
mfiano: double most of the time
02:45
<
clever >
an example from a config i'm editing now
02:45
<
clever >
fileSystems."/media/videos/4tb/" = {
02:45
<
clever >
keys in a set can be quoted
02:45
<
clever >
mfiano: ah, just quote it
02:45
<
clever >
mfiano: ${ inside a ''string'' is escaped as ''${
02:39
<
clever >
disasm: now i can diff the original router config, against a refactored version
02:38
<
clever >
[clever@system76:~/nixops]$ nix-diff $(readlink original) $(nix-instantiate -I nixpkgs=https://github.com/nixos/nixpkgs/archive/8bce347f02f6bd606ec1822f0ba9b94d7f139071.tar.gz '<nixpkgs/nixos>' -I nixos-config=./router.nix -A system)
02:26
<
clever >
disasm: i believe the -I flag from create/modify, is stored into the state file, and then persists from there
02:25
<
clever >
disasm: aha
02:25
<
clever >
disasm: [clever@system76:~/nixops]$ nixops modify router_deployment.nix -I nixpkgs=https://github.com/nixos/nixpkgs/archive/8bce347f02f6bd606ec1822f0ba9b94d7f139071.tar.gz
01:53
<
clever >
i'm trying to track down how to set the nix_path in the same region
01:53
<
clever >
i think i was mixing different python files up
01:50
<
clever >
there is another mode that looks only at the { and } chars
01:48
<
clever >
mfiano: yeah, it probably depends on what you set the indentation to
01:47
<
clever >
mfiano: i believe each string would be its own fold, because they are indented one lever deeper then their quotes
01:43
<
clever >
mfiano: i havent looked into folding that heavily yet, but if the file is well indented, then the indent mode also works nicely
01:43
<
clever >
disasm: the nixops i cloned, doesnt match the nixops i have in github
01:42
<
clever >
rollback_enabled = nixops.util.attr_property("rollbackEnabled", False)
01:42
<
clever >
nixops/deployment.py: self.rollback_enabled = config["network"].get("enableRollback", False)
01:41
<
clever >
but the option is called enableRollback in nix...
01:41
<
clever >
disasm: ok, weird, nixops python code is checking for rollbackEnabled
01:30
<
clever >
disasm: i see an extra_nix_path in that source, that feels related to what i saw before...
01:28
<
clever >
disasm: whatever we do, it has to impact this area of the code
01:26
<
clever >
i need to look into a better option, i saw one but cant remember where it was
01:26
<
clever >
disasm: currently, i'm just changing $NIX_PATH before i run nixops
01:24
<
clever >
nixos-unstable currently fails to build hydra, so i cant go further
01:23
<
clever >
then i upgraded it to the latest nixos 17.09 channel
01:23
<
clever >
which got nixops into control, with minimal changes
01:23
<
clever >
disasm: i initially copy-closured that nixpkgs to the laptop, and aimed nixops at it, and used nix-diff to get the resulting derivation to be as identical as possible
01:23
<
clever >
disasm: originally, the router ran a copy of nixos-unstable that claimed to be nixos 16.03, lol
01:21
<
clever >
awygle: yeah
01:20
<
clever >
disasm: i switched my nixos router over to nixops lastnight, with minimal issues
01:19
<
clever >
mfiano: ive made netboot images with nixos, that boot into a ramdisk, and can run without any hdd
01:19
<
clever >
mfiano: oh, another crazy thing ive done, that may interest you
01:19
<
clever >
awygle: you can also just refer to files on the local machine as paths
01:17
<
clever >
awygle: then you have your own default.nix file, that has a url pointing anywhere you want
01:16
<
clever >
awygle: with nix, you typically give both a URL and a sha256, and then it automatically downloads it, and verifies it still matches that hash
01:11
<
clever >
so core.nix contains common stuff for both machines
01:11
<
clever >
and both laptop and desktop contain imports = [ ./core.nix ];
01:11
<
clever >
also, i have a desktop.nix in the same nixcfg repo
01:10
<
clever >
and if somebody wants to spawn a copy of your machine, laptop.nix is all they care about, all the btrfs sub-volume junk is useless
01:10
<
clever >
everything else goes into laptop.nix
01:10
<
clever >
and then configuration.nix is basically just the bare-minimum to boot the hardware, and imports = [ ./nixcfg/laptop.nix ];
01:10
<
clever >
the way i manage my systems, is that i have a git repo at /etc/nixos/nixcfg/
01:09
<
clever >
id leave it owned by root
01:08
<
clever >
if you wanted to use a specific bash to run this script
01:08
<
clever >
and it could be changed to #!${bashInteractive}/bin/bash
01:07
<
clever >
but the /bin/sh at the #! is what matters
01:07
<
clever >
because nothing actually runs bash
01:07
<
clever >
mfiano: the bashInteractive also does nothing in rofi-pass.nix
00:57
<
clever >
samueldr: nice
00:55
<
clever >
editing...
00:55
<
clever >
thats also an option
00:54
<
clever >
and those keys are in scope while parsing <value>
00:54
<
clever >
mfiano: any place you can put a value, you can also put: let key=value; key2=value; in <value>
00:54
<
clever >
mfiano: the in is part of the let syntax
00:51
<
clever >
updated my gist
00:51
<
clever >
mfiano: oops, i forgot to prepend to path, env cant be found, lol
00:50
<
clever >
tertle||eltret: then add environment.systemPackages = [ (renoise.override { releasePath = /home/foo/path/to/renoise.tar.gz; }) ]; between the main { and }
00:49
<
clever >
tertle||eltret: farther down, where it says systemPackages
00:48
<
clever >
tertle||eltret: inside the systemPackages array
00:48
<
clever >
disasm: you just have to run things like ifconfig or ip, and parse away
00:48
<
clever >
disasm: not really, its only known at runtime, so nix has no clue what it will be
00:47
<
clever >
mfiano: adding it to the vm to iron-out the bugs
00:46
<
clever >
you will need to merge it with your own line 1
00:46
<
clever >
mfiano: line 1 defines a function, and what arguments it is asking for
00:43
<
clever >
mfiano: the same as your nix-shell -p
00:42
<
clever >
typing up an example...
00:42
<
clever >
that just skips nix-shell entirely
00:42
<
clever >
mfiano: and you can generate a rofi-pass in your configuration.nix
00:42
<
clever >
mfiano: use that, to prepend to PATH, and use the writeScriptBin example i made for doit
00:41
<
clever >
mfiano: using this, you can generate a PATH variable
00:41
<
clever >
coreutils utillinux procps ]}
00:41
<
clever >
export PATH=${lib.makeBinPath [
00:41
<
clever >
that would probably also fix everything?
00:41
<
clever >
id rewrite it to be installed as part of configuration.nix, dont use nix-shell
00:40
<
clever >
the VM is meant for testing nixos, and lacks a <nixpkgs>
00:40
<
clever >
$NIX_PATH is broken
00:39
<
clever >
nothing happened
00:39
<
clever >
no /tmp/vars
00:37
<
clever >
manually made it before running
00:36
<
clever >
ps confirms
00:35
<
clever >
now i have a new terminal
00:35
<
clever >
mfiano: alt+enter no longer opens a shell
00:33
<
clever >
mfiano: this generates a bash script, and line 59 puts it into the default $PATH
00:31
<
clever >
lets see...
00:30
<
clever >
there is still the issue of getting that giant string into the VM
00:28
<
clever >
cant even get the URL into the vm
00:28
<
clever >
mfiano: and i dont have any cut/paste in the VM
00:25
<
clever >
mfiano: how do i launch the problem nix-shell then?
00:23
<
clever >
ah, one min
00:21
<
clever >
so the only question remaining, is if those land after the set
00:21
<
clever >
set-environment obeys methods A and C
00:21
<
clever >
you can also modify what goes into set-environment
00:20
<
clever >
testing it that way...
00:20
<
clever >
it was already setup correctly by /etc/profile
00:20
<
clever >
then when you source set-environment again (which isnt needed due to profile already having been sourced), it sets PATH again, undoing things
00:19
<
clever >
so when you source /etc/profile (which xsession does), it sets PATH directly, then prepends your things
00:19
<
clever >
then read that file
00:19
<
clever >
read the /etc/profile file to find the set-environment path
00:18
<
clever >
not append, not prepend, just set
00:18
<
clever >
mfiano: set-environment, SETS PATH!, lol
00:18
<
clever >
mfiano: aha, found some of the problem
00:17
<
clever >
samueldr: :D
00:16
<
clever >
so it just said, mesos somehow depends on this tar
00:16
<
clever >
it may be an overriden version
00:16
<
clever >
and nix-index had trouble finding the attrpath of gnutar
00:16
<
clever >
and mesos depends on tar
00:16
<
clever >
gnutar is the package with a man page
00:16
<
clever >
ah, over more
00:15
<
clever >
samueldr: can you paste the full line nix-index gave?
00:14
<
clever >
which is different from "${mesos}"
00:14
<
clever >
samueldr: that means its the .out output of mesos
00:13
<
clever >
for the i3 child, its wrong
00:13
<
clever >
for the xsession bash, its right
00:12
<
clever >
mfiano: let me check deeper...
00:12
<
clever >
mfiano: i believe i3 is doing something wonky
00:11
<
clever >
mfiano: its right for root (via sudo -i), but wrong for your user, interesting
00:11
<
clever >
mfiano: that launched uxterm
00:11
<
clever >
mfiano: yep
00:10
<
clever >
samueldr: are you quering the exact storepath the nix-index listed?
00:10
<
clever >
samueldr: maybe they had one when the index was made, but lack it now?
00:10
<
clever >
mfiano: yep, no more xterm auto-opening, now i need to know the magic i3 spell to get a shell, lol
00:09
<
clever >
mfiano: testing with the line 136 i pasted above...
00:09
<
clever >
samueldr: so the wrapper package has to symlink the man pages into itself
00:08
<
clever >
samueldr: you generate a package that is just shell-scripts setting up env vars, and then that breaks all man pages
00:08
<
clever >
samueldr: browsers are a good use of that
00:07
<
clever >
so it varies from user to user
00:07
<
clever >
the order of the default DM's, is dependant on how your FS sorts files in a dir
00:07
<
clever >
i think there is also a filesystem dependant bug here
00:07
<
clever >
added this
00:07
<
clever >
136 desktopManager.xterm.enable = false;
00:06
<
clever >
the vm boots directly into an xterm window, fullscreen, with i3 at the bottom
00:05
<
clever >
the instant you quit the xterm, it kills the entire gui session
00:05
<
clever >
you appear to be using xterm as a desktop manager as well, which can be rather anoying
00:04
<
clever >
mfiano: something is probably setting it again
00:03
<
clever >
mfiano: the line i linked samueldr covers all of /etc/profile
00:03
<
clever >
so its something to do with how i3 got launched
00:02
<
clever >
mfiano: the weird part, is that the parent of i3 is good, but i3 itself is bad
00:01
<
clever >
but the i3 under it, doesnt!
00:01
<
clever >
mfiano: the bash running xsession, has the right $PATH
00:01
<
clever >
mfiano: whoa
00:00
<
clever >
and its xterm that is adding things, for the reason samueldr mentioned
00:00
<
clever >
mfiano: using /proc, i confirmed that the i3 in my vm, has that 2nd PATH
2018-02-25
23:59
<
clever >
mfiano: that is the path i get in this VM, in xterm
23:58
<
clever >
mfiano: cargo and .bin are in $PATH
23:58
<
clever >
environment.shellInit
23:57
<
clever >
mfiano: i added `export FINDME=yes` to that block, and it persists to the xterm that opened
23:54
<
clever >
mfiano: so which variable is (not) set in what situation?
23:51
<
clever >
then the whole gui crashed
23:51
<
clever >
I3 is giving me a tutorial, heh
23:50
<
clever >
mfiano: build-vm forces the driver to something
23:50
<
clever >
mfiano: it be booting!
23:49
<
clever >
i'm on a different version of nixpkgs
23:48
<
clever >
mfiano: minor bug in the neovim build, but i doubt vim is involved, so i can just delete it
23:48
<
clever >
ln: failed to create symbolic link '/nix/store/hnr5cvavqcd12iiclcpqy2vvwz2pry7d-neovim-ruby-env/bin/bundle': File exists
23:45
<
clever >
and you never have to think about them on future installs
23:45
<
clever >
mfiano: thats why i prefer doing everything with nixos, then they are just included automatically
23:44
<
clever >
mfiano: when done, i'll have a qemu based VM that contains a complete copy of your machine, minus your $HOME files
23:43
<
clever >
the nix eval passes, these paths will be fetched (183.18 MiB download, 863.57 MiB unpacked):
23:42
<
clever >
mfiano: ive cloned the gist, and removed the hardware-configuration.nix line, it is now processing...
23:42
<
clever >
[clever@amd-nixos:~/mfiano/a97e94b42f59aea37cef5ca615d7a5ef]$ nixos-rebuild -I nixos-config=./configuration.nix build-vm -Q
23:39
<
clever >
mfiano: ehh, gist then
23:38
<
clever >
mfiano: can you just put the entire configuration.nix into a github repo?
23:37
<
clever >
nvm, there it is
23:37
<
clever >
source /nix/store/1ximi7apy1wdc4hgywldyr5sln39r5hk-set-environment
23:37
<
clever >
mfiano: something fishy is going on
23:37
<
clever >
mfiano: but the changes i said to apply are abnormally missing
23:36
<
clever >
mfiano: aha, and /etc/profile already sources the file i said to add, so A&C should also work
23:36
<
clever >
mfiano: hmmm, line 35 sources /etc/profile, so options D, B, and E should already work
23:35
<
clever >
dtz: `man configuration.nix` is already available by default, thats a large chunk of it
23:34
<
clever >
mfiano: can you gist the file?
23:33
<
clever >
mfiano: and you can read it to confirm what went into it
23:32
<
clever >
id just duplicate them then
23:30
<
clever >
mfiano: oops, didnt spell xsession correctly
23:29
<
clever >
mfiano: nix-store -qR /run/current-system | grep xession
23:29
<
clever >
mfiano: one sec
23:29
<
clever >
mfiano: even after restarting display-mamager?
23:27
<
clever >
then everything done with methods A and C will be included
23:26
<
clever >
yeah, like this
23:26
<
clever >
services.xserver.displayManager.sessionCommands = "source ${config.system.build.setEnvironment}";
23:25
<
clever >
mfiano: so if we just source that inside the display manager one
23:25
<
clever >
mfiano: methods a and c from my original gist
23:25
<
clever >
mfiano: several of them land in this file
23:25
<
clever >
. /nix/store/x13swbpz573bgk0b5lfiddhk3w6ipns7-set-environment
23:24
<
clever >
mfiano: yeah, those would still need their, oh, hmmm
23:24
<
clever >
mfiano: that will also persist to any shell the WM launches, so you likely wont need the other config
23:22
<
clever >
mfiano: those should fix it
23:22
<
clever >
mfiano: with this, you can set env vars before the WM runs
23:19
<
clever >
mfiano: but the nvidia driver knows how to actually control the card, and do things right
23:18
<
clever >
mfiano: i think the vesa driver is trying to use legacy bios API's to change the resolution, and its using dos-era tech to do it all, lol
23:14
<
clever >
bhipple[m]: i think proot has more overhead then nix-user-chroot