aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-10-16 00:20:21 +0000
committerFuwn <[email protected]>2024-10-16 00:20:24 +0000
commitbafff37435ba121c588f234b6a7e53c449e9cc08 (patch)
tree291c616a33f14c5da4168c423d424271a3ed48fc /examples
parentdocs(readme): add section heading to usage example (diff)
downloadyae-bafff37435ba121c588f234b6a7e53c449e9cc08.tar.xz
yae-bafff37435ba121c588f234b6a7e53c449e9cc08.zip
docs: add nixpkgs examples
Diffstat (limited to 'examples')
-rw-r--r--examples/nixpkgs-simple/flake.nix18
-rw-r--r--examples/nixpkgs-simple/yae.json10
-rw-r--r--examples/nixpkgs/flake.nix47
-rw-r--r--examples/nixpkgs/yae.json10
4 files changed, 85 insertions, 0 deletions
diff --git a/examples/nixpkgs-simple/flake.nix b/examples/nixpkgs-simple/flake.nix
new file mode 100644
index 0000000..2903230
--- /dev/null
+++ b/examples/nixpkgs-simple/flake.nix
@@ -0,0 +1,18 @@
+{
+ outputs =
+ { self }:
+ let
+ nixpkgs = (builtins.fromJSON (builtins.readFile "${self}/yae.json")).nixpkgs;
+
+ pkgs =
+ import
+ (builtins.fetchTarball {
+ inherit (nixpkgs) url sha256;
+ })
+ {
+ };
+ in
+ {
+ packages.${pkgs.system}.hello = pkgs.hello;
+ };
+}
diff --git a/examples/nixpkgs-simple/yae.json b/examples/nixpkgs-simple/yae.json
new file mode 100644
index 0000000..54b371c
--- /dev/null
+++ b/examples/nixpkgs-simple/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"
+ }
+}
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"
+ }
+}