Compare commits

..

23 commits

Author SHA1 Message Date
Manuel Thalmann 692c2157fd Configure Surface Touchpad by default 2024-09-20 02:23:09 +02:00
Manuel Thalmann 2eb471e820 Add scripts for handling HiDPI 2024-09-20 02:07:32 +02:00
Manuel Thalmann 40e5738453 Add scripts for installing drivers 2024-09-20 02:01:22 +02:00
Manuel Thalmann 2e006c7dbe Install bt-dualboot for dualboot systems 2024-09-20 01:39:52 +02:00
Manuel Thalmann 3570233a2d Allow enabling Secure Boot 2024-09-20 00:56:56 +02:00
Manuel Thalmann 03f7a80193 Only ask for logout when applicable 2024-09-19 23:48:29 +02:00
Manuel Thalmann cd3e603a45 Allow configuring the hostname 2024-09-19 23:45:19 +02:00
Manuel Thalmann 8a4e7919da Reboot system after installation 2024-09-19 22:29:50 +02:00
Manuel Thalmann dffdc87d99 Keep all variables during installation 2024-09-19 22:29:34 +02:00
Manuel Thalmann b172d0291b Instruct user to log out 2024-09-19 22:27:44 +02:00
Manuel Thalmann cc083e15e4 Exclude rclone directory from indexing 2024-09-19 22:26:06 +02:00
Manuel Thalmann 20826fd8e5 Add module import scripts globally 2024-09-19 22:25:48 +02:00
Manuel Thalmann bb55434659 Allow configuring vscode for any user 2024-09-19 22:24:58 +02:00
Manuel Thalmann d3dcddab08 Make zoxide installation cross platform 2024-09-19 22:24:36 +02:00
Manuel Thalmann 9e2a8473e1 Run rclone user config script in Plasma 2024-09-19 22:23:45 +02:00
Manuel Thalmann ce7acef1f7 Add scripts for installing PS modules 2024-09-19 22:20:59 +02:00
Manuel Thalmann 79fcb9062d Configure git for Linux users properly 2024-09-19 22:00:08 +02:00
Manuel Thalmann a1b6681491 Add aliae support in Linux pwsh 2024-09-19 21:59:37 +02:00
Manuel Thalmann c06a7ed152 Make profile dialogue platform independent 2024-09-19 21:59:01 +02:00
Manuel Thalmann 3c5375002b Configure oh-my-posh on Linux 2024-09-19 21:58:30 +02:00
Manuel Thalmann c67cdc362a Configure aliae for individual Linux users 2024-09-19 21:56:32 +02:00
Manuel Thalmann 03e8a0e5ff Add support for PowerShell conf.d on Linux 2024-09-19 21:53:24 +02:00
Manuel Thalmann 984d03d5dd Refactor the sudo configuration script 2024-09-19 21:23:16 +02:00
17 changed files with 303 additions and 4 deletions

View file

@ -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.";

View file

@ -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 = {

View file

@ -72,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;
};
};
};
}

View file

@ -6,6 +6,7 @@
config = {
valhalla = {
hostname = lib.mkDefault "der-geret";
linux.secureBoot = true;
windows = {
dualboot = {
@ -40,6 +41,7 @@
"Predator Z301C"
];
xoneReceiver = true;
eyeX = true;
amdCPU = true;
nvidiaGPU = true;

View file

@ -6,6 +6,14 @@
config = {
valhalla = {
hostname = "manu-surface";
hidpi = true;
linux.secureBoot = true;
hardware = {
surfaceBook = true;
xoneReceiver = true;
};
partition.os.deviceName = "nvme0n1";
};
};

View 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

View 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

View 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

View file

@ -14,7 +14,27 @@ 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 \
@ -256,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 \
@ -267,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

View 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

View 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

View 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

View 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

View file

@ -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"

View file

@ -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

View 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

View 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