Skip to content

bycEEE/crib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

482 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bycEEE Nix Home

NixOS logo NixOS logo

Status

Personal project for managing home environments across my Windows, WSL2, and MacOS setups. This repo is intended for personal use only since I am still learning Nix. Most of this project is based on kclejeune/system with pieces slammed together from inspirations.

Features

Main

  • Manage my main user across WSL and MacOS.
  • Uses 1Password SSH Agent.
  • Personal and work profiles.
  • Use DevBox for individual projects.

Windows

  • Utilises WSL to manage Windows 11 machine host.
  • Manage host applications via bash scripts for winget and scoop (WIP).
  • Configure host applications (WIP).
  • Manage WSL GUI applications and have them show in host Start menu.

MacOS

  • Configure basic MacOS default preferences (WIP).
  • homebrew package management without NixOS.
  • Manages application configuration for non-nixpkgs applications such as iTerm2 and Karabiner.

Installation

Prerequisites

WSL Setup

  • Install and set up Ubuntu:

    wsl --install
    wsl -d Ubuntu # Start up Ubuntu
    wsl -s Ubuntu # Make default distribution
  • Configure %USERPROFILE%\.wslconfig to take advantage of mirrored mode monitoring:

    [wsl2]
    memory=24GB
    networkingMode=mirrored
    
    [experimental]
    sparseVhd=true
  • Verify WSL networking mode:

    ❯ wslinfo --networking-mode
    mirrored
  • Install Nix and Home Manager:

    # Determinate Systems Nix Installer
    curl -fsSL https://install.determinate.systems/nix | sh -s -- install --extra-conf "trusted-users = root $USER"
    
    # Create directory
    mkdir -p ~/crib
    cd ~/crib
    
    # Build and activate
    nix build "github:bycEEE/crib#homeConfigurations.$USER@$(hostname -s).activationPackage" && ./result/activate
    
    # Clone the actual repo
    git clone git@github.com:bycEEE/crib.git .
    
    # Add nix installed shells to system (may have to edit files manually)
    # sudo echo "$HOME/.nix-profile/bin/bash" >> /etc/shells
    sudo echo "$HOME/.nix-profile/bin/zsh" >> /etc/shells
    
    # Change shell
    chsh -s $HOME/.nix-profile/bin/zsh
  • To enable GUI apps in Windows Start Menu:

    sudo ln -s $HOME/.nix-profile/share/applications /usr/local/share/applications
    sudo ln -s $HOME/.nix-profile/share/icons /usr/local/share/icons
  • Subsequent runs:

    just apply

MacOS Setup

  • If coming from brew:

    # Backup brew packages
    brew list -1 > .brew.backup
    brew bundle dump
    
    # Uninstall all packages
    brew uninstall --force $(brew list)
    
    # Fix broken links and clean up
    brew doctor
    brew cleanup
    brew cleanup -s
  • Install brew:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    brew analytics off
  • Install Nix and Home Manager:

    Note: Haven't tried testing on a fresh system.

    Download just binary.

    # Determinate Systems Nix Installer
    curl -fsSL https://install.determinate.systems/nix | sh -s -- install --extra-conf "trusted-users = root $USER"
    
    git clone git@github.com:bycEEE/crib.git ~/crib
    just build
    
    # Add nix installed shells to system (may have to edit files manually)
    # sudo echo "$HOME/.nix-profile/bin/bash" >> /etc/shells
    sudo echo "$HOME/.nix-profile/bin/zsh" >> /etc/shells
    
    # Change shell
    chsh -s "$HOME/.nix-profile/bin/zsh"

Resources

Learning Nix

Useful Links

Inspirations

TODO

  • Move 1password logic outside of zsh and ssh files, eg. kclejeune/system 1password.
  • Move WSL logic outside of individual files.
  • Fix Windows GitHub download script.
  • Add atuin and croc relay.
  • Maybe use sops instead of agenix.
  • Maybe use 1password to generate credentials such as on awscli2.
  • Add pentesting tools that exist in default.nix in pentesting.nix as well.
  • Separate out tools into separate folders and consolidate redundant home/default.nix.
  • Fix broken agenix secrets.
  • Copy iTerm2 and other MacOS configs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors