Skip to content

Instantly share code, notes, and snippets.

@snambi
Last active March 24, 2025 20:12
Show Gist options
  • Save snambi/9160b23dfe7a48f32b6a42dc8ebbd740 to your computer and use it in GitHub Desktop.
Save snambi/9160b23dfe7a48f32b6a42dc8ebbd740 to your computer and use it in GitHub Desktop.
Create a Kubernetes development machine using NIX HomeManager

Kubernetes Development

Follow the Kubernetes developmemt Guide and Build

Ubuntu Develepment Setup

I have used ubuntu 24

Steps

  1. Create a lightsail VM from AWS with atleast 8GB RAM and 50GB of disk space
  2. Install NIX cli. https://nixos.org/download/#nix-install-linux
  3. Install home-manager by following https://nix-community.github.io/home-manager/index.xhtml#sec-install-standalone
  4. Install Docker https://docs.docker.com/engine/install/ubuntu/
  5. Configure Docker to run as a non-root user https://docs.docker.com/engine/install/linux-postinstall/
  6. Create home.nix using the home.nix file.
  7. Install Kubernetes dependencies using home-manager
  8. Checkout kubernetes code from github repo
  9. Build the code using this

home.nix file

{ config, pkgs, ... }:

{
  home.username = "ubuntu";
  home.homeDirectory = "/home/ubuntu";

  home.stateVersion = "24.11"; # Please read the comment before changing.

  # The home.packages option allows you to install Nix packages into your
  # environment.
  home.packages = [
    pkgs.hello
    pkgs.htop
    pkgs.git
    pkgs.fortune
    pkgs.cowsay
    pkgs.jdk23
    pkgs.go
    pkgs.coreutils-full
    pkgs.ed
    pkgs.findutils
    pkgs.gawk
    pkgs.gnused
    pkgs.gnutar
    pkgs.gnugrep
    pkgs.gnumake
    pkgs.jq
    pkgs.gcc
    pkgs.zsh
    pkgs.oh-my-zsh

  ];

  home.file = {
  };

  home.sessionVariables = {
    # EDITOR = "emacs";
    EDITOR = "vi";
  };

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;
}

Install Dependencies Using home-manager

# Copy the home.nix file under $HOME/.config/home-manager/home.nix
vi ~/.config/home-manager/home.nix

# Applies the changes 
home-manager switch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment