Skip to content

Commit

Permalink
build: adding flake
Browse files Browse the repository at this point in the history
Once merged, running `nix run 'github:pazz/alot'` will be able to run a
master version of alot.
This assumes you have the nix package manager available with flakes
enabled.
  • Loading branch information
teto committed Jul 30, 2023
1 parent 2e0dba3 commit d6e7259
Show file tree
Hide file tree
Showing 2 changed files with 183 additions and 0 deletions.
138 changes: 138 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
description = "Application packaged using poetry2nix";

inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs.nixpkgs.follows = "nixpkgs";
};

outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
# see https://github.com/nix-community/poetry2nix/tree/master#api for more functions and examples.
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication;
pkgs = nixpkgs.legacyPackages.${system};

in
{
packages = {
myapp = mkPoetryApplication {
projectDir = self;
nativeBuildInputs = [
pkgs.python3.pkgs.cffi
];
propagatedBuildInputs = with pkgs; [
gpgme
pkgs.gpgme.dev
pkgs.python3.pkgs.cffi
];
overrides = poetry2nix.legacyPackages.${system}.overrides.withDefaults (self: super: {
gpg = super.gpgme;
notmuch2 = pkgs.python3.pkgs.notmuch2;
});

};
default = self.packages.${system}.myapp;
};

devShells.default = pkgs.mkShell {
packages = [ poetry2nix.packages.${system}.poetry ];
};

});
}

0 comments on commit d6e7259

Please sign in to comment.