2020-07-05

<clever> haskell has the same problem, it cant even listen on tcp or udp without that file
<clever> rickhull: let me grab my solution...
<clever> rickhull: that happens due to the sandbox lacking a /etc/protocols
<clever> Graypup_: it would be better for each module to return an overlay, then combine them all into a single `pkgs = import <nixpkgs> { overlays = something; }`
<clever> Graypup_: it will return the result of adding that overlay
<clever> Graypup_: you can also use `pkgs.extend overlay` to add another overlay onto pkgs
<clever> Graypup_: you probably want to look into overlays
<clever> i have ran into problems with a new nix-instantiate and old nix-daemon
<clever> as long as the nix-daemon is up to date, yep
<clever> nix-hash can also hash things as well, if you know what is being hashed
<clever> azure1: an overlay is probably simplest
<clever> lol
<clever> then it rounds down to the byte, instead of down to the mb
<clever> > toString ((25 * 1024 * 1024) / 1.3)
<clever> > (25 * 1024 * 1024) / 1.3
<clever> just give it a number in bytes, and it will have less rounding
<clever> >> Shorthand notation, as described in this FAQ, may also be used.
<clever> >> When an integer is used, the value is measured in bytes.
<clever> it may convert to int for you, when you put a float into the file
<clever> have you tried just giving it a float and see what happens?
<clever> hmmm
<clever> assume you lack float support?
<clever> just *100 first?
<clever> ,xy asbachb
<clever> > lib.toInt (lib.head (lib.splitString "." (toString 3.14)))
<clever> > lib.toInt (toString 3.14)
<clever> fps: you can also use this to make a : seperated list, with /bin added to each
<clever> > :p lib.makeBinPath [ hello ]
<clever> not sure, ive not done much python in nix
<clever> hpfr[m]: i think you want pythonPackages.callPackage ?
<clever> virus_dave: for /nix/store/hash-name, try to `curl https://cache.nixos.org/hash.narinfo`
<clever> and nixos-rebuild uses nix-env to create roots
<clever> nix-env and nix-build are the main things creating roots
<clever> depends on where the root is
<clever> correct
<clever> robodojo: a way to stop gc from deleting things you are using or may want to use
<clever> and --max-freed will change what it depends
<clever> robodojo: it also has --print-live to show what cant be GC'd
<clever> robodojo: i believe they are the same
<clever> robodojo: yes
<clever> robodojo: yeah

2020-07-04

<clever> ah, that also fits
<clever> yes
<clever> robodojo: because -u was taken for Upgrade, so e is used for rEmove
<clever> ,libraries rm200910
<clever> to remove anything else, you need to give it some flags, to do more then the default
<clever> anything else, build-time dependencies, and stuff from using nix-shell
<clever> robodojo: anything you install with nix-env or configuration.nix is kept, even if you remove it, since you may want to do a rollback
<clever> robodojo: by default, it will delete anything that lacks a GC root, so anything that you had ever installed with configuration.nix or nix-env will remain, even if you have since removed it (rollbacks)

2020-07-03

<clever> nixuser: then you just run map over all PR's to create many jobsets
<clever> nixuser: that default.nix must then contain a single job, called jobsets, which returns a json file, a set of key=spec, where each spec is similar to the spec.json from before
<clever> nixuser: the default.nix (line 6 of my json) will then receive a list of PR's as json, on one of its inputs (the name, and which PR's is defined on line 15)
<clever> nixuser: and you then set that as the declarative project file for the whole project, that will auto-create a jobset called .jobsets
<clever> nixuser: you start with a spec.json file, that describes the inputs, including the gitlab PR's (my example is github though): https://github.com/cleverca22/hydra-configs/blob/master/not-os/spec.json
<clever> ScottHDev: your welcome :)
<clever> nixuser: `Open Gitlab Merge Request` is a special input type, that you use with declarative jobsets
<clever> check what current-system is, then reboot and check it again
<clever> mount it properly, run nixos-generate-config to fix the hardware-configuration.nix, then re-run nixos-rebuild switch
<clever> ScottHDev: do you know which partition /boot is on?
<clever> is the machine booting with efi or bios?
<clever> is /boot/ properly mounted?
<clever> ScottHDev: compare the path after rebuild, to the path after a reboot
<clever> ScottHDev: where does /run/current-system point after a nixos-rebuild switch?, where does it point after a reboot?
<clever> duairc: there is also mkBefore and mkAfter
<clever> raghavsood: have you tried using a systemd timer instead?
<clever> keyed on projectid, so 9 = <token>
<clever> and your token would then be inside a <gitlab_authorization> block, similar to what i did for github
<clever> looks like you just want to give it "http://example.com 9" i think
<clever> and it expects the token to be in the main hydra config file
<clever> nixuser: hydra is going to internally generate that url on its own, based on the input you gave it
<clever> assuming thats the user doing the actual access
<clever> and use an absolute path, like `sudo -u nginx ls -l /run/uwsgi/`
<clever> mtn: +x on a file is execute, +x on a dir is traverse (cd, and accessing children)
<clever> and you can test for +x on the parents, by just trying to do `ls -l` as the right user

2020-07-02

<clever> Dadou: then you want something like "${pkgs.path}/foo/bar
<clever> Dadou: <nixpkgs/lib/options.nix>
<clever> install-grub.sh will likely need patching
<clever> and the dir is missing, so nixos isnt creating it either
<clever> ls: cannot access '/boot/grub/layout/': No such file or directory
<clever> the required module is already installed...
<clever> -rw-r--r-- 1 root root 4.9K Aug 9 2019 /boot/grub/i386-pc/keylayouts.mod
<clever> and i'm off to bed
<clever> so it may get upset about home-manager making things read-only
<clever> i think irssi may want to write to its own config file if you use /set and /save
<clever> its on an old gentoo box that i have been neglecting for years
<clever> i just use irssi, i still havent moved that client to a nixos machine, lol
<clever> those appear to be the most important parts
<clever> insmod keylayouts
<clever> keymap /boot/grub/layout/us-dvorak-alt-intl.gkb
<clever> sudo grub-kbdcomp -o /boot/grub/layout/us-dvorak-alt-intl.gkb us dvorak-alt-intl
<clever> now, to adapt that to nixos...
<clever> so you can brute-force your way to a solution
<clever> the grub cli also has tab completion for drives and files
<clever> yeah
<clever> you can also manually run that grub command, from the grub cmd prompt (hit c at the menu) to test it out
<clever> yeah
<clever> check what the grub.cfg has on there
<clever> and the wiki srhb linked might already have examples you can use
<clever> you could also find somebody that has os-prober working over efi, and steal a copy of their config
<clever> so you can just hit up the docs, and write them yourself instead
<clever> the os-prober stuff is purely just to automate creating those grub entries

2020-07-01

<clever> extracts the options out*
<clever> duairc: dont think so, thats usually handled by a normal module, that extracts the copies out and sets other options
<clever> colemickens: profiles/base.nix: boot.supportedFilesystems = [ "btrfs" "reiserfs" "vfat" "f2fs" "xfs" "zfs" "ntfs" "cifs" ];
<clever> let nixos take over all the systems!
<clever> then you need to commit to nixos more! :P
<clever> and you need to use nix-build eventually, when you want to deploy the program
<clever> then nix can use cached builds, and nix knows what your binary depends on
<clever> better to just build it with nix-build
<clever> stuff stack builds can randomly break when nix gc's things
<clever> stack cant use stuff hydra.nixos.org pre-built for haskell
<clever> i always build with nix's haskell framework, haskellPackages.mkDerivation and cabal2nix
<clever> ah, i avoid stack like the plague :P
<clever> _d0t: so you still need to tell nix you depend on ghc
<clever> _d0t: at build-time, the stuff from the system (such as apt-get) wont be visible to the derivation
<clever> _d0t: so it is unlikely to work either way
<clever> _d0t: things in the nativeBuildInputs wont be available at runtime, and system stuff (from apt-get) cant be used inside a derivation
<clever> _d0t: are they programs you expect to find in $PATH?
<clever> _d0t: what extra things do you depend on when on nixos? why can you not depend on them outside of nixos?
<clever> _d0t: why do you need extra stuff on nixos?
<clever> evanjs: use plain `if` and carefully ensure you dont have infinite recursion
<clever> evanjs: but key1 and key2 must be valid options
<clever> evanjs: that lets condition depend on key3, and lazyness can figure your 2 things out later
<clever> evanjs: its a bit tricky, when you do `mkIf condition { key1 = ...; key2 = ...; }`, it will magically transform into `{ key1 = mkIf condition ...; key2 = mkIf condition ...; }`
<clever> man pages can confirm
<clever> grep -Lr i think?
<clever> and nixos heavily uses symlinks in /etc/
<clever> hexo: grep doesnt follow symlinks by default
<clever> AmandaC: i think its already in nixpkgs proper now
<clever> and then hydra has to copy that 20gig between build machines
<clever> turion: that gets expensive with some (non python) packages like chromium, where unpacking the source creates ~20gig of src
<clever> its meant to be ran from an empty directory
<clever> turion: it will fail if you have ran unpackPhase already
<clever> turion: ah right, the default is set within genericBuild itself
<clever> turion: where in in the nix-shell when you did that?
<clever> or just `genericBuild` to run all of them
<clever> turion: `echo $phases`
<clever> turion: `buildPhase` is a bash function, `$buildPhase` is a bash vairable, that then gets parsed as a single bash statement (and corrupts the cmd if it had newlines in it)
<clever> turion: yeah, you have to run all of the phases in order
<clever> turion: how did you launch nix-shell?
<clever> turion: try `phases="buildPhase" genericBuild` ?
<clever> then nix will continue to build as normal
<clever> hexo: if you can find that exact file in google, you can then insert it into the store with nix-prefetch-url file:///path/to/file.tar.xz

2020-06-30

<clever> ,unstable
<clever> yep
<clever> vereis: then it will always be using the version that was in nixpkgs back in march
<clever> Miyu-saki: i think thats been fixed
<clever> Miyu-saki: ?
<clever> ah, programs is a bit diff
<clever> Miyu-saki: yep, with the default buildPhase
<clever> jakobrs: ^
<clever> Alias of services.openssh.enable.
<clever> services.sshd.enable
<clever> Miyu-saki: that will spawn 64 procs!
<clever> minimal vs graphical installer
<clever> patagonicus: the current default is that sshd is technically enabled (so you dont need to nixos-rebuild), but systemd is set to not run on bootup
<clever> jakobrs: the problem, is the security nightmare caused by ssh being on, with a default pw
<clever> jakobrs: you could fairly easily make a custom iso, that forces sshd to start, and has a key pe-authorized
<clever> jakobrs: sshd is configured, but set to not auto-start, so you must run `passwd`, and `systemctl start sshd` to make it function

2020-06-29

<clever> it maps <nixpkgs> to the nixos channel
<clever> dutchie: ah, thats normal nixos, `echo $NIX_PATH`
<clever> dutchie: what does `ls -ld ~/.nix-defexpr/*/nixpkgs` report?
<clever> pax-12: usually, only root needs the channels configured, and everybody else can inherit from root
<clever> pax-12: and the collision warning, is because you have a nixos channel on both root and pax, compare `nix-channel --list` with and without sudo
<clever> to force it to build for 64bit linux, instead of the default (which is whatever the host is)
<clever> bahamas: you need to set nixpkgs.system = "x86_64-linux"; in your configuration.nix file
<clever> bahamas: and what is line 56 of that generic.nix file?
<clever> assertion failed at /nix/store/apnn10fiqg0gz1xf87vg0qnm6gk6sd7c-nixos-20.03/pkgs/os-specific/linux/kernel/generic.nix:56:1
<clever> bahamas: what is the full output when it fails?
<clever> bahamas: i would expect that to work, what is the full output?
<clever> bahamas: what is the command you ran?
<clever> thats also why the example i gave above, used interpolation to make the 2nd string as one piece
<clever> > ./. + ("/" + "foo")
<clever> > ./. + "/.."
<clever> after each concat, it removes any redundant elements and re-absolutes the path
<clever> this can also lead to confusion
<clever> > ./. + "/" + "foo"
<clever> > ./. + "/"
<clever> > ./.
<clever> ./. + "/foo" appends to a path, and keeps it as a path, so the above 2 rules can still apply, but copy a smaller subtree
<clever> "${./.}" copies . to the store, and returns the path of the copy
<clever> toString ./. returns the absolute path of . as a string
<clever> not sure then, ive not had a chance to play with flakes yet
<clever> not a string
<clever> the result of that is still a path
<clever> ./. + "/machines/${hostname}/config.nix"
<clever> colemickens: + works on paths
<clever> drakonis: you can also just `nix-store -r /nix/store/q8yjc393xglp1szq7s87492pi5rjvd9f-nix-2.4pre20200623_09fc06d` to download it from any binary cache
<clever> drakonis: --option require-sigs false
<clever> but if its a closure, its not a nar, its a collection of several nar's with something else
<clever> bqv: a nar is basically just a tar, with less features
<clever> and that one does register it as valid
<clever> --import is for a closure
<clever> a closure uses a different arg to unpack it
<clever> `nix-store --restore` is basically just `tar -x`, and doesnt flag it as valid
<clever> and nix wont consider that as being a valid path in /nix/store/
<clever> drakonis: it reads from stdin, you want `nix-store --restore destination < nix2.4pre20200623.nar`
<clever> drakonis: what cmd did you run?
<clever> drakonis: it expects a nar on stdin
<clever> BellRooks: oh, but the above tarball is arm7, not arm6
<clever> drakonis: my hydra is also building it: https://hydra.angeldsis.com/build/102388
<clever> drakonis: plus https://gist.github.com/cleverca22/16873623f6a33ee192f0f4cdf4d2b598 is how you install the tar the above produces
<clever> nekroze: how is cmake trying to detect python?

2020-06-28

<clever> thats usually the safest route
<clever> ,tofu
<clever> delroth: pkgs.fetchpatch mangles the file a lot, to make it more predictable
<clever> typetetris: correct
<clever> typetetris: or use -I nixpkgs=something, to affect the first run
<clever> typetetris: and changes only take effect when you re-open the shell
<clever> typetetris: no, nixos-rebuild reads $NIX_PATH, which is set by the value of nix.nixPath the PREVIOUS time you ran nixos-rebuild
<clever> typetetris: 2020-06-28 04:48:02 < clever> patagonicus: simplest is to just ignore channels, and use nix.nixPath to setup NIX_PATH to point nixpkgs=/path/to/nixpkgs
<clever> typetetris: that only looks at $NIX_PATH
<clever> typetetris: if you want nix-env to see it, yes
<clever> typetetris: if you want to grab directly from github, then you want the archive url, https://github.com/nixos/nixpkgs/archive/master.tar.gz will get master for ex
<clever> typetetris: but that wont be in $NIX_PATH, so you cant <foo> by default
<clever> typetetris: this will create a channel, that behaves in the same manner as nix-env expects, allowing you to nix-env -iA foo.hello
<clever> [clever@amd-nixos:~]$ cat .nix-defexpr/test/foo/default.nix
<clever> import /home/clever/apps/nixpkgs
<clever> typetetris: one sec
<clever> patagonicus: simplest is to just ignore channels, and use nix.nixPath to setup NIX_PATH to point nixpkgs=/path/to/nixpkgs
<clever> WIII: `nix build -f . -L`
<clever> > pkgs.gist
<clever> i tend to just use gist

2020-06-27

<clever> quinn: you can also: nix-build ~/apps/nixpkgs/nixos -A vm --arg configuration ./configuration.nix
<clever> quinn: you can also just put custom modules into the imports list of configuration.nix, and leave nixpkgs alone at first
<clever> quinn: yeah
<clever> DigitalKiwi: yeah, i would move the mkIf to line 54, networking.firewall = mkIf cfg.enable { ... };
<clever> quinn: nixos-rebuild build-vm -I nixpkgs=/home/clever/apps/nixpkgs/

2020-06-25

<clever> then nix would delete a small amount, and gradualy work its way up as you increase that number
<clever> excelsiora: yeah
<clever> excelsiora: so you need to start with small max-freed values, to work your way up
<clever> excelsiora: without `--max-freed 1`, it will keep deleting things, until the sqlite journal consumes the entire 10mb you freed, and it fails
<clever> excelsiora: youll need to manually delete something non-nix on the same FS
<clever> excelsiora: try `nix-collect-garbage --max-freed 1` ?
<clever> yeah

2020-06-23

<clever> aleph-: you need to figure out why its doing network, and make it stop
<clever> aleph-: its trying to do network at build time, which isnt allowed
<clever> are things like usbhid and hid_generic present?
<clever> energizer2: you may need -I nixos-config=/mnt/etc/nixos/configuration.nix to eval that against the right cfg
<clever> nix-repl> config.boot.initrd.availableKernelModules
<clever> [root@amd-nixos:~]# nix repl '<nixpkgs/nixos>'
<clever> energizer2: usb keyboard? did you include usb drivers in the initrd?
<clever> yeah
<clever> pjt_mpt: you can also symlink
<clever> pjt_mpt: why does the client program need to read torrc?
<clever> and that lets nixos services work without /etc/tor/torrc
<clever> pjt_mpt: read /etc/systemd/system/tor.service
<clever> energizer2: nixos-install never wipes anything, it just runs nix-build in a chroot
<clever> it basically just runs nix-build in a chroot, and then updates the target /boot/
<clever> energizer2: what would it overwrite?

2020-06-22

<clever> j`ey: `nix-env -iA nixpkgs.hello` installs hello
<clever> j`ey: -iA will still have much better performance, compared to -u
<clever> j`ey: upgrading everything in nix-env at once
<clever> j`ey: if you want to upgrade a package, just install it again with -i
<clever> energizer: boot.initrd.luks.devices can be on nvme, since linux is in control by then
<clever> and linux wont care
<clever> but once you load the initrd, that can contain nvme drivers for linux (if you set configuration.nix right)
<clever> the entire /boot must be on non-nvme
<clever> so you cant cheat with boot.loader.grub.device = "/dev/sda" but /boot on nvme
<clever> energizer: grub relies on the firmware in the board to provide nvme drivers
<clever> energizer: one surprising fact i discovered, is that grub technically doesnt support nvme at all
<clever> energizer: you can work around that by putting /boot/ on non-nvme stuff
<clever> hoverbear: the example i linked will make all of nixos cross automatically
<clever> hoverbear: pkgs.cross only does packages, not all of nixos
<clever> smiles: add these 2 lines to your configuration.nix file: https://github.com/librerpi/rpi-open-firmware/blob/master/nixos.nix#L35-L36
<clever> smiles: you either need an arm machine with nix already installed, or switch to cross-compiling
<clever> and nix-daemon will run on bootup
<clever> seven-eleven: if you do a multi-user install, it should setup root automatically for you
<clever> dminuoso: though that is complicating it some to force specific versions of plugins, i think you just want `p = ps: [ ps.nixops-packet ];` for ex
<clever> jkachmar: then youll want things somewhere like /etc/pihole/ and use environment.etc
<clever> seven-eleven: if you want to install something system-wide on ubuntu, you just run nix-env -i as root
<clever> seven-eleven: /etc/nixos/configuration.nix is only for nixos
<clever> seven-eleven: nixos-rebuild switch
<clever> jkachmar: id patch the script to take paths via env vars and then have systemd set those env vars

2020-06-21

<clever> dminuoso: that should also work
<clever> "9480bae337095fd24f61380bce3174fdfe926a00"
<clever> nix-repl> lib.trivial.revisionWithDefault "not found"
<clever> ah, its in a let block
<clever> trivial.nix: revisionFile = "${toString ./..}/.git-revision";
<clever> and then shortens it
<clever> lib.version reads that with builtins.readFile
<clever> [root@amd-nixos:~]# cat $(nix-instantiate --find-file nixpkgs/.git-revision)
<clever> 9480bae337095fd24f61380bce3174fdfe926a00
<clever> dminuoso: try the .git-revision file in the root of the channel
<clever> dminuoso: nix eval nixpkgs.lib.version
<clever> > let s = { __functor = a: b: a.hidden + b; hidden = 1; }; in s 5
<clever> madhukar93: the set youve called s, and the arg it was called with
<clever> madhukar93: the __functor accepts 2 arguments
<clever> MtotheM: but you can also do `config = mkIf config.gaming.steam.enable { ... };` to do more complete on/off
<clever> MtotheM: this defines a custom option, programs.vim.fat, and then it uses the value to decide if youcompleteme should be enabled