feat: add Home Manager refactoring plan and initial structure
- Add comprehensive Home Manager refactoring plan document - Create initial Home Manager directory structure with user configs - Add modular Emacs configuration for Home Manager integration - Update system configurations for Home Manager compatibility - Preserve existing functionality while preparing for migration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f323e3b909
commit
ef4b4b7736
39 changed files with 825 additions and 11 deletions
441
HOME_MANAGER_REFACTORING_PLAN.md
Normal file
441
HOME_MANAGER_REFACTORING_PLAN.md
Normal file
|
@ -0,0 +1,441 @@
|
||||||
|
# Home Manager Refactoring Plan
|
||||||
|
|
||||||
|
## Executive Summary
|
||||||
|
|
||||||
|
This document outlines a comprehensive plan to refactor the current user configuration management system from a system-centric NixOS approach to a user-centric Home Manager approach. The refactoring will provide better separation of concerns, improved dotfile management, user-level service management, and enhanced maintainability while preserving the existing sophisticated Emacs configuration system.
|
||||||
|
|
||||||
|
## Current Architecture Analysis
|
||||||
|
|
||||||
|
### Strengths of Current System
|
||||||
|
- **Declarative Configuration**: All configurations defined in Nix modules
|
||||||
|
- **Sophisticated Emacs Integration**: Profile-based Emacs system with Nix tool integration
|
||||||
|
- **Multi-machine Consistency**: Centralized configuration repository
|
||||||
|
- **Modular Design**: Clear separation between machines, modules, and users
|
||||||
|
- **Nix Tool Integration**: Excellent integration with Nix-provided tools and language servers
|
||||||
|
|
||||||
|
### Current Limitations
|
||||||
|
- **System-level User Configuration**: User preferences mixed with system configuration
|
||||||
|
- **No User Service Management**: Cannot manage user-level systemd services
|
||||||
|
- **Manual Dotfile Deployment**: Limited systematic dotfile management
|
||||||
|
- **Monolithic User Modules**: Large, complex user configuration files
|
||||||
|
- **No Per-user Package Management**: User packages defined at system level
|
||||||
|
|
||||||
|
## Refactoring Goals
|
||||||
|
|
||||||
|
### Primary Objectives
|
||||||
|
1. **Separate User from System Configuration**: Move user-specific settings to Home Manager
|
||||||
|
2. **Enable User Service Management**: Leverage Home Manager's systemd user service support
|
||||||
|
3. **Systematic Dotfile Management**: Implement proper dotfile deployment and management
|
||||||
|
4. **Preserve Emacs Excellence**: Maintain current sophisticated Emacs configuration
|
||||||
|
5. **Improve Maintainability**: Reduce complexity and improve modularity
|
||||||
|
|
||||||
|
### Secondary Objectives
|
||||||
|
1. **Multi-user Support**: Better support for multiple users with different preferences
|
||||||
|
2. **Development Environment Isolation**: User-level development environments
|
||||||
|
3. **Profile-based Configuration**: Different user profiles for different contexts
|
||||||
|
4. **Improved Package Management**: User-level package installation and management
|
||||||
|
|
||||||
|
## Migration Strategy
|
||||||
|
|
||||||
|
### Phase 1: Foundation Setup
|
||||||
|
**Timeline**: Week 1-2
|
||||||
|
**Risk Level**: Low
|
||||||
|
|
||||||
|
#### Tasks:
|
||||||
|
1. **Initialize Home Manager Integration**
|
||||||
|
- Add Home Manager to flake.nix inputs
|
||||||
|
- Configure basic Home Manager module in NixOS
|
||||||
|
- Create initial home.nix for user 'geir'
|
||||||
|
|
||||||
|
2. **Create Home Manager Directory Structure**
|
||||||
|
```
|
||||||
|
home-manager/
|
||||||
|
├── users/
|
||||||
|
│ ├── geir/
|
||||||
|
│ │ ├── home.nix # Main user configuration
|
||||||
|
│ │ ├── profiles/
|
||||||
|
│ │ │ ├── development.nix # Development profile
|
||||||
|
│ │ │ ├── workstation.nix # Full workstation profile
|
||||||
|
│ │ │ └── minimal.nix # Minimal profile
|
||||||
|
│ │ ├── programs/
|
||||||
|
│ │ │ ├── emacs.nix # Emacs configuration
|
||||||
|
│ │ │ ├── zsh.nix # Shell configuration
|
||||||
|
│ │ │ ├── git.nix # Git configuration
|
||||||
|
│ │ │ └── development.nix # Development tools
|
||||||
|
│ │ └── services/
|
||||||
|
│ │ ├── emacs-daemon.nix # User-level Emacs daemon
|
||||||
|
│ │ └── desktop.nix # Desktop services
|
||||||
|
│ └── sma/
|
||||||
|
│ └── home.nix # Admin user configuration
|
||||||
|
├── modules/
|
||||||
|
│ ├── emacs/ # Shared Emacs modules
|
||||||
|
│ ├── development/ # Development environment modules
|
||||||
|
│ └── desktop/ # Desktop environment modules
|
||||||
|
└── dotfiles/
|
||||||
|
├── emacs/ # Emacs configuration files
|
||||||
|
├── shell/ # Shell configuration files
|
||||||
|
└── desktop/ # Desktop configuration files
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Basic User Configuration Migration**
|
||||||
|
- Migrate user packages from system to Home Manager
|
||||||
|
- Set up basic shell configuration
|
||||||
|
- Implement minimal dotfile management
|
||||||
|
|
||||||
|
#### Deliverables:
|
||||||
|
- Working Home Manager integration
|
||||||
|
- Basic user configuration in Home Manager
|
||||||
|
- Preserved system functionality
|
||||||
|
|
||||||
|
### Phase 2: Emacs Migration
|
||||||
|
**Timeline**: Week 3-4
|
||||||
|
**Risk Level**: Medium
|
||||||
|
|
||||||
|
#### Tasks:
|
||||||
|
1. **Migrate Emacs Configuration to Home Manager**
|
||||||
|
- Preserve current profile-based system
|
||||||
|
- Migrate from `/etc/emacs/` to Home Manager file management
|
||||||
|
- Maintain Nix tool integration
|
||||||
|
- Convert systemd service to user service
|
||||||
|
|
||||||
|
2. **Enhanced Emacs Module Structure**
|
||||||
|
```nix
|
||||||
|
programs.emacs = {
|
||||||
|
enable = true;
|
||||||
|
profile = "development"; # or "workstation", "minimal"
|
||||||
|
package = emacsWithProfile;
|
||||||
|
|
||||||
|
profiles = {
|
||||||
|
minimal = {
|
||||||
|
packages = [...];
|
||||||
|
extraConfig = "...";
|
||||||
|
};
|
||||||
|
development = {
|
||||||
|
packages = [...];
|
||||||
|
extraConfig = "...";
|
||||||
|
};
|
||||||
|
workstation = {
|
||||||
|
packages = [...];
|
||||||
|
extraConfig = "...";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
nixIntegration = {
|
||||||
|
enableLspServers = true;
|
||||||
|
enableFormatters = true;
|
||||||
|
tools = {
|
||||||
|
ripgrep = true;
|
||||||
|
fd = true;
|
||||||
|
sqlite = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Dotfile Management for Emacs**
|
||||||
|
- Use `xdg.configFile` for Emacs configuration deployment
|
||||||
|
- Maintain modular structure
|
||||||
|
- Preserve profile-based loading
|
||||||
|
|
||||||
|
#### Deliverables:
|
||||||
|
- Emacs fully managed by Home Manager
|
||||||
|
- User-level Emacs daemon service
|
||||||
|
- Preserved profile-based functionality
|
||||||
|
- Improved dotfile deployment
|
||||||
|
|
||||||
|
### Phase 3: Complete User Migration
|
||||||
|
**Timeline**: Week 5-6
|
||||||
|
**Risk Level**: Medium
|
||||||
|
|
||||||
|
#### Tasks:
|
||||||
|
1. **Shell Configuration Migration**
|
||||||
|
- Move zsh configuration to Home Manager
|
||||||
|
- Implement user-specific aliases and functions
|
||||||
|
- Preserve current shell enhancement integration
|
||||||
|
|
||||||
|
2. **Development Environment Setup**
|
||||||
|
- User-level development tools
|
||||||
|
- Language server configurations
|
||||||
|
- Project-specific environments
|
||||||
|
|
||||||
|
3. **Desktop Environment Integration**
|
||||||
|
- User-level desktop services
|
||||||
|
- Application-specific configurations
|
||||||
|
- Theme and appearance management
|
||||||
|
|
||||||
|
#### Deliverables:
|
||||||
|
- Complete user environment in Home Manager
|
||||||
|
- System packages reduced to essential only
|
||||||
|
- User-specific development environments
|
||||||
|
|
||||||
|
### Phase 4: Multi-user and Profiles
|
||||||
|
**Timeline**: Week 7-8
|
||||||
|
**Risk Level**: Low
|
||||||
|
|
||||||
|
#### Tasks:
|
||||||
|
1. **Multi-user Support**
|
||||||
|
- Migrate 'sma' user configuration
|
||||||
|
- Shared modules for common functionality
|
||||||
|
- User-specific customizations
|
||||||
|
|
||||||
|
2. **Profile System Enhancement**
|
||||||
|
- Machine-specific user profiles
|
||||||
|
- Context-aware configurations
|
||||||
|
- Easy profile switching
|
||||||
|
|
||||||
|
3. **Documentation and Testing**
|
||||||
|
- Comprehensive documentation
|
||||||
|
- Migration testing on different machines
|
||||||
|
- Rollback procedures
|
||||||
|
|
||||||
|
#### Deliverables:
|
||||||
|
- Complete multi-user Home Manager setup
|
||||||
|
- Profile-based user configurations
|
||||||
|
- Comprehensive documentation
|
||||||
|
|
||||||
|
## Technical Implementation Details
|
||||||
|
|
||||||
|
### Home Manager Integration Pattern
|
||||||
|
|
||||||
|
```nix
|
||||||
|
# flake.nix
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { nixpkgs, home-manager, ... }: {
|
||||||
|
nixosConfigurations = {
|
||||||
|
little-rascal = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
./machines/little-rascal/configuration.nix
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.users.geir = import ./home-manager/users/geir/home.nix;
|
||||||
|
home-manager.users.sma = import ./home-manager/users/sma/home.nix;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Emacs Configuration Structure
|
||||||
|
|
||||||
|
```nix
|
||||||
|
# home-manager/users/geir/programs/emacs.nix
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
emacsProfile = config.programs.emacs.profile or "development";
|
||||||
|
|
||||||
|
# Package sets remain the same as current implementation
|
||||||
|
packageSets = {
|
||||||
|
essential = epkgs: with epkgs; [ use-package diminish bind-key which-key ];
|
||||||
|
minimal = epkgs: with epkgs; [ /* minimal packages */ ];
|
||||||
|
development = epkgs: with epkgs; [ /* development packages */ ];
|
||||||
|
workstation = epkgs: with epkgs; [ /* full packages */ ];
|
||||||
|
};
|
||||||
|
|
||||||
|
emacsWithProfile = profile:
|
||||||
|
(if profile == "nox" then pkgs.emacs-nox else pkgs.emacs-pgtk).pkgs.withPackages
|
||||||
|
(epkgs: packageSets.essential epkgs ++
|
||||||
|
(if profile == "nox"
|
||||||
|
then packageSets.minimal epkgs
|
||||||
|
else packageSets.development epkgs ++ packageSets.workstation epkgs));
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.programs.emacs.profile = lib.mkOption {
|
||||||
|
type = lib.types.enum [ "gui" "nox" ];
|
||||||
|
default = "gui";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = {
|
||||||
|
programs.emacs = {
|
||||||
|
enable = true;
|
||||||
|
package = emacsWithProfile emacsProfile;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.emacs = {
|
||||||
|
enable = true;
|
||||||
|
package = config.programs.emacs.package;
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile = {
|
||||||
|
"emacs/init.el".source = ../../../dotfiles/emacs/init-nix.el;
|
||||||
|
"emacs/modules/ui.el".source = ../../../dotfiles/emacs/modules/ui.el;
|
||||||
|
"emacs/modules/completion.el".source = ../../../dotfiles/emacs/modules/completion.el;
|
||||||
|
# ... other modules
|
||||||
|
};
|
||||||
|
|
||||||
|
home.sessionVariables = {
|
||||||
|
EMACS_PROFILE = emacsProfile;
|
||||||
|
RG_PATH = "${pkgs.ripgrep}/bin/rg";
|
||||||
|
FD_PATH = "${pkgs.fd}/bin/fd";
|
||||||
|
# ... other tool paths
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Dotfile Management Strategy
|
||||||
|
|
||||||
|
```nix
|
||||||
|
# home-manager/users/geir/home.nix
|
||||||
|
{
|
||||||
|
# XDG-compliant configuration files
|
||||||
|
xdg.configFile = {
|
||||||
|
"niri/config.kdl".source = ../../dotfiles/niri/config.kdl;
|
||||||
|
"git/config".source = ../../dotfiles/git/config;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Home directory files
|
||||||
|
home.file = {
|
||||||
|
".zshrc".source = ../../dotfiles/shell/zshrc;
|
||||||
|
".tmux.conf".source = ../../dotfiles/tmux/tmux.conf;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Direct content management
|
||||||
|
xdg.configFile."starship.toml".text = ''
|
||||||
|
# Starship configuration
|
||||||
|
format = "$all$character"
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Risk Assessment and Mitigation
|
||||||
|
|
||||||
|
### High-Risk Areas
|
||||||
|
1. **Emacs Configuration Migration**
|
||||||
|
- **Risk**: Breaking existing sophisticated Emacs setup
|
||||||
|
- **Mitigation**:
|
||||||
|
- Preserve exact current functionality first
|
||||||
|
- Test on non-critical machine first
|
||||||
|
- Maintain parallel system during transition
|
||||||
|
|
||||||
|
2. **User Service Management**
|
||||||
|
- **Risk**: Service startup/shutdown issues
|
||||||
|
- **Mitigation**:
|
||||||
|
- Test user services thoroughly
|
||||||
|
- Provide fallback to system services
|
||||||
|
- Document service debugging procedures
|
||||||
|
|
||||||
|
### Medium-Risk Areas
|
||||||
|
1. **Package Dependency Changes**
|
||||||
|
- **Risk**: Missing packages or version conflicts
|
||||||
|
- **Mitigation**:
|
||||||
|
- Careful package migration tracking
|
||||||
|
- Test on all machine types
|
||||||
|
- Maintain system packages temporarily
|
||||||
|
|
||||||
|
2. **Dotfile Deployment**
|
||||||
|
- **Risk**: Configuration file conflicts or missing files
|
||||||
|
- **Mitigation**:
|
||||||
|
- Backup existing configurations
|
||||||
|
- Gradual migration approach
|
||||||
|
- Collision detection and resolution
|
||||||
|
|
||||||
|
### Low-Risk Areas
|
||||||
|
1. **Shell Configuration**
|
||||||
|
- **Risk**: Minor shell behavior changes
|
||||||
|
- **Mitigation**: Preserve exact current shell configuration
|
||||||
|
|
||||||
|
2. **Git Configuration**
|
||||||
|
- **Risk**: Git workflow disruption
|
||||||
|
- **Mitigation**: Migrate settings exactly as-is
|
||||||
|
|
||||||
|
## Testing Strategy
|
||||||
|
|
||||||
|
### Phase Testing
|
||||||
|
1. **Per-phase Testing**: Each phase tested independently
|
||||||
|
2. **Machine-specific Testing**: Test on each machine type
|
||||||
|
3. **User-specific Testing**: Test for both geir and sma users
|
||||||
|
4. **Rollback Testing**: Verify rollback procedures work
|
||||||
|
|
||||||
|
### Test Environments
|
||||||
|
1. **Development VM**: Safe testing environment
|
||||||
|
2. **Non-critical Machine**: Real hardware testing
|
||||||
|
3. **Critical Machines**: Final validation
|
||||||
|
|
||||||
|
### Test Cases
|
||||||
|
1. **Emacs Functionality**: All profiles, modules, and integrations
|
||||||
|
2. **Development Workflow**: Complete development environment
|
||||||
|
3. **Service Management**: User services start/stop correctly
|
||||||
|
4. **Multi-machine**: Configuration works across all machines
|
||||||
|
5. **Package Management**: All user packages available
|
||||||
|
|
||||||
|
## Migration Timeline
|
||||||
|
|
||||||
|
| Week | Phase | Focus | Risk Level |
|
||||||
|
|------|-------|-------|------------|
|
||||||
|
| 1-2 | Foundation | Home Manager setup, basic migration | Low |
|
||||||
|
| 3-4 | Emacs | Emacs configuration migration | Medium |
|
||||||
|
| 5-6 | Complete User | Full user environment migration | Medium |
|
||||||
|
| 7-8 | Polish | Multi-user, profiles, documentation | Low |
|
||||||
|
|
||||||
|
## Success Criteria
|
||||||
|
|
||||||
|
### Functional Requirements
|
||||||
|
- [ ] All current functionality preserved
|
||||||
|
- [ ] Emacs profiles work exactly as before
|
||||||
|
- [ ] User services managed by Home Manager
|
||||||
|
- [ ] Dotfiles systematically deployed
|
||||||
|
- [ ] Development environment fully functional
|
||||||
|
|
||||||
|
### Quality Requirements
|
||||||
|
- [ ] Configuration is more modular and maintainable
|
||||||
|
- [ ] Clear separation between user and system configuration
|
||||||
|
- [ ] Comprehensive documentation
|
||||||
|
- [ ] Easy rollback capability
|
||||||
|
- [ ] Multi-user support functional
|
||||||
|
|
||||||
|
### Performance Requirements
|
||||||
|
- [ ] No degradation in system startup time
|
||||||
|
- [ ] Emacs startup time maintained or improved
|
||||||
|
- [ ] Home Manager switch time acceptable (<30 seconds)
|
||||||
|
|
||||||
|
## Rollback Plan
|
||||||
|
|
||||||
|
### Emergency Rollback
|
||||||
|
1. **Git Revert**: Revert to pre-migration commit
|
||||||
|
2. **System Rebuild**: `sudo nixos-rebuild switch --flake .`
|
||||||
|
3. **Service Restart**: Restart affected services
|
||||||
|
|
||||||
|
### Partial Rollback
|
||||||
|
1. **Disable Home Manager**: Comment out Home Manager in machine configuration
|
||||||
|
2. **Restore System Packages**: Move packages back to system level
|
||||||
|
3. **Manual Service Management**: Manually manage services during transition
|
||||||
|
|
||||||
|
### Validation Steps
|
||||||
|
1. **Emacs Functionality**: Verify Emacs starts and works correctly
|
||||||
|
2. **Development Environment**: Verify development tools work
|
||||||
|
3. **User Services**: Verify essential services are running
|
||||||
|
4. **System Stability**: Verify system is stable and responsive
|
||||||
|
|
||||||
|
## Documentation Deliverables
|
||||||
|
|
||||||
|
### User Documentation
|
||||||
|
1. **Migration Guide**: Step-by-step migration instructions
|
||||||
|
2. **Home Manager Usage**: How to use Home Manager for daily workflow
|
||||||
|
3. **Profile Management**: How to switch and manage user profiles
|
||||||
|
4. **Troubleshooting Guide**: Common issues and solutions
|
||||||
|
|
||||||
|
### Developer Documentation
|
||||||
|
1. **Architecture Documentation**: New system architecture
|
||||||
|
2. **Module Documentation**: How modules are structured and work
|
||||||
|
3. **Extension Guide**: How to add new functionality
|
||||||
|
4. **Testing Procedures**: How to test changes
|
||||||
|
|
||||||
|
## Conclusion
|
||||||
|
|
||||||
|
This refactoring plan provides a comprehensive roadmap for migrating from the current system-centric user configuration to a modern Home Manager-based approach. The phased approach minimizes risk while ensuring all current functionality is preserved and enhanced. The end result will be a more maintainable, flexible, and user-centric configuration management system that better separates concerns between system and user configuration.
|
||||||
|
|
||||||
|
The plan prioritizes preserving the excellent current Emacs configuration while adding the benefits of proper user-level service management, systematic dotfile deployment, and improved modularity. The migration can be executed with confidence due to the comprehensive testing strategy and rollback procedures.
|
|
@ -25,7 +25,9 @@
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
|
(when (fboundp 'tool-bar-mode) (tool-bar-mode -1))
|
||||||
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
|
(when (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
|
||||||
(set-face-attribute 'default nil :height 100)
|
(set-face-attribute 'default nil :height 110)
|
||||||
|
;; Set text width to 140 characters
|
||||||
|
(setq-default fill-column 140)
|
||||||
(setq-default cursor-type 'bar)
|
(setq-default cursor-type 'bar)
|
||||||
|
|
||||||
;; Nix Integration Setup
|
;; Nix Integration Setup
|
||||||
|
|
|
@ -51,5 +51,13 @@
|
||||||
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
|
(add-to-list 'completion-at-point-functions #'cape-dabbrev)
|
||||||
(add-to-list 'completion-at-point-functions #'cape-file))
|
(add-to-list 'completion-at-point-functions #'cape-file))
|
||||||
|
|
||||||
|
;; All-the-icons completion (for icons in completion UI)
|
||||||
|
(use-package all-the-icons-completion
|
||||||
|
:if (display-graphic-p)
|
||||||
|
:after marginalia
|
||||||
|
:config
|
||||||
|
(all-the-icons-completion-mode)
|
||||||
|
(add-hook 'marginalia-mode-hook #'all-the-icons-completion-marginalia-setup))
|
||||||
|
|
||||||
(provide 'completion)
|
(provide 'completion)
|
||||||
;;; completion.el ends here
|
;;; completion.el ends here
|
|
@ -277,7 +277,7 @@ spawn-at-startup "waybar"
|
||||||
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
|
// Additionally, clients will be informed that they are tiled, removing some client-side rounded corners.
|
||||||
// This option will also fix border/focus ring drawing behind some semitransparent windows.
|
// This option will also fix border/focus ring drawing behind some semitransparent windows.
|
||||||
// After enabling or disabling this, you need to restart the apps for this to take effect.
|
// After enabling or disabling this, you need to restart the apps for this to take effect.
|
||||||
// prefer-no-csd
|
prefer-no-csd
|
||||||
|
|
||||||
// You can change the path where screenshots are saved.
|
// You can change the path where screenshots are saved.
|
||||||
// A ~ at the front will be expanded to the home directory.
|
// A ~ at the front will be expanded to the home directory.
|
||||||
|
|
12
flake.lock
generated
12
flake.lock
generated
|
@ -54,11 +54,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751271578,
|
"lastModified": 1751792365,
|
||||||
"narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=",
|
"narHash": "sha256-J1kI6oAj25IG4EdVlg2hQz8NZTBNYvIS0l4wpr9KcUo=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df",
|
"rev": "1fd8bada0b6117e6c7eb54aad5813023eed37ccb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -70,11 +70,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1751479989,
|
"lastModified": 1751741127,
|
||||||
"narHash": "sha256-M5KgdpVBVcW4HRVq9/OSRbrxlwsQ1ogEKqnvzsClDqU=",
|
"narHash": "sha256-t75Shs76NgxjZSgvvZZ9qOmz5zuBE8buUaYD28BMTxg=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "34627c90f062da515ea358360f448da57769236e",
|
"rev": "29e290002bfff26af1db6f64d070698019460302",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
2
home-manager/dotfiles/desktop/niri.kdl
Normal file
2
home-manager/dotfiles/desktop/niri.kdl
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
// Placeholder for Niri configuration
|
||||||
|
// This will contain the migrated Niri window manager configuration
|
2
home-manager/dotfiles/desktop/theme.conf
Normal file
2
home-manager/dotfiles/desktop/theme.conf
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Placeholder for desktop theme configuration
|
||||||
|
# This will contain desktop theme and appearance settings
|
4
home-manager/dotfiles/desktop/waybar.json
Normal file
4
home-manager/dotfiles/desktop/waybar.json
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
{
|
||||||
|
"_comment": "Placeholder for Waybar configuration",
|
||||||
|
"_note": "This will contain the migrated Waybar configuration"
|
||||||
|
}
|
3
home-manager/dotfiles/emacs/init.el
Normal file
3
home-manager/dotfiles/emacs/init.el
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# Placeholder for Emacs init.el
|
||||||
|
# This will contain the migrated Emacs configuration
|
||||||
|
# from dotfiles/geir/emacs-config/init-nix.el
|
2
home-manager/dotfiles/emacs/modules/claude-code.el
Normal file
2
home-manager/dotfiles/emacs/modules/claude-code.el
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
;; Placeholder for Emacs claude-code module
|
||||||
|
;; This will contain the migrated claude-code configuration
|
2
home-manager/dotfiles/emacs/modules/completion.el
Normal file
2
home-manager/dotfiles/emacs/modules/completion.el
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
;; Placeholder for Emacs completion module
|
||||||
|
;; This will contain the migrated completion configuration
|
2
home-manager/dotfiles/emacs/modules/development.el
Normal file
2
home-manager/dotfiles/emacs/modules/development.el
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
;; Placeholder for Emacs development module
|
||||||
|
;; This will contain the migrated development configuration
|
2
home-manager/dotfiles/emacs/modules/elisp-development.el
Normal file
2
home-manager/dotfiles/emacs/modules/elisp-development.el
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
;; Placeholder for Emacs elisp development module
|
||||||
|
;; This will contain the migrated elisp development configuration
|
2
home-manager/dotfiles/emacs/modules/navigation.el
Normal file
2
home-manager/dotfiles/emacs/modules/navigation.el
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
;; Placeholder for Emacs navigation module
|
||||||
|
;; This will contain the migrated navigation configuration
|
2
home-manager/dotfiles/emacs/modules/ui.el
Normal file
2
home-manager/dotfiles/emacs/modules/ui.el
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
;; Placeholder for Emacs UI module
|
||||||
|
;; This will contain the migrated UI configuration
|
2
home-manager/dotfiles/shell/aliases
Normal file
2
home-manager/dotfiles/shell/aliases
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Placeholder for shell aliases
|
||||||
|
# This will contain shared shell aliases
|
2
home-manager/dotfiles/shell/zshrc
Normal file
2
home-manager/dotfiles/shell/zshrc
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# Placeholder for zsh configuration
|
||||||
|
# This will contain shell-specific configurations that need to be deployed as dotfiles
|
10
home-manager/modules/desktop/default.nix
Normal file
10
home-manager/modules/desktop/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Shared desktop environment module
|
||||||
|
# Contains common desktop configurations and services
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Shared desktop environment configuration
|
||||||
|
# Common desktop applications, services, and integrations
|
||||||
|
# Desktop-specific environment variables
|
||||||
|
}
|
10
home-manager/modules/desktop/wayland.nix
Normal file
10
home-manager/modules/desktop/wayland.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Wayland-specific desktop configurations
|
||||||
|
# Contains Wayland window manager and compositor configurations
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Wayland-specific desktop configuration
|
||||||
|
# Window manager configurations (Niri, Sway, etc.)
|
||||||
|
# Wayland-specific tools and services
|
||||||
|
}
|
10
home-manager/modules/development/default.nix
Normal file
10
home-manager/modules/development/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Shared development environment module
|
||||||
|
# Contains common development tools and configurations
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Shared development environment configuration
|
||||||
|
# Common development tools, language servers, formatters
|
||||||
|
# Development-specific environment variables
|
||||||
|
}
|
10
home-manager/modules/development/languages.nix
Normal file
10
home-manager/modules/development/languages.nix
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Language-specific development configurations
|
||||||
|
# Contains language servers, tools, and environment setup
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Language-specific development tools
|
||||||
|
# LSP servers, formatters, linters for different languages
|
||||||
|
# Language-specific environment variables and configurations
|
||||||
|
}
|
12
home-manager/modules/emacs/default.nix
Normal file
12
home-manager/modules/emacs/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Shared Emacs module for Home Manager
|
||||||
|
# Contains common Emacs functionality that can be shared across users
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Shared Emacs configuration that can be imported by users
|
||||||
|
# Contains package sets, profile definitions, and common configurations
|
||||||
|
|
||||||
|
# This will contain the migrated packageSets from the current emacs.nix
|
||||||
|
# and shared Emacs functionality
|
||||||
|
}
|
11
home-manager/modules/emacs/nix-integration.nix
Normal file
11
home-manager/modules/emacs/nix-integration.nix
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
# Emacs Nix integration module
|
||||||
|
# Contains Nix tool integration and environment variable configuration
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Nix tool integration for Emacs
|
||||||
|
# Environment variables for Nix-provided tools
|
||||||
|
# LSP server configurations
|
||||||
|
# Formatter integrations
|
||||||
|
}
|
12
home-manager/modules/emacs/profiles.nix
Normal file
12
home-manager/modules/emacs/profiles.nix
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# Emacs profile definitions for Home Manager
|
||||||
|
# Contains the profile-based package selection logic
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Profile-based Emacs package configurations
|
||||||
|
# This will contain the migrated packageSets logic from current emacs.nix
|
||||||
|
|
||||||
|
# Profiles: essential, minimal, development, workstation
|
||||||
|
# Package selection based on profile type
|
||||||
|
}
|
38
home-manager/users/geir/home.nix
Normal file
38
home-manager/users/geir/home.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
# Main home configuration for user 'geir'
|
||||||
|
# This is the entry point for all user-specific Home Manager configuration
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./profiles/development.nix
|
||||||
|
./programs/emacs.nix
|
||||||
|
./programs/zsh.nix
|
||||||
|
./programs/git.nix
|
||||||
|
./programs/development.nix
|
||||||
|
./services/emacs-daemon.nix
|
||||||
|
./services/desktop.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
# Home Manager needs a bit of information about you and the paths it should manage
|
||||||
|
home.username = "geir";
|
||||||
|
home.homeDirectory = "/home/geir";
|
||||||
|
|
||||||
|
# This value determines the Home Manager release that your configuration is compatible with
|
||||||
|
home.stateVersion = "25.05";
|
||||||
|
|
||||||
|
# Let Home Manager install and manage itself
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
# User-specific packages will be defined in profiles and programs
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# Essential user packages will be moved here from system configuration
|
||||||
|
];
|
||||||
|
|
||||||
|
# User-specific environment variables
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "emacs";
|
||||||
|
BROWSER = "firefox";
|
||||||
|
TERMINAL = "kitty";
|
||||||
|
};
|
||||||
|
}
|
19
home-manager/users/geir/profiles/development.nix
Normal file
19
home-manager/users/geir/profiles/development.nix
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Development profile configuration for geir
|
||||||
|
# Contains development-specific packages and configurations
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Development-specific packages
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# Development tools
|
||||||
|
# Will be migrated from current user configuration
|
||||||
|
];
|
||||||
|
|
||||||
|
# Development-specific environment variables
|
||||||
|
home.sessionVariables = {
|
||||||
|
# Development environment variables
|
||||||
|
};
|
||||||
|
|
||||||
|
# Development-specific services and configurations
|
||||||
|
}
|
13
home-manager/users/geir/profiles/minimal.nix
Normal file
13
home-manager/users/geir/profiles/minimal.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# Minimal profile configuration for geir
|
||||||
|
# Contains only essential packages for lightweight setups
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Minimal essential packages
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# Only essential tools
|
||||||
|
];
|
||||||
|
|
||||||
|
# Minimal configurations
|
||||||
|
}
|
14
home-manager/users/geir/profiles/workstation.nix
Normal file
14
home-manager/users/geir/profiles/workstation.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Workstation profile configuration for geir
|
||||||
|
# Contains full workstation packages and configurations for powerful machines
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Workstation-specific packages
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# Full workstation packages
|
||||||
|
# Creative tools, media applications, etc.
|
||||||
|
];
|
||||||
|
|
||||||
|
# Workstation-specific configurations
|
||||||
|
}
|
21
home-manager/users/geir/programs/development.nix
Normal file
21
home-manager/users/geir/programs/development.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
# Development tools and environment configuration
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Development packages
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# Development tools will be migrated here
|
||||||
|
# neovim, vscode, nodejs, etc.
|
||||||
|
];
|
||||||
|
|
||||||
|
# Development tool configurations
|
||||||
|
programs = {
|
||||||
|
# Individual development tool configurations
|
||||||
|
};
|
||||||
|
|
||||||
|
# Development environment variables
|
||||||
|
home.sessionVariables = {
|
||||||
|
# Development-specific environment variables
|
||||||
|
};
|
||||||
|
}
|
26
home-manager/users/geir/programs/emacs.nix
Normal file
26
home-manager/users/geir/programs/emacs.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# Emacs configuration for Home Manager
|
||||||
|
# Migrated from modules/development/emacs.nix with Home Manager integration
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Emacs program configuration
|
||||||
|
programs.emacs = {
|
||||||
|
enable = true;
|
||||||
|
# package will be configured based on profile
|
||||||
|
# extraPackages will be migrated from current profile system
|
||||||
|
};
|
||||||
|
|
||||||
|
# Emacs configuration files deployment
|
||||||
|
xdg.configFile = {
|
||||||
|
# Emacs configuration files will be deployed here
|
||||||
|
# "emacs/init.el".source = ...;
|
||||||
|
# "emacs/modules/ui.el".source = ...;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Emacs-specific environment variables
|
||||||
|
home.sessionVariables = {
|
||||||
|
# Nix tool integration variables
|
||||||
|
# RG_PATH, FD_PATH, etc.
|
||||||
|
};
|
||||||
|
}
|
22
home-manager/users/geir/programs/git.nix
Normal file
22
home-manager/users/geir/programs/git.nix
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Git configuration for Home Manager
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "Geir Okkenhaug Jerstad";
|
||||||
|
userEmail = "geokkjer@gmail.com";
|
||||||
|
|
||||||
|
# Git configuration
|
||||||
|
extraConfig = {
|
||||||
|
# Git settings will be configured here
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Git-related packages
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
git-credential-manager
|
||||||
|
# Other git tools
|
||||||
|
];
|
||||||
|
}
|
34
home-manager/users/geir/programs/zsh.nix
Normal file
34
home-manager/users/geir/programs/zsh.nix
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# Zsh configuration for Home Manager
|
||||||
|
# Migrated from current zsh configuration in user modules
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# History configuration
|
||||||
|
history = {
|
||||||
|
size = 10000;
|
||||||
|
path = "$HOME/.histfile";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Shell aliases
|
||||||
|
shellAliases = {
|
||||||
|
# User-specific aliases will be migrated here
|
||||||
|
};
|
||||||
|
|
||||||
|
# Interactive shell initialization
|
||||||
|
initExtra = ''
|
||||||
|
# Shell initialization code will be migrated here
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Shell-related packages
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
starship
|
||||||
|
zoxide
|
||||||
|
direnv
|
||||||
|
# Other shell enhancement tools
|
||||||
|
];
|
||||||
|
}
|
14
home-manager/users/geir/services/desktop.nix
Normal file
14
home-manager/users/geir/services/desktop.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Desktop services configuration for Home Manager
|
||||||
|
# User-level desktop services and integrations
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Desktop services
|
||||||
|
services = {
|
||||||
|
# User-level desktop services will be configured here
|
||||||
|
# Examples: clipboards, notifications, etc.
|
||||||
|
};
|
||||||
|
|
||||||
|
# Desktop-specific configurations
|
||||||
|
}
|
14
home-manager/users/geir/services/emacs-daemon.nix
Normal file
14
home-manager/users/geir/services/emacs-daemon.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Emacs daemon service configuration for Home Manager
|
||||||
|
# Migrated from system-level emacs service
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
services.emacs = {
|
||||||
|
enable = true;
|
||||||
|
# package will be set from emacs program configuration
|
||||||
|
# Additional daemon-specific configuration
|
||||||
|
};
|
||||||
|
|
||||||
|
# User-level systemd service customization if needed
|
||||||
|
}
|
42
home-manager/users/sma/home.nix
Normal file
42
home-manager/users/sma/home.nix
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# Main home configuration for user 'sma' (admin user)
|
||||||
|
# Minimal configuration for system administration tasks
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Home Manager needs a bit of information about you and the paths it should manage
|
||||||
|
home.username = "sma";
|
||||||
|
home.homeDirectory = "/home/sma";
|
||||||
|
|
||||||
|
# This value determines the Home Manager release that your configuration is compatible with
|
||||||
|
home.stateVersion = "25.05";
|
||||||
|
|
||||||
|
# Let Home Manager install and manage itself
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
# Admin-specific packages
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
# System administration tools
|
||||||
|
];
|
||||||
|
|
||||||
|
# Basic shell configuration
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
history = {
|
||||||
|
size = 5000;
|
||||||
|
path = "$HOME/.histfile";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Basic git configuration
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "System Admin";
|
||||||
|
userEmail = "admin@example.com";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Admin-specific environment variables
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "nano";
|
||||||
|
};
|
||||||
|
}
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
# Desktop
|
# Desktop
|
||||||
../../modules/desktop/niri.nix
|
../../modules/desktop/niri.nix
|
||||||
../../modules/desktop/waybar.nix
|
# ../../modules/desktop/waybar.nix
|
||||||
../../modules/desktop/gnome.nix
|
../../modules/desktop/gnome.nix
|
||||||
../../modules/desktop/cosmic.nix
|
../../modules/desktop/cosmic.nix
|
||||||
../../modules/desktop/fonts.nix
|
../../modules/desktop/fonts.nix
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
programs.niri.enable = true;
|
programs.niri = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# Niri scrolling window manager
|
# Niri scrolling window manager
|
||||||
niri
|
niri
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"position": "top",
|
"position": "top",
|
||||||
"height": 30,
|
"height": 30,
|
||||||
"spacing": 4,
|
"spacing": 4,
|
||||||
"modules-left": ["sway/workspaces"],
|
"modules-left": ["niri/workspaces"],
|
||||||
"modules-center": [],
|
"modules-center": [],
|
||||||
"modules-right": ["network", "clock"],
|
"modules-right": ["network", "clock"],
|
||||||
"sway/workspaces": {
|
"sway/workspaces": {
|
||||||
|
|
|
@ -87,6 +87,7 @@ with lib; let
|
||||||
doom-themes
|
doom-themes
|
||||||
doom-modeline
|
doom-modeline
|
||||||
all-the-icons
|
all-the-icons
|
||||||
|
all-the-icons-completion
|
||||||
rainbow-delimiters
|
rainbow-delimiters
|
||||||
highlight-indent-guides
|
highlight-indent-guides
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue