Skip to content

Instantly share code, notes, and snippets.

@tolgamorf
Last active February 4, 2025 21:28
Show Gist options
  • Save tolgamorf/14a90cd1fde28fd4dc2f138e74941086 to your computer and use it in GitHub Desktop.
Save tolgamorf/14a90cd1fde28fd4dc2f138e74941086 to your computer and use it in GitHub Desktop.
New Windows PC Quick Installation

New Windows PC Quick Installation

Install and prepare scoop

In Windows PowerShell:

# Setup SSH agent (requires admin rights)
Set-Service ssh-agent -StartupType Manual

# Generate an SSH key and add it to the ssh-agent (for github, etc.)
ssh-keygen -t ed25519 -C "[email protected]"
ssh-add ~/.ssh/id_ed25519

# Install scoop
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression

# Setup scoop
scoop install git
scoop bucket add extras
scoop bucket add versions
scoop bucket add nerd-fonts

# Configure git
git config --global user.email "[email protected]"
git config --global user.name "Tolga Y. Ozudogru"

Setup MSYS2 and Windows Terminal

  1. First, install Visual Studio Code as you will need it:

    scoop install vscode
  2. Install MYSYS2:

    scoop install MSYS2

    Update home directory config in /etc/nsswitch.conf under <scoop_dir>/apps/msys2/current as follows:

    db_home: windows
    

    Run MSYS2

    msys2
  3. Install terminal related packages:

    # Terminal stuff
    scoop install busybox cmder-full colortool cwrsync fzf pshazz starship sudo
    
    # Fonts
    scoop install 0xProto-NF AnonymousPro-NF CascadiaCode-NF CodeNewRoman-NF CommitMono-NF Cousine-NF D2Coding-NF DejaVuSansMono-NF DroidSansMono-NF FiraCode-NF FiraMono-NF Hack-NF Inconsolata-NF RobotoMono-NF SourceCodePro-NF SpaceMono-NF Terminus-NF Ubuntu-NF UbuntuMono-NF
  4. Install fish shell:

    # fish shell
    pacman -S fish
    
    # fisher and some plug-ins
    curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
    fisher install edc/bass jorgebucaran/autopair.fish jethrokuan/z

    Copy fish settings from your previous installation to ~/.config/fish/.

  5. Configure starship:

    Copy starship.toml from your previous installation to ~/.config/starship.toml.

    Add starship initialization to ~/.config/fish/config.fish:

    # Initialize starship.rs
    starship init fish | source

    Add starship initialization to $PROFILE (located at C:\Users\<USERNAME>\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1):

    # Initialize starship.rs
    Invoke-Expression (&starship init powershell)
  6. Configure Windows Terminal:

    Update Windows Terminal from the Microsoft Store.

    Copy settings.json from your previous installation.

    MSYS2 launch command:

    %UserProfile%\scoop\apps\MSYS2\current\msys2_shell.cmd -use-full-path -defterm -here -no-start -ucrt64 -shell fish

Install packages with scoop

# Windows desktop runtime (requires admin rights)
sudo scoop install windowsdesktop-runtime-6.0 windowsdesktop-runtime-lts windowsdesktop-runtime
sudo scoop uninstall windowsdesktop-runtime-6.0 windowsdesktop-runtime-lts windowsdesktop-runtime

# Dev stack
scoop install python pyenv pipx uv ruby nodejs gh docker typst tectonic bruno winscp sqlyog-community

# Monitoring & tools
scoop install rufus driverstoreexplorer hwinfo hwmonitor coretemp cpu-z gpu-z ssd-z uninstalr winaero-tweaker spacesniffer ddu msklc qmk-toolbox open-log-viewer

# Applications
scoop install 7zip altus chatgpt deeplx discord ffmpeg firefox flameshot googlechrome handbrake iptvnator microsoft-teams mpv-git ollama-full raindrop.io spotify stremio telegram transmission vlc yt-dlp zoom

# PostgreSQL must be installed globally (requires admin rights)
sudo scoop install postgresql --global

# Non-portable apps (requires admin rights – not tested)
scoop bucket add nonportable
sudo scoop install dropbox-np teracopy-np protonvpn-np

Miscellaneous

# Install python versions using pyenv
pyenv install 3.9.13 3.10.11 3.11.9 3.12.8 3.13.1
pyenv global 3.13.1

# Add Git Credential Manager as a context menu option by running:
Invoke-Expression "reg import ""$(scoop prefix git)\install-context.reg"""

# Add 7-Zip as a context menu option by running:
Invoke-Expression "reg import ""$(scoop prefix 7zip)\install-context.reg"""

# Add Visual Studio Code as a context menu option by running:
Invoke-Expression "reg import ""$(scoop prefix vscode)\install-context.reg"""

# For file associations, run:
Invoke-Expression "reg import ""$(scoop prefix vscode)\install-associations.reg"""

# For github integration, run:
Invoke-Expression "reg import ""$(scoop prefix vscode)\install-github-integration.reg"""

# Register PostgreSQL as a service:
pg_ctl register -N PostgreSQL

Maybe's

# Install WSL
wsl --install

scoop 'em all

scoop install python pyenv pipx uv ruby nodejs gh docker typst tectonic bruno winscp sqlyog-community rufus driverstoreexplorer hwinfo hwmonitor coretemp cpu-z gpu-z ssd-z uninstalr winaero-tweaker spacesniffer ddu msklc qmk-toolbox open-log-viewer 7zip altus chatgpt deeplx discord ffmpeg firefox flameshot googlechrome handbrake iptvnator microsoft-teams mpv-git ollama-full raindrop.io spotify stremio telegram transmission vlc yt-dlp zoom
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions":
[
{
"command":
{
"action": "copy",
"singleLine": false
},
"id": "User.copy.644BA8F2",
"keys": "ctrl+c"
},
{
"command": "paste",
"id": "User.paste",
"keys": "ctrl+v"
},
{
"command": "find",
"id": "User.find",
"keys": "ctrl+shift+f"
},
{
"command":
{
"action": "splitPane",
"split": "auto",
"splitMode": "duplicate"
},
"id": "User.splitPane.A6751878",
"keys": "alt+shift+d"
}
],
"copyFormatting": "none",
"copyOnSelect": false,
"defaultProfile": "{e622c57b-3547-4ccd-8c3b-aaf651e65714}",
"firstWindowPreference": "persistedWindowLayout",
"language": "en-US",
"newTabMenu":
[
{
"type": "remainingProfiles"
}
],
"profiles":
{
"defaults":
{
"antialiasingMode": "grayscale",
"colorScheme": "Campbell",
"cursorShape": "vintage",
"experimental.retroTerminalEffect": false,
"font":
{
"face": "FiraCode Nerd Font",
"size": 14
},
"padding": "15"
},
"list":
[
{
"commandline": "%UserProfile%\\scoop\\apps\\MSYS2\\current\\msys2_shell.cmd -use-full-path -defterm -here -no-start -ucrt64 -shell fish",
"guid": "{e622c57b-3547-4ccd-8c3b-aaf651e65714}",
"hidden": false,
"icon": "%UserProfile%\\scoop\\apps\\MSYS2\\current\\ucrt64.ico",
"name": "UCRT64 / MSYS2",
"startingDirectory": "D:\\Developer"
},
{
"guid": "{2c4de342-38b7-51cf-b940-2309a097f518}",
"hidden": false,
"name": "Ubuntu",
"source": "Windows.Terminal.Wsl"
},
{
"background": "#2E3436",
"commandline": "cmd.exe /k %CMDER_ROOT%\\vendor\\init.bat",
"guid": "{106f3480-dad9-4602-8c28-1967cc756e15}",
"hidden": false,
"icon": "%CMDER_ROOT%\\icons\\cmder.ico",
"name": "Cmder",
"startingDirectory": "%USERPROFILE%"
},
{
"guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
"hidden": false,
"name": "PowerShell",
"source": "Windows.Terminal.PowershellCore"
},
{
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"hidden": false,
"name": "Windows PowerShell"
},
{
"commandline": "%SystemRoot%\\System32\\cmd.exe",
"guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
"hidden": false,
"name": "Command Prompt"
},
{
"guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
"hidden": true,
"name": "Azure Cloud Shell",
"source": "Windows.Terminal.Azure"
},
{
"guid": "{51855cb2-8cce-5362-8f54-464b92b32386}",
"hidden": true,
"name": "Ubuntu",
"source": "CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc"
}
]
},
"schemes": [],
"startOnUserLogin": false,
"themes": []
}
format = """\
[╭╴](fg:arrow)\
$username\
$directory\
$time\
(\
$git_branch\
$git_status\
)\
(\
$python\
$conda\
$nodejs\
)\
$cmd_duration
[╰─](fg:arrow)$character\
"""
# Add the modules you need
# Disables the blank line at the start of the prompt
add_newline = true
# Palettes:
# old: the previous version.
# normal: dark gray / yellow / white palette.
# light: pastel light colors.
# To change the colors: change to the corresponding palette.
palette = "normal"
[palettes.old]
arrow = "#353535"
os = "#3778BF"
os_admin = "#6A040F"
directory = "#3F37C9"
node = "green"
time = "#177E89"
git = "#B02B10"
git_status = "#8B1D2C"
python = "#3776AB"
conda = "#3EB049"
java = "#861215"
rust = "#C33C00"
clang = "#00599D"
duration = "yellow"
text_color = "#EDF2F4"
text_light = "#EDF2F4"
[palettes.normal]
arrow = "#353535"
os = "#2C3032"
os_admin = "#6A040F"
directory = "#363C3E"
time = "#474D5C"
node = "#F1DEA9"
git = "#D0DBDA"
git_status = "#DFEBED"
python = "#F5CB5C"
conda = "#3EB049"
java = "#861215"
rust = "#C33C00"
clang = "#00599D"
duration = "#F4FBFF"
text_color = "#EDF2F4"
text_light = "#26272A"
[palettes.light]
arrow = "#353535"
os = "#F7768E"
os_admin = "#ACBEF1"
directory = "#FF9578"
time = "#FFDC72"
git = "#F5F5F5"
git_status = "#72FFD5"
clang = "#67E3FF"
java = "#FF52A3"
python = "#B4F9F8"
node = "#81FF85"
conda = "#BAF5C0"
duration = "#91FFE7"
text_color = "#26272A"
text_light = "#26272A"
[username]
style_user = 'os'
style_root = 'os_admin'
format = '[]($style)[ $user](bg:$style fg:text_color)[]($style)'
disabled = false
show_always = true
[character]
success_symbol = "[](fg:arrow)"
error_symbol = "[](fg:red)"
disabled = false
# success_symbol = '[](bold fg:arrow)'
# error_symbol = '[](bold fg:red)'
vimcmd_symbol = '[](fg:green)'
vimcmd_replace_one_symbol = '[](fg:purple)'
vimcmd_replace_symbol = '[](fg:purple)'
vimcmd_visual_symbol = '[](fg:yellow)'
[directory]
format = " [](fg:directory)[ $path ]($style)[$read_only]($read_only_style)[](fg:directory)"
truncation_length = 2
style = "fg:text_color bg:directory"
read_only_style = "fg:text_color bg:directory"
before_repo_root_style = "fg:text_color bg:directory"
truncation_symbol = "…/"
truncate_to_repo = true
read_only = "  "
[directory.substitutions]
"Documents" = "󰈙 "
"Downloads" = " "
"Music" = "󰝚 "
"Pictures" = " "
"Developer" = "󰲋 "
[time]
disabled = false
format = " [](fg:time)[ $time]($style)[](fg:time)"
time_format = "%H:%M"
style = "fg:text_color bg:time"
[cmd_duration]
format = " [](fg:duration)[ $duration]($style)[](fg:duration)"
style = "fg:text_light bg:duration"
min_time = 500
[git_branch]
format = " [](fg:git)[$symbol$branch](fg:text_light bg:git)[](fg:git)"
symbol = " "
[git_status]
format = '([ ](fg:git_status)[ $all_status$ahead_behind ]($style)[](fg:git_status))'
style = "fg:text_light bg:git_status"
[docker_context]
disabled = true
symbol = " "
[package]
disabled = true
[java]
format = "[ ](fg:java)[$symbol$version](bg:java fg:text_color)[](fg:java)"
version_format = "${raw}"
symbol = " "
disabled = true
[nodejs]
format = "[ ](fg:node)[$symbol$version]($style)[](fg:node)"
style = "bg:node fg:text_light"
symbol = " "
version_format = "${raw}"
disabled = false
[rust]
format = "[ ](fg:rust)[$symbol$version](bg:rust fg:text_color)[](fg:rust)"
symbol = " "
version_format = "${raw}"
disabled = true
[python]
disabled = false
format = '[ ](fg:python)[${symbol}${pyenv_prefix}(${version} )(\($virtualenv\))]($style)[](fg:python)'
symbol = " "
version_format = "${raw}"
style = "fg:text_light bg:python"
[conda]
format = "[ ](fg:conda)[$symbol$environment]($style)[](fg:conda)"
style = "bg:conda fg:text_color"
ignore_base = false
disabled = false
symbol = " "
[c]
format = "[ ](fg:clang)[$symbol($version(-$name) )](bg:clang fg:text_color)[](fg:clang)"
symbol = " "
version_format = "${raw}"
disabled = true
[os.symbols]
Alpine = " "
Amazon = " "
Android = " "
Arch = " "
CentOS = " "
Debian = " "
DragonFly = " "
Emscripten = " "
EndeavourOS = " "
Fedora = " "
FreeBSD = " "
Gentoo = " "
Linux = " "
Macos = " "
Manjaro = " "
Mariner = " "
MidnightBSD = " "
Mint = " "
NetBSD = " "
NixOS = " "
openSUSE = " "
Pop = " "
Raspbian = " "
Redhat = " "
RedHatEnterprise = " "
Redox = " "
SUSE = " "
Ubuntu = " "
Unknown = " "
Windows = " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment