distribution-nixpkgs-1.2: Types and functions to manipulate the Nixpkgs distribution

Safe HaskellNone
LanguageHaskell2010

Distribution.Nixpkgs.License

Description

Known licenses in Nix expressions are represented using the attributes defined in pkgs/lib/licenses.nix, and unknown licenses are represented as a literal string.

Synopsis

Documentation

data License Source #

The representation for licenses used in Nix derivations. Known licenses are Nix expressions -- such as stdenv.lib.licenses.bsd3 --, so their exact "name" is not generally known, because the path to stdenv depends on the context defined in the expression. In Cabal expressions, for example, the BSD3 license would have to be referred to as self.stdenv.lib.licenses.bsd3. Other expressions, however, use different paths to the licenses record. Because of tat situation, the library cannot provide an abstract data type that encompasses all known licenses. Instead, the License type just distinguishes references to known and unknown licenses. The difference between the two is in the way they are pretty-printed:

> putStrLn (display (Known "stdenv.lib.license.gpl2"))
stdenv.lib.license.gpl2

> putStrLn (display (Unknown (Just "GPL")))
"GPL"

> putStrLn (display (Unknown Nothing))
"unknown"

Note that the Text instance definition provides pretty-printing, but no parsing as of now!

Constructors

Known String 
Unknown (Maybe String) 
Instances
Eq License Source # 
Instance details

Defined in Distribution.Nixpkgs.License

Methods

(==) :: License -> License -> Bool #

(/=) :: License -> License -> Bool #

Ord License Source # 
Instance details

Defined in Distribution.Nixpkgs.License

Show License Source # 
Instance details

Defined in Distribution.Nixpkgs.License

Generic License Source # 
Instance details

Defined in Distribution.Nixpkgs.License

Associated Types

type Rep License :: Type -> Type #

Methods

from :: License -> Rep License x #

to :: Rep License x -> License #

NFData License Source # 
Instance details

Defined in Distribution.Nixpkgs.License

Methods

rnf :: License -> () #

Pretty License Source # 
Instance details

Defined in Distribution.Nixpkgs.License

type Rep License Source # 
Instance details

Defined in Distribution.Nixpkgs.License

type Rep License = D1 (MetaData "License" "Distribution.Nixpkgs.License" "distribution-nixpkgs-1.2-KJRAI6AGuWUIQXqZdDGt0u" False) (C1 (MetaCons "Known" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String)) :+: C1 (MetaCons "Unknown" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe String))))