deploy: a89ce9ad6a7470e87090025d2d92de7128db5d2b

This commit is contained in:
davegallant
2021-09-26 19:17:27 +00:00
parent 045df839c5
commit d1c7738d7e
2 changed files with 118 additions and 118 deletions

View File

@@ -151,81 +151,81 @@ As of right now, the latest AUR is <code>4.2.2-1</code>.</p>
<p>These steps highlight how to get it working with <code>Python3.8</code> by making a 1 line modification to AppGate source code.</p> <p>These steps highlight how to get it working with <code>Python3.8</code> by making a 1 line modification to AppGate source code.</p>
<h1 id=packaging>Packaging</h1> <h1 id=packaging>Packaging</h1>
<p>We already know the community package is currently out of date, so let&rsquo;s clone it:</p> <p>We already know the community package is currently out of date, so let&rsquo;s clone it:</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>git clone https://aur.archlinux.org/appgate-sdp.git <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>git clone https://aur.archlinux.org/appgate-sdp.git
cd appgate-sdp <span style=color:#366>cd</span> appgate-sdp
</code></pre></div><p>You&rsquo;ll likely notice that the version is not what we want, so let&rsquo;s modify the <code>PKGBUILD</code> to the following:</p> </code></pre></div><p>You&rsquo;ll likely notice that the version is not what we want, so let&rsquo;s modify the <code>PKGBUILD</code> to the following:</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=color:#75715e># Maintainer: Pawel Mosakowski &lt;pawel at mosakowski dot net&gt;</span> <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell><span style=color:#09f;font-style:italic># Maintainer: Pawel Mosakowski &lt;pawel at mosakowski dot net&gt;</span>
pkgname<span style=color:#f92672>=</span>appgate-sdp <span style=color:#033>pkgname</span><span style=color:#555>=</span>appgate-sdp
conflicts<span style=color:#f92672>=(</span><span style=color:#e6db74>&#39;appgate-sdp-headless&#39;</span><span style=color:#f92672>)</span> <span style=color:#033>conflicts</span><span style=color:#555>=(</span><span style=color:#c30>&#39;appgate-sdp-headless&#39;</span><span style=color:#555>)</span>
pkgver<span style=color:#f92672>=</span>4.3.2 <span style=color:#033>pkgver</span><span style=color:#555>=</span>4.3.2
_download_pkgver<span style=color:#f92672>=</span>4.3 <span style=color:#033>_download_pkgver</span><span style=color:#555>=</span>4.3
pkgrel<span style=color:#f92672>=</span><span style=color:#ae81ff>1</span> <span style=color:#033>pkgrel</span><span style=color:#555>=</span><span style=color:#f60>1</span>
epoch<span style=color:#f92672>=</span> <span style=color:#033>epoch</span><span style=color:#555>=</span>
pkgdesc<span style=color:#f92672>=</span><span style=color:#e6db74>&#34;Software Defined Perimeter - GUI client&#34;</span> <span style=color:#033>pkgdesc</span><span style=color:#555>=</span><span style=color:#c30>&#34;Software Defined Perimeter - GUI client&#34;</span>
arch<span style=color:#f92672>=(</span><span style=color:#e6db74>&#39;x86_64&#39;</span><span style=color:#f92672>)</span> <span style=color:#033>arch</span><span style=color:#555>=(</span><span style=color:#c30>&#39;x86_64&#39;</span><span style=color:#555>)</span>
url<span style=color:#f92672>=</span><span style=color:#e6db74>&#34;https://www.cyxtera.com/essential-defense/appgate-sdp/support&#34;</span> <span style=color:#033>url</span><span style=color:#555>=</span><span style=color:#c30>&#34;https://www.cyxtera.com/essential-defense/appgate-sdp/support&#34;</span>
license<span style=color:#f92672>=(</span><span style=color:#e6db74>&#39;custom&#39;</span><span style=color:#f92672>)</span> <span style=color:#033>license</span><span style=color:#555>=(</span><span style=color:#c30>&#39;custom&#39;</span><span style=color:#555>)</span>
<span style=color:#75715e># dependecies calculated by namcap</span> <span style=color:#09f;font-style:italic># dependecies calculated by namcap</span>
depends<span style=color:#f92672>=(</span><span style=color:#e6db74>&#39;gconf&#39;</span> <span style=color:#e6db74>&#39;libsecret&#39;</span> <span style=color:#e6db74>&#39;gtk3&#39;</span> <span style=color:#e6db74>&#39;python&#39;</span> <span style=color:#e6db74>&#39;nss&#39;</span> <span style=color:#e6db74>&#39;libxss&#39;</span> <span style=color:#e6db74>&#39;nodejs&#39;</span> <span style=color:#e6db74>&#39;dnsmasq&#39;</span><span style=color:#f92672>)</span> <span style=color:#033>depends</span><span style=color:#555>=(</span><span style=color:#c30>&#39;gconf&#39;</span> <span style=color:#c30>&#39;libsecret&#39;</span> <span style=color:#c30>&#39;gtk3&#39;</span> <span style=color:#c30>&#39;python&#39;</span> <span style=color:#c30>&#39;nss&#39;</span> <span style=color:#c30>&#39;libxss&#39;</span> <span style=color:#c30>&#39;nodejs&#39;</span> <span style=color:#c30>&#39;dnsmasq&#39;</span><span style=color:#555>)</span>
source<span style=color:#f92672>=(</span><span style=color:#e6db74>&#34;https://sdpdownloads.cyxtera.com/AppGate-SDP-</span><span style=color:#e6db74>${</span>_download_pkgver<span style=color:#e6db74>}</span><span style=color:#e6db74>/clients/</span><span style=color:#e6db74>${</span>pkgname<span style=color:#e6db74>}</span><span style=color:#e6db74>_</span><span style=color:#e6db74>${</span>pkgver<span style=color:#e6db74>}</span><span style=color:#e6db74>_amd64.deb&#34;</span> <span style=color:#033>source</span><span style=color:#555>=(</span><span style=color:#c30>&#34;https://sdpdownloads.cyxtera.com/AppGate-SDP-</span><span style=color:#a00>${</span><span style=color:#033>_download_pkgver</span><span style=color:#a00>}</span><span style=color:#c30>/clients/</span><span style=color:#a00>${</span><span style=color:#033>pkgname</span><span style=color:#a00>}</span><span style=color:#c30>_</span><span style=color:#a00>${</span><span style=color:#033>pkgver</span><span style=color:#a00>}</span><span style=color:#c30>_amd64.deb&#34;</span>
<span style=color:#e6db74>&#34;appgatedriver.service&#34;</span><span style=color:#f92672>)</span> <span style=color:#c30>&#34;appgatedriver.service&#34;</span><span style=color:#555>)</span>
options<span style=color:#f92672>=(</span>staticlibs<span style=color:#f92672>)</span> <span style=color:#033>options</span><span style=color:#555>=(</span>staticlibs<span style=color:#555>)</span>
prepare<span style=color:#f92672>()</span> <span style=color:#f92672>{</span> prepare<span style=color:#555>()</span> <span style=color:#555>{</span>
tar -xf data.tar.xz tar -xf data.tar.xz
<span style=color:#f92672>}</span> <span style=color:#555>}</span>
package<span style=color:#f92672>()</span> <span style=color:#f92672>{</span> package<span style=color:#555>()</span> <span style=color:#555>{</span>
cp -dpr <span style=color:#e6db74>&#34;</span><span style=color:#e6db74>${</span>srcdir<span style=color:#e6db74>}</span><span style=color:#e6db74>&#34;</span>/<span style=color:#f92672>{</span>etc,lib,opt,usr<span style=color:#f92672>}</span> <span style=color:#e6db74>&#34;</span><span style=color:#e6db74>${</span>pkgdir<span style=color:#e6db74>}</span><span style=color:#e6db74>&#34;</span> cp -dpr <span style=color:#c30>&#34;</span><span style=color:#a00>${</span><span style=color:#033>srcdir</span><span style=color:#a00>}</span><span style=color:#c30>&#34;</span>/<span style=color:#555>{</span>etc,lib,opt,usr<span style=color:#555>}</span> <span style=color:#c30>&#34;</span><span style=color:#a00>${</span><span style=color:#033>pkgdir</span><span style=color:#a00>}</span><span style=color:#c30>&#34;</span>
mv -v <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/lib/systemd/system&#34;</span> <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/usr/lib/systemd/&#34;</span> mv -v <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/lib/systemd/system&#34;</span> <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/usr/lib/systemd/&#34;</span>
rm -vrf <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/lib&#34;</span> rm -vrf <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/lib&#34;</span>
cp -v <span style=color:#e6db74>&#34;</span>$srcdir<span style=color:#e6db74>/appgatedriver.service&#34;</span> <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/usr/lib/systemd/system/appgatedriver.service&#34;</span> cp -v <span style=color:#c30>&#34;</span><span style=color:#033>$srcdir</span><span style=color:#c30>/appgatedriver.service&#34;</span> <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/usr/lib/systemd/system/appgatedriver.service&#34;</span>
mkdir -vp <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/usr/share/licenses/appgate-sdp&#34;</span> mkdir -vp <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/usr/share/licenses/appgate-sdp&#34;</span>
cp -v <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/usr/share/doc/appgate/copyright&#34;</span> <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/usr/share/licenses/appgate-sdp&#34;</span> cp -v <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/usr/share/doc/appgate/copyright&#34;</span> <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/usr/share/licenses/appgate-sdp&#34;</span>
cp -v <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/usr/share/doc/appgate/LICENSE.github&#34;</span> <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/usr/share/licenses/appgate-sdp&#34;</span> cp -v <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/usr/share/doc/appgate/LICENSE.github&#34;</span> <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/usr/share/licenses/appgate-sdp&#34;</span>
cp -v <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/usr/share/doc/appgate/LICENSES.chromium.html.bz2&#34;</span> <span style=color:#e6db74>&#34;</span>$pkgdir<span style=color:#e6db74>/usr/share/licenses/appgate-sdp&#34;</span> cp -v <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/usr/share/doc/appgate/LICENSES.chromium.html.bz2&#34;</span> <span style=color:#c30>&#34;</span><span style=color:#033>$pkgdir</span><span style=color:#c30>/usr/share/licenses/appgate-sdp&#34;</span>
<span style=color:#f92672>}</span> <span style=color:#555>}</span>
md5sums<span style=color:#f92672>=(</span><span style=color:#e6db74>&#39;17101aac7623c06d5fbb95f50cf3dbdc&#39;</span> <span style=color:#033>md5sums</span><span style=color:#555>=(</span><span style=color:#c30>&#39;17101aac7623c06d5fbb95f50cf3dbdc&#39;</span>
<span style=color:#e6db74>&#39;002644116e20b2d79fdb36b7677ab4cf&#39;</span><span style=color:#f92672>)</span> <span style=color:#c30>&#39;002644116e20b2d79fdb36b7677ab4cf&#39;</span><span style=color:#555>)</span>
</code></pre></div><p>Let&rsquo;s first make sure we have some dependencies. If you do not have <a href=https://github.com/Jguer/yay>yay</a>, check it out.</p> </code></pre></div><p>Let&rsquo;s first make sure we have some dependencies. If you do not have <a href=https://github.com/Jguer/yay>yay</a>, check it out.</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>yay -S dnsmasq gconf <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>yay -S dnsmasq gconf
</code></pre></div><p>Now, let&rsquo;s install it:</p> </code></pre></div><p>Now, let&rsquo;s install it:</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>makepkg -si <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>makepkg -si
</code></pre></div><h1 id=running-the-client>Running the client</h1> </code></pre></div><h1 id=running-the-client>Running the client</h1>
<p>Ok, let&rsquo;s run the client by executing <code>appgate</code>.</p> <p>Ok, let&rsquo;s run the client by executing <code>appgate</code>.</p>
<p>It complains about not being able to connect.</p> <p>It complains about not being able to connect.</p>
<p>Easy fix:</p> <p>Easy fix:</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>sudo systemctl start appgatedriver.service <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>sudo systemctl start appgatedriver.service
</code></pre></div><p>Now we should be connected&mldr; but DNS is not working?</p> </code></pre></div><p>Now we should be connected&mldr; but DNS is not working?</p>
<h1 id=fixing-the-dns>Fixing the DNS</h1> <h1 id=fixing-the-dns>Fixing the DNS</h1>
<p>Running <code>resolvectl</code> should display that something is not right.</p> <p>Running <code>resolvectl</code> should display that something is not right.</p>
<p>Why is the DNS not being set by appgate?</p> <p>Why is the DNS not being set by appgate?</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>$ head -3 /opt/appgate/linux/set_dns <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>$ head -3 /opt/appgate/linux/set_dns
<span style=color:#75715e>#!/usr/bin/env python3</span> <span style=color:#09f;font-style:italic>#!/usr/bin/env python3</span>
<span style=color:#e6db74>&#39;&#39;</span><span style=color:#960050;background-color:#1e0010>&#39;</span> <span style=color:#c30>&#39;&#39;</span><span style=color:#a00;background-color:#faa>&#39;</span>
This is used to set and unset the DNS. This is used to <span style=color:#366>set</span> and <span style=color:#366>unset</span> the DNS.
</code></pre></div><p>It seems like python3 is required for the DNS setting to happen. </code></pre></div><p>It seems like python3 is required for the DNS setting to happen.
Let&rsquo;s try to run it.</p> Let&rsquo;s try to run it.</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>$ sudo /opt/appgate/linux/set_dns <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>$ sudo /opt/appgate/linux/set_dns
/opt/appgate/linux/set_dns:88: SyntaxWarning: <span style=color:#e6db74>&#34;is&#34;</span> with a literal. Did you mean <span style=color:#e6db74>&#34;==&#34;</span>? /opt/appgate/linux/set_dns:88: SyntaxWarning: <span style=color:#c30>&#34;is&#34;</span> with a literal. Did you mean <span style=color:#c30>&#34;==&#34;</span>?
servers <span style=color:#f92672>=</span> <span style=color:#f92672>[(</span> socket.AF_INET <span style=color:#66d9ef>if</span> x.version is <span style=color:#ae81ff>4</span> <span style=color:#66d9ef>else</span> socket.AF_INET6, map<span style=color:#f92672>(</span>int, x.packed<span style=color:#f92672>))</span> <span style=color:#66d9ef>for</span> x in servers<span style=color:#f92672>]</span> <span style=color:#033>servers</span> <span style=color:#555>=</span> <span style=color:#555>[(</span> socket.AF_INET <span style=color:#069;font-weight:700>if</span> x.version is <span style=color:#f60>4</span> <span style=color:#069;font-weight:700>else</span> socket.AF_INET6, map<span style=color:#555>(</span>int, x.packed<span style=color:#555>))</span> <span style=color:#069;font-weight:700>for</span> x in servers<span style=color:#555>]</span>
Traceback <span style=color:#f92672>(</span>most recent call last<span style=color:#f92672>)</span>: Traceback <span style=color:#555>(</span>most recent call last<span style=color:#555>)</span>:
File <span style=color:#e6db74>&#34;/opt/appgate/linux/set_dns&#34;</span>, line 30, in &lt;module&gt; File <span style=color:#c30>&#34;/opt/appgate/linux/set_dns&#34;</span>, line 30, in &lt;module&gt;
import dbus import dbus
ModuleNotFoundError: No module named <span style=color:#e6db74>&#39;dbus&#39;</span> ModuleNotFoundError: No module named <span style=color:#c30>&#39;dbus&#39;</span>
</code></pre></div><p>Ok, let&rsquo;s install it:</p> </code></pre></div><p>Ok, let&rsquo;s install it:</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>$ sudo python3.8 -m pip install dbus-python <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>$ sudo python3.8 -m pip install dbus-python
</code></pre></div><p>Will it work now? Not yet. There&rsquo;s another issue:</p> </code></pre></div><p>Will it work now? Not yet. There&rsquo;s another issue:</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>$ sudo /opt/appgate/linux/set_dns <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>$ sudo /opt/appgate/linux/set_dns
/opt/appgate/linux/set_dns:88: SyntaxWarning: <span style=color:#e6db74>&#34;is&#34;</span> with a literal. Did you mean <span style=color:#e6db74>&#34;==&#34;</span>? /opt/appgate/linux/set_dns:88: SyntaxWarning: <span style=color:#c30>&#34;is&#34;</span> with a literal. Did you mean <span style=color:#c30>&#34;==&#34;</span>?
servers <span style=color:#f92672>=</span> <span style=color:#f92672>[(</span> socket.AF_INET <span style=color:#66d9ef>if</span> x.version is <span style=color:#ae81ff>4</span> <span style=color:#66d9ef>else</span> socket.AF_INET6, map<span style=color:#f92672>(</span>int, x.packed<span style=color:#f92672>))</span> <span style=color:#66d9ef>for</span> x in servers<span style=color:#f92672>]</span> <span style=color:#033>servers</span> <span style=color:#555>=</span> <span style=color:#555>[(</span> socket.AF_INET <span style=color:#069;font-weight:700>if</span> x.version is <span style=color:#f60>4</span> <span style=color:#069;font-weight:700>else</span> socket.AF_INET6, map<span style=color:#555>(</span>int, x.packed<span style=color:#555>))</span> <span style=color:#069;font-weight:700>for</span> x in servers<span style=color:#555>]</span>
module <span style=color:#e6db74>&#39;platform&#39;</span> has no attribute <span style=color:#e6db74>&#39;linux_distribution&#39;</span> module <span style=color:#c30>&#39;platform&#39;</span> has no attribute <span style=color:#c30>&#39;linux_distribution&#39;</span>
</code></pre></div><p>This is a breaking change in Python3.8.</p> </code></pre></div><p>This is a breaking change in Python3.8.</p>
<p>So what is calling <code>platform.linux_distribution</code>?</p> <p>So what is calling <code>platform.linux_distribution</code>?</p>
<p>Let&rsquo;s search for it:</p> <p>Let&rsquo;s search for it:</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>$ sudo grep -r <span style=color:#e6db74>&#39;linux_distribution&#39;</span> /opt/appgate/linux/ <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>$ sudo grep -r <span style=color:#c30>&#39;linux_distribution&#39;</span> /opt/appgate/linux/
/opt/appgate/linux/nm.py: <span style=color:#66d9ef>if</span> platform.linux_distribution<span style=color:#f92672>()[</span>0<span style=color:#f92672>]</span> !<span style=color:#f92672>=</span> <span style=color:#e6db74>&#39;Fedora&#39;</span>: /opt/appgate/linux/nm.py: <span style=color:#069;font-weight:700>if</span> platform.linux_distribution<span style=color:#555>()[</span>0<span style=color:#555>]</span> !<span style=color:#555>=</span> <span style=color:#c30>&#39;Fedora&#39;</span>:
</code></pre></div><p>Aha! So this is in the local AppGate source code. This should be an easy fix. Let&rsquo;s just replace this line with:</p> </code></pre></div><p>Aha! So this is in the local AppGate source code. This should be an easy fix. Let&rsquo;s just replace this line with:</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-python data-lang=python><span style=color:#66d9ef>if</span> <span style=color:#66d9ef>True</span>: <span style=color:#75715e># Since we are not using Fedora :)</span> <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-python data-lang=python><span style=color:#069;font-weight:700>if</span> <span style=color:#069;font-weight:700>True</span>: <span style=color:#09f;font-style:italic># Since we are not using Fedora :)</span>
</code></pre></div><h1 id=wrapping-up>Wrapping up</h1> </code></pre></div><h1 id=wrapping-up>Wrapping up</h1>
<p>It turns out there are <a href=https://docs.python.org/3.7/library/platform.html#platform.linux_distribution>breaking changes</a> in Python3.8.</p> <p>It turns out there are <a href=https://docs.python.org/3.7/library/platform.html#platform.linux_distribution>breaking changes</a> in Python3.8.</p>
<p>The docs say <code>Deprecated since version 3.5, will be removed in version 3.8: See alternative like the distro package.</code></p> <p>The docs say <code>Deprecated since version 3.5, will be removed in version 3.8: See alternative like the distro package.</code></p>

View File

@@ -159,25 +159,25 @@ lrwxr-xr-x 73 root 31 Dec 1969 /run/current-system/sw/bin/dig -&gt; /nix/store/
<p>⚠️ If you run this on your main machine, make sure you backup your configuration files first. home-manager is pretty good about not overwriting existing configuration, but it is better to have a backup! Alternatively, you could test this out on a VM or cloud instance.</p> <p>⚠️ If you run this on your main machine, make sure you backup your configuration files first. home-manager is pretty good about not overwriting existing configuration, but it is better to have a backup! Alternatively, you could test this out on a VM or cloud instance.</p>
</blockquote> </blockquote>
<p>The first thing you should do is <a href=https://nixos.org/guides/install-nix.html>install nix</a>:</p> <p>The first thing you should do is <a href=https://nixos.org/guides/install-nix.html>install nix</a>:</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>curl -L https://nixos.org/nix/install | sh <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>curl -L https://nixos.org/nix/install | sh
</code></pre></div><p>It&rsquo;s not a good idea to curl and execute files from the internet (without verifying integrity), so you might want to download the install script first and take a peak before executing it!</p> </code></pre></div><p>It&rsquo;s not a good idea to curl and execute files from the internet (without verifying integrity), so you might want to download the install script first and take a peak before executing it!</p>
<p>Open up a new shell in your terminal and running <code>nix</code> <em>should</em> work. If not, run <code>. ~/.nix-profile/etc/profile.d/nix.sh</code></p> <p>Open up a new shell in your terminal and running <code>nix</code> <em>should</em> work. If not, run <code>. ~/.nix-profile/etc/profile.d/nix.sh</code></p>
<p>Now, <a href=https://github.com/nix-community/home-manager#installation>install home-manager</a>:</p> <p>Now, <a href=https://github.com/nix-community/home-manager#installation>install home-manager</a>:</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-shell data-lang=shell>nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update nix-channel --update
nix-shell <span style=color:#e6db74>&#39;&lt;home-manager&gt;&#39;</span> -A install nix-shell <span style=color:#c30>&#39;&lt;home-manager&gt;&#39;</span> -A install
</code></pre></div><p>You should see a wave of <code>/nix/store/*</code> paths being displayed on your screen.</p> </code></pre></div><p>You should see a wave of <code>/nix/store/*</code> paths being displayed on your screen.</p>
<p>Now, to start off with a basic configuration, open up <code>~/.config/nixpkgs/home.nix</code> in the editor of your choice and paste this in (you will want to change <code>userName</code> and <code>homeDirectory</code>):</p> <p>Now, to start off with a basic configuration, open up <code>~/.config/nixpkgs/home.nix</code> in the editor of your choice and paste this in (you will want to change <code>userName</code> and <code>homeDirectory</code>):</p>
<div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-nix data-lang=nix>{ config<span style=color:#f92672>,</span> pkgs<span style=color:#f92672>,</span> <span style=color:#f92672>...</span> }: <div class=highlight><pre tabindex=0 style=background-color:#f0f3f3;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-nix data-lang=nix>{ config<span style=color:#555>,</span> pkgs<span style=color:#555>,</span> <span style=color:#555>...</span> }:
{ {
programs<span style=color:#f92672>.</span>home-manager<span style=color:#f92672>.</span>enable <span style=color:#f92672>=</span> <span style=color:#66d9ef>true</span>; programs<span style=color:#555>.</span>home-manager<span style=color:#555>.</span>enable <span style=color:#555>=</span> <span style=color:#360>true</span>;
home <span style=color:#f92672>=</span> { home <span style=color:#555>=</span> {
username <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;dave&#34;</span>; username <span style=color:#555>=</span> <span style=color:#c30>&#34;dave&#34;</span>;
homeDirectory <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;/home/dave&#34;</span>; homeDirectory <span style=color:#555>=</span> <span style=color:#c30>&#34;/home/dave&#34;</span>;
stateVersion <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;21.11&#34;</span>; stateVersion <span style=color:#555>=</span> <span style=color:#c30>&#34;21.11&#34;</span>;
packages <span style=color:#f92672>=</span> <span style=color:#66d9ef>with</span> pkgs; [ packages <span style=color:#555>=</span> <span style=color:#069;font-weight:700>with</span> pkgs; [
bind bind
exa exa
fd fd
@@ -185,83 +185,83 @@ nix-shell <span style=color:#e6db74>&#39;&lt;home-manager&gt;&#39;</span> -A ins
]; ];
}; };
programs <span style=color:#f92672>=</span> { programs <span style=color:#555>=</span> {
git <span style=color:#f92672>=</span> { git <span style=color:#555>=</span> {
enable <span style=color:#f92672>=</span> <span style=color:#66d9ef>true</span>; enable <span style=color:#555>=</span> <span style=color:#360>true</span>;
aliases <span style=color:#f92672>=</span> { aliases <span style=color:#555>=</span> {
aa <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;add -A .&#34;</span>; aa <span style=color:#555>=</span> <span style=color:#c30>&#34;add -A .&#34;</span>;
br <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;branch&#34;</span>; br <span style=color:#555>=</span> <span style=color:#c30>&#34;branch&#34;</span>;
c <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;commit -S&#34;</span>; c <span style=color:#555>=</span> <span style=color:#c30>&#34;commit -S&#34;</span>;
ca <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;commit -S --amend&#34;</span>; ca <span style=color:#555>=</span> <span style=color:#c30>&#34;commit -S --amend&#34;</span>;
cb <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;checkout -b&#34;</span>; cb <span style=color:#555>=</span> <span style=color:#c30>&#34;checkout -b&#34;</span>;
co <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;checkout&#34;</span>; co <span style=color:#555>=</span> <span style=color:#c30>&#34;checkout&#34;</span>;
d <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;diff&#34;</span>; d <span style=color:#555>=</span> <span style=color:#c30>&#34;diff&#34;</span>;
l <span style=color:#f92672>=</span> l <span style=color:#555>=</span>
<span style=color:#e6db74>&#34;log --graph --pretty=format:&#39;%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset&#39; --abbrev-commit&#34;</span>; <span style=color:#c30>&#34;log --graph --pretty=format:&#39;%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset&#39; --abbrev-commit&#34;</span>;
}; };
delta <span style=color:#f92672>=</span> { delta <span style=color:#555>=</span> {
enable <span style=color:#f92672>=</span> <span style=color:#66d9ef>true</span>; enable <span style=color:#555>=</span> <span style=color:#360>true</span>;
options <span style=color:#f92672>=</span> { options <span style=color:#555>=</span> {
features <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;line-numbers decorations&#34;</span>; features <span style=color:#555>=</span> <span style=color:#c30>&#34;line-numbers decorations&#34;</span>;
whitespace-error-style <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;22 reverse&#34;</span>; whitespace-error-style <span style=color:#555>=</span> <span style=color:#c30>&#34;22 reverse&#34;</span>;
plus-style <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;green bold ul &#39;#198214&#39;&#34;</span>; plus-style <span style=color:#555>=</span> <span style=color:#c30>&#34;green bold ul &#39;#198214&#39;&#34;</span>;
decorations <span style=color:#f92672>=</span> { decorations <span style=color:#555>=</span> {
commit-decoration-style <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;bold yellow box ul&#34;</span>; commit-decoration-style <span style=color:#555>=</span> <span style=color:#c30>&#34;bold yellow box ul&#34;</span>;
file-style <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;bold yellow ul&#34;</span>; file-style <span style=color:#555>=</span> <span style=color:#c30>&#34;bold yellow ul&#34;</span>;
file-decoration-style <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;none&#34;</span>; file-decoration-style <span style=color:#555>=</span> <span style=color:#c30>&#34;none&#34;</span>;
}; };
}; };
}; };
extraConfig <span style=color:#f92672>=</span> { extraConfig <span style=color:#555>=</span> {
push <span style=color:#f92672>=</span> { default <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;current&#34;</span>; }; push <span style=color:#555>=</span> { default <span style=color:#555>=</span> <span style=color:#c30>&#34;current&#34;</span>; };
pull <span style=color:#f92672>=</span> { rebase <span style=color:#f92672>=</span> <span style=color:#66d9ef>true</span>; }; pull <span style=color:#555>=</span> { rebase <span style=color:#555>=</span> <span style=color:#360>true</span>; };
}; };
}; };
starship <span style=color:#f92672>=</span> { starship <span style=color:#555>=</span> {
enable <span style=color:#f92672>=</span> <span style=color:#66d9ef>true</span>; enable <span style=color:#555>=</span> <span style=color:#360>true</span>;
enableZshIntegration <span style=color:#f92672>=</span> <span style=color:#66d9ef>true</span>; enableZshIntegration <span style=color:#555>=</span> <span style=color:#360>true</span>;
settings <span style=color:#f92672>=</span> { settings <span style=color:#555>=</span> {
add_newline <span style=color:#f92672>=</span> <span style=color:#66d9ef>false</span>; add_newline <span style=color:#555>=</span> <span style=color:#360>false</span>;
scan_timeout <span style=color:#f92672>=</span> <span style=color:#ae81ff>10</span>; scan_timeout <span style=color:#555>=</span> <span style=color:#f60>10</span>;
}; };
}; };
zsh <span style=color:#f92672>=</span> { zsh <span style=color:#555>=</span> {
enable <span style=color:#f92672>=</span> <span style=color:#66d9ef>true</span>; enable <span style=color:#555>=</span> <span style=color:#360>true</span>;
enableAutosuggestions <span style=color:#f92672>=</span> <span style=color:#66d9ef>true</span>; enableAutosuggestions <span style=color:#555>=</span> <span style=color:#360>true</span>;
enableSyntaxHighlighting <span style=color:#f92672>=</span> <span style=color:#66d9ef>true</span>; enableSyntaxHighlighting <span style=color:#555>=</span> <span style=color:#360>true</span>;
history<span style=color:#f92672>.</span>size <span style=color:#f92672>=</span> <span style=color:#ae81ff>1000000</span>; history<span style=color:#555>.</span>size <span style=color:#555>=</span> <span style=color:#f60>1000000</span>;
localVariables <span style=color:#f92672>=</span> { localVariables <span style=color:#555>=</span> {
CASE_SENSITIVE <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;true&#34;</span>; CASE_SENSITIVE <span style=color:#555>=</span> <span style=color:#c30>&#34;true&#34;</span>;
DISABLE_UNTRACKED_FILES_DIRTY <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;true&#34;</span>; DISABLE_UNTRACKED_FILES_DIRTY <span style=color:#555>=</span> <span style=color:#c30>&#34;true&#34;</span>;
RPROMPT <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;&#34;</span>; <span style=color:#75715e># override because macOS defaults to filepath</span> RPROMPT <span style=color:#555>=</span> <span style=color:#c30>&#34;&#34;</span>; <span style=color:#09f;font-style:italic># override because macOS defaults to filepath</span>
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;fg=#838383,underline&#34;</span>; ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE <span style=color:#555>=</span> <span style=color:#c30>&#34;fg=#838383,underline&#34;</span>;
ZSH_DISABLE_COMPFIX <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;true&#34;</span>; ZSH_DISABLE_COMPFIX <span style=color:#555>=</span> <span style=color:#c30>&#34;true&#34;</span>;
}; };
initExtra <span style=color:#f92672>=</span> <span style=color:#e6db74>&#39;&#39; initExtra <span style=color:#555>=</span> <span style=color:#c30>&#39;&#39;
</span><span style=color:#e6db74> export PAGER=less </span><span style=color:#c30> export PAGER=less
</span><span style=color:#e6db74> &#39;&#39;</span>; </span><span style=color:#c30> &#39;&#39;</span>;
shellAliases <span style=color:#f92672>=</span> { shellAliases <span style=color:#555>=</span> {
<span style=color:#e6db74>&#34;..&#34;</span> <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;cd ..&#34;</span>; <span style=color:#c30>&#34;..&#34;</span> <span style=color:#555>=</span> <span style=color:#c30>&#34;cd ..&#34;</span>;
grep <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;rg --smart-case&#34;</span>; grep <span style=color:#555>=</span> <span style=color:#c30>&#34;rg --smart-case&#34;</span>;
ls <span style=color:#f92672>=</span> <span style=color:#e6db74>&#34;exa -la --git&#34;</span>; ls <span style=color:#555>=</span> <span style=color:#c30>&#34;exa -la --git&#34;</span>;
}; };
<span style=color:#e6db74>&#34;oh-my-zsh&#34;</span> <span style=color:#f92672>=</span> { <span style=color:#c30>&#34;oh-my-zsh&#34;</span> <span style=color:#555>=</span> {
enable <span style=color:#f92672>=</span> <span style=color:#66d9ef>true</span>; enable <span style=color:#555>=</span> <span style=color:#360>true</span>;
plugins <span style=color:#f92672>=</span> [ plugins <span style=color:#555>=</span> [
<span style=color:#e6db74>&#34;gitfast&#34;</span> <span style=color:#c30>&#34;gitfast&#34;</span>
<span style=color:#e6db74>&#34;last-working-dir&#34;</span> <span style=color:#c30>&#34;last-working-dir&#34;</span>
]; ];
}; };