Compare commits
23 commits
a7ba0a907b
...
692c2157fd
Author | SHA1 | Date | |
---|---|---|---|
Manuel Thalmann | 692c2157fd | ||
Manuel Thalmann | 2eb471e820 | ||
Manuel Thalmann | 40e5738453 | ||
Manuel Thalmann | 2e006c7dbe | ||
Manuel Thalmann | 3570233a2d | ||
Manuel Thalmann | 03f7a80193 | ||
Manuel Thalmann | cd3e603a45 | ||
Manuel Thalmann | 8a4e7919da | ||
Manuel Thalmann | dffdc87d99 | ||
Manuel Thalmann | b172d0291b | ||
Manuel Thalmann | cc083e15e4 | ||
Manuel Thalmann | 20826fd8e5 | ||
Manuel Thalmann | bb55434659 | ||
Manuel Thalmann | d3dcddab08 | ||
Manuel Thalmann | 9e2a8473e1 | ||
Manuel Thalmann | ce7acef1f7 | ||
Manuel Thalmann | 79fcb9062d | ||
Manuel Thalmann | a1b6681491 | ||
Manuel Thalmann | c06a7ed152 | ||
Manuel Thalmann | 3c5375002b | ||
Manuel Thalmann | c67cdc362a | ||
Manuel Thalmann | 03e8a0e5ff | ||
Manuel Thalmann | 984d03d5dd |
|
@ -14,6 +14,18 @@
|
|||
default = [];
|
||||
};
|
||||
|
||||
surfaceBook = mkOption {
|
||||
type = types.bool;
|
||||
description = "A value indicating whether the system is a Surface Book 2.";
|
||||
default = false;
|
||||
};
|
||||
|
||||
xoneReceiver = mkOption {
|
||||
type = types.bool;
|
||||
description = "A value indicating whether an Xbox receiver is present.";
|
||||
default = false;
|
||||
};
|
||||
|
||||
eyeX = mkOption {
|
||||
type = types.bool;
|
||||
description = "A value indicating whether a Tobii EyeX device is present.";
|
||||
|
|
|
@ -25,7 +25,20 @@
|
|||
];
|
||||
};
|
||||
|
||||
linuxVariant = osVariant.extendModules { };
|
||||
linuxVariant = osVariant.extendModules {
|
||||
modules = [
|
||||
({ ... }: {
|
||||
options = {
|
||||
secureBoot = mkOption {
|
||||
type = types.bool;
|
||||
description = "A value indicating whether the system supports Secure Boot.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
windowsVariant = osVariant.extendModules { };
|
||||
in {
|
||||
options = {
|
||||
|
|
|
@ -35,6 +35,12 @@
|
|||
};
|
||||
};
|
||||
|
||||
hostname = mkOption {
|
||||
type = types.str;
|
||||
description = "The hostname of the system.";
|
||||
default = "valhalla";
|
||||
};
|
||||
|
||||
setupUser = {
|
||||
name = mkOption {
|
||||
type = types.str;
|
||||
|
@ -66,6 +72,12 @@
|
|||
description = "The X11 keyboard layout of the system.";
|
||||
default = null;
|
||||
};
|
||||
|
||||
hidpi = mkOption {
|
||||
type = types.bool;
|
||||
description = "A value indicating whether the screen is hidpi.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,16 +1,21 @@
|
|||
{ ... }: {
|
||||
{ lib, ... }: {
|
||||
imports = [
|
||||
../defaults.nix
|
||||
];
|
||||
|
||||
config = {
|
||||
valhalla = {
|
||||
hostname = lib.mkDefault "der-geret";
|
||||
linux.secureBoot = true;
|
||||
|
||||
windows = {
|
||||
dualboot = {
|
||||
enable = true;
|
||||
linuxPercentage = 70; # better safe than sorry
|
||||
};
|
||||
|
||||
hostname = "DerGeret";
|
||||
|
||||
users.manuel = {
|
||||
microsoftAccount = true;
|
||||
groups = ["Administrators"];
|
||||
|
@ -36,6 +41,7 @@
|
|||
"Predator Z301C"
|
||||
];
|
||||
|
||||
xoneReceiver = true;
|
||||
eyeX = true;
|
||||
amdCPU = true;
|
||||
nvidiaGPU = true;
|
||||
|
|
|
@ -4,6 +4,17 @@
|
|||
];
|
||||
|
||||
config = {
|
||||
valhalla.partition.os.deviceName = "nvme0n1";
|
||||
valhalla = {
|
||||
hostname = "manu-surface";
|
||||
hidpi = true;
|
||||
linux.secureBoot = true;
|
||||
|
||||
hardware = {
|
||||
surfaceBook = true;
|
||||
xoneReceiver = true;
|
||||
};
|
||||
|
||||
partition.os.deviceName = "nvme0n1";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
35
scripts/Arch/Config/SecureBoot/main.fish
Executable file
35
scripts/Arch/Config/SecureBoot/main.fish
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW -V dir
|
||||
yayinst secureboot-grub
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
source "$dir/../../../Common/Scripts/config.fish"
|
||||
set -l label (getConfig valhalla.boot.label)
|
||||
set -l efiDir (getConfig valhalla.boot.efiMountPoint)
|
||||
set -l bootNums (efibootmgr | sed "/$label/{ s/^.*Boot\([[:digit:]]\+\)\*.*\$/\1/; p; }; d")
|
||||
|
||||
for bootNum in $bootNums
|
||||
sudo efibootmgr --delete-bootnum --bootnum $bootNum
|
||||
end
|
||||
|
||||
sudo sed -i \
|
||||
-e "/esp=/{" \
|
||||
-e "a esp=\"$efiDir\"" \
|
||||
-e "d" \
|
||||
-e "}" \
|
||||
-e "/bootloader_id=/{" \
|
||||
-e "a bootloader_id=\"$label\"" \
|
||||
-e "d" \
|
||||
-e "}" \
|
||||
/etc/secureboot.conf
|
||||
|
||||
sudo secure-grub-install
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
44
scripts/Arch/Drivers/Surface/main.fish
Executable file
44
scripts/Arch/Drivers/Surface/main.fish
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW -V dir
|
||||
set -l repo "linux-surface"
|
||||
set -l file "/etc/pacman.conf"
|
||||
|
||||
curl -s https://raw.githubusercontent.com/linux-surface/linux-surface/master/pkg/keys/surface.asc \
|
||||
| sudo pacman-key --add -
|
||||
|
||||
sudo pacman-key --finger 56C464BAAC421453
|
||||
sudo pacman-key --lsign-key 56C464BAAC421453
|
||||
|
||||
if ! grep "^\[$repo\]\$" $file
|
||||
begin
|
||||
printf %s\n \
|
||||
"" \
|
||||
"[$repo]" \
|
||||
"Server = https://pkg.surfacelinux.com/arch/"
|
||||
end | sudo tee -a $file > /dev/null
|
||||
|
||||
sudo pacinst
|
||||
|
||||
sudo pacinst \
|
||||
intel-ucode \
|
||||
linux-surface \
|
||||
linux-surface-headers \
|
||||
linux-surface-secureboot-mok \
|
||||
iptsd \
|
||||
linux-firmware-marvell
|
||||
|
||||
yes | runYay libwacom-surface
|
||||
yayinst libcamera-git
|
||||
end
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../Software/GRUB/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
26
scripts/Arch/Drivers/SurfaceBook2/main.fish
Executable file
26
scripts/Arch/Drivers/SurfaceBook2/main.fish
Executable file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW -V dir
|
||||
yayinst \
|
||||
surface-dtx-daemon-bin \
|
||||
surface-control-bin
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
begin
|
||||
printf %s\n \
|
||||
"# vim:set ft=sh" \
|
||||
"MODULES+=(pinctrl_sunrisepoint surface_dtx)"
|
||||
end | sudo tee /etc/mkinitcpio.conf.d/surface-book-2.conf > /dev/null
|
||||
|
||||
fish "$dir/../../../Common/Drivers/SurfaceBook2/main.fish" configure
|
||||
sudo systemctl enable surface-dtx-daemon.service
|
||||
sudo systemctl enable --global surface-dtx-userd.service
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
fish "$dir/../Surface/main.fish" $argv
|
||||
end
|
|
@ -17,10 +17,12 @@ begin
|
|||
and source "$dir/../Software/pacman/main.fish"
|
||||
and source "$dir/../Software/yay/main.fish"
|
||||
|
||||
and source "$dir/../Software/PowerShell/main.fish"
|
||||
|
||||
and yayinst \
|
||||
linux-headers \
|
||||
pacman-contrib \
|
||||
powershell-bin
|
||||
yq
|
||||
end
|
||||
|
||||
source "$dir/../../Common/OS/install.fish"
|
||||
|
|
|
@ -11,7 +11,7 @@ begin
|
|||
end
|
||||
|
||||
function installValhallaDeps -V mountDir
|
||||
pacstrap -K "$mountDir" fish git jq nix tmux
|
||||
pacstrap -K "$mountDir" fish git jq nix sudo tmux
|
||||
end
|
||||
|
||||
function getInstallerScript -V dir -S
|
||||
|
@ -86,11 +86,10 @@ begin
|
|||
true
|
||||
end
|
||||
|
||||
and echo "$ARCH_HOSTNAME" | arch-chroot "$mountDir" tee /etc/hostname > /dev/null
|
||||
and echo (getConfig valhalla.hostname) | arch-chroot "$mountDir" tee /etc/hostname > /dev/null
|
||||
|
||||
and arch-chroot "$mountDir" mkinitcpio -P
|
||||
and runHook installDrivers "Installing drivers..." || true
|
||||
and arch-chroot "$mountDir" bash "$tempDir/../Software/sudo/install.sh"
|
||||
and runInOS fish "$tempDir/../Software/GRUB/main.fish"
|
||||
|
||||
and if set -l keyLayout (getConfig valhalla.keyboardLayout)
|
||||
|
|
|
@ -14,14 +14,33 @@ function deploySoftware -d "Deploys a the specified software action" -a action
|
|||
end
|
||||
)
|
||||
|
||||
if collectionActive essential
|
||||
if isEnabled valhalla.linux.secureBoot
|
||||
source "$dir/../Config/SecureBoot/main.fish" $argv
|
||||
end
|
||||
|
||||
and if isEnabled valhalla.linux.hardware.surfaceBook
|
||||
source "$dir/../Drivers/SurfaceBook2/main.fish" $argv
|
||||
end
|
||||
|
||||
and if isEnabled valhalla.linux.hardware.nvidiaGPU
|
||||
source "$dir/../Software/nvidia-dkms/main.fish" $argv
|
||||
end
|
||||
|
||||
and if isEnabled valhalla.linux.hardware.xoneReceiver
|
||||
source "$dir/../Software/xone/main.fish" $argv
|
||||
end
|
||||
|
||||
and if isEnabled valhalla.windows.dualboot.enable && $isInstall
|
||||
yayinst bt-dualboot
|
||||
end
|
||||
|
||||
and if collectionActive essential
|
||||
if $isInstall
|
||||
yayinst \
|
||||
mkinitcpio-firmware \
|
||||
neofetch \
|
||||
bash-completion \
|
||||
wget \
|
||||
oh-my-posh-bin \
|
||||
screen \
|
||||
tmux \
|
||||
htop \
|
||||
|
@ -36,6 +55,8 @@ function deploySoftware -d "Deploys a the specified software action" -a action
|
|||
end
|
||||
|
||||
and source "$dir/../../Common/Software/bash/main.fish" $argv
|
||||
and source "$dir/../Software/sudo/main.fish" $argv
|
||||
and source "$dir/../Software/Oh My Posh/main.fish" $argv
|
||||
and source "$dir/../Software/openssh/main.fish" $argv
|
||||
and source "$dir/../Software/vim/main.fish" $argv
|
||||
and source "$dir/../Software/git/main.fish" $argv
|
||||
|
@ -255,7 +276,6 @@ function deploySoftware -d "Deploys a the specified software action" -a action
|
|||
and if collectionActive gaming
|
||||
if $isInstall
|
||||
yayinst \
|
||||
steam \
|
||||
chiaki-ng \
|
||||
osu-lazer-bin \
|
||||
libretro \
|
||||
|
@ -266,6 +286,7 @@ function deploySoftware -d "Deploys a the specified software action" -a action
|
|||
end
|
||||
|
||||
and source "$dir/../Software/Lutris/main.fish" $argv
|
||||
and source "$dir/../Software/steam/main.fish" $argv
|
||||
end
|
||||
|
||||
and if collectionActive essential && $isInstall
|
||||
|
|
20
scripts/Arch/Software/Oh My Posh/main.fish
Executable file
20
scripts/Arch/Software/Oh My Posh/main.fish
Executable file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/Oh My Posh/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW
|
||||
yayinst oh-my-posh-bin
|
||||
end
|
||||
|
||||
function configureSW -V base
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -S -V base -a name
|
||||
fish "$base" userConfig $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
15
scripts/Arch/Software/PowerShell/main.fish
Executable file
15
scripts/Arch/Software/PowerShell/main.fish
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW
|
||||
yayinst powershell-bin
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/PowerShell/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/aliae/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW
|
||||
|
@ -8,8 +9,12 @@ begin
|
|||
aliae-bin
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/aliae/main.fish" configure
|
||||
function configureSW -V base
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -V base
|
||||
fish "$base" userConfig $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/git/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW
|
||||
|
@ -13,8 +14,12 @@ begin
|
|||
gitflow-zshcompletion-avh
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/git/main.fish" configure
|
||||
function configureSW -V base
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -V base
|
||||
fish "$base" userConfig $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
17
scripts/Arch/Software/nvidia-dkms/main.fish
Executable file
17
scripts/Arch/Software/nvidia-dkms/main.fish
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW
|
||||
yayinst \
|
||||
nvidia-beta-dkms \
|
||||
lib32-nvidia-utils-beta
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/nvidia-dkms/main.fish" configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
|
@ -1,16 +1,20 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
set -l base "$dir/../../../Common/Software/rclone/main.fish"
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
source "$dir/../../../Common/Software/rclone/main.fish"
|
||||
|
||||
function installSW
|
||||
yayinst \
|
||||
rclone
|
||||
end
|
||||
|
||||
function configureSW -V dir
|
||||
fish "$dir/../../../Common/Software/rclone/main.fish" configure
|
||||
function configureSW -V base
|
||||
fish "$base" configure
|
||||
end
|
||||
|
||||
function userConfig -V base -a name
|
||||
fish "$base" userConfig $argv
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
24
scripts/Arch/Software/steam/main.fish
Normal file
24
scripts/Arch/Software/steam/main.fish
Normal file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW
|
||||
yayinst steam
|
||||
end
|
||||
|
||||
|
||||
function configureSW -V dir
|
||||
. "$dir/../../../Common/Scripts/config.fish"
|
||||
|
||||
if isEnabled valhalla.hidpi
|
||||
begin
|
||||
printf %s\n \
|
||||
"#!/bin/bash" \
|
||||
"export STEAM_FORCE_DESKTOPUI_SCALING=2.0"
|
||||
end | sudo tee /etc/profile.d/steam.sh > /dev/null
|
||||
end
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
15
scripts/Arch/Software/sudo/main.fish
Executable file
15
scripts/Arch/Software/sudo/main.fish
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW
|
||||
pacinst sudo
|
||||
end
|
||||
|
||||
function configureSW
|
||||
echo "%wheel ALL=(ALL:ALL) ALL" | sudo tee /etc/sudoers.d/wheel > /dev/null
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
22
scripts/Arch/Software/xone/main.fish
Executable file
22
scripts/Arch/Software/xone/main.fish
Executable file
|
@ -0,0 +1,22 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW
|
||||
set -l contextRoot (mktemp -d)
|
||||
set -l repo https://github.com/manuth/xone.git
|
||||
yayinst cabextract
|
||||
|
||||
if not dkms status --all | grep xone > /dev/null
|
||||
git clone "$repo" "$contextRoot"
|
||||
sudo env -C "$contextRoot" ./install.sh --release
|
||||
sudo chmod -R a+rx /usr/src/xone*
|
||||
yes "" | sudo xone-get-firmware.sh
|
||||
end
|
||||
|
||||
rm -rf "$contextRoot" > /dev/null
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
13
scripts/Common/Drivers/SurfaceBook2/main.fish
Normal file
13
scripts/Common/Drivers/SurfaceBook2/main.fish
Normal file
|
@ -0,0 +1,13 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function configureSW -V dir
|
||||
. "$dir/../../Software/KDE/input.fish"
|
||||
addInputConfig 1118 2338 "Microsoft Surface Keyboard Touchpad" "NaturalScroll=true"
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
fish "$dir/../Surface/main.fish" $argv
|
||||
end
|
|
@ -14,7 +14,7 @@ if [ (id -u) -eq 0 ]
|
|||
--comment "PortValhalla setup user" \
|
||||
--system \
|
||||
--no-user-group \
|
||||
--groups wheel,nix-users \
|
||||
--groups nix-users \
|
||||
--create-home \
|
||||
--uid (getConfig valhalla.setupUser.id --json) \
|
||||
"$name"
|
||||
|
@ -24,7 +24,7 @@ if [ (id -u) -eq 0 ]
|
|||
echo "$name ALL=(ALL:ALL) NOPASSWD: ALL"
|
||||
end > "$sudoConfig"
|
||||
|
||||
and sudo --preserve-env="CONFIG_NAME" --user "$name" "$INSTALLER_SCRIPT"
|
||||
and sudo --preserve-env --set-home --user "$name" "$INSTALLER_SCRIPT"
|
||||
rm "$sudoConfig"
|
||||
userdel -rf "$name"
|
||||
else
|
||||
|
@ -59,4 +59,9 @@ else
|
|||
end
|
||||
|
||||
and runHook postInstall || true
|
||||
echo "The installation finished successfully!"
|
||||
and echo "This machine will reboot in 5 seconds..."
|
||||
and echo "Press CTRL-C to abort..."
|
||||
and sleep 5
|
||||
and systemctl reboot
|
||||
end
|
||||
|
|
|
@ -18,7 +18,7 @@ function runSetup
|
|||
|
||||
if not type -q installValhallaDeps
|
||||
function installValhallaDeps
|
||||
echo 'Please set up the hook `installValhallaDeps` for installing `fish`, `git`, `jq`, `nix` and `tmux`.'
|
||||
echo 'Please set up the hook `installValhallaDeps` for installing `fish`, `git`, `jq`, `nix`, `sudo` and `tmux`.'
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,7 +51,7 @@ $null = New-Module {
|
|||
$profiles = & {
|
||||
. "$PSScriptRoot/SoftwareManagement.ps1";
|
||||
|
||||
if (Test-Command "wsl") {
|
||||
if (-not $IsWindows -or (Test-Command "wsl")) {
|
||||
return Invoke-ConfigScript "getProfiles";
|
||||
} else {
|
||||
return Get-ChildItem "$PSScriptRoot/../../../.config" | ForEach-Object { Split-Path -LeafBase $_ };
|
||||
|
@ -61,16 +61,20 @@ $null = New-Module {
|
|||
$choice = $Host.UI.PromptForChoice(
|
||||
"Select Profile",
|
||||
(& {
|
||||
switch (Get-Stage) {
|
||||
([WindowsInstallerAction]::Backup) {
|
||||
"Which profile do you wish to back up?";
|
||||
}
|
||||
([WindowsInstallerAction]::Install) {
|
||||
"Which profile do you wish to install?";
|
||||
}
|
||||
$null {
|
||||
"Which profile do you wish to set up?";
|
||||
if ($IsWindows) {
|
||||
switch (Get-Stage) {
|
||||
([WindowsInstallerAction]::Backup) {
|
||||
"Which profile do you wish to back up?";
|
||||
}
|
||||
([WindowsInstallerAction]::Install) {
|
||||
"Which profile do you wish to install?";
|
||||
}
|
||||
$null {
|
||||
"Which profile do you wish to set up?";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
"Please select a profile:";
|
||||
}
|
||||
}),
|
||||
(& {
|
||||
|
|
|
@ -25,6 +25,10 @@ function isSet -S -a property
|
|||
not test "$(getConfig "$property" --json)" = "null"
|
||||
end
|
||||
|
||||
function isEnabled -S -a property
|
||||
getConfig "$property" --json | jq --exit-status > /dev/null
|
||||
end
|
||||
|
||||
function collectionActive -S -a name
|
||||
[ "$(getConfig "valhalla.software.$name" --json)" = "true" ]
|
||||
end
|
||||
|
|
19
scripts/Common/Software/KDE/input.fish
Normal file
19
scripts/Common/Software/KDE/input.fish
Normal file
|
@ -0,0 +1,19 @@
|
|||
function addInputConfig -a vendorID productID name
|
||||
set -l file /etc/xdg/kcminputrc
|
||||
set -l statements $argv[4..]
|
||||
|
||||
if [ -z "$statements" ]
|
||||
set statements (cat)
|
||||
end
|
||||
|
||||
if not cat $file | grep "\\[$name\\]" > /dev/null 2>&1
|
||||
begin
|
||||
printf %s\n \
|
||||
(if [ -f $file ] && [ -n (cat $file) ]
|
||||
echo ""
|
||||
end) \
|
||||
"[Libinput][$vendorID][$productID][$name]" \
|
||||
"$statements"
|
||||
end | sudo tee $file > /dev/null
|
||||
end
|
||||
end
|
31
scripts/Common/Software/Oh My Posh/main.fish
Normal file
31
scripts/Common/Software/Oh My Posh/main.fish
Normal file
|
@ -0,0 +1,31 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function configureSW -V dir
|
||||
source "$dir/../bash/profile.fish"
|
||||
source "$dir/../fish/profile.fish"
|
||||
|
||||
begin
|
||||
printf %s\n \
|
||||
'set -x POSH_THEME $POSH_THEME' \
|
||||
"oh-my-posh init fish | source" \
|
||||
"oh-my-posh completion fish | source"
|
||||
end | installFishProfile "oh-my-posh"
|
||||
|
||||
begin
|
||||
printf %s\n \
|
||||
'eval "$(oh-my-posh init bash)"' \
|
||||
'eval "$(oh-my-posh completion bash)"'
|
||||
end | installBashProfile "oh-my-posh"
|
||||
|
||||
sudo -HE pwsh "$dir/Manage.ps1" Configure
|
||||
end
|
||||
|
||||
function userConfig -S -V dir -a name
|
||||
pwsh -CommandWithArgs '& $args[0] ConfigureUser @{ user=$args[1]; }' "$dir/Manage.ps1" $name
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
|
@ -62,7 +62,7 @@ $null = New-Module {
|
|||
$name = $Arguments.Name;
|
||||
|
||||
Add-PowerShellProfileStatement `
|
||||
-DefaultUser `
|
||||
-System `
|
||||
-Category $name `
|
||||
-Script "Import-Module `"$name`";";
|
||||
};
|
||||
|
|
11
scripts/Common/Software/PowerShell/main.fish
Executable file
11
scripts/Common/Software/PowerShell/main.fish
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function configureSW -V dir
|
||||
sudo -HE pwsh "$dir/Manage.ps1" Configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
11
scripts/Common/Software/Terminal-Icons/main.fish
Executable file
11
scripts/Common/Software/Terminal-Icons/main.fish
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW -V dir
|
||||
sudo -HE pwsh "$dir/Manage.ps1"
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
|
@ -38,6 +38,12 @@ begin
|
|||
"aliae completion fish | source"
|
||||
end | installFishProfile "aliae" "aliae"
|
||||
end
|
||||
|
||||
sudo -HE pwsh "$dir/Main.ps1" Configure
|
||||
end
|
||||
|
||||
function userConfig -V dir -a user
|
||||
pwsh -CommandWithArgs '& $args[0] ConfigureUser @{ user=$args[1]; }' "$dir/Main.ps1" $user
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
|
@ -7,7 +7,7 @@ param (
|
|||
. "$PSScriptRoot/../../Scripts/System.ps1";
|
||||
. "$PSScriptRoot/../../Types/InstallerAction.ps1";
|
||||
|
||||
$null = New-Module {
|
||||
& {
|
||||
param(
|
||||
[hashtable] $Parameters
|
||||
)
|
||||
|
|
|
@ -8,7 +8,7 @@ begin
|
|||
end
|
||||
|
||||
function userConfig -S -V dir -a name
|
||||
configureGit "$name"
|
||||
pwsh -CommandWithArgs '& $args[0] ConfigureUser @{ user=$args[1]; }' "$dir/Manage.ps1" $name
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
34
scripts/Common/Software/nvidia-dkms/main.fish
Executable file
34
scripts/Common/Software/nvidia-dkms/main.fish
Executable file
|
@ -0,0 +1,34 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function configureSW -V dir
|
||||
set -l indicator "GRUB_CMDLINE_LINUX_DEFAULT=\""
|
||||
set -l config "nvidia_drm.fbdev=1"
|
||||
|
||||
# According to: https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks
|
||||
begin
|
||||
printf %s\n \
|
||||
"options nvidia NVreg_PreserveVideoMemoryAllocations=1" \
|
||||
"options nvidia NVreg_TemporaryFilePath=/var/tmp"
|
||||
end | sudo tee /etc/modprobe.d/nvidia-power-management.conf > /dev/null
|
||||
|
||||
sudo systemctl enable \
|
||||
nvidia-suspend.service \
|
||||
nvidia-hibernate.service \
|
||||
nvidia-resume.service
|
||||
|
||||
if ! cat /etc/default/grub | grep "$indicator.*$config" > /dev/null
|
||||
sudo sed -i /etc/default/grub \
|
||||
-e "/$indicator/{" \
|
||||
-e "s/\($indicator.*[^ ]\)\(\"\)/\1 \2/" \
|
||||
-e "s/\($indicator.*\)\(\"\)/\1$config\2/" \
|
||||
-e "}"
|
||||
|
||||
fish "$dir/../GRUB/main.fish" configure
|
||||
end
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
11
scripts/Common/Software/posh-git/main.fish
Executable file
11
scripts/Common/Software/posh-git/main.fish
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/env fish
|
||||
begin
|
||||
set -l dir (status dirname)
|
||||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function installSW -V dir
|
||||
sudo -HE pwsh "$dir/Manage.ps1"
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
end
|
|
@ -14,9 +14,32 @@ begin
|
|||
|
||||
if [ (echo "$configs" | jq "length") -gt 0 ]
|
||||
if [ "$XDG_SESSION_TYPE" = "tty" ]
|
||||
set -l sessionPid
|
||||
set -l freeTty
|
||||
set -l service
|
||||
set -l sessionConfig
|
||||
set -l welcomeConfig ~"$name"/.config/plasma-welcomerc
|
||||
set -l entryPoint ~"$name"/.config/autostart/PortValhallaProfile.desktop
|
||||
sudo -u "$name" mkdir -p "$(dirname "$entryPoint")"
|
||||
|
||||
begin
|
||||
set -l file (sudo mktemp)
|
||||
sudo openvt -sw -- bash -c "tty > $(string escape $file)"
|
||||
set freeTty (basename (sudo cat $file))
|
||||
sudo rm $file
|
||||
end
|
||||
|
||||
set service "getty@$freeTty"
|
||||
set sessionConfig "/etc/systemd/system/$service.service.d/autologin.conf"
|
||||
sudo mkdir -p (dirname $sessionConfig)
|
||||
|
||||
begin
|
||||
printf %s\n \
|
||||
"[General]" \
|
||||
"LastSeenVersion=1.0.0" \
|
||||
"ShowUpdatePage=false"
|
||||
end | sudo -u "$name" tee "$welcomeConfig" > /dev/null
|
||||
|
||||
begin
|
||||
printf %s\n \
|
||||
"#!/user/bin/env xdg-open" \
|
||||
|
@ -26,20 +49,41 @@ begin
|
|||
"Terminal=false" (
|
||||
printf "%s " \
|
||||
"Exec=env" \
|
||||
"VALHALLA_REQUEST_LOGOUT=1" \
|
||||
"CONFIG_NAME=$(echo "$CONFIG_NAME" | string escape)" \
|
||||
"konsole -e fish $(realpath (status filename) | string escape) userConfig"
|
||||
)
|
||||
end | sudo -u "$name" tee "$entryPoint" > /dev/null
|
||||
|
||||
sudo chmod +x "$entryPoint"
|
||||
sudo -Eu "$name" dbus-launch --exit-with-session startplasma-wayland &> /dev/null
|
||||
rm "$entryPoint"
|
||||
rm ~"$name"/.config/plasma-welcomerc
|
||||
|
||||
begin
|
||||
printf %s\n \
|
||||
"[Service]" \
|
||||
"ExecStart=" \
|
||||
"ExecStart=-/sbin/agetty -o '-p -f -- \\u' --noclear --autologin $name %I \$TERM"
|
||||
end | sudo tee "$sessionConfig" > /dev/null
|
||||
|
||||
sudo systemctl daemon-reload
|
||||
sudo systemctl restart $service
|
||||
|
||||
while [ -z "$sessionPid" ]
|
||||
set sessionPid (sudo pgrep -t $freeTty -u "$name")
|
||||
end
|
||||
|
||||
sudo openvt -sw -- sudo -u "$name" env (sudo cat /proc/$sessionPid/environ | string split0) /usr/lib/plasma-dbus-run-session-if-needed startplasma-wayland
|
||||
sudo rm "$entryPoint"
|
||||
sudo rm "$welcomeConfig"
|
||||
sudo rm "$sessionConfig"
|
||||
sudo rmdir (dirname "$sessionConfig")
|
||||
sudo systemctl daemon-reload
|
||||
else if [ -n "$name" ] && [ "$name" != "$USER" ]
|
||||
sudo -Eu "$name" CONFIG_NAME="$CONFIG_NAME" fish "$(status filename)" userConfig
|
||||
else
|
||||
systemctl --user enable rclone.service
|
||||
echo "Please complete the setup of your rclone configurations!"
|
||||
mkdir -p ~/.mnt
|
||||
touch ~/.mnt/.trackerignore
|
||||
|
||||
for config in (echo "$configs" | jq '.[]' --raw-output0 | string split0)
|
||||
set -l configKey "$key.$config"
|
||||
|
@ -55,6 +99,12 @@ begin
|
|||
rclone config || true
|
||||
systemctl --user enable "$serviceName" --now || true
|
||||
end
|
||||
|
||||
echo "rclone was configured successfully!"
|
||||
|
||||
if [ -n "$VALHALLA_REQUEST_LOGOUT" ]
|
||||
read -P "Please log out"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ begin
|
|||
source "$dir/../../Scripts/software.fish"
|
||||
|
||||
function userConfig -V dir -a name
|
||||
pwsh "$dir/Main.ps1" ConfigureUser;
|
||||
pwsh -CommandWithArgs '& $args[0] ConfigureUser @{ user=$args[1]; }' "$dir/Main.ps1" $user
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
19
scripts/Common/Software/zoxide/Main.ps1
Normal file
19
scripts/Common/Software/zoxide/Main.ps1
Normal file
|
@ -0,0 +1,19 @@
|
|||
param(
|
||||
$Action,
|
||||
[hashtable] $Arguments
|
||||
)
|
||||
|
||||
. "$PSScriptRoot/../../Scripts/Software.ps1";
|
||||
. "$PSScriptRoot/../PowerShell/Profile.ps1";
|
||||
|
||||
Start-SoftwareInstaller @PSBoundParameters `
|
||||
-Configurator {
|
||||
Add-PowerShellProfileStatement `
|
||||
-System `
|
||||
-Category "zoxide" `
|
||||
-Script (
|
||||
@(
|
||||
"# zoxide",
|
||||
(Get-ScriptInitializer "zoxide init powershell | Out-String")
|
||||
) -join [System.Environment]::NewLine);
|
||||
};
|
|
@ -8,7 +8,7 @@ begin
|
|||
source "$dir/../fish/profile.fish"
|
||||
echo 'eval "$(zoxide init bash)"' | installBashProfile "zoxide"
|
||||
echo "zoxide init fish | source" | installFishProfile "zoxide"
|
||||
sudo pwsh -NoProfile "$dir/install.ps1"
|
||||
sudo -HE pwsh -NoProfile "$dir/Main.ps1" Configure
|
||||
end
|
||||
|
||||
runInstaller $argv
|
||||
|
|
|
@ -8,7 +8,6 @@ function Start-Setup {
|
|||
$Global:InformationPreference = "Continue";
|
||||
$Global:ErrorActionPreference = "Inquire";
|
||||
$env:CONFIG_NAME ??= $ConfigurationName;
|
||||
$null = $env:WIN_COMPUTER_NAME;
|
||||
$null = $env:SETUP_SCRIPT_NAME ??= "$PSScriptRoot/Install.ps1";
|
||||
$env:WSLENV = "CONFIG_NAME";
|
||||
|
||||
|
@ -218,7 +217,7 @@ function Start-Setup {
|
|||
|
||||
# Adjust unattended settings
|
||||
$computerName = (Get-Component (Get-PassSettings "specialize") "Microsoft-Windows-Shell-Setup").SelectSingleNode("./ua:ComputerName", $namespace);
|
||||
$computerName.InnerText = "$env:WIN_COMPUTER_NAME";
|
||||
$computerName.InnerText = $valhallaConfig.hostname;
|
||||
|
||||
# Execute corresponding installer script after startup
|
||||
$oobeSettings = (Get-Component (Get-PassSettings "oobeSystem") "Microsoft-Windows-Shell-Setup");
|
||||
|
|
|
@ -3,25 +3,30 @@ param(
|
|||
[hashtable] $Arguments
|
||||
)
|
||||
|
||||
. "$PSScriptRoot/../../../Common/Software/PowerShell/Profile.ps1";
|
||||
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
||||
& {
|
||||
param(
|
||||
[hashtable] $Parameters
|
||||
)
|
||||
|
||||
Start-SoftwareInstaller @PSBoundParameters `
|
||||
-Installer {
|
||||
param(
|
||||
[scriptblock] $Installer
|
||||
)
|
||||
. "$PSScriptRoot/../../../Common/Software/PowerShell/Profile.ps1";
|
||||
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
||||
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
|
||||
$base = "$PSScriptRoot/../../../Common/Software/zoxide/Main.ps1";
|
||||
|
||||
Install-ChocoPackage zoxide;
|
||||
Install-WingetPackage junegunn.fzf;
|
||||
} `
|
||||
-Configurator {
|
||||
Add-PowerShellProfileStatement `
|
||||
-System `
|
||||
-Category "zoxide" `
|
||||
-Script (
|
||||
@(
|
||||
"# zoxide",
|
||||
(Get-ScriptInitializer "zoxide init powershell | Out-String")
|
||||
) -join [System.Environment]::NewLine);
|
||||
};
|
||||
Start-SoftwareInstaller @PSBoundParameters `
|
||||
-Installer {
|
||||
param(
|
||||
[scriptblock] $Installer
|
||||
)
|
||||
|
||||
Install-ChocoPackage zoxide;
|
||||
Install-WingetPackage junegunn.fzf;
|
||||
} `
|
||||
-Configurator {
|
||||
param(
|
||||
$Arguments
|
||||
)
|
||||
|
||||
& $base ([InstallerAction]::ConfigureUser) @PSBoundParameters;
|
||||
};
|
||||
} $PSBoundParameters;
|
||||
|
|
Loading…
Reference in a new issue