Giter Club home page Giter Club logo

bootstrapping-winblows's Introduction

Windows Bootstrapping

Bootstrap your Windows desktop like a boss.

Quick Steps

  1. Launch Powershell as an admin to run the admin_*.ps1 files in the powershell_scripts directory. These scripts:

    • install the majority of end-user desktop software
    • remove some bloatware
    • install WSL
  2. Launch Powershell as a normal user to run the remaining uininstall_bloatware.ps1 script. This script:

    • Removes the majority of anti-features Windows provides
  3. Let's start on the NixOS install. Download this pre-built NixOS installation and import it into a WSL distirbution called "NixOS"

    [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
    (New-Object System.Net.WebClient).DownloadFile("https://github.com/nix-community/NixOS-WSL/releases/download/2311.5.3/nixos-wsl.tar.gz", "$HOME\Downloads\nixos-wsl.tar.gz")
    
    # Import NixOS
    wsl --import NixOS "$HOME\NixOS" "$HOME\Downloads\nixos-wsl.tar.gz" --version 2
    
    # Create a "workspaces" folder to persist your working documents outside of WSL
    wsl -d NixOS /run/current-system/sw/bin/mkdir -p "/mnt/c/Users/$env:USERNAME/Documents/workspaces"
    wsl -d NixOS /run/current-system/sw/bin/ln -s "/mnt/c/Users/$env:USERNAME/Documents/workspaces" "/home/nixos/workspaces"
    
    # Launch NixOS
    wsl --distribution NixOS
  4. From inside of WSL, update channels

    sudo nix-channel --update
  5. Clone this repo

    cd ~/workspaces
    nix-shell -p git
    git clone https://github.com/justmiles/bootstrapping-winblows.git
    cd bootstrapping-winblows
  6. Update wsl/flake.nix to set your username

    grep "username =" wsl/flake.nix
    nix-shell -p vim
    vi wsl/flake.nix
  7. Rebuild using the latest

    sudo nixos-rebuild switch --flake ./wsl
  8. Use the wsl -d NixOS to launch the shell or open http://localhost:3000 for an integrated development environment

  9. Fork this repo and start making changes to build out your own environment.

Building your own NixOS WSL distribution

Check out these resources:

Why does this repo exist?

This repo outlines my dev migration from Linux to Windows. While I aim for it to be technical in nature, my natural spite for development on Windows is bound to trickle through. Don't take it to heart. Great people have done great things at the Windows "power" shell.

Fuck Windows.

I have been a dedicated user of Linux Mint since 2006, relying on it for both personal and work machines. When it comes to servers, I have preferred Ubuntu Server. However, over the past year, I have discovered the value of the Nix ecosystem, which completely replaces traditional configuration management tools like Chef, Ansible, and Puppet with its fully declarative operating system. I have since started moving my personal servers from Ubuntu to NixOS and have been thoroughly enjoying the experience.

Unfortunately, recent changes in my work environment have forced me to replace Linux Mint with Windows as my daily driver. While this decision warrants a discussion on supporting innovative developers in their preferred environment, for now, I will focus on adapting to this inevitable change.

So, how can I make the best of using Windows? By installing Linux!

The Windows Subsystem for Linux (WSL) may not be perfect, but it allows us to run Linux within the Windows environment. Although it is slower, requires more resources, and features an ad-filled desktop environment called "Windows Shell," it still provides the Linux functionality we need. To enhance this experience, I recommend using Nix in the WSL. Yes, you can create a root tarball using Nix and then import it into WSL.

By following this approach, you can have your entire Nix environment available on Windows, effectively transferring your codified setup.

TODOs

  • check for and install all Windows updates

bootstrapping-winblows's People

Contributors

justmiles avatar

Stargazers

 avatar Oleg Pykhalov avatar John avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.