flake: switch formatter to nixpkgs-fmt

This commit is contained in:
Louis Bettens 2023-01-15 21:18:06 +01:00
parent 1abb58b5fc
commit 4a264449c5
No known key found for this signature in database
15 changed files with 150 additions and 150 deletions

View File

@ -6,4 +6,4 @@ let
sha256 = narHash;
};
in
(import flake-compat {src = ./.;}).defaultNix
(import flake-compat { src = ./.; }).defaultNix

View File

@ -10,12 +10,7 @@
inputs.cat-admin-tool.flake = false;
# Outputs are the public-facing interface to the flake.
outputs = inputs @ {
self,
fup,
nixpkgs,
...
}:
outputs = { self, fup, nixpkgs, ... } @ inputs:
fup.lib.mkFlake {
inherit self inputs;
@ -26,7 +21,7 @@
];
outputsBuilder = channels: {
formatter = channels.nixpkgs.alejandra;
formatter = channels.nixpkgs.nixpkgs-fmt;
packages = channels.nixpkgs.chiaNix;
};
};

View File

@ -1,9 +1,9 @@
{
lib,
src,
fetchFromGitHub,
python3Packages,
chia,
{ lib
, src
, fetchFromGitHub
, python3Packages
, chia
,
}:
python3Packages.buildPythonApplication rec {
pname = "CAT-admin-tool";
@ -34,7 +34,7 @@ python3Packages.buildPythonApplication rec {
meta = with lib; {
homepage = "https://www.chia.net/";
description = "Admin tool for issuing CATs";
license = with licenses; [asl20];
license = with licenses; [ asl20 ];
maintainers = teams.chia.members;
platforms = platforms.all;
};

View File

@ -1,10 +1,11 @@
{
lib,
cacert,
fetchFromGitHub,
fetchpatch,
python3Packages,
}: let
{ lib
, cacert
, fetchFromGitHub
, fetchpatch
, python3Packages
,
}:
let
chia = python3Packages.buildPythonApplication rec {
pname = "chia";
version = "1.7.0-b5";
@ -85,16 +86,16 @@
'';
passthru.tests = {
chiaWithTests = chia.overrideAttrs (_: {doCheck = true;});
chiaWithTests = chia.overrideAttrs (_: { doCheck = true; });
};
meta = with lib; {
homepage = "https://www.chia.net/";
description = "Chia is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure.";
license = with licenses; [asl20];
license = with licenses; [ asl20 ];
maintainers = teams.chia.members;
platforms = platforms.all;
};
};
in
chia
chia

View File

@ -1,9 +1,9 @@
{
lib,
fetchFromGitHub,
substituteAll,
python3Packages,
chia,
{ lib
, fetchFromGitHub
, substituteAll
, python3Packages
, chia
,
}:
python3Packages.buildPythonApplication rec {
pname = "chia-dev-tools";
@ -56,7 +56,7 @@ python3Packages.buildPythonApplication rec {
meta = with lib; {
homepage = "https://www.chia.net/";
description = "A utility for developing in the Chia ecosystem: Chialisp functions, object inspection, RPC client and more";
license = with licenses; [asl20];
license = with licenses; [ asl20 ];
maintainers = teams.chia.members;
platforms = platforms.all;
};

View File

@ -1,9 +1,10 @@
{
lib,
cacert,
fetchFromGitHub,
python3Packages,
}: let
{ lib
, cacert
, fetchFromGitHub
, python3Packages
,
}:
let
chia = python3Packages.buildPythonApplication rec {
pname = "chia";
version = "1.6.2";
@ -84,16 +85,16 @@
'';
passthru.tests = {
chiaWithTests = chia.overrideAttrs (_: {doCheck = true;});
chiaWithTests = chia.overrideAttrs (_: { doCheck = true; });
};
meta = with lib; {
homepage = "https://www.chia.net/";
description = "Chia is a modern cryptocurrency built from scratch, designed to be efficient, decentralized, and secure.";
license = with licenses; [asl20];
license = with licenses; [ asl20 ];
maintainers = teams.chia.members;
platforms = platforms.all;
};
};
in
chia
chia

View File

@ -1,44 +1,47 @@
{inputs, pkgs}: let
{ inputs, pkgs }:
let
replaceOlder = refPkg: altPkg:
if pkgs.lib.versionOlder (pkgs.lib.getVersion refPkg) (pkgs.lib.getVersion altPkg)
then altPkg
else pkgs.lib.warn "chia.nix: not replacing ${pkgs.lib.getName refPkg} ${pkgs.lib.getVersion refPkg} with ${pkgs.lib.getName altPkg} ${pkgs.lib.getVersion altPkg} because it's not older" refPkg;
replaceOlderAttr = refs: alts:
pkgs.lib.mapAttrs (name: pkg:
if pkgs.lib.hasAttr name refs
then replaceOlder (pkgs.lib.getAttr name refs) pkg
else pkg)
alts;
pkgs.lib.mapAttrs
(name: pkg:
if pkgs.lib.hasAttr name refs
then replaceOlder (pkgs.lib.getAttr name refs) pkg
else pkg)
alts;
pkgs' = pkgs.extend (final: prev:
{
python3Packages = prev.python3Packages.override {
overrides = final': prev':
replaceOlderAttr prev' {
# https://nixpk.gs/pr-tracker.html?pr=200769
blspy = final'.callPackage python/blspy {};
chia-rs = final'.callPackage python/chia-rs {};
chiapos = final'.callPackage python/chiapos {};
chiavdf = final'.callPackage python/chiavdf {};
clvm-tools = final'.callPackage python/clvm-tools {};
clvm-tools-rs = final'.callPackage python/clvm-tools-rs {};
blspy = final'.callPackage python/blspy { };
chia-rs = final'.callPackage python/chia-rs { };
chiapos = final'.callPackage python/chiapos { };
chiavdf = final'.callPackage python/chiavdf { };
clvm-tools = final'.callPackage python/clvm-tools { };
clvm-tools-rs = final'.callPackage python/clvm-tools-rs { };
# https://nixpk.gs/pr-tracker.html?pr=202239
typing-extensions = final'.callPackage python/typing-extensions {};
typing-extensions = final'.callPackage python/typing-extensions { };
# staging
watchdog = final'.callPackage python/watchdog {CoreServices = null;};
watchdog = final'.callPackage python/watchdog { CoreServices = null; };
};
};
}
// replaceOlderAttr prev rec {
chia-beta = final.callPackage ./chia-beta {};
chia-beta = final.callPackage ./chia-beta { };
chia-rc = chia;
chia = final.callPackage ./chia {};
chia-dev-tools = final.callPackage ./chia-dev-tools {};
chia = final.callPackage ./chia { };
chia-dev-tools = final.callPackage ./chia-dev-tools { };
cat-admin-tool = final.callPackage ./cat-admin-tool {
src = inputs.cat-admin-tool;
};
});
in {
in
{
inherit
(pkgs')
chia
@ -47,7 +50,7 @@ in {
chia-dev-tools
cat-admin-tool
# FIXME: it's useful to export this but it's not a derivation
python3Packages
;
}

View File

@ -1,15 +1,15 @@
{
lib,
buildPythonPackage,
fetchPypi,
fetchFromGitHub,
setuptools-scm,
substituteAll,
cmake,
boost,
gmp,
pybind11,
pythonOlder,
{ lib
, buildPythonPackage
, fetchPypi
, fetchFromGitHub
, setuptools-scm
, substituteAll
, cmake
, boost
, gmp
, pybind11
, pythonOlder
,
}:
buildPythonPackage rec {
pname = "blspy";
@ -48,9 +48,9 @@ buildPythonPackage rec {
})
];
nativeBuildInputs = [cmake setuptools-scm];
nativeBuildInputs = [ cmake setuptools-scm ];
buildInputs = [boost gmp.static pybind11];
buildInputs = [ boost gmp.static pybind11 ];
pythonImportsCheck = [
"blspy"

View File

@ -1,9 +1,9 @@
{
buildPythonPackage,
lib,
fetchFromGitHub,
pytestCheckHook,
rustPlatform,
{ buildPythonPackage
, lib
, fetchFromGitHub
, pytestCheckHook
, rustPlatform
,
}:
buildPythonPackage rec {
pname = "chia-rs";

View File

@ -1,18 +1,18 @@
{
stdenv,
lib,
substituteAll,
buildPythonPackage,
fetchPypi,
catch2,
cmake,
cxxopts,
ghc_filesystem,
pybind11,
pytestCheckHook,
pythonOlder,
psutil,
setuptools-scm,
{ stdenv
, lib
, substituteAll
, buildPythonPackage
, fetchPypi
, catch2
, cmake
, cxxopts
, ghc_filesystem
, pybind11
, pytestCheckHook
, pythonOlder
, psutil
, setuptools-scm
,
}:
buildPythonPackage rec {
pname = "chiapos";
@ -34,9 +34,9 @@ buildPythonPackage rec {
})
];
nativeBuildInputs = [cmake setuptools-scm];
nativeBuildInputs = [ cmake setuptools-scm ];
buildInputs = [pybind11];
buildInputs = [ pybind11 ];
checkInputs = [
psutil

View File

@ -1,16 +1,16 @@
{
lib,
stdenv,
buildPythonPackage,
fetchPypi,
setuptools-scm,
substituteAll,
cmake,
boost,
gmp,
pybind11,
pytestCheckHook,
pythonOlder,
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, setuptools-scm
, substituteAll
, cmake
, boost
, gmp
, pybind11
, pytestCheckHook
, pythonOlder
,
}:
buildPythonPackage rec {
pname = "chiavdf";
@ -33,9 +33,9 @@ buildPythonPackage rec {
# x86 instructions are needed for this component
BUILD_VDF_CLIENT = lib.optionalString (!stdenv.isx86_64) "N";
nativeBuildInputs = [cmake setuptools-scm];
nativeBuildInputs = [ cmake setuptools-scm ];
buildInputs = [boost gmp pybind11];
buildInputs = [ boost gmp pybind11 ];
checkInputs = [
pytestCheckHook

View File

@ -1,9 +1,9 @@
{
lib,
fetchFromGitHub,
buildPythonPackage,
rustPlatform,
pythonOlder,
{ lib
, fetchFromGitHub
, buildPythonPackage
, rustPlatform
, pythonOlder
,
}:
buildPythonPackage rec {
pname = "clvm-tools-rs";
@ -29,7 +29,7 @@ buildPythonPackage rec {
maturinBuildHook
];
pythonImportsCheck = ["clvm_tools_rs"];
pythonImportsCheck = [ "clvm_tools_rs" ];
meta = with lib; {
homepage = "https://chialisp.com/";

View File

@ -1,12 +1,12 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonOlder,
clvm,
clvm-tools-rs,
setuptools-scm,
pytestCheckHook,
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, clvm
, clvm-tools-rs
, setuptools-scm
, pytestCheckHook
,
}:
buildPythonPackage rec {
pname = "clvm_tools";

View File

@ -1,10 +1,10 @@
{
lib,
buildPythonPackage,
fetchPypi,
flit-core,
python,
pythonOlder,
{ lib
, buildPythonPackage
, fetchPypi
, flit-core
, python
, pythonOlder
,
}:
buildPythonPackage rec {
pname = "typing-extensions";
@ -35,6 +35,6 @@ buildPythonPackage rec {
description = "Backported and Experimental Type Hints for Python 3.5+";
homepage = "https://github.com/python/typing";
license = licenses.psfl;
maintainers = with maintainers; [pmiddend];
maintainers = with maintainers; [ pmiddend ];
};
}

View File

@ -1,16 +1,16 @@
{
lib,
stdenv,
buildPythonPackage,
CoreServices,
fetchpatch,
fetchPypi,
flaky,
pathtools,
pytest-timeout,
pytestCheckHook,
pythonOlder,
pyyaml,
{ lib
, stdenv
, buildPythonPackage
, CoreServices
, fetchpatch
, fetchPypi
, flaky
, pathtools
, pytest-timeout
, pytestCheckHook
, pythonOlder
, pyyaml
,
}:
buildPythonPackage rec {
pname = "watchdog";
@ -73,6 +73,6 @@ buildPythonPackage rec {
homepage = "https://github.com/gorakhargosh/watchdog";
changelog = "https://github.com/gorakhargosh/watchdog/blob/v${version}/changelog.rst";
license = licenses.asl20;
maintainers = with maintainers; [goibhniu];
maintainers = with maintainers; [ goibhniu ];
};
}