docs: add todos for git remotes and pass-store sync
This commit is contained in:
parent
df2d756a08
commit
55a2181d58
7 changed files with 109 additions and 125 deletions
|
|
@ -7,7 +7,6 @@
|
|||
./zsh.nix
|
||||
./duti.nix
|
||||
./pass.nix
|
||||
./pass-store.nix
|
||||
];
|
||||
|
||||
home.stateVersion = "24.11";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
{ pkgs, ... }: {
|
||||
home.packages = [ pkgs.duti ];
|
||||
|
||||
xdg.configFile."duti/config".text = ''
|
||||
# browser (html работает, url/xhtml - Apple блокирует)
|
||||
com.google.Chrome public.html all
|
||||
|
||||
# markdown viewer
|
||||
MarkEdit net.daringfireball.markdown all
|
||||
MarkEdit public.markdown all
|
||||
|
||||
# mail
|
||||
com.apple.mail public.email-message all
|
||||
|
||||
# для .url, .pdf, .sh, .txt - настраивать вручную через Finder
|
||||
# (Apple блокирует CLI настройку системных UTI на Sonoma+)
|
||||
'';
|
||||
# defaults applied via system.activationScripts.defaultApps in hosts/poppy/default.nix
|
||||
}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
# Setup git remotes for pass store
|
||||
# This file manages the git remote configuration for ~/.password-store
|
||||
# (pass itself is configured in home/pass.nix)
|
||||
|
||||
home.activation.passStoreRemotes = {
|
||||
data = ''
|
||||
set -e
|
||||
|
||||
if [ ! -d "$HOME/.password-store" ]; then
|
||||
mkdir -p "$HOME/.password-store"
|
||||
fi
|
||||
|
||||
cd "$HOME/.password-store"
|
||||
|
||||
# Init git if needed
|
||||
if [ ! -d ".git" ]; then
|
||||
${pkgs.git}/bin/git init -q
|
||||
fi
|
||||
|
||||
# Add origin (forgejo) if not present
|
||||
if ! ${pkgs.git}/bin/git remote get-url origin >/dev/null 2>&1; then
|
||||
${pkgs.git}/bin/git remote add origin "ssh://git@git.iscg.dev:2222/mikl/password-store.git"
|
||||
fi
|
||||
|
||||
# Add github remote if not present
|
||||
if ! ${pkgs.git}/bin/git remote get-url github >/dev/null 2>&1; then
|
||||
${pkgs.git}/bin/git remote add github "git@github.com:isogonalconjugate/password-store.git"
|
||||
fi
|
||||
|
||||
# Add git.sol.moe remote if not present
|
||||
if ! ${pkgs.git}/bin/git remote get-url "git.sol.moe" >/dev/null 2>&1; then
|
||||
${pkgs.git}/bin/git remote add "git.sol.moe" "git@git.sol.moe:mikl/password-store.git"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
@ -19,4 +19,47 @@
|
|||
defaultCacheTtl = 3600;
|
||||
enableSshSupport = true;
|
||||
};
|
||||
|
||||
# Activation: setup pass git origins (forgejo + github + sol.moe)
|
||||
# Uses pkgs.writeShellScript to avoid home.activation.data string issues
|
||||
home.activation.passOrigins = {
|
||||
data = let
|
||||
setupScript = pkgs.writeShellScript "pass-origins-setup" ''
|
||||
set -e
|
||||
|
||||
# Initialize pass if not yet
|
||||
if [ ! -d "$HOME/.password-store" ]; then
|
||||
echo "Initializing pass store..."
|
||||
mkdir -p "$HOME/.password-store"
|
||||
fi
|
||||
|
||||
# Initialize git if not yet
|
||||
if [ ! -d "$HOME/.password-store/.git" ]; then
|
||||
cd "$HOME/.password-store"
|
||||
${pkgs.git}/bin/git init -q
|
||||
fi
|
||||
|
||||
cd "$HOME/.password-store"
|
||||
|
||||
# Add origin (forgejo) if not present
|
||||
if ! ${pkgs.git}/bin/git remote get-url origin >/dev/null 2>&1; then
|
||||
${pkgs.git}/bin/git remote add origin "ssh://git@git.iscg.dev:2222/mikl/password-store.git"
|
||||
fi
|
||||
|
||||
# Add github remote if not present
|
||||
if ! ${pkgs.git}/bin/git remote get-url github >/dev/null 2>&1; then
|
||||
${pkgs.git}/bin/git remote add github "git@github.com:isogonalconjugate/password-store.git"
|
||||
fi
|
||||
|
||||
# Add git.sol.moe remote if not present
|
||||
if ! ${pkgs.git}/bin/git remote get-url git.sol.moe >/dev/null 2>&1; then
|
||||
${pkgs.git}/bin/git remote add "git.sol.moe" "git@git.sol.moe:mikl/password-store.git"
|
||||
fi
|
||||
|
||||
cd - >/dev/null
|
||||
'';
|
||||
in builtins.toFile "pass-origins.sh" ''
|
||||
${setupScript}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue