dream2nix/examples/repo-with-packages-flake/flake.nix
2023-11-07 19:08:27 +07:00

28 lines
748 B
Nix

{
description = "My flake with dream2nix packages";
inputs = {
dream2nix.url = "github:nix-community/dream2nix";
nixpkgs.follows = "dream2nix/nixpkgs";
};
outputs = inputs @ {
self,
dream2nix,
nixpkgs,
...
}: let
system = "x86_64-linux";
in {
# All packages defined in ./packages/<name> are automatically added to the flake outputs
# e.g., 'packages/hello/default.nix' becomes '.#packages.hello'
packages.${system} = dream2nix.lib.importPackages {
projectRoot = ./.;
# can be changed to ".git" or "flake.nix" to get rid of .project-root
projectRootFile = "flake.nix";
packagesDir = ./packages;
packageSets.nixpkgs = nixpkgs.legacyPackages.${system};
};
};
}