aboutsummaryrefslogtreecommitdiff
path: root/install.nu
blob: 56428564fd9478606a4a1c012eb75a8aecd8f549 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env nu

#
# ~~~ portage installer
#

#
# ~~~ variables

# get device
let DEVICE_ID = match (uname | get nodename) {
    "glados" => "010",
    "wheatley" => "020",
    "companioncube" => "110",
    "cavejohnson" => "120",
    _ => { error make -u { msg: "invalid device" } }
}

# get locations
let PORTAGE_DIR = match ($DEVICE_ID) {
    "010" | "020" => $"($env.HOME)/src/portage/src",
    "110" | "120" => $"($env.HOME)/portage/src",
    _ => { error make -u { msg: "unsupported device" } }
}

#
# ~~~ installer

# make.conf
try { rm "/etc/portage/make.conf" }
mv $"($PORTAGE_DIR)/make/($DEVICE_ID)_make.conf" "/etc/portage/make.conf"