Skip to content

Commit

Permalink
Merge pull request #16 from pub-solar/flake-formatting
Browse files Browse the repository at this point in the history
flake: format using nixfmt-rfc-style
  • Loading branch information
teutat3s authored Nov 25, 2024
2 parents 0669f8b + 66c811d commit f6474bc
Showing 1 changed file with 32 additions and 17 deletions.
49 changes: 32 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
flake-parts.url = "github:hercules-ci/flake-parts";
};

outputs = inputs@{ self, ... }:
outputs =
inputs@{ self, ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
Expand All @@ -17,32 +18,41 @@
];

perSystem =
args@{ pkgs, config, system, ... }: {
args@{
pkgs,
config,
system,
...
}:
{
packages = {
watson-td = pkgs.python3Packages.buildPythonPackage {
name = "watson-td";

src = ./.;
propagatedBuildInputs = with pkgs.python3Packages; [
# requirements
click
click-didyoumean
requests
arrow

# requirements-dev
flake8
py
pytest
pytest-datafiles
pytest-mock
pytest-runner
];
postInstall = ''
installShellCompletion --bash --name watson watson.completion
installShellCompletion --zsh --name _watson watson.zsh-completion
installShellCompletion --fish watson.fish
'';
nativeCheckInputs = with pkgs.python3Packages; [ pytestCheckHook pytest-mock mock pytest-datafiles ];

# requirements-dev.txt
nativeCheckInputs = with pkgs.python3Packages; [
pytestCheckHook
pytest-mock
mock
pytest-datafiles
];

# requirements.txt
propagatedBuildInputs = with pkgs.python3Packages; [
click
click-didyoumean
requests
arrow
];

nativeBuildInputs = [ pkgs.installShellFiles ];
};
};
Expand All @@ -52,6 +62,7 @@
gnumake
virtualenv
yaml-language-server
ruff
(python3.withPackages (p: [
# LSP support
p.python-lsp-ruff
Expand All @@ -78,5 +89,9 @@
];
};
};

flake = {
formatter."x86_64-linux" = inputs.nixpkgs.legacyPackages."x86_64-linux".nixfmt-rfc-style;
};
};
}

0 comments on commit f6474bc

Please sign in to comment.