ctucx.git: nixfiles

ctucx' nixfiles

commit 8e4160d5d11113ee1003d05957bfb92c4722be49
parent b42924441413d875dd79bd8f30def6852ec0be1d
Author: Katja (ctucx) <git@ctu.cx>
Date: Wed, 5 Mar 2025 18:51:57 +0100

darwin: fix build
18 files changed, 60 insertions(+), 124 deletions(-)
diff --git a/configurations/common/syncthing.nix b/configurations/common/syncthing.nix
@@ -1,4 +1,4 @@
-{ inputs, pkgs, config, lib, ... }:
+{ pkgs, config, lib, ... }:
 
 let
   devices = {
diff --git a/configurations/darwin/configure/dock.nix b/configurations/darwin/configure/dock.nix
@@ -2,7 +2,7 @@
 
 {
 
-  system.activationScripts.postActivation.text = ''
+  system.activationScripts.extraUserActivation.text = ''
     ${pkgs.dockutil}/bin/dockutil \
       --remove all \
       --add /Applications/Firefox.app \
diff --git a/configurations/darwin/default.nix b/configurations/darwin/default.nix
@@ -3,22 +3,21 @@
 {
 
   imports = [
-    ./systemSettings.nix
-    ./appSettings.nix
-    ./keyboard.nix
-    ./trackpad.nix
-    ./finder.nix
-    ./dock.nix
-
-    ./skhd.nix
-    ./aerospace.nix
-    ./syncthing.nix
-    ./uhubDaemon.nix
-    ./syncthing.nix
-
-    ./homebrew.nix
-    ./macAppStore.nix
-    ./programs
+    ctucxConfig.configure.systemSettings
+    ctucxConfig.configure.appSettings
+    ctucxConfig.configure.keyboard
+    ctucxConfig.configure.trackpad
+    ctucxConfig.configure.finder
+    ctucxConfig.configure.dock
+    ctucxConfig.configure.homebrew
+    ctucxConfig.configure.macAppStore
+
+    ctucxConfig.services.skhd
+    ctucxConfig.services.syncthing
+#    ctucxConfig.services.uhubDaemon
+    ctucxConfig.services.syncthing
+
+    ctucxConfig.programs.aerospace
 
     ctucxConfig.programs.ssh
     ctucxConfig.programs.git

@@ -27,16 +26,12 @@
     ctucxConfig.programs.yt-dlp
     ctucxConfig.programs.ocrmypdf
     ctucxConfig.programs.phockup
-    ctucxConfig.programs.bitwarden-cli
-  ];
+#    ctucxConfig.programs.bitwarden-cli
 
-  ctucxConfig.programs = {
-    password-store.enable = true;
-    texlive.enable        = true;
-    yt-dlp.enable         = true;
-    ocrmypdf.enable       = true;
-    phockup.enable        = true;
-  };
+    ctucxConfig.programs.yt-dlp
+    ctucxConfig.programs.ocrmypdf
+    ctucxConfig.programs.phockup
+  ];
 
   services.nix-daemon.enable = true;
 

@@ -53,7 +48,6 @@
   };
 
   environment = {
-    loginShell     = "${pkgs.bashInteractive}/bin/bash";
     shells         = [ pkgs.bashInteractive ];
     systemPackages = with pkgs; [
       bashInteractive
diff --git a/configurations/darwin/programs/Bitwarden.nix b/configurations/darwin/programs/Bitwarden.nix
@@ -2,16 +2,10 @@
 
 {
 
-  homebrew = {
-    enable  = true;
-
-    brews   = [
-      "mas"
-    ];
-
-    masApps = {
-      Bitwarden     = 1352778147;
-    };
+  homebrew.enable  = true;
+  homebrew.brews   = [ "mas" ];
+  homebrew.masApps = {
+    Bitwarden = 1352778147;
   };
 
   home-manager.users.katja.home.packages = with pkgs; [ bitwarden-cli ];
diff --git a/configurations/darwin/programs/aerospace.nix b/configurations/darwin/programs/aerospace.nix
@@ -20,18 +20,13 @@ let
 
 in {
 
-  homebrew = {
-    enable  = true;
-
-    casks = [
-       "nikitabobko/tap/aerospace"
-    ];
-  };
+  homebrew.enable = true;
+  homebrew.casks  = [ "nikitabobko/tap/aerospace" ];
 
   home-manager.users.katja.home.file.".aerospace.toml".text = (builtins.replaceStrings
     [ "\"mode.main.binding\"" "\"mode.resize.binding\"" "\"if.app-id\"" "\"if.during-aerospace-startup\"" ]
     [ "mode.main.binding"     "mode.resize.binding"     "if.app-id"     "if.during-aerospace-startup"]
-  (pkgs.std.serde.toTOML {
+  (inputs.nixStd.lib.serde.toTOML {
     enable-normalization-flatten-containers                         = false;
     enable-normalization-opposite-orientation-for-nested-containers = false;
 
diff --git a/configurations/darwin/programs/coconutBattery.nix b/configurations/darwin/programs/coconutBattery.nix
@@ -2,6 +2,9 @@
 
 {
 
+  homebrew.enable = true;
+  homebrew.casks  = [ "coconutbattery" ];
+
   system.defaults.CustomUserPreferences = {
     "com.coconut-flavour.coconutBattery" = {
       # don't check for updates

@@ -9,12 +12,4 @@
     };
   };
 
-  homebrew = {
-    enable  = true;
-
-    casks   = [
-      "coconutbattery"
-    ];
-  };
-
 }
diff --git a/configurations/darwin/programs/default.nix b/configurations/darwin/programs/default.nix
@@ -1,20 +0,0 @@
-{ ... }:
-
-{
-
-  imports = [
-    ./firefox.nix
-    ./iTerm.nix
-    ./Bitwarden.nix
-
-    ./iina.nix
-    ./noTunes.nix
-
-    ./coconutBattery.nix
-    ./rectangle.nix
-    ./hot.nix
-
-    ./java.nix
-  ];
-
-}
diff --git a/configurations/darwin/programs/firefox.nix b/configurations/darwin/programs/firefox.nix
@@ -2,6 +2,9 @@
 
 {
 
+  homebrew.enable = true;
+  homebrew.casks  = [ "firefox" ];
+
   services.skhd.skhdConfig = ''
       #firefox: map cmd+{pageup,pagedown} to ctrl+{pageup,pagedown}
       cmd - home [

@@ -12,12 +15,4 @@
       ]
   '';
 
-  homebrew = {
-    enable  = true;
-
-    casks   = [
-      "firefox"
-    ];
-  };
-
 }
diff --git a/configurations/darwin/programs/hot.nix b/configurations/darwin/programs/hot.nix
@@ -2,6 +2,9 @@
 
 {
 
+  homebrew.enable = true;
+  homebrew.casks  = [ "hot" ];
+
   system.defaults.CustomUserPreferences = {
     "com.xs-labs.Hot" = {
       # don't check for updates

@@ -15,12 +18,4 @@
     };
   };
 
-  homebrew = {
-    enable  = true;
-
-    casks   = [
-      "hot"
-    ];
-  };
-
 }
diff --git a/configurations/darwin/programs/iTerm.nix b/configurations/darwin/programs/iTerm.nix
@@ -2,10 +2,8 @@
 
 {
 
-  homebrew.enable  = true;
-  homebrew.casks   = [
-    "iterm2"
-  ];
+  homebrew.enable = true;
+  homebrew.casks  = [ "iterm2" ];
 
   system.defaults.CustomUserPreferences = {
     "com.googlecode.iterm2" = {
diff --git a/configurations/darwin/programs/iina.nix b/configurations/darwin/programs/iina.nix
@@ -2,10 +2,8 @@
 
 {
 
-  homebrew.enable  = true;
-  homebrew.casks   = [
-    "iina"
-  ];
+  homebrew.enable = true;
+  homebrew.casks  = [ "iina" ];
 
   system.defaults.CustomUserPreferences = {
     "com.colliderli.iina" = {
diff --git a/configurations/darwin/programs/java.nix b/configurations/darwin/programs/java.nix
@@ -2,13 +2,8 @@
 
 {
 
-  homebrew = {
-    enable  = true;
-
-    brews   = [
-      "openjdk"
-    ];
-  };
+  homebrew.enable = true;
+  homebrew.brews  = [ "openjdk" ];
 
   system.activationScripts.postActivation.text = ''
     # Link the homebrew openjdk so that macos can use it
diff --git a/configurations/darwin/programs/noTunes.nix b/configurations/darwin/programs/noTunes.nix
@@ -2,6 +2,9 @@
 
 {
 
+  homebrew.enable = true;
+  homebrew.casks  = [ "notunes" ];
+
   system.defaults.CustomUserPreferences = {
     "digital.twisted.noTunes" = {
       hideIcon    = 1;

@@ -9,12 +12,4 @@
     };
   };
 
-  homebrew = {
-    enable  = true;
-
-    casks   = [
-      "notunes"
-    ];
-  };
-
 }
diff --git a/configurations/darwin/services/syncthing.nix b/configurations/darwin/services/syncthing.nix
@@ -1,17 +1,18 @@
-{ inputs, pkgs, config, lib, ... }:
+{ ctucxConfig, pkgs, config, lib, ... }:
 
 let
-  syncthingConfig = import ../common/syncthing-config.nix { inherit inputs pkgs config lib; };
+  syncthingConfig = import ctucxConfig.syncthing { inherit pkgs config lib; };
 
 in {
+
   age.identityPaths = [ "/Users/katja/.ssh/id_ed25519" ];
   age.secrets = {
     syncthing-key = {
-      file  = ../../secrets + "/${config.networking.hostName}/syncthing/key.age";
+      file  = ../../../secrets + "/${config.networking.hostName}/syncthing/key.age";
       owner = "katja";
     };
     syncthing-cert = {
-      file  = ../../secrets + "/${config.networking.hostName}/syncthing/cert.age";
+      file  = ../../../secrets + "/${config.networking.hostName}/syncthing/cert.age";
       owner = "katja";
     };
   };
diff --git a/configurations/nixos/services/syncthing.nix b/configurations/nixos/services/syncthing.nix
@@ -1,7 +1,7 @@
-{ inputs, ctucxConfig, config, pkgs, lib, ... }:
+{ ctucxConfig, config, pkgs, lib, ... }:
 
 let
-  syncthingConfig = import ctucxConfig.syncthing { inherit inputs pkgs config lib; };
+  syncthingConfig = import ctucxConfig.syncthing { inherit pkgs config lib; };
 
 in {
 
diff --git a/flake.lock b/flake.lock
@@ -646,15 +646,16 @@
         ]
       },
       "locked": {
-        "lastModified": 1740755725,
-        "narHash": "sha256-amZbqP84H/ApugaT+TADXTB3NbjkVHI9Vac1saIk0kE=",
+        "lastModified": 1741126078,
+        "narHash": "sha256-ng0a4cIq3c9E3iGKomlwqKzVYs2RLOzQho2U1Mc2sqU=",
         "owner": "lnl7",
         "repo": "nix-darwin",
-        "rev": "5d6e0851b60508cffd66b4a6982440a40720338d",
+        "rev": "c172f50b55b087f8e7801631de977461603bb976",
         "type": "github"
       },
       "original": {
         "owner": "lnl7",
+        "ref": "nix-darwin-24.11",
         "repo": "nix-darwin",
         "type": "github"
       }
diff --git a/flake.nix b/flake.nix
@@ -160,7 +160,7 @@
 
     nixosHardware.url  = "github:NixOS/nixos-hardware/master";
 
-    nixDarwin.url = "github:lnl7/nix-darwin";
+    nixDarwin.url = "github:lnl7/nix-darwin/nix-darwin-24.11";
     nixDarwin.inputs.nixpkgs.follows = "nixpkgs";
 
     homeManager.url = "github:nix-community/home-manager/release-24.11";
diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix
@@ -1,5 +1,5 @@
 
-{ lib ... }:
+{ lib, ... }:
 
 {