style: Apply nixpkgs-fmt and fix

Apply standard formatting and some statix conventions using;

```sh
nixpkgs-fmt **.nix && statix fix .
```

With the intent of making contribution a bit easier and reducing mental
load in hand formatting (in the same vein as [black]).

[black]: https://github.com/psf/black#the-uncompromising-code-formatter
This commit is contained in:
Chris Scutcher 2023-02-06 14:24:34 +00:00
parent b1a4ecb8ca
commit 08435eec4b
No known key found for this signature in database
GPG key ID: 19C0BED130CD39CE
23 changed files with 171 additions and 158 deletions

13
doc.nix
View file

@ -6,12 +6,12 @@ let
rootMountPoint = "/mnt";
};
eval = lib.evalModules {
modules = [
modules = [
{
options.disko = {
devices = lib.mkOption {
type = types.devices;
default = {};
default = { };
description = "The devices to set up";
};
};
@ -19,7 +19,7 @@ let
];
};
options = nixosOptionsDoc {
options = eval.options;
inherit (eval) options;
};
md = (runCommand "disko-options.md" { } ''
cat >$out <<EOF
@ -28,14 +28,15 @@ let
EOF
cat ${options.optionsCommonMark} >>$out
'').overrideAttrs (o: {
# Work around https://github.com/hercules-ci/hercules-ci-agent/issues/168
allowSubstitutes = true;
# Work around https://github.com/hercules-ci/hercules-ci-agent/issues/168
allowSubstitutes = true;
});
css = fetchurl {
url = "https://gist.githubusercontent.com/killercup/5917178/raw/40840de5352083adb2693dc742e9f75dbb18650f/pandoc.css";
sha256 = "sha256-SzSvxBIrylxBF6B/mOImLlZ+GvCfpWNLzGFViLyOeTk=";
};
in runCommand "disko.html" { nativeBuildInputs = [ pandoc ]; } ''
in
runCommand "disko.html" { nativeBuildInputs = [ pandoc ]; } ''
mkdir $out
cp ${css} $out/pandoc.css
pandoc --css="pandoc.css" ${md} --to=html5 -s -f markdown+smart --metadata pagetitle="Disko options" -o $out/index.html