aboutsummaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorJacob Janzen <jacob.a.s.janzen@gmail.com>2024-09-25 21:12:18 -0500
committerJacob Janzen <jacob.a.s.janzen@gmail.com>2024-09-25 21:12:18 -0500
commitc8d19a52e004abdeaaa73416747d9acb56984446 (patch)
tree2af8810d30588fa2ea1dc3574148b4f6a065b1cc /install
parent98ddd576c3a5766d3fcace49ea105950c26cde03 (diff)
add nixos config
Diffstat (limited to 'install')
-rwxr-xr-xinstall53
1 files changed, 30 insertions, 23 deletions
diff --git a/install b/install
index 506e59e..ddb9dc1 100755
--- a/install
+++ b/install
@@ -20,9 +20,9 @@ CWD=$(pwd)
if [ "$(uname)" = 'Darwin' ]; then
echo 'detected Mac OS; installing Mac OS configuration...'
cd ~/.dotfiles/macos/ || exit
-elif [ "$(uname)" = 'Linux' ] && grep -q 'ID=gentoo' /etc/os-release; then
- echo 'detected Gentoo; installing Gentoo configuration...'
- cd ~/.dotfiles/gentoo/ || exit
+elif [ "$(uname)" = 'Linux' ] && grep -q 'ID=nixos' /etc/os-release; then
+ echo 'detected NixOS; installing NixOS configuration...'
+ cd ~/.dotfiles/nixos/ || exit
else
echo 'unsupported operating system'
exit 1
@@ -46,28 +46,35 @@ if [ "$(uname)" = 'Darwin' ]; then
osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"/$HOME/.wallpaper\" as POSIX file"
fi
-echo 'installing fonts...'
-fonts_changed=false
-mkdir -p ~/.local/share/fonts
-if ! test -d ~/.local/share/fonts/ComputerModern; then
- echo ' Computer Modern font missing. Installing...'
- tar xf .local/share/fonts/ComputerModern.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log 2>&1
- fonts_changed=true
-fi
-if ! test -f ~/.local/share/fonts/NFM.ttf; then
- echo ' Nerd Font Mono font missing. Installing...'
- tar xf .local/share/fonts/NFM.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log 2>&1
- fonts_changed=true
-fi
-if ! test -d ~/.local/share/fonts/SauceCodePro; then
- echo ' Source Code Pro Nerd Font missing. Installing...'
- tar xf .local/share/fonts/SauceCodePro.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log 2>&1
- fonts_changed=true
+if [ "$(uname)" = 'Linux' ] && grep -q 'ID=nixos' /etc/os-release; then
+ echo 'installing NixOS flake'
+ sudo nixos-rebuild switch --flake './flake#nixos'
fi
-if [ $fonts_changed = true ]; then
- echo ' updating the font cache...'
- fc-cache -f >> ~/.update-home.log
+fonts_changed=false
+if [ "$(uname)" = 'Darwin' ]; then
+ echo 'installing fonts...'
+ mkdir -p ~/.local/share/fonts
+ if ! test -d ~/.local/share/fonts/ComputerModern; then
+ echo ' Computer Modern font missing. Installing...'
+ tar xf .local/share/fonts/ComputerModern.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log 2>&1
+ fonts_changed=true
+ fi
+ if ! test -f ~/.local/share/fonts/NFM.ttf; then
+ echo ' Nerd Font Mono font missing. Installing...'
+ tar xf .local/share/fonts/NFM.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log 2>&1
+ fonts_changed=true
+ fi
+ if ! test -d ~/.local/share/fonts/SauceCodePro; then
+ echo ' Source Code Pro Nerd Font missing. Installing...'
+ tar xf .local/share/fonts/SauceCodePro.tar.gz -C ~/.local/share/fonts >> ~/.update-home.log 2>&1
+ fonts_changed=true
+ fi
+
+ if [ $fonts_changed = true ]; then
+ echo ' updating the font cache...'
+ fc-cache -f >> ~/.update-home.log
+ fi
fi
cd "$CWD" || exit