Comment

Comment by vertex-four

For basic package descriptions, the language is not terribly different from JSON. Here's a definition of a Python application I'm working on:

    { pkgs ? import <nixpkgs> {}}:
    
    with pkgs;
    
    python3Packages.buildPythonApplication rec {
      name = "quicktill";
    
      src = ./.;
    
      doCheck = false;
    
      propagatedBuildInputs = with python3Packages; [
        dateutil pyyaml
        sqlalchemy psycopg2
        pycups reportlab
        requests_oauthlib
        pygobject3
      ];
    
      nativeBuildInputs = [ wrapGAppsHook ];
      buildInputs = [ gobjectIntrospection gtk3 ];
    }
The only big things here are the fact that this is defined as a function that takes the package repository as an argument to access dependencies (the first line), and the "with" expressions that allow me to skip having to type "pkgs." and "pkgs.python3Packages." for every package I depend on.
parent vertex-four 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton