aboutsummaryrefslogtreecommitdiffstats
path: root/modules/home
diff options
context:
space:
mode:
Diffstat (limited to 'modules/home')
-rw-r--r--modules/home/default.nix19
-rw-r--r--modules/home/git.nix8
-rw-r--r--modules/home/lazygit.nix20
-rw-r--r--modules/home/twm.nix37
4 files changed, 74 insertions, 10 deletions
diff --git a/modules/home/default.nix b/modules/home/default.nix
index 1ff1c19..b9c80e5 100644
--- a/modules/home/default.nix
+++ b/modules/home/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, lib, ... }:
+{ pkgs, lib, config, ... }:
{
imports = [
@@ -6,12 +6,17 @@
./ghostty.nix
./starship.nix
./tmux.nix
+ ./lazygit.nix
+ ./twm.nix
./zsh.nix
];
home = {
- username = "simenandre";
- homeDirectory = if pkgs.stdenv.isDarwin then "/Users/simenandre" else "/home/simenandre";
+ homeDirectory = lib.mkForce (
+ if pkgs.stdenv.isDarwin
+ then "/Users/${config.home.username}"
+ else "/home/${config.home.username}"
+ );
# Do not change this after the first installation
stateVersion = "24.11";
};
@@ -23,10 +28,10 @@
# Let home-manager manage itself
programs.home-manager.enable = true;
- # Install Claude Code via npm on Linux (on macOS it's managed by Homebrew)
- home.activation.installClaudeCode = lib.mkIf (!pkgs.stdenv.isDarwin)
- (lib.hm.dag.entryAfter [ "writeBoundary" ] ''
+ # Install Claude Code via npm
+ home.activation.installClaudeCode =
+ lib.hm.dag.entryAfter [ "writeBoundary" ] ''
export PATH="${pkgs.nodejs_22}/bin:$PATH"
npm install -g @anthropic-ai/claude-code 2>/dev/null || true
- '');
+ '';
}
diff --git a/modules/home/git.nix b/modules/home/git.nix
index e79a760..3865e25 100644
--- a/modules/home/git.nix
+++ b/modules/home/git.nix
@@ -3,15 +3,17 @@
{
programs.git = {
enable = true;
- userName = "Simen A. W. Olsen";
- userEmail = "hello@simenandre.no";
signing = {
key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMCyUn5BfmAnd/6xi0X1mYF/+jPOmCS0bpNUePF55gCY";
signByDefault = true;
};
- extraConfig = {
+ settings = {
+ user = {
+ name = "Simen A. W. Olsen";
+ email = "hello@simenandre.no";
+ };
apply.whitespace = "fix";
core = {
trustctime = false;
diff --git a/modules/home/lazygit.nix b/modules/home/lazygit.nix
new file mode 100644
index 0000000..da8996a
--- /dev/null
+++ b/modules/home/lazygit.nix
@@ -0,0 +1,20 @@
+{ ... }:
+
+{
+ home.file.".config/lazygit/config.yml".text = ''
+ git:
+ pagers:
+ - colorArg: always
+ pager: delta --dark --paging=never
+ customCommands:
+ - key: "C"
+ context: "files"
+ description: "Generate commit message with Claude Code"
+ command: >
+ git diff --staged | $HOME/.local/bin/claude -p 'Generate a concise git commit message for these staged changes.
+ Output ONLY the raw commit message with no markdown, no code blocks, no backticks, no explanations.
+ Use conventional commit format.' --model haiku --output-format text > /tmp/commit_msg &&
+ GIT_EDITOR=nvim git commit -e -F /tmp/commit_msg
+ output: terminal
+ '';
+}
diff --git a/modules/home/twm.nix b/modules/home/twm.nix
new file mode 100644
index 0000000..cebfc6e
--- /dev/null
+++ b/modules/home/twm.nix
@@ -0,0 +1,37 @@
+{ config, ... }:
+
+{
+ home.file.".config/twm/twm.yaml".text = ''
+ search_paths:
+ - ${config.home.homeDirectory}/ghq
+ - ~/.config/nvim/
+
+ exclude_path_components:
+ - .git
+ - .direnv
+ - node_modules
+ - venv
+ - target
+
+ workspace_definitions:
+ - name: catchall
+ default_layout: catchall-dev
+
+ - name: go
+ has_all_files:
+ - go.mod
+ - go.sum
+
+ - name: docker-compose
+ has_any_file:
+ - docker-compose.yml
+ - docker-compose.yaml
+ has_all_files:
+ - Dockerfile
+ - .git
+
+ - name: pulumi
+ has_all_files:
+ - Pulumi.yaml
+ '';
+}