v1.0.0
This commit is contained in:
28
flake.nix
28
flake.nix
@ -7,23 +7,32 @@
|
||||
url = "github:nix-community/poetry2nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
microvm = {
|
||||
url = "github:astro/microvm.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
poetry2nix-lib,
|
||||
}: let
|
||||
outputs = {self, ...} @ inputs: let
|
||||
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
|
||||
poetry2nix = forAllSystems (system: poetry2nix-lib.lib.mkPoetry2Nix {pkgs = pkgs.${system};});
|
||||
forAllSystems = inputs.nixpkgs.lib.genAttrs supportedSystems;
|
||||
pkgs = forAllSystems (system: inputs.nixpkgs.legacyPackages.${system});
|
||||
poetry2nix = forAllSystems (system: inputs.poetry2nix-lib.lib.mkPoetry2Nix {pkgs = pkgs.${system};});
|
||||
in {
|
||||
# `nix build`
|
||||
packages = forAllSystems (system: {
|
||||
default = poetry2nix.${system}.mkPoetryApplication {
|
||||
projectDir = self;
|
||||
};
|
||||
vm = self.nixosConfigurations.vm.config.microvm.declaredRunner;
|
||||
});
|
||||
|
||||
# `nix run`
|
||||
apps = forAllSystems (system: {
|
||||
default = {
|
||||
program = "${self.packages.${system}.default}/bin/testdata";
|
||||
type = "app";
|
||||
};
|
||||
});
|
||||
|
||||
# `nix fmt`
|
||||
@ -45,5 +54,8 @@
|
||||
++ [poetryEnv];
|
||||
};
|
||||
});
|
||||
|
||||
# NixOS Module
|
||||
nixosModules.default = import ./nix/module.nix inputs;
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user