86 Matching Annotations
  1. Oct 2021
  2. Jul 2021
  3. Jun 2021
  4. May 2021
  5. Feb 2021
    1. NIX_PATHA colon-separated list of directories used to look up Nix expressions enclosed in angle brackets (i.e., <path>). For instance, the value

      It would be helpful to

      1. formally describe the formats for NIXPATH, and
      2. note the allowed angle bracket syntax accordingly

      <path> will work with the prefixless format, but not with the prefixed one, and it may be helpful to spell this out explicitly.

      0 [14:16:19] nix repl
      Welcome to Nix version 2.3.10. Type :? for help.
      
      nix-repl> :l <nixpkgs/doc>  
      Added 40 variables.
      
      nix-repl> :l <doc>
      error: file 'doc' was not found in the Nix search path (add it using $NIX_PATH or -I)
      

      I always saw a NIXPATH used with the prefix syntax so far:

      $ echo $NIX_PATH
      nixpkgs=/nix/var/nix/profiles/per-user/root/channels/nixos:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root
      

      but NIX_PATH documentation shows that the prefixless format is also valid.

      $ export NIX_PATH=/home/toraritte:/nix/var/nix/profiles/per-user/root/channels/nixos
      
      $ printenv NIX_PATH
      /home/toraritte:/nix/var/nix/profiles/per-user/root/channels/nixos
      
      $ nix repl
      Welcome to Nix version 2.3.10. Type :? for help.
      
      nix-repl> :l <nixpkgs>
      Added 12439 variables.
      
  6. Aug 2020
    1. > (square: (x: y: square x + square y) 3 7) (x: x*x)58

      This can be written up in many other forms, plus the possibility of currying deserves to be pointed out:

      $ nix repl
      nix-repl> (sq: (x: y: sq y + sq x) 2 7) (x: x*x)
      53
      
      nix-repl> (sq: (x: y: sq y + sq x)) (x: x*x)     
      «lambda @ (string):1:11»
      
      nix-repl> (sq: (x: y: sq y + sq x)) (x: x*x) 2
      «lambda @ (string):1:14»
      
      nix-repl> (sq: (x: y: sq y + sq x)) (x: x*x) 2 7
      53
      
      nix-repl> (sq: x: y: sq y + sq x) (x: x*x) 2 7   
      53
      
  7. Jul 2020
  8. Jun 2020
    1. Why is Nix written in C++ rather than a functional language like Haskell?[ ] Mainly because Nix is intended to be lightweight, easy to learn and portable (zero dependencies). Since 24. April 2017 thanks to Shea Levy and the crowdfunding of 54 community members, nix does not have Perl as dependency anymore.

      There is hnix that is still actively developed (as of 2020/06/21).

    1. Basic Install environment.systemPackages = with pkgs; [ vim ]; or environment.systemPackages = with pkgs; [ vim_configurable ];

      What is the difference between the vim and vim_configurable packages?

      I believe the source for the latter is here.

    1. The easiest way I've found to manage that is to copy hardware-configuration.nix and a minimal version of configuration.nix and import it into the NixOps config for the corresponding machine. (I keep them in a git submodule, but keeping them in the same repo could also make sense.) 1 Pick your reaction

      If I understood it correctly, take the hardware-configration.nix from the target machine, and put it into the NixOps config.

      Also relevant: Minimal NixOS config for Nixops deployment (discourse)

    1. Install the latest version of NixOps. $ nix-env -i nixops

      ... or list it in environment.systemPackages in /etc/nixos/configuration.nix, and nixos-rebuild switch.

    1. extraUsers

      extraUsers have been renamed to users. See related commits.

    2. # cryptsetup luksFormat $LVM_PARTITION

      Got a warning here but it seems to be safe to ignore.

      WARNING: Locking directory /run/cryptsetup is missing!
      
    3. Networking

      This didn't work out of the box, therefore worth looking at the Arch linux wpa_supplicant docs.

      wpa_cli also wouldn't work, and needed to make sure that I had the right SSID so this link is also helpful to list available wifi networks.

    4. Note that from here on in we’ll be in root prompts the whole time. The NixOS install environment helpfully drops you in a shell with root logged in.

      On 20.03 install drops users to a non-privileged terminal so sudo su has to be entered to become root. (Otherwise the first steps in "Networking" will fail immediately.)

      Saving this here for posterity: https://stackoverflow.com/questions/55191125/cant-seem-to-get-sudo-working-under-nixos

  9. Feb 2020
  10. Jan 2020
  11. Nov 2019
  12. Sep 2019
  13. Aug 2019
  14. Jul 2019
  15. Jun 2019
  16. Mar 2019
  17. Feb 2019
  18. Dec 2018
  19. Oct 2018
  20. Sep 2018
  21. Aug 2018
  22. Jul 2018
  23. Jun 2018
  24. Dec 2017