upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/archive/2025-11-04-flake-migration.md
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-03 11:19:40 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-03 11:19:40 +0000
commit2eaff5b79fed364d5eba5eb38e4b7bf76326884d (patch)
treedeacd6294f8860096ee82ee76930204efd65e33c /docs/archive/2025-11-04-flake-migration.md
parent57bc8cd9c021feaf08e139e8fb62800bc476068e (diff)
remove docs archive
Diffstat (limited to 'docs/archive/2025-11-04-flake-migration.md')
-rw-r--r--docs/archive/2025-11-04-flake-migration.md203
1 files changed, 0 insertions, 203 deletions
diff --git a/docs/archive/2025-11-04-flake-migration.md b/docs/archive/2025-11-04-flake-migration.md
deleted file mode 100644
index 2d2514d..0000000
--- a/docs/archive/2025-11-04-flake-migration.md
+++ /dev/null
@@ -1,203 +0,0 @@
1# Flake Migration Complete
2
3**Date:** November 4, 2025
4**Change:** Migrated from shell.nix to flake.nix
5
6## What Changed
7
8### Files Modified
9
101. **Created: grasp-audit/flake.nix**
11 - Based on ../ngit/flake.nix
12 - Uses rust-overlay for Rust toolchain
13 - Includes devShell and package outputs
14 - Properly configured with dependencies
15
162. **Removed: grasp-audit/shell.nix**
17 - Old Nix shell configuration
18 - Replaced by flake.nix
19
203. **Updated Documentation:**
21 - grasp-audit/README.md
22 - grasp-audit/QUICK_START.md
23 - NEXT_SESSION_QUICKSTART.md
24 - SMOKE_TEST_REPORT.md
25 - FILES_CREATED.md
26
27All references to `nix-shell` changed to `nix develop`.
28
29## New Flake Configuration
30
31```nix
32{
33 inputs = {
34 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
35 rust-overlay.url = "github:oxalica/rust-overlay";
36 flake-utils.url = "github:numtide/flake-utils";
37 };
38
39 outputs = { nixpkgs, rust-overlay, flake-utils, ... }:
40 flake-utils.lib.eachDefaultSystem (system:
41 let
42 overlays = [ (import rust-overlay) ];
43 pkgs = import nixpkgs { inherit system overlays; };
44 manifest = pkgs.lib.importTOML ./Cargo.toml;
45 in with pkgs; {
46 devShells.default = mkShell {
47 nativeBuildInputs = [
48 rust-bin.stable.latest.default
49 pkg-config
50 gitlint
51 ];
52 buildInputs = [
53 openssl
54 ];
55 shellHook = ''
56 echo "πŸ¦€ GRASP Audit development environment loaded"
57 # ... helpful messages ...
58 export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc}
59 '';
60 };
61
62 packages.default = pkgs.rustPlatform.buildRustPackage {
63 pname = manifest.package.name;
64 version = manifest.package.version;
65 src = ./.;
66 cargoLock = { lockFile = ./Cargo.lock; };
67 buildInputs = [ openssl ];
68 nativeBuildInputs = [ pkg-config ];
69 doCheck = false;
70 };
71 });
72}
73```
74
75## Flake Validation
76
77```bash
78$ cd grasp-audit && nix flake show
79git+file:///persistent/dcdev/clones/ngit-grasp?dir=grasp-audit
80β”œβ”€β”€β”€devShells
81β”‚ β”œβ”€β”€β”€aarch64-darwin
82β”‚ β”‚ └───default: omitted (use '--all-systems' to show)
83β”‚ β”œβ”€β”€β”€aarch64-linux
84β”‚ β”‚ └───default: omitted (use '--all-systems' to show)
85β”‚ β”œβ”€β”€β”€x86_64-darwin
86β”‚ β”‚ └───default: omitted (use '--all-systems' to show)
87β”‚ └───x86_64-linux
88β”‚ └───default: development environment 'nix-shell'
89└───packages
90 β”œβ”€β”€β”€aarch64-darwin
91 β”‚ └───default: omitted (use '--all-systems' to show)
92 β”œβ”€β”€β”€aarch64-linux
93 β”‚ └───default: omitted (use '--all-systems' to show)
94 β”œβ”€β”€β”€x86_64-darwin
95 β”‚ └───default: omitted (use '--all-systems' to show)
96 └───x86_64-linux
97 └───default: package 'grasp-audit-0.1.0'
98```
99
100βœ… Flake is valid and provides:
101- Dev shell for all major systems
102- Package output for grasp-audit binary
103
104## Usage
105
106### Old Way (shell.nix)
107```bash
108cd grasp-audit
109nix-shell
110cargo build
111```
112
113### New Way (flake.nix)
114```bash
115cd grasp-audit
116nix develop
117cargo build
118```
119
120### Additional Flake Commands
121
122```bash
123# Show flake outputs
124nix flake show
125
126# Check flake validity
127nix flake check
128
129# Build the package directly
130nix build
131
132# Run without installing
133nix run
134
135# Update flake inputs
136nix flake update
137```
138
139## Benefits of Flakes
140
1411. **Reproducibility:** Locked inputs ensure consistent builds
1422. **Multi-output:** Both dev shell and package in one file
1433. **Standard:** Follows modern Nix best practices
1444. **Composability:** Can be used as input to other flakes
1455. **Better UX:** `nix develop` is clearer than `nix-shell`
146
147## Updated Quick Start
148
149```bash
150# 1. Enter dev environment
151cd grasp-audit
152nix develop
153
154# 2. Build
155cargo build
156
157# 3. Test
158cargo test --lib
159
160# 4. Run example
161cargo run --example simple_audit
162```
163
164## Documentation Updates
165
166All documentation has been updated to use `nix develop` instead of `nix-shell`:
167
168- βœ… grasp-audit/README.md
169- βœ… grasp-audit/QUICK_START.md
170- βœ… NEXT_SESSION_QUICKSTART.md
171- βœ… SMOKE_TEST_REPORT.md
172- βœ… FILES_CREATED.md
173
174## Next Steps
175
176The flake is ready to use. Next session can:
177
1781. **Enter dev environment:**
179 ```bash
180 cd grasp-audit
181 nix develop
182 ```
183
1842. **Build and test:**
185 ```bash
186 cargo build
187 cargo test --lib
188 ```
189
1903. **Continue with integration tests** (once relay is set up)
191
192## Status
193
194- βœ… Flake created and validated
195- βœ… Documentation updated
196- βœ… Old shell.nix removed
197- βœ… Git tracking enabled
198- 🚧 Dev environment ready (first run will download dependencies)
199- 🚧 Build pending (waiting for nix develop to complete)
200
201---
202
203**Migration Complete:** shell.nix β†’ flake.nix βœ