-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: update build scripts and flake configurations
- Removed `temp_dir` variable and cleaned up build scripts in `justfile`. - Updated `build-template` to use `mktemp` for temporary directories. - Added `set -euxo pipefail` to ensure scripts fail on errors. - Modified `build-darwin`, `build-home-manager`, `build-language`, `build-nixos-desktop`, and `build-nixos-minimal` to use the new `build-template` logic. - Reordered fields in `template/haskell/flake.nix` for consistency. - Removed `nodejs` inheritance in `template/vite-react/flake.nix` and cleaned up package definition.
- Loading branch information
1 parent
fb1fc56
commit b42f706
Showing
3 changed files
with
42 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,52 @@ | ||
temp_dir := "/tmp/kickstart.nix" | ||
|
||
_default: | ||
just --list | ||
|
||
build profile: | ||
nix build --json --no-link --print-build-logs "{{ profile }}" | ||
nix build --json --no-link --print-build-logs "{{ profile }}" \ | ||
| jq -r ".[0].outputs.out" | ||
|
||
check: | ||
nix flake check | ||
|
||
clean-template template: | ||
rm -rf {{ temp_dir }}/{{ template }} | ||
mkdir -p {{ temp_dir }}/{{ template }} | ||
|
||
build-template template: (clean-template template) | ||
build-template template: | ||
#!/usr/bin/env bash | ||
DERIVATION=$(just build ".#example-{{ template }}") | ||
OUTPUT=$(echo $DERIVATION | jq -r ".[0].outputs.out") | ||
cp --no-preserve=mode -r $OUTPUT/* {{ temp_dir }}/{{ template }} | ||
set -euxo pipefail | ||
OUTPUT_DIR=$(just build "$PWD#example-{{ template }}") | ||
TEMP_DIR=$(mktemp -d) | ||
cp --no-preserve=mode -r $OUTPUT_DIR/* $TEMP_DIR/. | ||
echo $TEMP_DIR | ||
build-darwin system="x86_64": (build-template "darwin") | ||
just build "{{ temp_dir }}/darwin#darwinConfigurations.{{ system }}.config.system.build.toplevel" | ||
build-darwin system="x86_64": | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
TEMP_DIR=$(just build-template "darwin") | ||
ls -alh $TEMP_DIR | ||
just build "$TEMP_DIR#darwinConfigurations.{{ system }}.config.system.build.toplevel" | ||
build-home-manager system="x86_64-linux": (build-template "home-manager") | ||
just build "{{ temp_dir }}/home-manager#homeConfigurations.{{ system }}.activationPackage" | ||
build-home-manager system="x86_64-linux": | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
TEMP_DIR=$(just build-template "home-manager") | ||
ls -alh $TEMP_DIR | ||
just build "$TEMP_DIR#homeConfigurations.{{ system }}.activationPackage" | ||
build-language template profile="default": (build-template template) | ||
just build "{{ temp_dir }}/{{ template }}#{{ profile }}" | ||
build-language language profile="default": | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
TEMP_DIR=$(just build-template "{{ language }}") | ||
ls -alh $TEMP_DIR | ||
just build "$TEMP_DIR" | ||
build-nixos-desktop system="x86_64" desktop="gnome": (build-template 'nixos-desktop-'+desktop) | ||
just build "{{ temp_dir }}/nixos-desktop-{{ desktop }}#nixosConfigurations.{{ system }}.config.system.build.toplevel" | ||
build-nixos-desktop system="x86_64" desktop="gnome": | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
TEMP_DIR=$(just build-template "nixos-desktop-{{ desktop }}") | ||
ls -alh $TEMP_DIR | ||
just build "$TEMP_DIR#nixosConfigurations.{{ system }}.config.system.build.toplevel" | ||
build-nixos-minimal system="x86_64": (build-template "nixos-minimal") | ||
just build "{{ temp_dir }}/nixos-minimal#nixosConfigurations.{{ system }}.config.system.build.toplevel" | ||
build-nixos-minimal system="x86_64": | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
TEMP_DIR=$(just build-template "nixos-minimal") | ||
ls -alh $TEMP_DIR | ||
just build "$TEMP_DIR#nixosConfigurations.{{ system }}.config.system.build.toplevel" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters