feat: introduce treefmt and fmt all
This commit is contained in:
parent
80250b0179
commit
27c6c4f9fa
237 changed files with 5440 additions and 5214 deletions
|
@ -3,38 +3,40 @@
|
|||
repoHttps ? "https://gitlab.com/steveeJ/dotfiles.git",
|
||||
repoSsh ? "git@gitlab.com:/steveeJ/dotfiles.git",
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
repoBareLocal =
|
||||
pkgs.runCommand "fetchbare"
|
||||
{
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = "0000000000000000000000000000000000000000000000000000";
|
||||
} ''
|
||||
(
|
||||
set -xe
|
||||
export GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
${pkgs.git}/bin/git clone --mirror ${repoHttps} $out
|
||||
)
|
||||
'';
|
||||
{
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "sha256";
|
||||
outputHash = "0000000000000000000000000000000000000000000000000000";
|
||||
}
|
||||
''
|
||||
(
|
||||
set -xe
|
||||
export GIT_SSL_CAINFO=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
export SSL_CERT_FILE=${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt
|
||||
${pkgs.git}/bin/git clone --mirror ${repoHttps} $out
|
||||
)
|
||||
'';
|
||||
in
|
||||
pkgs.writeScript "activation-script" ''
|
||||
export HOST=$(hostname -s)
|
||||
pkgs.writeScript "activation-script" ''
|
||||
export HOST=$(hostname -s)
|
||||
|
||||
function set_remotes {
|
||||
${pkgs.vcsh}/bin/vcsh dotfiles remote set-url origin $1
|
||||
${pkgs.vcsh}/bin/vcsh dotfiles remote set-url --push origin $2
|
||||
}
|
||||
function set_remotes {
|
||||
${pkgs.vcsh}/bin/vcsh dotfiles remote set-url origin $1
|
||||
${pkgs.vcsh}/bin/vcsh dotfiles remote set-url --push origin $2
|
||||
}
|
||||
|
||||
if ! test -d $HOME/.config/vcsh/repo.d/dotfiles.git; then
|
||||
echo Cloning dotfiles for $HOST...
|
||||
${pkgs.vcsh}/bin/vcsh clone -b $HOST ${repoBareLocal} dotfiles
|
||||
set_remotes ${repoHttps} ${repoSsh}
|
||||
else
|
||||
set_remotes ${repoBareLocal} ${repoSsh}
|
||||
echo Updating dotfiles for $HOST...
|
||||
${pkgs.vcsh}/bin/vcsh pull $HOST || true
|
||||
set_remotes ${repoHttps} ${repoSsh}
|
||||
fi
|
||||
''
|
||||
if ! test -d $HOME/.config/vcsh/repo.d/dotfiles.git; then
|
||||
echo Cloning dotfiles for $HOST...
|
||||
${pkgs.vcsh}/bin/vcsh clone -b $HOST ${repoBareLocal} dotfiles
|
||||
set_remotes ${repoHttps} ${repoSsh}
|
||||
else
|
||||
set_remotes ${repoBareLocal} ${repoSsh}
|
||||
echo Updating dotfiles for $HOST...
|
||||
${pkgs.vcsh}/bin/vcsh pull $HOST || true
|
||||
set_remotes ${repoHttps} ${repoSsh}
|
||||
fi
|
||||
''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue