<clever>
pjt_0141: the env command prints all env vars
2020-04-05
<clever>
evertedsphere: and callCabal2nix solves that anoyance entirely!
<clever>
evertedsphere: you can also just run cabal2nix yourself, any time the cabal file changes, and then use callPackage
<clever>
evertedsphere: using it within nixpkgs isnt allowed, because it harms the performance of `nix-env -i` and such, but your free to use it within your own stuff, and nixpkgs does contain code to help with it (like callCabal2nix)
<clever>
evertedsphere: its sort of like template haskell
<clever>
,ifd evertedsphere
<clever>
evertedsphere: callCabal2nix will run cabal2nix for you, then run callPackage on the resulting file, using IFD
<clever>
zeta_0: oh, line 4 sorta does that now
<clever>
zeta_0: add cabal2nix-file somewhere, like in the buildInputs list
<clever>
evertedsphere: then `haskellPackages.callCabal<tab><tab>`
<clever>
evertedsphere: `nix repl '<nixpkgs>'`
<clever>
evertedsphere: try tab completing haskellPackages.callCabal in nix repl
<clever>
infinisil: out of order execution!!! lol
<clever>
evertedsphere: weird, the bot didnt print it, but your casing is off, its nix, not Nix
<clever>
> true
<clever>
> haskellPackages.callCabal2nix
<clever>
> haskellPackages.callCabal2Nix
<clever>
zeta_0: then reference the variable somewhere
<clever>
evertedsphere: how did you run it?
<clever>
zeta_0: absolutely nothing in that references the cabal2nix-file variable, so you can just delete line 2
<clever>
kraem: this helper handles the empty-string case
<clever>
> lib.optionalString false "foo"
<clever>
> lib.optionalString true "foo"
<clever>
zeta_0: you can only put a `key = value;` inside a let block or a set
<clever>
evertedsphere: by default, nixos-rebuild uses <nixos-config> to find configuration.nix, this line remaps it to a file that causes errors, so it never even looks in /etc/nixos
<clever>
evertedsphere: and that is your entry-point and pin
<clever>
evertedsphere: then `nixops deploy -I nixpkgs=...` or `nixops modify deployment.nix -I nixpkgs=...`
<clever>
evertedsphere: if your not using those, it will just use whatever $NIX_PATH pointed <nixpkgs> to
<clever>
evertedsphere: you still have to tell nixos-rebuild which nixpkgs to get nixpkgs/nixos/default.nix from
<clever>
numkem: ive not used node2nix much, only yarn2nix
<clever>
evertedsphere: just delete lines 5 and 9
<clever>
evertedsphere: its better to leave nixpkgs.pkgs as-is, and let it come from whatever nixpkgs you got nixpkgs/nixos/default.nix from
<clever>
evertedsphere: which can lead to weird bugs, because the services and packages are out of sync
<clever>
evertedsphere: line 9 doesnt fully do what you want, it changes the nixpkgs used by nixos, but it doesnt change the nixos modules used by nixos
<clever>
numkem: npm wants to download stuff while building, thats what yarn2nix and friends solve
<clever>
evertedsphere: can you pastebin the whole nix file?
<clever>
evertedsphere: ls -l /run/current-system/sw/bin/sleep
<clever>
evertedsphere: maybe you just hadnt downloaded them before?
<clever>
evertedsphere: substituteAllInPlace is a variant that doesnt do that
<clever>
rnhmjoj: it breaks not-os, which is reusing kernel.nix outside of nixos
<clever>
rnhmjoj: oh, that PR
<clever>
rnhmjoj: the `with import <nixpkgs> {};` breaks the channel: evaluation aborted with the following error message: 'Illegal use of <nixpkgs> in Nixpkgs.'
<clever>
evertedsphere: do you have an @xinput@ in your script?
<clever>
vika_nezrimaya: i'm already editing it to add the dummy option
<clever>
asbachb: also, are the idle machines of the same cpu arch?
<clever>
asbachb: dont count the machines with a line thru the name
<clever>
morgrimm: and it can still run phases as well
<clever>
morgrimm: the attrset that runCommand takes, can accept meta and other stuff
<clever>
learnday20: line 163, `with lib;` is not a `key = expression;` pair
<clever>
learnday20: line 7 is the start of an attribute set, which must only contain `key = expression;` pairs
<clever>
learnday20: yep, line 163 is the problem
<clever>
learnday20: is the pastebin xmonad.nix or configuration.nix ?
<clever>
learnday20: the error says you have a problem on line 163, but that pastebin is only 95 lines long, where is 163?
<clever>
learnday20: can you put the whole file into a pastebin, its hard to see what exactly is wrong here
<clever>
munksgaard: patchelf --set-rpath ${gmp}/lib, will have nix build gmp, and insert the path for you
<clever>
munksgaard: you can already build things in the shellHook
<clever>
munksgaard: i would just just run nix-build outside of the nix-shell
<clever>
chloekek: yeah, then youll want to delete the channels after the install is done, though, nix itself must be in roots profile, or nix will try to delete nix
<clever>
learnday20: what is the code around line 163?
<clever>
morgrimm: i think there is stuff in place, to take a requirements.txt and auto-generate the nix to do that
<clever>
chloekek: the problem, is that nix needs to modify the $HOME for a non-root user, and things may start to malfunction down the road if you bypass it
<clever>
morgrimm: do it!
<clever>
jluttine: yeah, i would use `nix-shell -p ghc cabal-install` for that first run
<clever>
yourfate: yeah
<clever>
jluttine: `cabal init` can automate that i believe
<clever>
jluttine: lines 5 and 6 load a machotool.cabal and a macho.cabal into nix, then you can just `nix-build -A machotool` to build it, or `nix-shell -A machotool.env` to get a shell with the deps
<clever>
yourfate: my prefered method is to point `services.nginx.virtualHosts.<name>.root` to a derivation, probably pkgs.runCommand, so everything is in the nix store
<clever>
munksgaard: this one is a bit complex, but the selected area will run `yarn install`, then overwrite several of the pre-compiled binaries with symlinks to pre-patched ones nix provides
<clever>
munksgaard: you may also want to use a shell.nix file with a shellHook, to patch things, since youll need to repeat that every time npm re-downloads the binary
<clever>
munksgaard: when ran like that, nix will default to the same arch that nix-build itself was compiled with
<clever>
munksgaard: ask nix for it, `nix-build '<nixpkgs>' -A gmp`
<clever>
munksgaard: file confirms that
<clever>
/nix/store/h5j89q8sf64079zgwqg4fqmw7hfzq43z-gmp-6.2.0/lib/libgmp.so.10.4.0: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, not stripped
<clever>
munksgaard: you gave it a 32bit gmp, not a 64bit gmp
<clever>
munksgaard: so, you want to add `--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker)` to the cmd
<clever>
munksgaard: this env var tells you where it is
<clever>
jluttine: use pkgs.haskellPackages.callCabal2nix and plain old `cabal build` (via `runHaskell Setup.hs build`)
<clever>
jluttine: personally, i just avoid stack and `cabal new-build` like the modern plague :P
<clever>
morgrimm: the nixpkgs manual should explain the phases better
<clever>
morgrimm: which will make your job a lot harder
<clever>
morgrimm: setting the builder like that, means buildInputs and a lot of other things wont actually work
<clever>
morgrimm: installPhase for ex
<clever>
morgrimm: you almost always want to use either a phase, or buildCommand (runCommand uses buildCommand for you)
2020-04-04
<clever>
ornxka: you can even swap in aarch64-linux or x86_64-darwin, to see what it would need for those platforms
<clever>
ornxka: nix-build --dry-run '<nixpkgs>' -A hello --argstr system i686-linux
<clever>
ornxka: nix.buildMachines in the nixos manual
<clever>
nix manual explains most of it, nixos then has a config option to generate the cfg for you
<clever>
both nix and nixos manuals
<clever>
mudri: but, the files your copying, may refer to the original $dev, not the new $dev
<clever>
mudri: and then just make sure to populate both $out and $dev
<clever>
mudri: by default, it has only 1 output, but you can do `runCommand "name" { outputs = [ "out" "dev" ]; }` like any other derivation
<clever>
__monty__: ive seen people putting haskell type signatures in comments, but its purely just to help the user understand things, nix ignores it all
<clever>
mudri: the changes your doing must still be pure, but you wont have to recompile, so you can iterate faster
<clever>
mudri: that makes a new package, which will copy an old package, then overwrite one file
<clever>
List of packages to override without doing a full rebuild. The original derivation and replacement derivation must have the same name length, and ideally should have close-to-identical directory layout.