From 90d771556077202c900fde88c2610a10e0ead4a9 Mon Sep 17 00:00:00 2001 From: JOLIMAITRE Matthieu Date: Thu, 7 Mar 2024 20:37:08 +0100 Subject: [PATCH] fix chroot, config and add configs --- profile/airootfs/etc/pacman.conf | 97 ++++++++++++++++++ .../home/.config/Code/User/settings.json | 4 + .../content/home/{ => .config}/dconf/user | Bin profile/airootfs/root/content/lightdm.conf | 13 +++ profile/airootfs/root/content/loader.conf | 2 + profile/airootfs/root/post_install.sh | 33 +++--- profile/airootfs/root/user_configuration.json | 8 +- src/iso_root | 1 + 8 files changed, 145 insertions(+), 13 deletions(-) create mode 100644 profile/airootfs/etc/pacman.conf create mode 100644 profile/airootfs/root/content/home/.config/Code/User/settings.json rename profile/airootfs/root/content/home/{ => .config}/dconf/user (100%) create mode 100644 profile/airootfs/root/content/lightdm.conf create mode 100644 profile/airootfs/root/content/loader.conf create mode 120000 src/iso_root diff --git a/profile/airootfs/etc/pacman.conf b/profile/airootfs/etc/pacman.conf new file mode 100644 index 0000000..69d2496 --- /dev/null +++ b/profile/airootfs/etc/pacman.conf @@ -0,0 +1,97 @@ +# +# /etc/pacman.conf +# +# See the pacman.conf(5) manpage for option and repository directives + +# +# GENERAL OPTIONS +# +[options] +# The following paths are commented out with their default values listed. +# If you wish to use different paths, uncomment and update the paths. +#RootDir = / +#DBPath = /var/lib/pacman/ +#CacheDir = /var/cache/pacman/pkg/ +#LogFile = /var/log/pacman.log +#GPGDir = /etc/pacman.d/gnupg/ +#HookDir = /etc/pacman.d/hooks/ +HoldPkg = pacman glibc +#XferCommand = /usr/bin/curl -L -C - -f -o %o %u +#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u +#CleanMethod = KeepInstalled +Architecture = auto + +# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup +#IgnorePkg = +#IgnoreGroup = + +#NoUpgrade = +#NoExtract = + +# Misc options +#UseSyslog +Color +#NoProgressBar +# CheckSpace +#VerbosePkgLists +ParallelDownloads = 5 + +# By default, pacman accepts packages signed by keys that its local keyring +# trusts (see pacman-key and its man page), as well as unsigned packages. +SigLevel = Never +LocalFileSigLevel = Optional +#RemoteFileSigLevel = Required + +# NOTE: You must run `pacman-key --init` before first using pacman; the local +# keyring can then be populated with the keys of all official Arch Linux +# packagers with `pacman-key --populate archlinux`. + +# +# REPOSITORIES +# - can be defined here or included from another file +# - pacman will search repositories in the order defined here +# - local/custom mirrors can be added here or in separate files +# - repositories listed first will take precedence when packages +# have identical names, regardless of version number +# - URLs will have $repo replaced by the name of the current repo +# - URLs will have $arch replaced by the name of the architecture +# +# Repository entries are of the format: +# [repo-name] +# Server = ServerName +# Include = IncludePath +# +# The header [repo-name] is crucial - it must be present and +# uncommented to enable the repo. +# + +# The testing repositories are disabled by default. To enable, uncomment the +# repo name header and Include lines. You can add preferred servers immediately +# after the header, and they will be used before the default mirrors. + +#[core-testing] +#Include = /etc/pacman.d/mirrorlist + +[core] +Include = /etc/pacman.d/mirrorlist + +#[extra-testing] +#Include = /etc/pacman.d/mirrorlist + +[extra] +Include = /etc/pacman.d/mirrorlist + +# If you want to run 32 bit applications on your x86_64 system, +# enable the multilib repositories as required here. + +#[multilib-testing] +#Include = /etc/pacman.d/mirrorlist + +#[multilib] +#Include = /etc/pacman.d/mirrorlist + +# An example of a custom package repository. See the pacman manpage for +# tips on creating your own repositories. +#[custom] +#SigLevel = Optional TrustAll +#Server = file:///home/custompkgs diff --git a/profile/airootfs/root/content/home/.config/Code/User/settings.json b/profile/airootfs/root/content/home/.config/Code/User/settings.json new file mode 100644 index 0000000..55e9e19 --- /dev/null +++ b/profile/airootfs/root/content/home/.config/Code/User/settings.json @@ -0,0 +1,4 @@ +{ + "security.workspace.trust.enabled": false, + "workbench.colorTheme": "Community Material Theme Darker High Contrast" +} \ No newline at end of file diff --git a/profile/airootfs/root/content/home/dconf/user b/profile/airootfs/root/content/home/.config/dconf/user similarity index 100% rename from profile/airootfs/root/content/home/dconf/user rename to profile/airootfs/root/content/home/.config/dconf/user diff --git a/profile/airootfs/root/content/lightdm.conf b/profile/airootfs/root/content/lightdm.conf new file mode 100644 index 0000000..31e87c1 --- /dev/null +++ b/profile/airootfs/root/content/lightdm.conf @@ -0,0 +1,13 @@ +[Seat:*] +[LightDM] +run-directory=/run/lightdm + +[Seat:*] +greeter-session=lightdm-slick-greeter +user-session=cinnamon +session-wrapper=/etc/lightdm/Xsession +autologin-user=user + +[XDMCPServer] + +[VNCServer] diff --git a/profile/airootfs/root/content/loader.conf b/profile/airootfs/root/content/loader.conf new file mode 100644 index 0000000..96fdb7b --- /dev/null +++ b/profile/airootfs/root/content/loader.conf @@ -0,0 +1,2 @@ +timeout 0 +#console-mode keep diff --git a/profile/airootfs/root/post_install.sh b/profile/airootfs/root/post_install.sh index 99016cf..050183f 100644 --- a/profile/airootfs/root/post_install.sh +++ b/profile/airootfs/root/post_install.sh @@ -4,6 +4,7 @@ alias log='echo [post_install.sh]' ROOT=/mnt/archinstall +export HOME=/home/user log "clearing caches" @@ -13,6 +14,8 @@ log "clearing caches" log "altering linux confs" cp content/sudoers "$ROOT/etc/sudoers" cp content/pacman.conf "$ROOT/etc/pacman.conf" + cp content/lightdm.conf "$ROOT/etc/lightdm/lightdm.conf" + cp content/loader.conf "$ROOT/boot/loader/loader.conf" log "configuring network" @@ -21,7 +24,7 @@ log "configuring network" echo " sudo systemctl enable systemd-networkd.service sudo systemctl enable systemd-resolved.service - " | arch-chroot "$ROOT" su user + " | arch-chroot -u user "$ROOT" log "installing paru" @@ -30,21 +33,29 @@ log "installing paru" git clone https://aur.archlinux.org/paru-bin.git cd paru-bin makepkg -si - " | arch-chroot "$ROOT" su user + " | arch-chroot -u user "$ROOT" cp content/paru.conf "$ROOT/etc/paru.conf" log "installing extra packages" echo " - paru -Sy --noconfirm tealdeer nnn-nerd ttf-ms-fonts discord visual-studio-code-bin opam - " | arch-chroot "$ROOT" su user + paru -Sy --noconfirm tealdeer nnn-nerd ttf-ms-fonts discord visual-studio-code-bin opam ttf-firacode-nerd + " | arch-chroot -u user "$ROOT" + + +log "clearing caches" + rm -fr "$ROOT/home/user/.cache" + rm -fr "$ROOT/var/cache/" log "configuring extra packages" echo ' sudo systemctl enable lightdm.service + sudo groupadd autologin + sudo usermod --append --groups=autologin user opam init --yes - ' | arch-chroot "$ROOT" su user + opam install --yes ocaml-lsp-server dune + ' | arch-chroot -u user "$ROOT" log "configuring home" @@ -52,24 +63,22 @@ log "configuring home" cd sudo chsh --shell=/bin/zsh user true | sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" - ' | arch-chroot "$ROOT" su user - + ' | arch-chroot -u user "$ROOT" cp -r content/home/* content/home/.* "$ROOT/home/user/" echo ' - cd + cd /home/user/ sudo chown -R user:user . - ' | arch-chroot "$ROOT" su user + ' | arch-chroot -u user "$ROOT" + echo ' git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-completions ${ZSH_CUSTOM:-${ZSH:-~/.oh-my-zsh}/custom}/plugins/zsh-completions git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting ' | arch-chroot -u user "$ROOT" zsh - echo ' for ext in eamodio.gitlens Equinusocio.vsc-community-material-theme Equinusocio.vsc-material-theme equinusocio.vsc-material-theme-icons ms-dotnettools.csharp ms-python.isort ms-python.python ms-python.vscode-pylance ms-vscode.cpptools ocamllabs.ocaml-platform rust-lang.rust-analyzer usernamehw.errorlens VisualStudioExptTeam.intellicode-api-usage-examples VisualStudioExptTeam.vscodeintellicode do code --install-extension $ext done - - ' | arch-chroot "$ROOT" su user + ' | arch-chroot -u user "$ROOT" diff --git a/profile/airootfs/root/user_configuration.json b/profile/airootfs/root/user_configuration.json index 817644d..d9c36a4 100644 --- a/profile/airootfs/root/user_configuration.json +++ b/profile/airootfs/root/user_configuration.json @@ -131,7 +131,13 @@ "virtualbox-guest-utils", "lightdm-slick-greeter", "cinnamon", - "gnome-terminal" + "gnome-terminal", + "zsh", + "wget", + "nano", + "less", + "bat", + "noto-fonts" ], "parallel downloads": 0, "profile_config": { diff --git a/src/iso_root b/src/iso_root new file mode 120000 index 0000000..02b80cf --- /dev/null +++ b/src/iso_root @@ -0,0 +1 @@ +../profile/airootfs/root \ No newline at end of file