class Getch::Config::Gentoo

Public Class Methods

new() click to toggle source
# File lib/getch/config/gentoo.rb, line 4
def initialize
  @systemd_net_dir = "#{MOUNTPOINT}/etc/systemd"
end

Public Instance Methods

dns() click to toggle source
# File lib/getch/config/gentoo.rb, line 40
def dns
  conf = "#{@systemd_net_dir}/resolved.conf.d/dns_over_tls.conf"
  datas = [
    "[Resolve]",
    "DNS=9.9.9.9#dns.quad9.net",
    "DNSOverTLS=yes",
    "",
  ]
  Helpers::create_dir("#{@systemd_net_dir}/resolved.conf.d")
  File.write(conf, datas.join("\n"), mode: 'w')

  Getch::Chroot.new('systemctl enable systemd-networkd').run!
  Getch::Chroot.new('systemctl enable systemd-resolved').run!
end
ethernet() click to toggle source
# File lib/getch/config/gentoo.rb, line 8
def ethernet
  conf = "#{@systemd_net_dir}/network/20-ethernet.network"
  datas = [
    "[Match]",
    "Name=en*",
    "Name=eth*",
    "[Network]",
    "DHCP=yes",
    "IPv6PrivacyExtensions=yes",
    "[DHCP]",
    "RouteMetric=512",
    "",
  ]
  File.write(conf, datas.join("\n"), mode: 'w')
end
shell() click to toggle source
# File lib/getch/config/gentoo.rb, line 55
def shell
end
wifi() click to toggle source
# File lib/getch/config/gentoo.rb, line 24
def wifi
  conf = "#{@systemd_net_dir}/network/20-wireless.network"
  datas = [
    "[Match]",
    "Name=wlp*",
    "Name=wlan*",
    "[Network]",
    "DHCP=yes",
    "IPv6PrivacyExtensions=yes",
    "[DHCP]",
    "RouteMetric=1024",
    "",
  ]
  File.write(conf, datas.join("\n"), mode: 'w')
end