Merge branch 'treefmt'
This commit is contained in:
commit
b97ba0ac2e
3
bin/ci
3
bin/ci
@ -47,7 +47,7 @@ if [ "${1}" = "update" ]; then
|
|||||||
git add pull_requests
|
git add pull_requests
|
||||||
git commit -m 'watched: update watched pull requests'
|
git commit -m 'watched: update watched pull requests'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for inp in $(nix flake metadata --json | jq -r '.locks.nodes.root.inputs | keys[] as $k | $k'); do
|
for inp in $(nix flake metadata --json | jq -r '.locks.nodes.root.inputs | keys[] as $k | $k'); do
|
||||||
if ! git checkout -b "${ci_branch}_${inp}"; then
|
if ! git checkout -b "${ci_branch}_${inp}"; then
|
||||||
handle_co_fail "${ci_branch}_${inp}"
|
handle_co_fail "${ci_branch}_${inp}"
|
||||||
@ -88,7 +88,6 @@ if [ "${1}" = "update" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if ! git checkout main; then
|
if ! git checkout main; then
|
||||||
handle_co_fail
|
handle_co_fail
|
||||||
exit 1
|
exit 1
|
||||||
|
10
bin/fmt
10
bin/fmt
@ -2,12 +2,4 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
find . -name \*.nix -exec nix fmt {} \+
|
treefmt
|
||||||
find . -name \*.sh -exec shfmt -w {} \+
|
|
||||||
|
|
||||||
deadnix -f .
|
|
||||||
shfmt -w bin/deploy
|
|
||||||
shfmt -w bin/mkboot
|
|
||||||
# TODO: https://github.com/nerdypepper/statix/issues/68
|
|
||||||
#statix check --ignore lib/default.nix .
|
|
||||||
statix check .
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
while nix flake check --no-build |& grep "is not valid" >/tmp/invalid; do
|
while nix flake check --no-build |& grep "is not valid" >/tmp/invalid; do
|
||||||
path=$(cat /tmp/invalid | awk -F\' '{print $2}')
|
path=$(cat /tmp/invalid | awk -F\' '{print $2}')
|
||||||
|
@ -20,15 +20,15 @@ CURRENT_COMMIT="$(echo $CURRENT | jq -r .rev)"
|
|||||||
if [ "${CURRENT_COMMIT}" != "${COMMIT}" ]; then
|
if [ "${CURRENT_COMMIT}" != "${COMMIT}" ]; then
|
||||||
nix-prefetch-github openssh openssh-portable \
|
nix-prefetch-github openssh openssh-portable \
|
||||||
--rev "${COMMIT}" \
|
--rev "${COMMIT}" \
|
||||||
--json | \
|
--json |
|
||||||
jq -r --arg v "${UPDATED}" \
|
jq -r --arg v "${UPDATED}" \
|
||||||
--arg c "${COMMENT}" \
|
--arg c "${COMMENT}" \
|
||||||
'. |= . + {"version": $v, "comment": $c}' \
|
'. |= . + {"version": $v, "comment": $c}' \
|
||||||
> pkgs/openssh/version.json
|
>pkgs/openssh/version.json
|
||||||
FN=$(mktemp)
|
FN=$(mktemp)
|
||||||
echo "pkgs/openssh: update to '${COMMIT}'" > ${FN}
|
echo "pkgs/openssh: update to '${COMMIT}'" >${FN}
|
||||||
echo >> ${FN}
|
echo >>${FN}
|
||||||
echo "${COMMENT}" >> ${FN}
|
echo "${COMMENT}" >>${FN}
|
||||||
git add pkgs/openssh/version.json && git commit -F $FN
|
git add pkgs/openssh/version.json && git commit -F $FN
|
||||||
else
|
else
|
||||||
echo "No updates."
|
echo "No updates."
|
||||||
|
@ -56,7 +56,7 @@ resolveAlias() {
|
|||||||
agentHasKey() {
|
agentHasKey() {
|
||||||
checkKey="$(echo $1 | awk '{print $NF}')"
|
checkKey="$(echo $1 | awk '{print $NF}')"
|
||||||
for i in $AgentKeys; do
|
for i in $AgentKeys; do
|
||||||
if [[ "$i" == $checkKey ]]; then
|
if [[ $i == $checkKey ]]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -101,6 +101,8 @@ let
|
|||||||
ssh-to-age
|
ssh-to-age
|
||||||
ssh-to-pgp
|
ssh-to-pgp
|
||||||
statix
|
statix
|
||||||
|
treefmt2
|
||||||
|
perlPackages.PerlTidy
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -9,10 +9,10 @@ NORMAL=$(tput sgr0)
|
|||||||
FLAKE_EPOCH=$(@nix@/bin/nix flake metadata --json | @jq@/bin/jq .lastModified)
|
FLAKE_EPOCH=$(@nix@/bin/nix flake metadata --json | @jq@/bin/jq .lastModified)
|
||||||
NOW_EPOCH=$(@coreutils@/bin/date +"%s")
|
NOW_EPOCH=$(@coreutils@/bin/date +"%s")
|
||||||
|
|
||||||
EPOCH_DIFF=$(($NOW_EPOCH - $FLAKE_EPOCH))
|
EPOCH_DIFF=$((NOW_EPOCH - FLAKE_EPOCH))
|
||||||
|
|
||||||
if [ $EPOCH_DIFF -gt $((60480 * 5)) ]; then
|
if [ $EPOCH_DIFF -gt $((60480 * 5)) ]; then
|
||||||
echo
|
echo
|
||||||
echo "${BOLD}WARNING: inputs haven't been updated in $(($EPOCH_DIFF / 86400)) days!${NORMAL}"
|
echo "${BOLD}WARNING: inputs haven't been updated in $((EPOCH_DIFF / 86400)) days!${NORMAL}"
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
@ -8,7 +8,7 @@ use 5.10.0;
|
|||||||
use Mojolicious::Lite -signatures;
|
use Mojolicious::Lite -signatures;
|
||||||
|
|
||||||
get '/' => sub ($c) {
|
get '/' => sub ($c) {
|
||||||
$c->render(text => 'Hello Thing!');
|
$c->render( text => 'Hello Thing!' );
|
||||||
};
|
};
|
||||||
|
|
||||||
app->start;
|
app->start;
|
||||||
|
28
treefmt.toml
Normal file
28
treefmt.toml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
[formatter.statix]
|
||||||
|
command = "statix"
|
||||||
|
options = ["check"]
|
||||||
|
priority = 1
|
||||||
|
|
||||||
|
[formatter.deadnix]
|
||||||
|
command = "deadnix"
|
||||||
|
options = ["-f"]
|
||||||
|
includes = [ "*.nix" ]
|
||||||
|
priority = 2
|
||||||
|
|
||||||
|
[formatter.nix]
|
||||||
|
command = "nix"
|
||||||
|
options = ["fmt"]
|
||||||
|
includes = ["*.nix"]
|
||||||
|
priority = 3
|
||||||
|
|
||||||
|
[formatter.shfmt]
|
||||||
|
command = "shfmt"
|
||||||
|
options = ["-w"]
|
||||||
|
includes = ["*.sh", "bin/*"]
|
||||||
|
priority = 1
|
||||||
|
|
||||||
|
[formatter.perltidy]
|
||||||
|
command = "perltidy"
|
||||||
|
options = ["-b"]
|
||||||
|
includes = ["*.pl", "*.PL"]
|
||||||
|
priority = 1
|
Loading…
Reference in New Issue
Block a user