-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathflake.nix
More file actions
107 lines (97 loc) · 3.54 KB
/
flake.nix
File metadata and controls
107 lines (97 loc) · 3.54 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{
description = "Flake utils demo";
inputs.nixpkgs.url = "git+https://github.com/NixOS/nixpkgs?shallow=1&ref=nixpkgs-unstable";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
inputs.treefmt-nix.url = "github:numtide/treefmt-nix";
inputs.treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-darwin"
];
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem =
{
config,
pkgs,
lib,
self',
...
}:
{
devShells.default = pkgs.callPackage ./shell.nix {
treefmt = config.treefmt.build.wrapper;
};
packages = {
harvest-exporter = pkgs.callPackage ./harvest-exporter.nix { };
kimai-exporter = self'.packages.harvest-exporter;
wise-exporter = pkgs.callPackage ./wise-exporter.nix { };
sevdesk-api = pkgs.python3.pkgs.callPackage ./sevdesk-api { };
sevdesk-invoicer = pkgs.python3.pkgs.callPackage ./sevdesk-invoicer.nix {
inherit (self'.packages) sevdesk-api;
};
sevdesk-cli = pkgs.python3.pkgs.callPackage ./sevdesk-cli {
inherit (self'.packages) sevdesk-api;
};
quipu-invoicer = pkgs.python3.pkgs.callPackage ./quipu-invoicer.nix { };
paperless-cli = pkgs.callPackage ./paperless-cli { };
working-days-calculator = pkgs.writers.writePython3Bin "working-days-calculator" {
libraries = [ pkgs.python3Packages.pandas ];
flakeIgnore = [ "E501" ];
} (builtins.readFile ./working-days-calculator.py);
default = config.packages.harvest-exporter;
};
checks =
let
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages;
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
in
packages // devShells;
treefmt = {
# Used to find the project root
projectRootFile = "flake.lock";
programs.mypy = {
enable = true;
directories = {
".".modules = [
"harvest"
"harvest_exporter"
"harvest_report"
"rest"
"kimai"
"kimai_exporter"
];
"sevdesk-api" = {
modules = [ "sevdesk_api" ];
};
"sevdesk-invoicer" = {
modules = [
"sevdesk_invoicer"
"sevdesk_wise_importer"
"sevdesk_tax_estimator"
];
extraPythonPackages = [ self'.packages.sevdesk-api ];
};
"wise-exporter" = {
extraPythonPackages = [ pkgs.python3.pkgs.rsa ];
};
"quipu-invoicer" = { };
"paperless-cli" = { };
"sevdesk-cli" = {
modules = [ "sevdesk_cli" ];
extraPythonPackages = [ self'.packages.sevdesk-api ];
};
};
};
programs.ruff.format = true;
programs.ruff.check = true;
programs.nixfmt.enable = true;
};
};
};
}