2019-11-19 19:33:44 +00:00
|
|
|
{
|
|
|
|
description = "Poetry2nix flake";
|
|
|
|
|
2020-12-30 21:57:32 +01:00
|
|
|
inputs.flake-utils.url = "github:numtide/flake-utils";
|
2023-08-28 10:15:56 +03:00
|
|
|
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
|
2020-12-30 21:57:32 +01:00
|
|
|
|
2023-07-14 17:36:10 +12:00
|
|
|
inputs.nix-github-actions.url = "github:nix-community/nix-github-actions";
|
|
|
|
inputs.nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, flake-utils, nix-github-actions }:
|
2023-01-15 12:19:39 +01:00
|
|
|
{
|
2020-04-29 14:12:59 +01:00
|
|
|
overlay = import ./overlay.nix;
|
2021-04-25 10:23:20 +02:00
|
|
|
|
2023-07-14 17:36:10 +12:00
|
|
|
githubActions =
|
|
|
|
let
|
|
|
|
mkPkgs = system: import nixpkgs {
|
|
|
|
config = {
|
|
|
|
allowAliases = false;
|
|
|
|
allowInsecurePredicate = x: true;
|
|
|
|
};
|
|
|
|
overlays = [ self.overlay ];
|
|
|
|
inherit system;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
nix-github-actions.lib.mkGithubMatrix {
|
|
|
|
checks = {
|
|
|
|
x86_64-linux =
|
|
|
|
let
|
|
|
|
pkgs = mkPkgs "x86_64-linux";
|
|
|
|
in
|
|
|
|
import ./tests { inherit pkgs; };
|
|
|
|
|
|
|
|
x86_64-darwin =
|
|
|
|
let
|
|
|
|
pkgs = mkPkgs "x86_64-darwin";
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
tests = import ./tests { inherit pkgs; };
|
|
|
|
in
|
|
|
|
{
|
|
|
|
# Aggregate all tests into one derivation so that only one GHA runner is scheduled for all darwin jobs
|
|
|
|
aggregate = pkgs.runCommand "darwin-aggregate"
|
|
|
|
{
|
|
|
|
env.TEST_INPUTS = (lib.concatStringsSep " " (lib.attrValues (lib.filterAttrs (n: v: lib.isDerivation v) tests)));
|
|
|
|
} "touch $out";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-04-25 10:23:20 +02:00
|
|
|
templates = {
|
|
|
|
app = {
|
|
|
|
path = ./templates/app;
|
|
|
|
description = "An example of a NixOS container";
|
|
|
|
};
|
2023-01-15 12:19:39 +01:00
|
|
|
default = self.templates.app;
|
2021-04-25 10:23:20 +02:00
|
|
|
};
|
|
|
|
|
2020-12-30 21:57:32 +01:00
|
|
|
} // (flake-utils.lib.eachDefaultSystem (system:
|
2023-01-15 12:19:39 +01:00
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
2023-04-05 10:01:40 +03:00
|
|
|
poetry2nix = import ./default.nix { inherit pkgs; };
|
|
|
|
poetry = pkgs.callPackage ./pkgs/poetry { python = pkgs.python3; inherit poetry2nix; };
|
2023-01-15 12:19:39 +01:00
|
|
|
in
|
2020-12-30 21:57:32 +01:00
|
|
|
rec {
|
2023-01-15 12:19:39 +01:00
|
|
|
packages = {
|
|
|
|
inherit poetry;
|
|
|
|
poetry2nix = poetry2nix.cli;
|
|
|
|
default = poetry2nix.cli;
|
|
|
|
};
|
2021-01-15 18:00:08 +01:00
|
|
|
|
2023-01-15 12:26:41 +01:00
|
|
|
legacyPackages = poetry2nix;
|
2020-12-01 12:14:39 +01:00
|
|
|
|
2020-12-30 21:57:32 +01:00
|
|
|
apps = {
|
|
|
|
poetry = flake-utils.lib.mkApp { drv = packages.poetry; };
|
2021-01-15 18:00:08 +01:00
|
|
|
poetry2nix = flake-utils.lib.mkApp { drv = packages.poetry2nix; };
|
2023-01-15 12:19:39 +01:00
|
|
|
default = apps.poetry2nix;
|
2020-12-01 12:44:48 +01:00
|
|
|
};
|
2020-12-30 21:57:32 +01:00
|
|
|
}));
|
2019-11-19 19:33:44 +00:00
|
|
|
}
|