From 9b79fd3be85304e9dd95ad37178a370cc7723279 Mon Sep 17 00:00:00 2001 From: Martin Larsson Date: Wed, 26 Feb 2025 01:07:36 +0100 Subject: [PATCH] Add new config entry: `darwin_work` which follows the darwin system configuration but has another home config. --- flake.nix | 50 ++++++++++++++++++++++++++-------------- nix/pkgs/darwin_work.nix | 13 +++++++++++ nix/pkgs/home.nix | 2 -- 3 files changed, 46 insertions(+), 19 deletions(-) create mode 100644 nix/pkgs/darwin_work.nix diff --git a/flake.nix b/flake.nix index da950d7..579e09f 100644 --- a/flake.nix +++ b/flake.nix @@ -110,25 +110,32 @@ }; }; - darwinConfigurations."darwin" = makeSystemConfig { - name = "darwin"; - system = "aarch64-darwin"; - builder = nix-darwin.lib.darwinSystem; - extraModules = [ - ./nix/system/darwin.nix - nix-homebrew.darwinModules.nix-homebrew - { - nix-homebrew = { - enable = true; - enableRosetta = true; + darwinConfigurations = + let + baseDarwinConfig = makeSystemConfig { + name = "darwin"; + system = "aarch64-darwin"; + builder = nix-darwin.lib.darwinSystem; + extraModules = [ + ./nix/system/darwin.nix + nix-homebrew.darwinModules.nix-homebrew + { + nix-homebrew = { + enable = true; + enableRosetta = true; + }; + } + ]; + specialArgs = { + self = self; + nix-homebrew = nix-homebrew; }; - } - ]; - specialArgs = { - self = self; - nix-homebrew = nix-homebrew; + }; + in + { + "darwin" = baseDarwinConfig; + "darwin_work" = baseDarwinConfig; }; - }; homeConfigurations = { "wsl" = makeHomeConfig { @@ -154,6 +161,15 @@ system = "aarch64-darwin"; extraModules = [ ./nix/pkgs/darwin.nix ]; }; + + "darwin_work" = makeHomeConfig { + name = "work"; + system = "aarch64-darwin"; + extraModules = [ + ./nix/pkgs/darwin.nix + ./nix/pkgs/darwin_work.nix + ]; + }; }; }; } diff --git a/nix/pkgs/darwin_work.nix b/nix/pkgs/darwin_work.nix new file mode 100644 index 0000000..02947f4 --- /dev/null +++ b/nix/pkgs/darwin_work.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: +{ + home = { + packages = with pkgs; [ + (python311.withPackages (pythonPkgs: [ + pythonPkgs.pip + pythonPkgs.setuptools + ])) + pcre + ccache + ]; + }; +} diff --git a/nix/pkgs/home.nix b/nix/pkgs/home.nix index cda0f05..2053ed0 100644 --- a/nix/pkgs/home.nix +++ b/nix/pkgs/home.nix @@ -119,8 +119,6 @@ in tree-sitter codelldb bottom - python311 - pcre ]; file = symlinkFiles;