Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix derivation #17

Open
winterec opened this issue Oct 21, 2024 · 0 comments
Open

Nix derivation #17

winterec opened this issue Oct 21, 2024 · 0 comments

Comments

@winterec
Copy link

winterec commented Oct 21, 2024

Hi friends, just sharing my shell.nix I'm using for my beancount project under NixOS. May be useful for someone.

{ pkgs ? import <nixpkgs> {} }:

let
  autobean = pkgs.python3Packages.buildPythonPackage rec {
    pname = "autobean";
    version = "0.2.2";
    format = "pyproject";

    src = pkgs.python3Packages.fetchPypi {
      inherit pname version;
      sha256 = "0jiady5nn7h190j195gj6x6vxmgvbxs2dmmlqa0bvsps4c1ps0ys"; 
    };
    
    nativeBuildInputs = with pkgs.python3Packages; [
      pdm-pep517
      setuptools
      wheel
    ];
    
    propagatedBuildInputs = with pkgs.python3Packages; [
      beancount
      python-dateutil
      pyyaml
      requests
    ];
    
    pythonImportsCheck = [ "autobean" ];
    
    doCheck = false;
  };
in
pkgs.mkShell {
  packages = with pkgs; [
    (python3.withPackages (ps: with ps; [
      pip
      beancount
      fava
      autobean
    ]))
  ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant