1{
2 description = "A tool for creating and managing qutebrowser profiles";
3
4 inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
5 inputs.flake-utils.url = "github:numtide/flake-utils";
6 inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
7 inputs.pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
8 inputs.pre-commit-hooks.inputs.nixpkgs-stable.follows = "nixpkgs";
9
10 outputs = {
11 self,
12 nixpkgs,
13 flake-utils,
14 pre-commit-hooks,
15 }:
16 flake-utils.lib.eachDefaultSystem (
17 system: let
18 pkgs = nixpkgs.legacyPackages.${system};
19 mkDevShell = args:
20 pkgs.mkShell (args
21 // {
22 buildInputs = with pkgs; [
23 ruff
24 (python3.withPackages (ps:
25 with ps; [
26 pyxdg
27 click
28 pytest
29 mypy
30 black
31 ]))
32 ];
33 });
34 in rec {
35 packages = flake-utils.lib.flattenTree rec {
36 qbpm = import ./. {inherit pkgs;};
37 default = qbpm;
38 };
39 apps = rec {
40 qbpm = flake-utils.lib.mkApp {drv = packages.qbpm;};
41 default = qbpm;
42 };
43 devShells.ci = mkDevShell {};
44 devShells.default = mkDevShell {
45 inherit (self.checks.${system}.pre-commit-check) shellHook;
46 };
47
48 checks = {
49 pre-commit-check = pre-commit-hooks.lib.${system}.run {
50 src = ./.;
51 hooks = {
52 alejandra.enable = true;
53 deadnix.enable = true;
54 statix.enable = true;
55
56 black.enable = true;
57 ruff.enable = true;
58 };
59 };
60 };
61 }
62 );
63}