clean up and refactor more into OS snippets; bluetooth works on x13s
This commit is contained in:
parent
5921ad1df0
commit
ffdf25c117
27 changed files with 367 additions and 461 deletions
|
@ -1,10 +1,47 @@
|
|||
{ repoFlake
|
||||
, pkgs
|
||||
, config
|
||||
, repoHttps ? "https://gitlab.com/steveeJ/dotfiles.git"
|
||||
, repoSsh ? "git@gitlab.com:/steveeJ/dotfiles.git"
|
||||
, ...
|
||||
}:
|
||||
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
|
||||
)
|
||||
'';
|
||||
vcshActivationScript = 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
|
||||
}
|
||||
|
||||
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
|
||||
'';
|
||||
|
||||
in
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
vcshActivationScript = pkgs.callPackage ./dotfiles/vcsh.nix {};
|
||||
in {
|
||||
# TODO: fix the dotfiles
|
||||
# home.activation.vcsh = config.lib.dag.entryAfter["linkGeneration"] ''
|
||||
# $DRY_RUN_CMD ${vcshActivationScript}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue