Skip to content

Instantly share code, notes, and snippets.

@lovesegfault

lovesegfault/flake.nix Secret

Created May 4, 2021
Embed
What would you like to do?
{
description = "beautysh";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable-small";
flake-utils.url = "github:numtide/flake-utils";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { nixpkgs, flake-utils, poetry2nix, self }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; overlays = [ poetry2nix.overlay ]; };
in
{
defaultApp = self.apps.${system}.beautysh;
defaultPackage = self.packages.${system}.beautysh;
apps.beautysh = {
type = "app";
program = "${self.packages.${system}.beautysh}/bin/beautysh";
};
packages.beautysh = pkgs.poetry2nix.mkPoetryApplication rec {
projectDir = ./.;
checkPhase = ''
pytest -v -Wdefault
'';
devEnv = pkgs.poetry2nix.mkPoetryEnv { inherit projectDir; };
};
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
self.packages.${system}.beautysh.devEnv
poetry
nix-linter
nixpkgs-fmt
];
};
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment