Skip to content

Commit

Permalink
notes
Browse files Browse the repository at this point in the history
  • Loading branch information
BostX committed Dec 30, 2023
1 parent 324be67 commit b268497
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 23 deletions.
49 changes: 28 additions & 21 deletions notes/guix-guile-nix/guix_package.scrbl
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,24 @@
}

@block{@block-name{Package Inputs / Outputs}
;; https://www.gnu.org/software/guile/manual/html_node/Multiple-Values.html
(use-modules (rnrs base)) ;; provides 'let-values'
(define (divide-and-remainder a b)
(if (= b 0)
(error "Division by zero")
;; return multiple / more than one output value
(values (quotient a b) (remainder a b))))
;;
;; Read multiple values using `let-values`
(let-values (((quot rem) (divide-and-remainder 10 3)))
(format #t "Quotient: ~a, Remainder: ~a~%" quot rem))
;; Read multiple values using `call-with-values`
(call-with-values (lambda () (values 4 5))
(lambda (a b) b))
;; Read multiple values using `receive`, which is more convenient
(use-module (ice-9 receive)) ;; or (srfi srfi-8)
(receive (quot rem)
(divide-and-remainder 10 3)
(format #t "Quotient: ~a, Remainder: ~a~%" quot rem))

A package can have multiple "Outputs", i.e. multiple store-directories, that
serves as a mean to separate components of a program (libraries, extra tools,
Expand Down Expand Up @@ -389,20 +398,22 @@
Functional Package Management with Guix; Ludovic Courtès, 2013
https://arxiv.org/pdf/1305.4584.pdf
Like Guix and Nix, Vesta is a purely functional build system [11]

Scsh provides a complete interface to substitute Scheme in “shell programming” tasks [18].

Nickel is an evolution of the Nix language, while trying to overcome some of its limitations.

Scsh provides a complete interface to substitute Scheme in "shell programming"
tasks [18].

Nickel is an evolution of the Nix language, while trying to overcome some of
its limitations.
https://github.com/tweag/nickel
Nickel grammar for tree-sitter.
https://github.com/nickel-lang/tree-sitter-nickel

https://nixos.wiki/wiki/Packaging/Tutorial

nix-service-type
runs build daemon of the Nix package manager. Which 'would allow you to use
Nix's Firefox package'

Example how to use it:
(use-modules (gnu))
(use-service-modules nix)
Expand All @@ -415,28 +426,24 @@
(services (append (list (service nix-service-type))
%base-services)))
After `guix system reconfigure` configure Nix for your user:
Add a Nix channel and update it. See Nix Package Manager Guide.
Add a Nix channel and update it. See Nix Package Manager Guide.

Tree-sitter
An incremental parsing system for programming tools
https://github.com/tree-sitter/tree-sitter

TODO ChatGPT search for
- parsing the Nix DSL (racket FTW?)
- porting packages from Nix to Guix


Declaratively yours: Composing system abstractions with GNU Guix
https://archive.fosdem.org/2021/schedule/event/gnuguix/

Learning Nix:
Peering into the Land of Parentheses - Guix from the Nix Perspective (NixCon 2019)
https://www.youtube.com/watch?v=bDGzCXr6VYU

generate environment modules, as commonly used in high-performance computing (HPC) on shared clusters

generate environment modules, as commonly used in high-performance computing
(HPC) on shared clusters
https://gitlab.inria.fr/guix-hpc/guix-modules
`guix module create` ???

racket2nix generate a Nix derivation for your Racket package
Take an info.rkt file, produce a info.nix file.
Take an info.rkt file, produce a info.nix file.
https://github.com/fractalide/racket2nix
}
13 changes: 11 additions & 2 deletions notes/guix-guile-nix/nix.scrbl
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#lang notes

@block{@block-name{Nix Source Code}
@block{@block-name{Learning Nix}
Let's read the Nix source code
https://youtu.be/0tp86yOQ6XY?si=7vk-fjyYJCYqCZln

Peering into the Land of Parentheses - Guix from the Nix Perspective
https://www.youtube.com/watch?v=bDGzCXr6VYU
}

@block{@block-name{Nix parsers}
set prms "--extra-experimental-features nix-command"
echo '1 + 2' | nix --extra-experimental-features nix-command --extra-experimental-features flakes run github:kamadorueda/nixel -- --format=debug
echo '1 + 2' | nix run github:kamadorueda/nixel -- --format=debug
echo '1 + 2' | nix --extra-experimental-features nix-command run github:kamadorueda/nixel -- --format=debug
}

@block{@block-name{Various}
Expand Down Expand Up @@ -152,5 +162,4 @@

nix-env -i emacs.gptel
cat pkgs/applications/editors/emacs/elisp-packages/recipes-archive-melpa.json

}

0 comments on commit b268497

Please sign in to comment.