Compare commits
3 Commits
13c7655ccf
...
af049cefaa
| Author | SHA1 | Date | |
|---|---|---|---|
| af049cefaa | |||
| 0374c07266 | |||
| 69ae986260 |
19
Makefile
19
Makefile
@ -1,19 +0,0 @@
|
||||
# Special variables
|
||||
.DEFAULT_GOAL := help # Set default target to run
|
||||
.SILENT: # Disable printing recipes at runtime
|
||||
.ONESHELL: # Run target recipes in one shell invocation
|
||||
.PHONY: build-image \ # Phony targets
|
||||
clean \
|
||||
help
|
||||
|
||||
help: ## Shows this help prompt.
|
||||
egrep -h '\s##\s' $(MAKEFILE_LIST) \
|
||||
| sort \
|
||||
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
clean:
|
||||
rm -f result
|
||||
|
||||
build-image: clean ## Builds Linode campatible NixOS disk image.
|
||||
nix build ".#nixosConfigurations.linode-image.config.system.build.raw"
|
||||
|
||||
6
flake.lock
generated
6
flake.lock
generated
@ -2,11 +2,11 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1756469547,
|
||||
"narHash": "sha256-YvtD2E7MYsQ3r7K9K2G7nCslCKMPShoSEAtbjHLtH0k=",
|
||||
"lastModified": 1764316264,
|
||||
"narHash": "sha256-82L+EJU+40+FIdeG4gmUlOF1jeSwlf2AwMarrpdHF6o=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "41d292bfc37309790f70f4c120b79280ce40af16",
|
||||
"rev": "9a7b80b6f82a71ea04270d7ba11b48855681c4b0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
41
justfile
Normal file
41
justfile
Normal file
@ -0,0 +1,41 @@
|
||||
set dotenv-required
|
||||
set quiet := true
|
||||
|
||||
UPLOAD_URL := ```
|
||||
curl -s -X POST \
|
||||
--url https://api.linode.com/v4/images/upload \
|
||||
--header 'accept: application/json' \
|
||||
--header "authorization: Bearer $API_TOKEN" \
|
||||
--header 'content-type: application/json' \
|
||||
--data '
|
||||
{
|
||||
"description": "nixos",
|
||||
"label": "nixos",
|
||||
"region": "us-iad"
|
||||
}
|
||||
' | jq .upload_to
|
||||
```
|
||||
|
||||
[private]
|
||||
_default:
|
||||
just --list
|
||||
|
||||
[private]
|
||||
_clean:
|
||||
rm -f result
|
||||
|
||||
[private]
|
||||
_image_exists:
|
||||
[ -f result/linode-image.img.gz ] \
|
||||
|| echo "Linode image not found."
|
||||
|
||||
[doc('Builds Linode compatible NixOS disk image.')]
|
||||
build-image: _clean
|
||||
nix build ".#nixosConfigurations.linode-image.config.system.build.raw"
|
||||
|
||||
[doc('Uploads NixOS compatible disk image to Linode.')]
|
||||
upload-image: _image_exists
|
||||
curl -X PUT \
|
||||
--url {{UPLOAD_URL}} \
|
||||
-T result/linode-image.img.gz
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user