aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
Diffstat (limited to 'nix')
-rw-r--r--nix/lib/machine-utils.nix20
-rw-r--r--nix/machines/darwin-shared.nix12
-rw-r--r--nix/machines/hq-kwny2vh41p/default.nix5
-rw-r--r--nix/machines/mba-m2/default.nix8
-rw-r--r--nix/users/fcuny/dev.nix2
-rw-r--r--nix/users/fcuny/home-manager.nix6
-rw-r--r--nix/users/fcuny/personal.nix7
7 files changed, 38 insertions, 22 deletions
diff --git a/nix/lib/machine-utils.nix b/nix/lib/machine-utils.nix
new file mode 100644
index 0000000..6501257
--- /dev/null
+++ b/nix/lib/machine-utils.nix
@@ -0,0 +1,20 @@
+{ lib, ... }:
+
+let
+ # Simple function to check if a machine is of a specific type
+ isMachineType =
+ machineType: systemName:
+ let
+ workMachines = [ "hq-kwny2vh41p" ];
+ personalMachines = [ "mba-m2" ];
+ in
+ if machineType == "work" then
+ lib.elem systemName workMachines
+ else if machineType == "personal" then
+ lib.elem systemName personalMachines
+ else
+ false;
+in
+{
+ inherit isMachineType;
+}
diff --git a/nix/machines/darwin-shared.nix b/nix/machines/darwin-shared.nix
index 03239b2..5f46ce8 100644
--- a/nix/machines/darwin-shared.nix
+++ b/nix/machines/darwin-shared.nix
@@ -80,6 +80,8 @@
services.nix-daemon.enable = true;
+ environment.shells = [ pkgs.fish ];
+
programs.fish.enable = true;
programs.fish.shellInit = ''
# Nix
@@ -119,16 +121,6 @@
cleanup = "uninstall";
upgrade = true;
};
-
- brews = [
- "repomix"
- ];
-
- casks = [
- "docker"
- "iterm2"
- "vlc"
- ];
};
programs.ssh.knownHosts = {
diff --git a/nix/machines/hq-kwny2vh41p/default.nix b/nix/machines/hq-kwny2vh41p/default.nix
index 5910d09..1ae15f2 100644
--- a/nix/machines/hq-kwny2vh41p/default.nix
+++ b/nix/machines/hq-kwny2vh41p/default.nix
@@ -1,9 +1,6 @@
-{ pkgs, ... }:
+{ ... }:
{
imports = [ ../darwin-shared.nix ];
system.stateVersion = 5;
-
- programs.fish.enable = true;
- environment.shells = [ pkgs.fish ];
}
diff --git a/nix/machines/mba-m2/default.nix b/nix/machines/mba-m2/default.nix
index 04c5780..2e7faf6 100644
--- a/nix/machines/mba-m2/default.nix
+++ b/nix/machines/mba-m2/default.nix
@@ -1,14 +1,8 @@
-{ pkgs, ... }:
+{ ... }:
{
imports = [ ../darwin-shared.nix ];
system.stateVersion = 5;
networking.hostName = "mba-m2";
-
- programs.fish.enable = true;
- environment.shells = [ pkgs.fish ];
-
- # brew packages I only want to get installed on this machine
- homebrew.casks = [ "zoom" ];
}
diff --git a/nix/users/fcuny/dev.nix b/nix/users/fcuny/dev.nix
index f95c04d..3fa97da 100644
--- a/nix/users/fcuny/dev.nix
+++ b/nix/users/fcuny/dev.nix
@@ -7,6 +7,8 @@
home.packages = with pkgs; [
_1password-cli
aider-chat
+ docker
+ iterm2
wireshark
# go
diff --git a/nix/users/fcuny/home-manager.nix b/nix/users/fcuny/home-manager.nix
index 1298eb8..1c2077c 100644
--- a/nix/users/fcuny/home-manager.nix
+++ b/nix/users/fcuny/home-manager.nix
@@ -1,6 +1,9 @@
{ darwin, systemName, ... }:
{ lib, ... }:
+let
+ machineUtils = import ../../lib/machine-utils.nix { inherit lib; };
+in
{
home.stateVersion = "23.05";
@@ -20,5 +23,6 @@
./dev.nix
./media.nix
]
- ++ lib.optionals (systemName == "hq-kwny2vh41p") [ ./work.nix ];
+ ++ lib.optionals (machineUtils.isMachineType "work" systemName) [ ./work.nix ]
+ ++ lib.optionals (machineUtils.isMachineType "personal" systemName) [ ./personal.nix ];
}
diff --git a/nix/users/fcuny/personal.nix b/nix/users/fcuny/personal.nix
new file mode 100644
index 0000000..9dc9ebf
--- /dev/null
+++ b/nix/users/fcuny/personal.nix
@@ -0,0 +1,7 @@
+{ pkgs, ... }:
+{
+ home.packages = with pkgs; [
+ vlc-bin
+ zoom-us
+ ];
+}