105 Matching Annotations
  1. Mar 2023
  2. Jan 2023
  3. Dec 2022
  4. Nov 2022
  5. Oct 2022
  6. Aug 2022
  7. Jun 2022
  8. May 2022
  9. Apr 2022
  10. Mar 2022
  11. Feb 2022
  12. Jan 2022
  13. Oct 2021
  14. Jul 2021
  15. Jun 2021
  16. May 2021
  17. 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.
      
  18. 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
      
  19. Jul 2020
  20. 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

  21. Feb 2020
  22. Jan 2020
  23. Nov 2019
  24. Sep 2019
  25. Aug 2019
  26. Jul 2019
  27. Jun 2019
  28. Mar 2019
  29. Feb 2019
  30. Dec 2018
  31. Oct 2018
  32. Sep 2018
  33. Aug 2018
  34. Jul 2018
  35. Jun 2018
  36. Dec 2017