···16161717- `project`: contains a crystal (flake) definition for a project
18181919+# Ideas
2020+2121+- Have a repl with autocompletion to make build steps. A way to test and rollback steps to ensure that it works without having to run and inspect the derivation multiple times.
2222+1923# Lecture
20242125- The Purely Functional Software Deployment Model — Eelco Dolstra
···11+//! This file shows what items constitue the core library.
22+13// # Ressources
22-// https://github.com/NixOS/nixpkgs/blob/master/doc/stdenv/stdenv.chapter.md
33-// ---
44-55-//! In separate crates/projects
44+// - <https://github.com/NixOS/nixpkgs/blob/master/doc/stdenv/stdenv.chapter.md>
6576/// tools for transforming data, building derivations
87mod core {
···1091110 // equivalent for flake
1211 mod cristal {
1313-1212+ struct Shell {
1313+ name: String,
1414+1515+ packages: ???,
1616+ env: Env
1717+ }
1418 }
15191620 mod derivation {
1721 struct Drv<I, O> {
1822 pub meta: DrvMeta,
1923 pub source: Source,
2020- pub plan: BuildPlan,
2424+ pub plan: BuildPlan, // maybe we want to override that. no?
21252226 // this can be overridden when building
2327 inputs: I,
···5256 },
5357 }
54585555- let my_bin = make_new_script {
5959+ let my_bin = std::make_new_script {
5660 name: "hello",
5761 script: || {
5862 let res = Command::new(whatever.bin.whatever).exec();
···6165 },
6266 };
63676464- let screenshot_bin = std::make_script("lock-screenshot.sh", || {
6868+ let screenshot_bin = std::make_script("lock-screenshot", || {
6569 let tmp_img = Cmd::new(coreutils.bin.mktemp).arg("/tmp/lock-bg.XXX").exec()?;
7070+ // let tmp_img = shell!(coreutils.bin.mktemp "/tmp/lock-bg.XXX");
66716772 // Give some time to hide the bar
6873 std::sleep_milis(1);
+20-9
examples/machine/cristal.rs
···11//! This whole file is an experiment to show how I would translate my own Nix
22//! laptop config available at <https://github.com/mrnossiom/dotfiles/blob/main/flake.nix>
3344+// # Imports
45// this looks like deno http imports
56// See <https://docs.deno.com/runtime/fundamentals/modules/#https-imports>
66-use "github:nixos/nixpkgs/nixos-24.11" as nixpkgs;
77-use "github:nixos/nixpkgs/nixos-unstable" as nixpkgs_unstable;
88-use "github:nix-community/home-manager/release-24.11" as home_manager;
77+//
88+// versions of dependencies are frozen in a lockfile
99+//
1010+// these are specified inline to avoid the need for 3 files (source, deps info, deps lock)
1111+1212+use nixpkgs from "github:nixos/nixpkgs/nixos-24.11";
1313+use nixpkgs_unstable from "github:nixos/nixpkgs/nixos-unstable";
1414+use home_manager from "github:nix-community/home-manager/release-24.11";
9151010-// versions of dependencies are frozen in a lockfile
1616+use nix_darwin from "github:LnL7/nix-darwin";
1717+use agenix from "github:ryantm/agenix";
1818+use disko from "github:nix-community/disko";
1919+use nixos_hardware from "github:nixos/nixos-hardware";
11201212-use "github:LnL7/nix-darwin" as nix_darwin;
1313-use "github:ryantm/agenix" as agenix;
1414-use "github:nix-community/disko" as disko;
1515-use "github:nixos/nixos-hardware" as nixos_hardware;
2121+// formatter is builtin
16221723/// options definitions
1824mod options {
1919- mod machine {}
2525+ mod machine {
2626+ option Hello {
2727+2828+ }
2929+ }
3030+2031 mod user {}
2132}
2233