mirror of
https://github.com/nix-community/dream2nix.git
synced 2025-01-08 07:41:12 +03:00
d8e4b477e3
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.
47 lines
1001 B
Nix
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;
|
|
};
|
|
};
|
|
}
|