diff options
| author | Fuwn <[email protected]> | 2024-10-16 00:20:21 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-10-16 00:20:24 +0000 |
| commit | bafff37435ba121c588f234b6a7e53c449e9cc08 (patch) | |
| tree | 291c616a33f14c5da4168c423d424271a3ed48fc /examples/nixpkgs | |
| parent | docs(readme): add section heading to usage example (diff) | |
| download | yae-bafff37435ba121c588f234b6a7e53c449e9cc08.tar.xz yae-bafff37435ba121c588f234b6a7e53c449e9cc08.zip | |
docs: add nixpkgs examples
Diffstat (limited to 'examples/nixpkgs')
| -rw-r--r-- | examples/nixpkgs/flake.nix | 47 | ||||
| -rw-r--r-- | examples/nixpkgs/yae.json | 10 |
2 files changed, 57 insertions, 0 deletions
diff --git a/examples/nixpkgs/flake.nix b/examples/nixpkgs/flake.nix new file mode 100644 index 0000000..7dd28a4 --- /dev/null +++ b/examples/nixpkgs/flake.nix @@ -0,0 +1,47 @@ +{ + outputs = + { self }: + let + nixpkgs = (builtins.fromJSON (builtins.readFile "${self}/yae.json")).nixpkgs; + + systemsFlakeExposed = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "armv6l-linux" + "armv7l-linux" + "i686-linux" + "aarch64-darwin" + "powerpc64le-linux" + "riscv64-linux" + "x86_64-freebsd" + ]; + + forEachSystem = + systems: action: + builtins.listToAttrs ( + map (system: { + name = system; + value = action system; + }) systems + ); + in + { + packages = (forEachSystem systemsFlakeExposed) ( + system: + let + pkgs = + import + (builtins.fetchTarball { + inherit (nixpkgs) url sha256; + }) + { + inherit system; + }; + in + { + hello = pkgs.hello; + } + ); + }; +} diff --git a/examples/nixpkgs/yae.json b/examples/nixpkgs/yae.json new file mode 100644 index 0000000..54b371c --- /dev/null +++ b/examples/nixpkgs/yae.json @@ -0,0 +1,10 @@ +{ + "nixpkgs": { + "url": "https://github.com/NixOS/nixpkgs/archive/nixos-unstable.tar.gz", + "sha256": "1wn29537l343lb0id0byk0699fj0k07m1n2d7jx2n0ssax55vhwy", + "unpack": true, + "type": "git", + "version": "nixos-unstable", + "url_template": "https://github.com/NixOS/nixpkgs/archive/{version}.tar.gz" + } +} |