Exemple #1
0
def diskSetup():
  cprint('The following disks are available')
  cmd('lsblk')
  cprint('END')

  disk = input('Which disk should I install to? ex: sdX: ')
  diskToInstallTo = f'/dev/{disk}'

  cprint('Wiping the disk...')
  cmd(f'wipefs -a {diskToInstallTo}')

  partedDisk = parted(diskToInstallTo)
  partedDisk('mklabel gpt')
  partedDisk(f'mkpart primary fat32 {UEFI_FROM}MB {UEFI_TO}MB')
  partedDisk('set 1 esp on')
  partedDisk(f'mkpart primary ext4 {UEFI_TO}MiB 100%')

  cprint('The final partition is as follows:')
  partedDisk('print')
  input('Press enter to continue...')

  nvmeInput = ''
  while nvmeInput not in ['Y', 'n']:
    nvmeInput = input('Installing to nvme? [Y/n]')
    break
  except KeyboardInterrupt:
    raise
Exemple #2
0
def initIntoMnt():
  # Install mirror-lists
  cprint('Updating mirrors')
  cp(rel('various-files/mirrorlist'), '/etc/pacman.d/mirrorlist')

  # Install essential packages
  cprint('Installing essentials')
  cmd('pacstrap /mnt base base-devel linux linux-firmware neovim dhcpcd man-db man-pages intel-ucode grub efibootmgr fish git python python-pip cmake xz pigz lvm2')
Exemple #3
0
def updateAutokeyFolders():
    fileDir = f'{HOME}/.config/autokey'
    fileLocation = f'{fileDir}/autokey.json'
    cmd(f'mkdir -p {fileDir}')
    content = getFileContents(fileLocation)
    jsonContent = json.loads(content)
    jsonContent['folders'] = [f'{HOME}/dotfiles/autokey/my-rebinds']
    resultingContent = json.dumps(jsonContent, indent=4)
    writeFileContent(fileLocation, resultingContent)
Exemple #4
0
def install():
  cmd('yay -S visual-studio-code-bin --noconfirm')
  cmd('mkdir -p $HOME/.config/Code/User/')
  cmd('ln -s $HOME/dotfiles/vscode/*.json $HOME/.config/Code/User/')

  for ext in getExtensions():
    cmd(f'code --install-extension {ext}')
Exemple #5
0
def install():
  user = input('Which user shall I install as: ')
  # Locale and clock syncing
  cmd('loadkeys sv-latin1')
  cmd('timedatectl set-ntp true')

  cryptDevice = diskSetup()
  initIntoMnt()
  generateFStab()
  setupNewSystem()
  setupUsers(user)
  updateMkinitcpio()
  configureGrub(cryptDevice)
  enableMultiLibs()
  cpIntoUserHome(user)
  cprint('DONE!')
  cprint('Restart and run "./dotfiles --arch_post_install"')
Exemple #6
0
def install():
    cmd('./arch_post_install/scripts/post-install.sh')
Exemple #7
0
def updateLockScreenWallpaper():
    cmd('kwriteconfig5 --file kscreenlockerrc --group Greeter --group Wallpaper --group org.kde.image --group General --key Image "file://$HOME/dotfiles/configure_kde/kde_files/wallpaper.jpg"'
        )
Exemple #8
0
def runScript(script):
    cmd(f'qdbus org.kde.plasmashell /PlasmaShell org.kde.PlasmaShell.evaluateScript "$(echo "$(cat {filePath(script)})")"'
        )
Exemple #9
0
 def cryptOpen():
   return cmd(f'cryptsetup open {cryptDisk} cryptlvm')
Exemple #10
0
 def cryptFormat():
   return cmd(f'cryptsetup luksFormat {cryptDisk}')
Exemple #11
0
 def partedOnDisk(command):
   return cmd(f'parted {disk} {command}')
Exemple #12
0
def chroot(command):
  cmd(f'arch-chroot /mnt {command}')
Exemple #13
0
    extra = 'p'

  cprint('Crypto setup')
  cryptDisk = f'{diskToInstallTo}{extra}2'
  def cryptFormat():
    return cmd(f'cryptsetup luksFormat {cryptDisk}')
  runInput(cryptFormat)

  def cryptOpen():
    return cmd(f'cryptsetup open {cryptDisk} cryptlvm')
  runInput(cryptOpen)

  cprint('LVM setup')
  lvmGroupName = 'lvm'
  cryptLvmPath = '/dev/mapper/cryptlvm'
  cmd(f'pvcreate {cryptLvmPath}')
  cmd(f'vgcreate {lvmGroupName} {cryptLvmPath}')
  cmd(f'lvcreate -L {SWAP_SIZE}G {lvmGroupName} --name swap')
  swapDisk = f'/dev/{lvmGroupName}/swap'
  cmd(f'lvcreate -l 100%FREE {lvmGroupName} --name root')
  rootDisk = f'/dev/{lvmGroupName}/root'

  cprint('Formatting')
  cmd(f'mkfs.vfat {diskToInstallTo}{extra}1')
  cmd(f'mkfs.ext4 {rootDisk}')

  cprint('Enabling swap')
  cmd(f'mkswap {swapDisk}')
  cmd(f'swapon {swapDisk}')

  # Mount partitions