-
Notifications
You must be signed in to change notification settings - Fork 0
/
choco.ps1
98 lines (89 loc) · 3.04 KB
/
choco.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Configuration Desktop {
# Import the module that contains the File resource.
Import-DscResource -ModuleName PsDesiredStateConfiguration
Import-DscResource -ModuleName xPSDesiredStateConfiguration
Import-DscResource -ModuleName cChoco
Import-DscResource -ModuleName 'xHyper-V'
# The Node statement specifies which targets to compile MOF files for, when
# this configuration is executed.
Node 'localhost' {
$VhdPath = "C://"
$VMName = "nix_os_vm"
$diskNameOS = "$VMName-DiskOS.vhdx"
$diskNameExtra1 = "$VMName-Disk1.vhdx"
xRemoteFile DownloadFile
{
DestinationPath = "C://nix.iso"
Uri = "https://channels.nixos.org/nixos-23.11/latest-nixos-gnome-x86_64-linux.iso"
UserAgent = [Microsoft.PowerShell.Commands.PSUserAgent]::InternetExplorer
Headers = @{
'Accept-Language' = 'en-US'
}
}
xVHD DiskOS
{
Name = $diskNameOS
Path = $VhdPath
Generation = 'vhdx'
MaximumSizeBytes = 20GB
Ensure = 'Present'
}
xVHD Disk1
{
Name = $diskNameExtra1
Path = $VhdPath
Generation = 'vhdx'
MaximumSizeBytes = 20GB
Ensure = 'Present'
}
xVMHyperV NewVM
{
Ensure = 'Present'
Name = "nix_os_vm"
VhdPath = Join-Path $VhdPath -ChildPath $diskNameOS
Generation = 1
DependsOn = '[xVHD]DiskOS'
}
cChocoPackageInstallerSet installChocoPackages
{
Ensure = 'present'
Name = @(
"7zip.install"
"adobereader"
"alacritty"
"bitwarden"
"discord"
"docker-desktop"
"firefox"
"gcloudsdk"
"gimp"
"git"
"github-desktop"
"libreoffice-fresh"
"miktex"
"nerd-fonts-3270"
"netlogo"
"nodejs"
"nordvpn"
"python"
"r"
"rust"
"steam"
"strawberryperl"
"terraform"
"vscode"
)
}
File alacritty_toml
{
Ensure = "Present" # Ensure the directory is Present on the target node.
Type = "File" # The default is File.
Force = $true
# TODO Change to relative path somehow
SourcePath = "C:\Users\spike\Documents\windows_install_scripts\alacritty.toml"
DestinationPath = "C:\Users\spike\AppData\Roaming\alacritty\alacritty.toml"
checksum = 'modifiedDate'
matchsource = $true
}
}
}