File: flake.nix

package info (click to toggle)
python-mpd 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 472 kB
  • sloc: python: 3,148; makefile: 201; sh: 9
file content (63 lines) | stat: -rw-r--r-- 1,600 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
  description = "Development environment for this project";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-parts.url = "github:hercules-ci/flake-parts";
    flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
    treefmt-nix.url = "github:numtide/treefmt-nix";
    treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs =
    inputs@{ flake-parts, treefmt-nix, ... }:
    flake-parts.lib.mkFlake { inherit inputs; } {
      imports = [
        treefmt-nix.flakeModule
      ];
      systems = [
        "aarch64-linux"
        "x86_64-linux"
        "aarch64-darwin"
        "x86_64-darwin"
      ];
      perSystem =
        { pkgs, config, ... }:
        {
          treefmt = {
            projectRootFile = "flake.nix";
            programs = {
              ruff.format = true;
              ruff.check = true;
              mypy.enable = true;
              mypy.directories = {
                "." = {
                  modules = [ "mpd" ];
                };
              };
            };
          };

          devShells.default = pkgs.mkShell {
            packages = with pkgs; [
              bashInteractive
              python310
              python311
              python312
              (python313.withPackages (ps: [
                ps.setuptools
                ps.tox
                ps.wheel
                ps.build
              ]))
              python314
              pypy3
              twine
              mypy
              ruff
              config.treefmt.build.wrapper
            ];
          };
        };
    };
}