Merge pull request 'switch from alejandra -> nixpkgs-fmt' (#12) from formatting into main

Reviewed-on: #12
This commit is contained in:
Mic92 2023-07-21 09:15:48 +00:00
commit fb394f29ae
11 changed files with 64 additions and 65 deletions

View File

@ -1,16 +1,15 @@
{
self,
inputs,
...
{ self
, inputs
, ...
}: {
imports = [
inputs.treefmt-nix.flakeModule
];
perSystem = {pkgs, ...}: {
perSystem = { pkgs, ... }: {
treefmt.projectRootFile = "flake.nix";
treefmt.flakeCheck = true;
treefmt.flakeFormatter = true;
treefmt.programs.alejandra.enable = true;
treefmt.programs.nixpkgs-fmt.enable = true;
treefmt.programs.shellcheck.enable = true;
};
}

View File

@ -1,4 +1,4 @@
{self, ...}: {
{ self, ... }: {
flake.packages.x86_64-linux = {
inherit
(self.nixosConfigurations.installer.config.formats)

View File

@ -1,4 +1,4 @@
{self, ...}: {
{ self, ... }: {
pre-commit.settings.hooks.alejandra.enable = true;
pre-commit.settings.hooks.shellcheck.enable = true;
}

View File

@ -11,13 +11,12 @@
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} ({
lib,
config,
self,
...
}: {
outputs = inputs @ { flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ lib
, config
, self
, ...
}: {
systems = lib.systems.flakeExposed;
imports = [
./flake-parts/packages.nix

View File

@ -1,8 +1,7 @@
{
config,
lib,
pkgs,
...
{ config
, lib
, pkgs
, ...
}: {
options.hidden-announce = {
enable = lib.mkEnableOption "hidden-announce";
@ -32,9 +31,9 @@
};
systemd.services.hidden-ssh-announce = {
description = "irc announce hidden ssh";
after = ["tor.service" "network-online.target"];
wants = ["tor.service"];
wantedBy = ["multi-user.target"];
after = [ "tor.service" "network-online.target" ];
wants = [ "tor.service" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
# ${pkgs.tor}/bin/torify
ExecStart = pkgs.writers.writeDash "announce-hidden-service" ''

View File

@ -1,8 +1,7 @@
{
config,
lib,
pkgs,
...
{ config
, lib
, pkgs
, ...
}: {
systemd.tmpfiles.rules = [
"d /var/shared 0777 root root - -"

View File

@ -4,7 +4,7 @@
symlinkJoin {
name = "clan";
paths = [
(writers.writePython3Bin "clan" {} ./clan.py)
(writers.writePython3Bin "clan" { } ./clan.py)
(writers.writePython3Bin "clan-admin" { flakeIgnore = [ "E501" ]; } ./clan-admin.py)
];
}

View File

@ -1,7 +1,7 @@
{
lib,
buildGoModule,
fetchFromGitHub,
{ lib
, buildGoModule
, fetchFromGitHub
,
}:
buildGoModule rec {
pname = "go-ssb";
@ -17,7 +17,7 @@ buildGoModule rec {
vendorHash = "sha256-ZytuWFre7Cz6Qt01tLQoPEuNzDIyoC938OkdIrU8nZo=";
ldflags = ["-s" "-w"];
ldflags = [ "-s" "-w" ];
# take very long
doCheck = false;
@ -26,6 +26,6 @@ buildGoModule rec {
description = "Go implementation of ssb (work in progress)";
homepage = "https://github.com/ssbc/go-ssb";
license = licenses.mit;
maintainers = with maintainers; [];
maintainers = with maintainers; [ ];
};
}

View File

@ -1,11 +1,11 @@
{
pkgs ? import <nixpkgs> {},
lib ? pkgs.lib,
python3 ? pkgs.python3,
ruff ? pkgs.ruff,
runCommand ? pkgs.runCommand,
}: let
{ pkgs ? import <nixpkgs> { }
, lib ? pkgs.lib
, python3 ? pkgs.python3
, ruff ? pkgs.ruff
, runCommand ? pkgs.runCommand
,
}:
let
pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml);
name = pyproject.project.name;
@ -37,14 +37,14 @@
];
propagatedBuildInputs =
dependencies
++ [];
passthru.tests = {inherit check;};
++ [ ];
passthru.tests = { inherit check; };
passthru.devDependencies = devDependencies;
};
checkPython = python3.withPackages (ps: devDependencies ++ dependencies);
check = runCommand "${name}-check" {} ''
check = runCommand "${name}-check" { } ''
cp -r ${src} ./src
chmod +w -R ./src
cd src
@ -59,4 +59,4 @@
'';
in
package
package

View File

@ -1,10 +1,12 @@
{
perSystem = {pkgs, ...}: let
pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml);
name = pyproject.project.name;
package = pkgs.callPackage ./default.nix {};
in {
# packages.${name} = package;
checks.python-template = package.tests.check;
};
perSystem = { pkgs, ... }:
let
pyproject = builtins.fromTOML (builtins.readFile ./pyproject.toml);
name = pyproject.project.name;
package = pkgs.callPackage ./default.nix { };
in
{
# packages.${name} = package;
checks.python-template = package.tests.check;
};
}

View File

@ -1,7 +1,8 @@
{
pkgs ? import <nixpkgs> {},
system ? builtins.currentSystem,
}: let
{ pkgs ? import <nixpkgs> { }
, system ? builtins.currentSystem
,
}:
let
lib = pkgs.lib;
python3 = pkgs.python3;
package = import ./default.nix {
@ -9,11 +10,11 @@
};
pythonWithDeps = python3.withPackages (
ps:
package.propagatedBuildInputs
++ package.devDependencies
++ [
ps.pip
]
package.propagatedBuildInputs
++ package.devDependencies
++ [
ps.pip
]
);
checkScript = pkgs.writeScriptBin "check" ''
nix build -f . tests.check -L "$@"
@ -43,4 +44,4 @@
'';
};
in
devShell
devShell