mirror of
https://github.com/Mic92/nix-update.git
synced 2024-09-17 13:27:27 +03:00
Merge pull request #127 from drupol/add-formatter-attribute
Add `formatter` attribute with `nixpkgs-fmt`
This commit is contained in:
commit
9eb755db43
17
.github/workflows/nix-fmt-checks.yaml
vendored
Normal file
17
.github/workflows/nix-fmt-checks.yaml
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
name: Nix formatter checks
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lockfile:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@v18
|
||||
|
||||
- name: Run nix formatter tool
|
||||
run: nix fmt . -- --check
|
@ -1,5 +1,5 @@
|
||||
{ pkgs ? import <nixpkgs> {},
|
||||
src ? ./.
|
||||
{ pkgs ? import <nixpkgs> { }
|
||||
, src ? ./.
|
||||
}:
|
||||
|
||||
|
||||
@ -26,7 +26,9 @@ python3.pkgs.buildPythonApplication rec {
|
||||
mypy --no-warn-unused-ignores --strict nix_update tests
|
||||
'';
|
||||
makeWrapperArgs = [
|
||||
"--prefix PATH" ":" (lib.makeBinPath [ pkgs.nixVersions.stable or nix_2_4 nixpkgs-fmt nixpkgs-review ])
|
||||
"--prefix PATH"
|
||||
":"
|
||||
(lib.makeBinPath [ pkgs.nixVersions.stable or nix_2_4 nixpkgs-fmt nixpkgs-review ])
|
||||
];
|
||||
shellHook = ''
|
||||
# workaround because `python setup.py develop` breaks for me
|
||||
|
11
flake.nix
11
flake.nix
@ -6,9 +6,14 @@
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system: {
|
||||
packages.nix-update = nixpkgs.legacyPackages.${system}.callPackage self {
|
||||
src = self;
|
||||
formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
|
||||
|
||||
packages = {
|
||||
default = self.packages.${system}.nix-update;
|
||||
|
||||
nix-update = nixpkgs.legacyPackages.${system}.callPackage self {
|
||||
src = self;
|
||||
};
|
||||
};
|
||||
defaultPackage = self.packages.${system}.nix-update;
|
||||
});
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
{
|
||||
crate = pkgs.callPackage ./crate.nix {};
|
||||
github = pkgs.callPackage ./github.nix {};
|
||||
gitlab = pkgs.callPackage ./gitlab.nix {};
|
||||
pypi = pkgs.python3.pkgs.callPackage ./pypi.nix {};
|
||||
sourcehut = pkgs.python3.pkgs.callPackage ./sourcehut.nix {};
|
||||
savanna = pkgs.python3.pkgs.callPackage ./savanna.nix {};
|
||||
npm = pkgs.callPackage ./npm.nix {};
|
||||
crate = pkgs.callPackage ./crate.nix { };
|
||||
github = pkgs.callPackage ./github.nix { };
|
||||
gitlab = pkgs.callPackage ./gitlab.nix { };
|
||||
pypi = pkgs.python3.pkgs.callPackage ./pypi.nix { };
|
||||
sourcehut = pkgs.python3.pkgs.callPackage ./sourcehut.nix { };
|
||||
savanna = pkgs.python3.pkgs.callPackage ./savanna.nix { };
|
||||
npm = pkgs.callPackage ./npm.nix { };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user