diff --git a/examples/_d2n-std/flake.nix b/examples/_d2n-std/flake.nix new file mode 100644 index 0000000000..7a6c06a5bd --- /dev/null +++ b/examples/_d2n-std/flake.nix @@ -0,0 +1,27 @@ +{ + inputs = { + std.url = "github:divnix/std"; + dream2nix.url = "github:nix-community/dream2nix"; + dream2nix.inputs.nixpkgs.follows = "std/nixpkgs"; + nixpkgs.follows = "std/nixpkgs"; + src.url = "github:prettier/prettier/2.4.1"; + src.flake = false; + }; + + outputs = { + std, + self, + ... + } @ inputs: + std.growOn { + inherit inputs; + cellsFrom = ./nix; + cellBlocks = with std.blockTypes; [ + (installables "packages" {ci.build = true;}) + ]; + } + # compat with `nix` cli + { + packages = std.harvest self ["app" "packages"]; + }; +} diff --git a/examples/_d2n-std/nix/app/packages.nix b/examples/_d2n-std/nix/app/packages.nix new file mode 100644 index 0000000000..6f131fe10d --- /dev/null +++ b/examples/_d2n-std/nix/app/packages.nix @@ -0,0 +1,22 @@ +{ + inputs, + cell, +}: { + default = cell.packages.app; + app = + # a terrible idea + (inputs.dream2nix.lib.makeFlakeOutputs { + systems = [inputs.nixpkgs.system]; + source = inputs.src; + projects = { + prettier = { + name = "prettier"; + subsystem = "nodejs"; + translator = "yarn-lock"; + }; + }; + }) + .packages + .${inputs.nixpkgs.system} + .default; +}