Merge branch 'main' of https://git.zacke.dev/wholteza/consultant-windows
This commit is contained in:
20
.profile.ps1
20
.profile.ps1
@@ -17,6 +17,26 @@ Set-Alias -Name python3 -Value python
|
|||||||
|
|
||||||
|
|
||||||
# Functions
|
# Functions
|
||||||
|
function d-up {
|
||||||
|
docker compose up --build -d
|
||||||
|
}
|
||||||
|
function d-bash {
|
||||||
|
docker exec -it "$1" /bin/bash
|
||||||
|
}
|
||||||
|
function d-down {
|
||||||
|
docker compose down -v
|
||||||
|
}
|
||||||
|
function d-down-up {
|
||||||
|
d-down
|
||||||
|
d-up
|
||||||
|
}
|
||||||
|
function d-logs {
|
||||||
|
docker compose logs -f -t
|
||||||
|
}
|
||||||
|
function d-ps {
|
||||||
|
docker compose ps -a
|
||||||
|
}
|
||||||
|
|
||||||
function cdli {
|
function cdli {
|
||||||
Set-Location "C:\repos\litium"
|
Set-Location "C:\repos\litium"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,3 +64,10 @@ vim.opt.scrolloff = 10
|
|||||||
-- instead raise a dialog asking if you wish to save the current file(s)
|
-- instead raise a dialog asking if you wish to save the current file(s)
|
||||||
-- See `:help 'confirm'`
|
-- See `:help 'confirm'`
|
||||||
vim.opt.confirm = true
|
vim.opt.confirm = true
|
||||||
|
|
||||||
|
-- set LF instead of CRLF
|
||||||
|
vim.opt.fileformats = { 'unix', 'dos' }
|
||||||
|
vim.api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
||||||
|
pattern = { '*.sh', '*.xml' },
|
||||||
|
command = 'setlocal ff=unix',
|
||||||
|
})
|
||||||
|
|||||||
@@ -23,6 +23,19 @@ return {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
filesystem = {
|
filesystem = {
|
||||||
|
follow_current_file = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
filtered_items = {
|
||||||
|
always_show = {
|
||||||
|
'.gitignore',
|
||||||
|
'.gitattributes',
|
||||||
|
},
|
||||||
|
always_show_by_pattern = {
|
||||||
|
'.gitlab*',
|
||||||
|
'*.env',
|
||||||
|
},
|
||||||
|
},
|
||||||
window = {
|
window = {
|
||||||
mappings = {
|
mappings = {
|
||||||
['\\'] = 'close_window',
|
['\\'] = 'close_window',
|
||||||
|
|||||||
@@ -256,6 +256,8 @@ return {
|
|||||||
powershell_es = {},
|
powershell_es = {},
|
||||||
intelephense = {},
|
intelephense = {},
|
||||||
bashls = {},
|
bashls = {},
|
||||||
|
docker_language_server = {},
|
||||||
|
docker_compose_language_service = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Ensure the servers and tools above are installed
|
-- Ensure the servers and tools above are installed
|
||||||
|
|||||||
266
requirements.ps1
266
requirements.ps1
@@ -1,3 +1,144 @@
|
|||||||
|
param (
|
||||||
|
[Alias('h', '?')]
|
||||||
|
[switch]$Help,
|
||||||
|
[Alias('no-winget')]
|
||||||
|
[switch]$NoWinget,
|
||||||
|
[Alias('only-winget')]
|
||||||
|
[switch]$OnlyWinget,
|
||||||
|
[Alias('install-extras')]
|
||||||
|
[switch]$Extras,
|
||||||
|
[Alias('only-extras')]
|
||||||
|
[switch]$OnlyExtras,
|
||||||
|
[Alias('no-choco')]
|
||||||
|
[switch]$NoChoco,
|
||||||
|
[Alias('only-choco')]
|
||||||
|
[switch]$OnlyChoco,
|
||||||
|
[Alias('no-powershell')]
|
||||||
|
[switch]$NoPowershell,
|
||||||
|
[Alias('only-powershell')]
|
||||||
|
[switch]$OnlyPowershell,
|
||||||
|
[Alias('no-pip')]
|
||||||
|
[switch]$NoPip,
|
||||||
|
[Alias('only-pip')]
|
||||||
|
[switch]$OnlyPip,
|
||||||
|
[Alias('no-npm')]
|
||||||
|
[switch]$NoNpm,
|
||||||
|
[Alias('only-npm')]
|
||||||
|
[switch]$OnlyNpm,
|
||||||
|
[Alias('no-fonts')]
|
||||||
|
[switch]$NoFonts,
|
||||||
|
[Alias('only-fonts')]
|
||||||
|
[switch]$OnlyFonts,
|
||||||
|
[Alias('no-wallpaper')]
|
||||||
|
[switch]$NoWallpaper,
|
||||||
|
[Alias('only-wallpaper')]
|
||||||
|
[switch]$OnlyWallpaper
|
||||||
|
)
|
||||||
|
|
||||||
|
if ($Help)
|
||||||
|
{
|
||||||
|
@"
|
||||||
|
requirements.ps1 – Install system requirements
|
||||||
|
|
||||||
|
USAGE:
|
||||||
|
requirements.ps1 [options]
|
||||||
|
|
||||||
|
OPTIONS:
|
||||||
|
-no-winget Disable installation via winget
|
||||||
|
-no-choco Disable installation via Chocolatey
|
||||||
|
-no-powershell Disable PowerShell module installation
|
||||||
|
-no-pip Disable Python pip package installation
|
||||||
|
-install-extras Install optional / extra components
|
||||||
|
-help, -h, -? Show this help message and exit
|
||||||
|
|
||||||
|
NOTES:
|
||||||
|
• Use single-dash options for best compatibility:
|
||||||
|
-no-winget -no-choco
|
||||||
|
|
||||||
|
• Double-dash options (--no-winget) only work in PowerShell 7+ (pwsh)
|
||||||
|
|
||||||
|
EXAMPLES:
|
||||||
|
requirements.ps1 -no-winget -no-choco
|
||||||
|
requirements.ps1 -install-extras
|
||||||
|
pwsh requirements.ps1 --no-winget --no-pip
|
||||||
|
"@
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function Write-Divider
|
||||||
|
{
|
||||||
|
Write-Host "################################################################################"
|
||||||
|
}
|
||||||
|
|
||||||
|
$Flags = [ordered]@{
|
||||||
|
WingetEnabled = -not $NoWinget
|
||||||
|
ExtrasEnabled = $Extras
|
||||||
|
ChocoEnabled = -not $NoChoco
|
||||||
|
PowershellEnabled = -not $NoPowershell
|
||||||
|
PipEnabled = -not $NoPip
|
||||||
|
NpmEnabled = -not $NoNpm
|
||||||
|
FontsEnabled = -not $NoFonts
|
||||||
|
WallpaperEnabled = -not $NoWallpaper
|
||||||
|
}
|
||||||
|
|
||||||
|
function Reset-Flags
|
||||||
|
{
|
||||||
|
foreach ($key in @($Flags.Keys))
|
||||||
|
{
|
||||||
|
$Flags[$key] = $false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($OnlyWinget)
|
||||||
|
{
|
||||||
|
Reset-Flags
|
||||||
|
$Flags.WingetEnabled = $true
|
||||||
|
}
|
||||||
|
if ($OnlyExtras)
|
||||||
|
{
|
||||||
|
Reset-Flags
|
||||||
|
$Flags.ExtrasEnabled = $true
|
||||||
|
}
|
||||||
|
if ($OnlyChoco)
|
||||||
|
{
|
||||||
|
Reset-Flags
|
||||||
|
$Flags.ChocoEnabled = $true
|
||||||
|
}
|
||||||
|
if ($OnlyPowershell)
|
||||||
|
{
|
||||||
|
Reset-Flags
|
||||||
|
$Flags.PowershellEnabled = $true
|
||||||
|
}
|
||||||
|
if ($OnlyPip)
|
||||||
|
{
|
||||||
|
Reset-Flags
|
||||||
|
$Flags.PipEnabled = $true
|
||||||
|
}
|
||||||
|
if ($OnlyNpm)
|
||||||
|
{
|
||||||
|
Reset-Flags
|
||||||
|
$Flags.NpmEnabled = $true
|
||||||
|
}
|
||||||
|
if ($OnlyFonts)
|
||||||
|
{
|
||||||
|
Reset-Flags
|
||||||
|
$Flags.FontsEnabled = $true
|
||||||
|
}
|
||||||
|
if ($OnlyWallpaper)
|
||||||
|
{
|
||||||
|
Reset-Flags
|
||||||
|
$Flags.WallpaperEnabled = $true
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "These providers are enabled:"
|
||||||
|
foreach ($key in $Flags.Keys)
|
||||||
|
{
|
||||||
|
if ($Flags[$key])
|
||||||
|
{
|
||||||
|
Write-Host $key
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Install requirements via winget
|
# Install requirements via winget
|
||||||
# Important stuff
|
# Important stuff
|
||||||
$packages = @(
|
$packages = @(
|
||||||
@@ -16,50 +157,113 @@ $packages = @(
|
|||||||
"Python.Python.3.10", # isort
|
"Python.Python.3.10", # isort
|
||||||
"JernejSimoncic.Wget", # nvim
|
"JernejSimoncic.Wget", # nvim
|
||||||
"7zip.7zip" # nvim
|
"7zip.7zip" # nvim
|
||||||
"rustlang.rustup"
|
"rustlang.rustup",
|
||||||
|
"Mozilla.Firefox"
|
||||||
)
|
)
|
||||||
|
$ExtraPackages = @(
|
||||||
foreach ($package in $packages)
|
|
||||||
{
|
|
||||||
winget install $package
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install latest node LTS
|
|
||||||
fnm install 22
|
|
||||||
fnm use 22
|
|
||||||
|
|
||||||
cd ~
|
|
||||||
|
|
||||||
npm install # mostly nvim deps
|
|
||||||
|
|
||||||
## Nvim requirements from choco, needs to be run as admin
|
|
||||||
Start-Process pwsh -Verb RunAs -ArgumentList "-Command", "choco install make unzip ripgrep zig"
|
|
||||||
|
|
||||||
## Nvim requirements from pip
|
|
||||||
python -m pip install debugpy neovim pillow
|
|
||||||
|
|
||||||
## Git posh
|
|
||||||
Install-Module posh-git -Scope CurrentUser -Force
|
|
||||||
|
|
||||||
# extras, make flag for these
|
|
||||||
|
|
||||||
$packages = @(
|
|
||||||
"mRemoteNG.mRemoteNG",
|
"mRemoteNG.mRemoteNG",
|
||||||
"mozilla.firefox.developeredition",
|
|
||||||
"Microsoft.VisualStudio.2022.Community",
|
"Microsoft.VisualStudio.2022.Community",
|
||||||
"JetBrains.Resharper",
|
"JetBrains.Resharper",
|
||||||
"Microsoft.powertoys",
|
"Microsoft.powertoys",
|
||||||
"spotify.spotify",
|
"spotify.spotify",
|
||||||
"microsoft.azuredatastudio",
|
"microsoft.azuredatastudio",
|
||||||
"mozilla.thunderbird",
|
"mozilla.thunderbird",
|
||||||
"yubico.authenticator",
|
|
||||||
"Postman.Postman",
|
"Postman.Postman",
|
||||||
"docker.dockerdesktop"
|
"docker.dockerdesktop"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Iterate through each package and install it
|
if ($Flags.WingetEnabled)
|
||||||
foreach ($package in $packages)
|
|
||||||
{
|
{
|
||||||
|
Write-Divider
|
||||||
|
Write-Host "Installing Winget Packages"
|
||||||
|
foreach ($package in $packages)
|
||||||
|
{
|
||||||
winget install $package
|
winget install $package
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($Flags.ExtrasEnabled)
|
||||||
|
{
|
||||||
|
Write-Divider
|
||||||
|
Write-Host "Installing Extra Winget Packages"
|
||||||
|
foreach ($package in $ExtraPackages)
|
||||||
|
{
|
||||||
|
winget install $package
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Flags.NpmEnabled)
|
||||||
|
{
|
||||||
|
Write-Divider
|
||||||
|
Write-Host "Installing Npm Packages"
|
||||||
|
fnm install 22
|
||||||
|
fnm use 22
|
||||||
|
Set-Location ~
|
||||||
|
npm install
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Flags.ChocoEnabled)
|
||||||
|
{
|
||||||
|
Write-Divider
|
||||||
|
Write-Host "Installing Chocolatey Packages"
|
||||||
|
## Nvim requirements from choco, needs to be run as admin
|
||||||
|
Start-Process pwsh -Verb RunAs -ArgumentList "-Command", "choco install make unzip ripgrep zig"
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Flags.PipEnabled)
|
||||||
|
{
|
||||||
|
Write-Divider
|
||||||
|
Write-Host "Installing pip Packages"
|
||||||
|
## Nvim requirements from pip
|
||||||
|
python -m pip install debugpy neovim pillow
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Flags.PowershellEnabled)
|
||||||
|
{
|
||||||
|
Write-Divider
|
||||||
|
Write-Host "Installing Powershell Packages"
|
||||||
|
## Git posh
|
||||||
|
Install-Module posh-git -Scope CurrentUser -Force
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Flags.FontsEnabled)
|
||||||
|
{
|
||||||
|
Write-Divider
|
||||||
|
Write-Host "Installing Fonts"
|
||||||
|
Set-Location ~
|
||||||
|
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.4.0/JetBrainsMono.zip
|
||||||
|
mkdir ~\fonts
|
||||||
|
Copy-Item ~\JetBrainsMono.zip ~\fonts\JetBrainsMono.zip
|
||||||
|
Set-Location ~\fonts | Out-Null
|
||||||
|
unzip JetBrainsMono.zip
|
||||||
|
Remove-Item JetBrainsMono.zip
|
||||||
|
$FontsPath = "$HOME\fonts"
|
||||||
|
|
||||||
|
$shell = New-Object -ComObject Shell.Application
|
||||||
|
$fonts = $shell.Namespace(0x14)
|
||||||
|
|
||||||
|
Get-ChildItem $FontsPath -Include *.ttf,*.otf -File | ForEach-Object {
|
||||||
|
$fonts.CopyHere($_.FullName)
|
||||||
|
}
|
||||||
|
Set-Location ~
|
||||||
|
Remove-Item ~\fonts -Force -Recurse| Out-Null
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($Flags.WallpaperEnabled)
|
||||||
|
{
|
||||||
|
Write-Divider
|
||||||
|
Write-Host "Setting Wallpaper"
|
||||||
|
Add-Type @"
|
||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
public class Wallpaper {
|
||||||
|
[DllImport("user32.dll", SetLastError = true)]
|
||||||
|
public static extern bool SystemParametersInfo(
|
||||||
|
int uAction, int uParam, string lpvParam, int fuWinIni);
|
||||||
|
}
|
||||||
|
"@ -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
[Wallpaper]::SystemParametersInfo(20, 0, "$HOME\wallpaper.png", 0x03) | Out-Null
|
||||||
|
}
|
||||||
|
Write-Divider
|
||||||
|
Write-Host "Done!"
|
||||||
|
|||||||
Reference in New Issue
Block a user