dream2nix/examples/repo-flake-pdm/flake.nix
DavHau d8e4b477e3 refactor: move dev related things to /dev-flake
The goal is to reduce the flake inputs visible to the user
Still, the top-level flake re-exposes the outputs of the dev-flake, but
without exposing its inputs. This means a devShell is still available in
the top-level, for example.

This also removes the /modules/flake.nix. Its original purpose was
separating the modules inputs from the development inputs, but this is
now done the opposite way around by moving the dev inputs to
/dev-flake/flake.nix.
2023-11-05 03:42:18 +00:00

47 lines
1001 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";
lib = nixpkgs.lib;
module = {
config,
lib,
dream2nix,
...
}: {
imports = [
dream2nix.modules.dream2nix.WIP-python-pdm
];
pdm.lockfile = ./pdm.lock;
pdm.pyproject = ./pyproject.toml;
pdm.pythonInterpreter = nixpkgs.legacyPackages.python3;
mkDerivation = {
src = ./.;
buildInputs = [
config.deps.python3.pkgs.pdm-backend
];
};
};
evaled = lib.evalModules {
modules = [module];
specialArgs.dream2nix = dream2nix;
specialArgs.packageSets.nixpkgs = nixpkgs.legacyPackages.x86_64-linux;
};
in {
packages.${system} = {
my-project = evaled.config.public;
};
};
}