Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 53 additions & 1 deletion .config/home-manager/common.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:

let
# Get GPG signing key from host configuration, with fallback
gpgSigningKey = config.myConfig.gpgSigningKey or null;
in

{
home.packages = [
Expand All @@ -19,6 +24,7 @@
pkgs.lazydocker
pkgs.lazygit
pkgs.neovim
pkgs.pinentry-curses # For GPG password prompts in terminal
pkgs.ripgrep
pkgs.tmux
pkgs.yq
Expand Down Expand Up @@ -94,6 +100,11 @@
hm = "home-manager";
hms = "home-manager switch";
hmb = "home-manager build --no-out-link";

# GPG aliases for easier key management
gpg-list = "gpg --list-secret-keys --keyid-format=long";
gpg-export = "gpg --armor --export";
gpg-restart = "gpg-connect-agent reloadagent /bye";
};
};

Expand All @@ -114,6 +125,10 @@
init.defaultBranch = "main";
pull.rebase = false;
push.default = "simple";

# GPG signing configuration
commit.gpgsign = true;
tag.gpgsign = true;
};

aliases = {
Expand Down Expand Up @@ -148,6 +163,43 @@
".env"
".env.local"
];
} // lib.optionalAttrs (gpgSigningKey != null) {
signing = {
key = gpgSigningKey;
signByDefault = true;
};
};

# Configure GPG for commit signing
programs.gpg = {
enable = true;

# Configure GPG settings
settings = {
# Use agent for key management
use-agent = true;
# Default key preferences
personal-digest-preferences = "SHA512";
cert-digest-algo = "SHA512";
default-preference-list = "SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed";
};
};

# Configure GPG agent for automatic key management
services.gpg-agent = {
enable = true;

# Cache settings for convenience
defaultCacheTtl = 43200; # 12 hours (longer default)
maxCacheTtl = 86400; # 24 hours

# Enable SSH support (optional, useful for SSH key management)
enableSshSupport = false;

# Pin entry program for password prompts
pinentry = {
package = pkgs.pinentry-curses; # Use curses for terminal, or pkgs.pinentry-gtk2 for GUI
};
};

# Let Home Manager install and manage itself.
Expand Down
2 changes: 2 additions & 0 deletions .config/home-manager/hosts/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ in
# Custom configuration using our module
myConfig = {
configPath = "${homeDirectory}/.config/home-manager/hosts/default.nix";
# Default GPG key (optional - can be left null for no signing)
gpgSigningKey = null; # Set to your default key ID if desired
};

# Optional: Add some debug info to session variables
Expand Down
1 change: 1 addition & 0 deletions .config/home-manager/hosts/macbook-air.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
# Custom configuration using our module
myConfig = {
configPath = "${config.home.homeDirectory}/.config/home-manager/hosts/macbook-air.nix";
gpgSigningKey = "PERSONAL_GPG_KEY_ID_HERE"; # Personal MacBook Air GPG key
};
}
1 change: 1 addition & 0 deletions .config/home-manager/hosts/work-macbook-pro.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
# Custom configuration using our module
myConfig = {
configPath = "${config.home.homeDirectory}/.config/home-manager/hosts/work-macbook-pro.nix";
gpgSigningKey = "799887D03FE96FD0"; # Work-specific GPG key
};
}
7 changes: 7 additions & 0 deletions .config/home-manager/modules/machine-config.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ with lib;
default = "${config.home.homeDirectory}/.config/home-manager/home.nix";
description = "Path to the home-manager configuration file for this machine";
};

gpgSigningKey = mkOption {
type = types.nullOr types.str;
default = null;
description = "GPG key ID for signing git commits on this machine";
example = "ABC123DEF456";
};
};

config = {
Expand Down
22 changes: 5 additions & 17 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,10 @@
// "DEBUG_DOTFILES": "true"
// },
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"timonwong.shellcheck",
"esbenp.prettier-vscode",
"foxundermoon.shell-format",
"sumneko.lua"
],
"settings": {
"Lua.diagnostics.globals": ["vim"]
}
"settings": {
"dotfiles.repository": "",
"dotfiles.targetPath": "",
"dotfiles.installCommand": ""
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"remoteUser": "vscode"
}
}
64 changes: 0 additions & 64 deletions .kshell.sh

This file was deleted.

8 changes: 8 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

set -e # Exit on any error

# Check if dotfiles installation should be skipped
if [[ "${DEBUG_DOTFILES:-}" == "true" ]]; then
echo "🚫 DEBUG_DOTFILES is set to 'true' - skipping dotfiles installation"
echo " This is useful for debugging devcontainer setups without installing dotfiles"
echo " To install dotfiles, unset DEBUG_DOTFILES or set it to 'false'"
exit 0
fi

# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
Expand Down
Loading