summaryrefslogtreecommitdiff
path: root/hostnix/mojo/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hostnix/mojo/flake.nix')
-rw-r--r--hostnix/mojo/flake.nix97
1 files changed, 35 insertions, 62 deletions
diff --git a/hostnix/mojo/flake.nix b/hostnix/mojo/flake.nix
index 3ea5265..a61430f 100644
--- a/hostnix/mojo/flake.nix
+++ b/hostnix/mojo/flake.nix
@@ -8,73 +8,46 @@
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
};
- outputs = inputs@{ self, nix-darwin, nixpkgs, nixpkgs-unstable }:
- let
- configuration = { pkgs, ... }: {
- environment.systemPackages = let
- # TODO is there a better way to do this?
- pkgsUnstable = import nixpkgs-unstable {
- localSystem = pkgs.stdenv.system;
- config.allowUnfree = true;
- };
- in
- [
- pkgs.direnv
- pkgs.nix-direnv
-
- (pkgs.writeShellScriptBin "claude" ''
- exec /usr/bin/sandbox-exec -f ${self}/claude.sb \
- -D TARGET_DIR=$HOME/src \
- -D TMP_DIR=/tmp \
- -D HOME_DIR=$HOME \
- -D CACHE_DIR=$HOME/.cache \
- ${pkgsUnstable.claude-code}/bin/claude \
- --allow-dangerously-skip-permissions "$@"
- '')
- pkgsUnstable.jujutsu
- ];
-
- # $ chsh -s /run/current-system/sw/bin/bash
- environment.shells = [ pkgs.bashInteractive ];
- programs.bash.completion.enable = true;
-
- nix.settings.experimental-features = "nix-command flakes";
-
- system.primaryUser = "joe";
+ outputs =
+ inputs@{
+ self,
+ nix-darwin,
+ nixpkgs,
+ nixpkgs-unstable,
+ }:
+ let
+ configuration =
+ { pkgs, pkgsUnstable, ... }:
+ {
+ nix.settings.experimental-features = "nix-command flakes";
- # Set Git commit hash for darwin-version.
- system.configurationRevision = self.rev or self.dirtyRev or null;
+ # Set Git commit hash for darwin-version.
+ system.configurationRevision = self.rev or self.dirtyRev or null;
- # Used for backwards compatibility, please read the changelog before changing.
- # $ darwin-rebuild changelog
- system.stateVersion = 6;
+ # Used for backwards compatibility, please read the changelog before changing.
+ # $ darwin-rebuild changelog
+ system.stateVersion = 6;
- # The platform the configuration will be used on.
- nixpkgs.hostPlatform = "aarch64-darwin";
-
- nixpkgs.config.allowUnfree = true;
- };
+ # The platform the configuration will be used on.
+ nixpkgs.hostPlatform = "aarch64-darwin";
+ };
- apps = { pkgs, ... }: {
- homebrew = {
- enable = true;
- # Enable after nix-darwin 25.11
- # enableBashIntegration = true;
- onActivation.cleanup = "uninstall";
- brews = [ "mas" ];
- casks = [ "linearmouse" ];
- masApps = {
- "Ghostery Privacy Ad Blocker" = 6504861501;
- "Kagi for Safari" = 1622835804;
- "KeePassium (KeePass passwords)" = 1435127111;
- Xcode = 497799835;
+ in
+ {
+ darwinConfigurations.mojo = nix-darwin.lib.darwinSystem {
+ specialArgs = {
+ pkgsUnstable = import nixpkgs-unstable {
+ system = "aarch64-darwin";
+ config.allowUnfree = true;
+ };
};
+ modules = [
+ configuration
+ ./modules/apps.nix
+ ./modules/obsidian.nix
+ ./modules/sunshine.nix
+ ./modules/system.nix
+ ];
};
};
- in
- {
- darwinConfigurations.mojo = nix-darwin.lib.darwinSystem {
- modules = [ configuration apps ];
- };
- };
}