79 Matching Annotations
  1. Last 7 days
    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)
      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
      nix-repl> (sq: x: y: sq y + sq x) (x: x*x) 2 7   
  2. Jul 2020
  3. 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

  4. Feb 2020
  5. Jan 2020
  6. Nov 2019
  7. Sep 2019
  8. Aug 2019
  9. Jul 2019
  10. Jun 2019
  11. Mar 2019
  12. Feb 2019
  13. Dec 2018
  14. Oct 2018
  15. Sep 2018
  16. Aug 2018
  17. Jul 2018
  18. Jun 2018
  19. Dec 2017