ctucx.git: nixfiles

ctucx' nixfiles

commit d9af6b347f987922b45d721d509c75facd40e1fb
parent 8a4d110869262180fa8a81f7e087c0d09ebd7e45
Author: Leah (ctucx) <git@ctu.cx>
Date: Tue, 23 May 2023 10:06:13 +0200

configurations/darwin: add support for x86_64 darwin
5 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/configurations/common/default.nix b/configurations/common/default.nix
@@ -29,6 +29,11 @@ in {
 
       ../darwin
     ] else [])
+    (if (currentSystem == "x86_64-darwin") then [
+      inputs.home-manager.darwinModules.home-manager
+
+      ../darwin
+    ] else [])
   ]);
 
   time.timeZone              = "Europe/Berlin";
diff --git a/configurations/common/programs/bash.nix b/configurations/common/programs/bash.nix
@@ -78,7 +78,11 @@
           # Make bash check its window size after a process completes
           shopt -s checkwinsize
 
+          ${if pkgs.system == "aarch64-darwin" then ''
           eval "$(/opt/homebrew/bin/brew shellenv)"
+          '' else ''
+          eval "$(/usr/local/bin/brew shellenv)"
+          ''}
         '';
 
       };
diff --git a/configurations/darwin/dock.nix b/configurations/darwin/dock.nix
@@ -1,4 +1,4 @@
-{ pkgs, ... }:
+{ pkgs, lib, ... }:
 
 {
 

@@ -8,7 +8,8 @@
       --add /Applications/Firefox.app \
       --add /Applications/Thunderbird.app \
       --add /Applications/Telegram.app \
-      --add /Applications/WhatsApp.app \
+      --add /Applications/Mona.app \
+      ${if pkgs.system == "aarch64-darwin" then "--add /Applications/WhatsApp.app" else ""}\
       --add /Applications/Navigator.app \
       --add /System/Applications/Calendar.app \
       --add /System/Applications/Reminders.app \
diff --git a/configurations/darwin/homebrew.nix b/configurations/darwin/homebrew.nix
@@ -1,4 +1,4 @@
-{ ... }:
+{ pkgs, ... }:
 
 {
   imports = [

@@ -26,7 +26,7 @@
       "libreoffice"
       "iina"
       "spotify"
-      "polymc"
+#      "polymc"
       "moneymoney"
       "utm"
 

@@ -56,7 +56,11 @@
 
   system.activationScripts.postActivation.text = ''
     # Link the homebrew openjdk so that macos can use it
+    ${if pkgs.system == "aarch64-darwin" then ''
     HOMEBREW_JAVAVM="/opt/homebrew/opt/openjdk/libexec/openjdk.jdk"
+    '' else ''
+    HOMEBREW_JAVAVM="/usr/local/opt/openjdk/libexec/openjdk.jdk"
+    ''}
     MACOS_JAVAVM="/Library/Java/JavaVirtualMachines/openjdk.jdk"
     if [ -d "$HOMEBREW_JAVAVM" ]; then
       if [ ! -e "MACOS_JAVAVM" ]; then
diff --git a/modules/default.nix b/modules/default.nix
@@ -23,6 +23,12 @@
       ./darwin/hidutil.nix
       ./darwin/syncthing.nix
     ] else [])
+    (if (currentSystem == "x86_64-darwin") then [
+      inputs.agenix.darwinModules.default
+      ./darwin/quirks.nix
+      ./darwin/hidutil.nix
+      ./darwin/syncthing.nix
+    ] else [])
   ]);
 
   options = {