Make sourcing profile optional

This commit is contained in:
Martin Pander
2026-02-07 15:02:08 +01:00
parent 84ad11d543
commit 28f2042ad0
4 changed files with 100 additions and 108 deletions

View File

@@ -19,25 +19,6 @@ This file tracks remaining tasks and known issues for the NixOS configuration.
## Medium Priority ## Medium Priority
### Custom Packages
The following packages need to be integrated or replaced:
- [ ] **claude-code**
- Check if available in nixpkgs
- If custom: create derivation in `packages/claude-code.nix`
- Or use alternative package manager (npm, pip, cargo)
- [ ] **opencode**
- Check if available in nixpkgs
- If custom: create derivation in `packages/opencode.nix`
- Or use alternative package manager
- [ ] **gemini-cli**
- Check if available in nixpkgs
- If custom: create derivation in `packages/gemini-cli.nix`
- Or use alternative package manager
### Tmux Configuration ### Tmux Configuration
- [ ] Update note popup keybindings (C-n, C-p) with correct NixOS paths - [ ] Update note popup keybindings (C-n, C-p) with correct NixOS paths
@@ -101,16 +82,16 @@ initLua = builtins.concatStringsSep "\n" [
### Profile Loading ### Profile Loading
The shell configuration includes: The shell configuration is now configurable via `dot.sh.sourceProfile`:
```nix ```nix
profileExtra = '' profileExtra = lib.mkIf cfg.sourceProfile ''
source $HOME/.profile source $HOME/.profile
''; '';
``` ```
**Status**: Will fail silently if `~/.profile` doesn't exist **Status**: Disabled by default. Only enabled for work host.
**Action**: Either create `~/.profile` or remove this line if not needed **Action**: Verify `~/.profile` exists on hosts where `dot.sh.sourceProfile = true` is set.
## Testing Checklist ## Testing Checklist

View File

@@ -24,5 +24,9 @@
services.openssh.enable = true; services.openssh.enable = true;
environment.systemPackages = [
pkgs.ghostty.terminfo
];
system.stateVersion = "25.11"; system.stateVersion = "25.11";
} }

View File

@@ -14,8 +14,6 @@
home.stateVersion = "23.11"; home.stateVersion = "23.11";
programs.zsh.profileExtra = '' dot.sh.sourceProfile = true;
source $HOME/.profile
'';
} }

View File

@@ -1,99 +1,108 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
let
cfg = config.dot.sh;
in
{ {
programs.zsh = { options.dot.sh = {
enable = true; sourceProfile = lib.mkEnableOption "sourcing of $HOME/.profile in zsh profileExtra";
enableCompletion = true; };
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
history.size = 500000; config = {
programs.zsh = {
prezto = {
enable = true; enable = true;
caseSensitive = true; enableCompletion = true;
color = true; autosuggestion.enable = true;
editor = { syntaxHighlighting.enable = true;
dotExpansion = true;
keymap = "vi"; history.size = 500000;
};
pmodules = [ prezto = {
"environment" enable = true;
"terminal" caseSensitive = true;
"editor" color = true;
"history" editor = {
"directory" dotExpansion = true;
"spectrum" keymap = "vi";
"utility" };
"completion" pmodules = [
"syntax-highlighting" "environment"
"history-substring-search" "terminal"
"prompt" "editor"
"git" "history"
]; "directory"
prompt.theme = "minimal"; "spectrum"
syntaxHighlighting.highlighters = [ "utility"
"main" "completion"
"brackets" "syntax-highlighting"
"pattern" "history-substring-search"
"line" "prompt"
"cursor" "git"
"root" ];
]; prompt.theme = "minimal";
tmux = { syntaxHighlighting.highlighters = [
autoStartLocal = true; "main"
itermIntegration = true; "brackets"
"pattern"
"line"
"cursor"
"root"
];
tmux = {
autoStartLocal = true;
itermIntegration = true;
};
}; };
initContent = ''
HISTCONTROL='erasedups:ignoreboth'
HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear'
unsetopt beep
'';
profileExtra = lib.mkIf cfg.sourceProfile ''
source $HOME/.profile
'';
}; };
initContent = '' programs.fzf = {
HISTCONTROL='erasedups:ignoreboth' enable = true;
HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear' enableZshIntegration = true;
unsetopt beep };
'';
profileExtra = '' programs.lsd = {
source $HOME/.profile enable = true;
''; enableZshIntegration = true;
}; };
programs.fzf = { programs.zoxide = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
}; options = [
"--cmd cd"
];
};
programs.lsd = { programs.bat.enable = true;
enable = true; programs.ripgrep.enable = true;
enableZshIntegration = true; programs.btop.enable = true;
}; programs.ranger.enable = true;
programs.zoxide = { home.packages = with pkgs; [
enable = true; fd
enableZshIntegration = true; dust
options = [ glow
"--cmd cd" ripgrep-all
viddy
duf
]; ];
};
programs.bat.enable = true; home.sessionVariables = {
programs.ripgrep.enable = true; BAT_THEME = "Coldark-Cold";
programs.btop.enable = true; };
programs.ranger.enable = true;
home.packages = with pkgs; [ home.shellAliases = {
fd lst = "lsd --tree";
dust };
glow
ripgrep-all
viddy
duf
];
home.sessionVariables = {
BAT_THEME = "Coldark-Cold";
};
home.shellAliases = {
lst = "lsd --tree";
}; };
} }