Skip to content

Commit

Permalink
feat: activate nixago pebbles for std
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Jul 30, 2022
1 parent fcf1ff2 commit 7055af1
Show file tree
Hide file tree
Showing 8 changed files with 75 additions and 111 deletions.
54 changes: 22 additions & 32 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
# SPDX-FileCopyrightText: 2022 David Arnold <dgx.arnold@gmail.com>
# SPDX-FileCopyrightText: 2022 Kevin Amado <kamadorueda@gmail.com>
#
# SPDX-License-Identifier: Unlicense

# Editor configuration, see http://editorconfig.org
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2

# Ignore diffs/patches
[*.{diff,patch}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_size = unset
charset=utf-8
end_of_line=lf
indent_size=2
indent_style=space
insert_final_newline=true
trim_trailing_whitespace=true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
max_line_length=off
trim_trailing_whitespace=false

# Ignore paths
[*.xcf]
charset = unset
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
indent_style = unset
indent_size = unset
charset=unset
end_of_line=unset
indent_size=unset
indent_style=unset
insert_final_newline=unset
trim_trailing_whitespace=unset

[*.{diff,patch}]
end_of_line=unset
indent_size=unset
insert_final_newline=unset
trim_trailing_whitespace=unset

[{*.go,go.mod}]
indent_style = tab
indent_size = 4
indent_size=4
indent_style=tab
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@
.std
/**/flake.lock
result

# nixago: ignore-linked-files
adrgen.config.yml
.conform.yaml
treefmt.toml
lefthook.yml
12 changes: 0 additions & 12 deletions adrgen.config.yml

This file was deleted.

3 changes: 3 additions & 0 deletions book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ title = "The Standard Book"

[build]
build-dir = "docs/book"

[preprocessor.kroki-preprocessor]
command = "mdbook-kroki-preprocessor"
54 changes: 35 additions & 19 deletions cells/automation/devshells.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
cell,
}: let
l = nixpkgs.lib // builtins;
inherit (inputs) nixpkgs;
inherit (inputs) nixpkgs data-merge;
inherit (inputs.cells) std;
in
l.mapAttrs (_: std.lib.mkShell) {
Expand All @@ -13,22 +13,43 @@ in
...
}: {
name = "Standard";
packages = [
# formatters
nixpkgs.alejandra
nixpkgs.shfmt
nixpkgs.nodePackages.prettier
nixago = let
in [
(std.nixago.conform {configData = {inherit (inputs) cells;};})
std.nixago.lefthook
(std.nixago.treefmt {
configData.formatter.go = {
command = "gofmt";
options = ["-w"];
includes = ["*.go"];
};
packages = [nixpkgs.go];
})
(std.nixago.editorconfig {
configData = {
"*.xcf" = {
charset = "unset";
end_of_line = "unset";
insert_final_newline = "unset";
trim_trailing_whitespace = "unset";
indent_style = "unset";
indent_size = "unset";
};
"{*.go,go.mod}" = {
indent_style = "tab";
indent_size = 4;
};
};
})
(std.nixago.mdbook {
configData = {
book.title = "The Standard Book";
};
})
std.nixago.adrgen
];
commands =
[
{
package = nixpkgs.treefmt;
category = "formatters";
}
{
package = nixpkgs.editorconfig-checker;
category = "formatters";
}
{
package = nixpkgs.reuse;
category = "legal";
Expand Down Expand Up @@ -58,13 +79,8 @@ in
}
];
imports = [
"${extraModulesPath}/git/hooks.nix"
std.devshellProfiles.default
];
git.hooks = {
enable = true;
pre-commit.text = builtins.readFile ./devshells/pre-commit.sh;
};
};
checks = {
pkgs,
Expand Down
14 changes: 8 additions & 6 deletions cells/std/nixago.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,15 @@ in
'';
in ''
# Configure gitignore
create () { echo -n "$str" > "${file}" }
append () { echo -en "\n$str" >> "${file}" }
if ! test -f "${file}"
then
create() {
echo -n "$str" > "${file}"
}
append() {
echo -en "\n$str" >> "${file}"
}
if ! test -f "${file}"; then
create
else if ! grep -qF "${sentinel}" "${file}"
then
elif ! grep -qF "${sentinel}" "${file}"; then
append
fi
'';
Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# mdbook build
book/**

42 changes: 0 additions & 42 deletions treefmt.toml

This file was deleted.

0 comments on commit 7055af1

Please sign in to comment.