feat: isMac -> isDarwin

This commit is contained in:
uttarayan21
2025-03-13 00:33:06 +05:30
parent 6b71003bcb
commit 039585b0a9
5 changed files with 11 additions and 9 deletions

View File

@@ -5,6 +5,7 @@
]; ];
casks = [ casks = [
"firefox" "firefox"
"vlc"
"librewolf" "librewolf"
"raycast" "raycast"
"kunkun" # Soon "kunkun" # Soon

View File

@@ -232,7 +232,7 @@
if (builtins.hasAttr "isNix" device) if (builtins.hasAttr "isNix" device)
then device.isNix then device.isNix
else false; else false;
isMac = !isNull (builtins.match ".*-darwin" device.system); isDarwin = !isNull (builtins.match ".*-darwin" device.system);
hasGui = hasGui =
if (builtins.hasAttr "hasGui" device) if (builtins.hasAttr "hasGui" device)
then device.hasGui then device.hasGui
@@ -251,7 +251,7 @@
nixos_devices = builtins.filter (x: x.isNix) devices; nixos_devices = builtins.filter (x: x.isNix) devices;
linux_devices = builtins.filter (x: x.isLinux) devices; linux_devices = builtins.filter (x: x.isLinux) devices;
darwin_devices = builtins.filter (x: x.isMac) devices; darwin_devices = builtins.filter (x: x.isDarwin) devices;
overlays = import ./overlays.nix { overlays = import ./overlays.nix {
inherit inputs; inherit inputs;

View File

@@ -18,7 +18,7 @@
++ lib.optionals device.isLinux [./linux] ++ lib.optionals device.isLinux [./linux]
++ lib.optionals device.hasGui [./gui-programs]; ++ lib.optionals device.hasGui [./gui-programs];
# ++ lib.optionals.device.isMac [./macos]; # ++ lib.optionals.device.isDarwin [./macos];
xdg.enable = true; xdg.enable = true;
xdg.userDirs = { xdg.userDirs = {
@@ -35,7 +35,7 @@
home = { home = {
username = device.user; username = device.user;
homeDirectory = homeDirectory =
if device.isMac if device.isDarwin
then lib.mkForce "/Users/${device.user}" then lib.mkForce "/Users/${device.user}"
else lib.mkForce "/home/${device.user}"; else lib.mkForce "/home/${device.user}";
@@ -66,7 +66,7 @@
SHELL = "${pkgs.bash}/bin/bash"; SHELL = "${pkgs.bash}/bin/bash";
CARGO_TARGET_DIR = "${config.xdg.cacheHome}/cargo/target"; CARGO_TARGET_DIR = "${config.xdg.cacheHome}/cargo/target";
BROWSER = BROWSER =
if device.isMac if device.isDarwin
then "open" then "open"
else "xdg-open"; else "xdg-open";
}; };

View File

@@ -92,5 +92,5 @@
usbutils usbutils
ddcbacklight ddcbacklight
] ]
++ lib.optionals device.isMac []; ++ lib.optionals device.isDarwin [];
} }

View File

@@ -36,9 +36,10 @@
${pkgs.pfetch-rs}/bin/pfetch ${pkgs.pfetch-rs}/bin/pfetch
${lib.optionalString (device.isLinux && !device.isNix) "source /etc/profile.d/nix-daemon.fish"} ${lib.optionalString (device.isLinux && !device.isNix) "source /etc/profile.d/nix-daemon.fish"}
${lib.optionalString (device.isNix && device.hasGui) ${lib.optionalString (device.isNix && device.hasGui)
'' if not set -q HYPRLAND_INSTANCE_SIGNATURE ''
set -x HYPRLAND_INSTANCE_SIGNATURE (hyprctl instances | head -1 | cut -d ' ' -f2 | tr -d :) if not set -q HYPRLAND_INSTANCE_SIGNATURE
end set -x HYPRLAND_INSTANCE_SIGNATURE (hyprctl instances | head -1 | cut -d ' ' -f2 | tr -d :)
end
''} ''}
''; '';
}; };