about summary refs log tree commit diff
path: root/darwin/kompakt-darwin
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2023-06-02 22:11:08 +0900
committersefidel <contact@sefidel.net>2023-06-02 22:11:08 +0900
commit1642de788ccac8098d944066184a0c71b7a8e537 (patch)
treeeb6ddd182008486a6ac6234b997113d346f9dcc0 /darwin/kompakt-darwin
parentfab665812fa1d507fbfb0fc143afe873163b7d36 (diff)
downloadnixrc-1642de788ccac8098d944066184a0c71b7a8e537.tar.gz
nixrc-1642de788ccac8098d944066184a0c71b7a8e537.zip
fix(darwin/kompakt-darwin): fixup
Diffstat (limited to 'darwin/kompakt-darwin')
-rw-r--r--darwin/kompakt-darwin/configuration.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/darwin/kompakt-darwin/configuration.nix b/darwin/kompakt-darwin/configuration.nix
new file mode 100644
index 0000000..7080e77
--- /dev/null
+++ b/darwin/kompakt-darwin/configuration.nix
@@ -0,0 +1,66 @@
+{ config, pkgs, lib, ... }:
+
+{
+  nix = {
+    settings.substituters = [
+      "https://cache.nixos.org/"
+    ];
+    settings.trusted-public-keys = [
+      "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
+    ];
+
+    settings.trusted-users = [
+      "@admin"
+    ];
+
+    settings.auto-optimise-store = lib.mkDefault true;
+    configureBuildUsers = true;
+    gc.automatic = lib.mkDefault true;
+    gc.options = lib.mkDefault "--delete-older-than 10d";
+    extraOptions = ''
+      experimental-features = nix-command flakes
+      extra-platforms = x86_64-darwin aarch64-darwin
+    '';
+  };
+
+  # List packages installed in system profile. To search by name, run:
+  # $ nix-env -qaP | grep wget
+  environment.systemPackages =
+    [
+      pkgs.vim
+    ];
+
+  # Use a custom configuration.nix location.
+  # $ darwin-rebuild switch -I darwin-config=$HOME/.config/nixpkgs/darwin/configuration.nix
+  # environment.darwinConfig = "$HOME/.config/nixpkgs/darwin/configuration.nix";
+
+  # Auto upgrade nix package and the daemon service.
+  services.nix-daemon.enable = true;
+  # nix.package = pkgs.nix;
+
+  users.users.sefidel = {
+    name = "sefidel";
+    home = "/Users/sefidel";
+  };
+
+  # Create /etc/zshrc that loads the nix-darwin environment.
+  programs.zsh.enable = true; # default shell on catalina
+  # programs.fish.enable = true;
+
+  # Make applications pop up in finder/spotlight
+  system.activationScripts.applications.text = pkgs.lib.mkForce (
+    ''
+      echo "setting up ~/Applications..." >&2
+      rm -rf ~/Applications/Nix\ Apps
+      mkdir -p ~/Applications/Nix\ Apps
+      for app in $(find ${config.system.build.applications}/Applications -maxdepth 1 -type l); do
+        src="$(/usr/bin/stat -f%Y "$app")"
+        cp -r "$src" ~/Applications/Nix\ Apps
+      done
+    ''
+  );
+
+  # Used for backwards compatibility, please read the changelog before changing.
+  # $ darwin-rebuild changelog
+  system.stateVersion = 4;
+}