diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fcfc4a1 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result* diff --git a/dae/metadata.json b/dae/metadata.json new file mode 100644 index 0000000..b715859 --- /dev/null +++ b/dae/metadata.json @@ -0,0 +1,6 @@ +{ + "version": "v0.6.0rc1", + "rev": "v0.6.0rc1", + "hash": "sha256-A8ecYE0p+FoW0yskprvvy73pup/eR4bx8HNa55OorwY=", + "vendorHash": "sha256-NzPPf/KwuRCMmOGwk9k3ndYojDF9B/hXBPQ8ySan3t8=" +} diff --git a/dae/package.nix b/dae/package.nix index fa4a107..3654202 100644 --- a/dae/package.nix +++ b/dae/package.nix @@ -3,20 +3,20 @@ , fetchFromGitHub , buildGoModule }: +let + metadata = builtins.fromJSON (builtins.readFile ./metadata.json); +in buildGoModule rec { pname = "dae"; - version = "unstable-2023-09-04"; + inherit (metadata) version vendorHash; src = fetchFromGitHub { owner = "daeuniverse"; repo = pname; - rev = "8334868905096abc4a2e94d39f831f6bae8e86d3"; - hash = "sha256-aOL0rwjRES0V3PFmBiHJcNiyOcGKGNY78Wqgnbk2cG0="; + inherit (metadata) rev hash; fetchSubmodules = true; }; - vendorHash = "sha256-rZwK+mYWJqgLFhzwZTfCC4tIg2gtNtx7Lu/fyOL3ozA="; - proxyVendor = true; nativeBuildInputs = [ clang ]; diff --git a/justfile b/justfile new file mode 100644 index 0000000..160a966 --- /dev/null +++ b/justfile @@ -0,0 +1,39 @@ +# justfile +# cheatsheet: https://cheatography.com/linux-china/cheat-sheets/justfile/ + +# define alias + +# set options +set positional-arguments := true + +# default recipe to display help information +default: + @just --list + +# build pkg +build pkg: + @nix build .#{{ pkg }} + +# check version +version pkg: + @./result/bin/{{ pkg }} --version + +# update all flake inputs +update: + @nix flake update + +# update a particular flake input +update-input input: + @nix flake lock --update-input {{ input }} + +# nix-prefetch-url +prefetch-url url: + @nix-prefetch-url --type sha256 '{{ url }}' | xargs nix hash to-sri --type sha256 + +# nix-prefetch-git +prefetch-git repo rev: + @nix-prefetch-git --url 'git@github.com:{{ repo }}' --rev '{{ rev }}' --fetch-submodules --quiet + +# stage all files +add: + @git add .