Skip to content

Commit

Permalink
flake: add defaultPackage
Browse files Browse the repository at this point in the history
  • Loading branch information
kraanzu committed Nov 7, 2024
1 parent a971469 commit 9504862
Showing 1 changed file with 30 additions and 25 deletions.
55 changes: 30 additions & 25 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,41 @@
}
);

mainPkgs = python3: with python3; [
poetry-core
pyperclip
textual
pyyaml
dateutil
sqlalchemy
platformdirs
tzlocal
click
];
mainPkgs = python3:
with python3; [
poetry-core
pyperclip
textual
pyyaml
dateutil
sqlalchemy
platformdirs
tzlocal
click
];

devShellPkgs = python3: with python3; [
textual-dev
pre-commit-hooks
pytest
pytest-aio
faker
];
devShellPkgs = python3:
with python3; [
textual-dev
pre-commit-hooks
pytest
pytest-aio
faker
];

nativeBuildInputs = pkgs: with pkgs; [
poetry
];
nativeBuildInputs = pkgs:
with pkgs; [
poetry
];

# Define devShell for each system
devShellFor = system:
inputs.nixpkgs.lib.genAttrs ["default"] (
_:
pkgsFor.${system}.mkShell {
buildInputs = (mainPkgs pkgsFor.${system}.python312Packages)
buildInputs =
(mainPkgs pkgsFor.${system}.python312Packages)
++ (devShellPkgs pkgsFor.${system}.python312Packages)
++ [ pkgsFor.${system}.bun ];
++ [pkgsFor.${system}.bun];

shellHook = ''
cd site/
Expand Down Expand Up @@ -77,13 +80,15 @@

doCheck = false;
};

in {
devShells = forEachSystem devShellFor;

packages = forEachSystem (
system: {
default = defaultPackageFor system;
}
);

defaultPackage = defaultPackageFor builtins.currentSystem;
};
}

0 comments on commit 9504862

Please sign in to comment.