Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# first time
if [[ ! -d $(nix store add-path --name source --dry-run .) ]]; then
nix store add-path --name source .
(cd ./src/local && nix flake lock --update-input std)
(cd ./src/tests && nix flake lock --update-input std)
(cd ./src/local && nix flake lock --override-input std git+file://$(pwd)/../..?rev=4177882c378184b795fa97594b5effd062213891)
(cd ./src/tests && nix flake lock --override-input std git+file://$(pwd)/../..?rev=4177882c378184b795fa97594b5effd062213891)
fi

# shellcheck disable=SC1090
Expand Down
8 changes: 0 additions & 8 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,6 @@ After making code changes, ALWAYS test these complete workflows:
# Should work without errors - takes 5-15 minutes first time
```

4. **Subflake lock file updates** (for maintainers):
```bash
# When updating Standard framework itself:
./.github/workflows/update-subflake.sh
# This updates src/local/flake.lock and src/tests/flake.lock
```

## Common Tasks

### Repository Structure
Expand Down Expand Up @@ -234,7 +227,6 @@ mdbook serve # Serve docs locally at localhost:3000
- **Slow builds**: This is normal for Nix - do not cancel, builds are cached after first success
- **direnv not working**: Ensure direnv is installed and shell hook is configured
- **Network errors during setup**: Some dependencies require internet access; check firewall/proxy settings
- **Flake lock issues**: In subflakes, run `./.github/workflows/update-subflake.sh` to update lock files
- **"error: getting status of '/nix/store/...'**: Usually means incomplete download; try `nix build` again
- **Out of disk space**: Nix store can get large; run `nix-collect-garbage` to clean up

Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/gh-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:

- uses: nixbuild/nix-quick-install-action@v25

- name: Update subflake references
run: ./.github/workflows/update-subflake.sh

- run: nix develop .#book -c mdbook build ./.

- name: Deploy
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/std.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: nixbuild/nix-quick-install-action@v25
- name: Update subflake references
run: ./.github/workflows/update-subflake.sh
# - uses: DeterminateSystems/magic-nix-cache-action@main
- uses: divnix/std-action/discover@main
id: discovery
Expand Down Expand Up @@ -68,7 +66,5 @@ jobs:
steps:
- uses: nixbuild/nix-quick-install-action@v25
- uses: actions/checkout@v3
- name: Update subflake references
run: ./.github/workflows/update-subflake.sh
# - uses: DeterminateSystems/magic-nix-cache-action@main
- uses: divnix/std-action/run@main
15 changes: 4 additions & 11 deletions .github/workflows/update-subflake.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
# create the store path of
nix store add-path --name source .

# update the subflake lockfile to the (now existing) store path
# set lastModified to 1 because unknown issues in the GH action environment
(cd ./src/local && nix flake lock --update-input std && (
jq '.nodes.std.locked.lastModified = 1' flake.lock > flake.lock.new && rm flake.lock && mv flake.lock.new flake.lock
) && git add -f flake.lock)
(cd ./src/tests && nix flake lock --update-input std && (
jq '.nodes.std.locked.lastModified = 1' flake.lock > flake.lock.new && rm flake.lock && mv flake.lock.new flake.lock
) &&git add -f flake.lock)
# update the subflake lockfile using git+file:// override with explicit rev
# this avoids the self-referencing issue with Nix 2.18+
(cd ./src/local && nix flake lock --override-input std git+file://$(pwd)/../..?rev=4177882c378184b795fa97594b5effd062213891 && git add -f flake.lock)
(cd ./src/tests && nix flake lock --override-input std git+file://$(pwd)/../..?rev=4177882c378184b795fa97594b5effd062213891 && git add -f flake.lock)
# continue normally ...
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

.std
/**/flake.lock
!src/local/flake.lock
!src/tests/flake.lock
result

# prj-spec dirs
Expand Down
19 changes: 9 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
flake = false; # we're after the source code, only
};
};
};
inputs.blank.url = "github:divnix/blank";
inputs.yants = {
url = "github:divnix/yants";
Expand All @@ -38,16 +39,14 @@
/*
Auxiliar inputs used in builtin libraries or for the dev environment.
*/
inputs = {
# Placeholder inputs that can be overloaded via follows
n2c.follows = "blank";
devshell.follows = "blank";
nixago.follows = "blank";
terranix.follows = "blank";
microvm.follows = "blank";
makes.follows = "blank";
arion.follows = "blank";
};
inputs.n2c.follows = "blank";
inputs.devshell.follows = "blank";
inputs.nixago.follows = "blank";
inputs.terranix.follows = "blank";
inputs.microvm.follows = "blank";
inputs.makes.follows = "blank";
inputs.arion.follows = "blank";
inputs.flake-parts.follows = "blank";

outputs = inputs: let
# bootstrap std
Expand Down
Loading