UI-design.org 3.8 KB

Goals

guix search and guix show should show parameters

guix parameter to find parameter types, combinations and more

guix parameter validate to validate a parameter list for a package

should support the usual options like -h, -L etc

Guix Search

guix show racket


name: racket
version: 8.8
parameters:
+ enabled: jpeg png x11 gcc-oflag@-O3
+ optional: minimal
outputs:
+ out: everything
systems: x86_64-linux
dependencies: cairo@1.16.0* fontconfig-minimal@2.13.94 glib@2.70.2 glu@9.0.2 gmp@6.2.1 gtk+@3.24.30* libedit@20191231-3.1
+ libjpeg-turbo@2.0.5* libpng@1.6.37* libx11@1.7.3.1* mesa@21.3.8 mpfr@4.1.0 pango@1.48.10* racket-minimal@8.8 racket-vm-cs@8.8 unixodbc@2.3.9
...

* -> colored/bold highlight

non-boolean enabled parameters have symbol next to them

dependencies pulled by parameters highlighted

non-default dependencies on separate heading, with parameter indexing

Only global parameter dependency shown


  parametric-dependencies:
  + param-1: dep1 dep2
  +   parameters: param-3
  + param-2: dep4

extra combinations with substitutes

In practice very few parameters will have global parameter or even package dependencies


  combinations-with-substitutes:
    (name): param1 param2 param3@value
    (name2): param2

Guix Parameter

guix parameter global pkg

guix parameter spec pkg

Non-default will be very rare, and this line will only be shown when that's the case Time-consuming command that checks and gives a list of global parameters that'll work on pkg Returns a human-friendly analysis of the parameter-spec of pkg. ex. (one-of _ x y) -> x or y or neither


  (parameter-spec
   (local '(x y z))
   (optional '(d e))
   (one-of
    '((_ x y)
      ((x #:off) z)
      (y (z 3))))
   (use-variants
    '(#:yes d
      #:no (z 3)
      #:special (e . (without-tests . #:package-name)))))

Becomes


  local: x y z*
  global: d e
  rules:
    1. x or y or neither
    2. not x or z
    3. y or z@3
  variants:
    yes: d x y z*
    no: z@3
    special: e
  number of combinatons: __

guix parameter combinations pkg

guix parameter show some-global-parameter

Returns a list of legal combinations. Will implement later. Run with caution, this is a #P hard problem. Returns human friendly analysis of the package-parameter record associated with some-global-parameter


(package-parameter
     (name 'tests)
     (variants
      (parameter-variant-match
       (#:off #:transform (without-tests #:package-name))))
     (description "Toggle for tests")
     (predicate #t))

Becomes


  name: tests
  type: boolean
  description:
    Toggle for tests
  variants:
    1. off
       transform: --without-tests="(the package's name)"
  predicate:
    Works on all packages (#t)

guix parameter show pkg some-parameter

global parameter overridden?

guix parameter validate pkg "(a b ...)"

guix parameter type boolean-parameter-type

Same as the previous command, but with a local parameter in pkg~'s spec or a global parameter overridden by it. ~use-variants can disable or replace the parameter-variants field of a global parameter. Takes a parameter list and runs it against pkg. Throws an error if it doesn't work, and the final list otherwise. Human friendly analysis of a parameter type boolean-parameter-type


(define boolean-parameter-type
  (parameter-type
   (name 'boolean)
   (accepted-values '(off on))
   (description "Boolean Parameter Type")))

Becomes


  name: boolean
  bound-to: boolean-parameter-type
  accepted-values: off on
  negation: off
  default: on
  description:
    Boolean Parameter Type

TODO Find a way to search through parameter type names