add dango

This commit is contained in:
Ray Andrew 2025-04-05 02:14:48 -05:00
parent 6946d0532f
commit fa4919f87e
Signed by: rayandrew
SSH key fingerprint: SHA256:XYrYrxF0Z3A72n8P/p6mqPRNQZT22F88XcLsG+kX4xw
23 changed files with 1106 additions and 264 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
result

130
darwin/aerospace.nix Normal file
View file

@ -0,0 +1,130 @@
{ pkgs, lib, config, ... }:
{
options.custom = with lib; {
aerospace = {
enable = mkEnableOption "Enable aerospace";
};
};
config = lib.mkIf config.custom.aerospace.enable {
services.aerospace = {
enable = config.custom.aerospace.enable;
settings = {
enable-normalization-flatten-containers = true;
enable-normalization-opposite-orientation-for-nested-containers = true;
accordion-padding = 0;
on-focused-monitor-changed = [ "move-mouse monitor-lazy-center" ];
default-root-container-layout = "tiles";
default-root-container-orientation = "auto";
gaps = {
inner = {
horizontal = 0;
vertical = 0;
};
outer = {
left = 0;
bottom = 0;
top = 0;
right = 0;
};
};
mode = {
main = {
binding = {
alt-enter =
let
script = pkgs.writeText "ghostty.applescript" ''
do shell script "open -n -a Ghostty"
'';
in "exec-and-forget osascript ${script}";
alt-shift-f = "fullscreen";
alt-p = "layout floating tiling";
alt-e = "layout tiles horizontal vertical";
alt-t = "layout accordion horizontal vertical";
alt-h = "focus left";
alt-l = "focus right";
alt-shift-h = "move left";
alt-shift-l = "move right";
alt-1 = "workspace 1";
alt-2 = "workspace 2";
alt-3 = "workspace 3";
alt-4 = "workspace 4";
alt-5 = "workspace 5";
alt-6 = "workspace 6";
alt-7 = "workspace 7";
alt-8 = "workspace 8";
alt-9 = "workspace 9";
alt-0 = "workspace 10";
alt-shift-1 = [
"move-node-to-workspace 1"
"workspace 1"
];
alt-shift-2 = [
"move-node-to-workspace 2"
"workspace 2"
];
alt-shift-3 = [
"move-node-to-workspace 3"
"workspace 3"
];
alt-shift-4 = [
"move-node-to-workspace 4"
"workspace 4"
];
alt-shift-5 = [
"move-node-to-workspace 5"
"workspace 5"
];
alt-shift-6 = [
"move-node-to-workspace 6"
"workspace 6"
];
alt-shift-7 = [
"move-node-to-workspace 7"
"workspace 7"
];
alt-shift-8 = [
"move-node-to-workspace 8"
"workspace 8"
];
alt-shift-9 = [
"move-node-to-workspace 9"
"workspace 9"
];
alt-shift-0 = [
"move-node-to-workspace 10"
"workspace 10"
];
alt-r = "mode resize";
};
};
resize = {
binding = {
h = "resize width -50";
j = "resize height +50";
k = "resize height -50";
l = "resize width +50";
enter = "mode main";
esc = "mode main";
};
};
};
on-window-detected = [
{
"if".app-id="com.mitchellh.ghostty";
run= [ "layout tiling" ];
}
];
};
};
};
}

63
darwin/default.nix Normal file
View file

@ -0,0 +1,63 @@
{
inputs,
lib,
config,
pkgs,
system,
host,
...
}: {
imports = [
./aerospace.nix
./homebrew.nix
./keyboard.nix
];
options.custom = with lib; {
shell = {
packages = mkOption {
type =
with types;
attrsOf (oneOf [
str
attrs
package
]);
apply = custom.mkShellPackages;
default = { };
description = ''
Attrset of shell packages to install and add to pkgs.custom overlay (for compatibility across multiple shells).
Both string and attr values will be passed as arguments to writeShellApplicationCompletions
'';
example = ''
shell.packages = {
myPackage1 = "echo 'Hello, World!'";
myPackage2 = {
runtimeInputs = [ pkgs.hello ];
text = "hello --greeting 'Hi'";
};
}
'';
};
};
symlinks = mkOption {
type = types.attrsOf types.str;
default = { };
description = "Symlinks to create in the format { dest = src;}";
};
};
config = {
# networking
# networking.hostName = host;
# networking.hostId = builtins.substring 0 8 (builtins.hashString "md5" config.networking.hostName);
# networking.networkmanager.enable = true;
environment.systemPackages = with pkgs; [
vim
htop
] ++ (lib.attrValues config.custom.shell.packages);
system.stateVersion = 6;
};
}

34
darwin/homebrew.nix Normal file
View file

@ -0,0 +1,34 @@
{ pkgs, user, inputs, ... }:
{
nix-homebrew = {
inherit user;
enable = true;
enableRosetta = true;
taps = {
"homebrew/homebrew-core" = inputs.homebrew-core;
"homebrew/homebrew-cask" = inputs.homebrew-cask;
"homebrew/homebrew-createzap" = inputs.homebrew-createzap;
};
mutableTaps = false;
};
homebrew = {
enable = true;
onActivation = {
# autoUpdate = true;
# cleanup = "zap";
};
global = {
brewfile = true;
};
casks = [
"zen-browser"
"webex"
"slack"
"zoom"
"spotify"
"ghostty"
];
};
}

7
darwin/keyboard.nix Normal file
View file

@ -0,0 +1,7 @@
{ config, ... }:
{
system.keyboard = {
enableKeyMapping = true;
remapCapsLockToControl = true;
};
}

View file

@ -1,5 +1,37 @@
{ {
"nodes": { "nodes": {
"brew-src": {
"flake": false,
"locked": {
"lastModified": 1742457334,
"narHash": "sha256-Gn7ruyb3NDFr+SsHBfA2NsJI8YkkWdECqLRj/xcjt+E=",
"owner": "Homebrew",
"repo": "brew",
"rev": "f3bd91d3afe086824d24708230e1f0c7f943135a",
"type": "github"
},
"original": {
"owner": "Homebrew",
"ref": "4.4.25",
"repo": "brew",
"type": "github"
}
},
"cl-nix-lite": {
"locked": {
"lastModified": 1728174978,
"narHash": "sha256-Grqqg+xuicANB85j0gNEXxi9SBKY7bzGeTuyi95eGcY=",
"owner": "hraban",
"repo": "cl-nix-lite",
"rev": "31cfe6275c341eb3120a99f4b1c8516c49a29d87",
"type": "github"
},
"original": {
"owner": "hraban",
"repo": "cl-nix-lite",
"type": "github"
}
},
"disko": { "disko": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -7,11 +39,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1741786315, "lastModified": 1743598667,
"narHash": "sha256-VT65AE2syHVj6v/DGB496bqBnu1PXrrzwlw07/Zpllc=", "narHash": "sha256-ViE7NoFWytYO2uJONTAX35eGsvTYXNHjWALeHAg8OQY=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "0d8c6ad4a43906d14abd5c60e0ffe7b587b213de", "rev": "329d3d7e8bc63dd30c39e14e6076db590a6eabe6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -52,6 +84,23 @@
"type": "github" "type": "github"
} }
}, },
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1730663653,
"narHash": "sha256-kFCUWettiFHDIqxCWWQ9qY8pVh+Lj+XL0Giyy/kdomg=",
"owner": "hraban",
"repo": "flake-compat",
"rev": "e5b16676185cb7548581c852f51ce7f3a49bba5e",
"type": "github"
},
"original": {
"owner": "hraban",
"ref": "fixed-output",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
@ -70,6 +119,26 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"inputs": {
"systems": [
"mac-app-util",
"systems"
]
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"id": "flake-utils",
"type": "indirect"
}
},
"ghostty": { "ghostty": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
@ -80,11 +149,11 @@
"zon2nix": "zon2nix" "zon2nix": "zon2nix"
}, },
"locked": { "locked": {
"lastModified": 1742589311, "lastModified": 1743809482,
"narHash": "sha256-YCAEmOPDSHVKygFov2zOg3Fkb060SRgjiGi4P7y9+kc=", "narHash": "sha256-zzR3VX9+7fz+twG+84XKyyTzJhyjgQgZIkzSwr5W8HI=",
"owner": "ghostty-org", "owner": "ghostty-org",
"repo": "ghostty", "repo": "ghostty",
"rev": "747c43ffa0047aa2ef550aa361ba63f4060a85ba", "rev": "c0eaa4b158c418499b9963e84c9ce2787a09d473",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -143,11 +212,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742670145, "lastModified": 1743788974,
"narHash": "sha256-xQ2F9f+ICAGBp/nNv3ddD2U4ZvzuLOci0u/5lyMXPvk=", "narHash": "sha256-2LeVyQZI2wTkSzMLvnN/kJjXVWp4HCVUoq17Bv8TNTk=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "63e77d09a133ac641a0c204e7cfb0c97e133706d", "rev": "0f5908daf890c3d7e7052bef1d6deb0f2710aaa1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -156,6 +225,156 @@
"type": "github" "type": "github"
} }
}, },
"home-manager_2": {
"inputs": {
"nixpkgs": [
"zen-browser",
"nixpkgs"
]
},
"locked": {
"lastModified": 1743604125,
"narHash": "sha256-ZD61DNbsBt1mQbinAaaEqKaJk2RFo9R/j+eYWeGMx7A=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "180fd43eea296e62ae68e079fcf56aba268b9a1a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"homebrew-cask": {
"flake": false,
"locked": {
"lastModified": 1743826030,
"narHash": "sha256-UsALr6GdYIzQQJKVEa0dxfsl2lvTKkvbI4xt89Fe3HA=",
"owner": "homebrew",
"repo": "homebrew-cask",
"rev": "280a26f1d237f1794d265143069db808d32a7469",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-cask",
"type": "github"
}
},
"homebrew-core": {
"flake": false,
"locked": {
"lastModified": 1743825975,
"narHash": "sha256-7n/XMkwZk/EwbK2+W6MHv6MgR54vP+kZ8z1QxIEVA4Q=",
"owner": "homebrew",
"repo": "homebrew-core",
"rev": "7d6f347c4533509284d72ae6d6b7253c6248418b",
"type": "github"
},
"original": {
"owner": "homebrew",
"repo": "homebrew-core",
"type": "github"
}
},
"homebrew-createzap": {
"flake": false,
"locked": {
"lastModified": 1715123866,
"narHash": "sha256-3Mf21xheYYoiTtbakmRhnhXXx21iKlCnG2oQGcq3pZw=",
"owner": "nrlquaker",
"repo": "homebrew-createzap",
"rev": "08249a9211606dbde1c18b891b595ffead5f15a0",
"type": "github"
},
"original": {
"owner": "nrlquaker",
"repo": "homebrew-createzap",
"type": "github"
}
},
"mac-app-util": {
"inputs": {
"cl-nix-lite": "cl-nix-lite",
"flake-compat": "flake-compat_3",
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs",
"systems": "systems_2"
},
"locked": {
"lastModified": 1742156590,
"narHash": "sha256-aTM/2CrNN5utdVEQGsOA+kl4UozgH7VPLBQL5OXtBrg=",
"owner": "hraban",
"repo": "mac-app-util",
"rev": "341ede93f290df7957047682482c298e47291b4d",
"type": "github"
},
"original": {
"owner": "hraban",
"repo": "mac-app-util",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1743496612,
"narHash": "sha256-emPWa5lmKbnyuj8c1mSJUkzJNT+iJoU9GMcXwjp2oVM=",
"owner": "nix-darwin",
"repo": "nix-darwin",
"rev": "73d59580d01e9b9f957ba749f336a272869c42dd",
"type": "github"
},
"original": {
"owner": "nix-darwin",
"ref": "master",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-darwin_2": {
"inputs": {
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1716329735,
"narHash": "sha256-ap51w+VqG21vuzyQ04WrhI2YbWHd3UGz0e7dc/QQmoA=",
"owner": "LnL7",
"repo": "nix-darwin",
"rev": "eac4f25028c1975a939c8f8fba95c12f8a25e01c",
"type": "github"
},
"original": {
"owner": "LnL7",
"repo": "nix-darwin",
"type": "github"
}
},
"nix-homebrew": {
"inputs": {
"brew-src": "brew-src",
"nix-darwin": "nix-darwin_2",
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1742619394,
"narHash": "sha256-8uwIBjbKxeJ7u0VACSNs634HwtgRLxP6/+cIkUXmuyI=",
"owner": "zhaofengli",
"repo": "nix-homebrew",
"rev": "04b0536479d2d2e8d71dc8c8ee97c2b61f0c9987",
"type": "github"
},
"original": {
"owner": "zhaofengli",
"repo": "nix-homebrew",
"type": "github"
}
},
"nix-index-database": { "nix-index-database": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -163,11 +382,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742174123, "lastModified": 1743306489,
"narHash": "sha256-pDNzMoR6m1ZSJToZQ6XDTLVSdzIzmFl1b8Pc3f7iV6Y=", "narHash": "sha256-LROaIjSLo347cwcHRfSpqzEOa2FoLSeJwU4dOrGm55E=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-index-database", "repo": "nix-index-database",
"rev": "2cfb4e1ca32f59dd2811d7a6dd5d4d1225f0955c", "rev": "b3696bfb6c24aa61428839a99e8b40c53ac3a82d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -178,11 +397,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1742631601, "lastModified": 1743420942,
"narHash": "sha256-yJ3OOAmsGAxSl0bTmKUp3+cEYtSS+V6hUPK2rYhIPr8=", "narHash": "sha256-b/exDDQSLmENZZgbAEI3qi9yHkuXAXCPbormD8CSJXo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "380ed15bcd6440606c6856db44a99140d422b46f", "rev": "de6fc5551121c59c01e2a3d45b277a6d05077bc4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -194,17 +413,35 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1742422364, "lastModified": 1732617236,
"narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=", "narHash": "sha256-PYkz6U0bSEaEB1al7O1XsqVNeSNS+s3NVclJw7YC43w=",
"owner": "nixos", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc", "rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nixos", "owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "af51545ec9a44eadf3fe3547610a5cdd882bc34e",
"type": "github"
}
},
"nixpkgs-firefox-darwin": {
"inputs": {
"nixpkgs": "nixpkgs_5"
},
"locked": {
"lastModified": 1743814796,
"narHash": "sha256-NzvnPhm1qAnKRVapGIdyyiu79AHqYtEOa5c0doxLnWs=",
"owner": "bandithedoge",
"repo": "nixpkgs-firefox-darwin",
"rev": "767b994a4171d8fefd4f4b46a8f2ce2f0e639e0d",
"type": "github"
},
"original": {
"owner": "bandithedoge",
"repo": "nixpkgs-firefox-darwin",
"type": "github" "type": "github"
} }
}, },
@ -240,15 +477,83 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1687274257,
"narHash": "sha256-TutzPriQcZ8FghDhEolnHcYU2oHIG5XWF+/SUBNnAOE=",
"path": "/nix/store/22qgs3skscd9bmrxv9xv4q5d4wwm5ppx-source",
"rev": "2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1716330097,
"narHash": "sha256-8BO3B7e3BiyIDsaKA0tY8O88rClYRTjvAp66y+VBUeU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5710852ba686cc1fd0d3b8e22b3117d43ba374c2",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1743583204,
"narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2c8d3f48d33929642c1c12cd243df4cc7d2ce434",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_5": {
"locked": {
"lastModified": 1639237670,
"narHash": "sha256-RTdL4rEQcgaZGpvtDgkp3oK/V+1LM3I53n0ACPSroAQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "edfb969386ebe6c3cf8f878775a7975cd88f926d",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixpkgs",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"ghostty": "ghostty", "ghostty": "ghostty",
"git-hooks": "git-hooks", "git-hooks": "git-hooks",
"home-manager": "home-manager", "home-manager": "home-manager",
"homebrew-cask": "homebrew-cask",
"homebrew-core": "homebrew-core",
"homebrew-createzap": "homebrew-createzap",
"mac-app-util": "mac-app-util",
"nix-darwin": "nix-darwin",
"nix-homebrew": "nix-homebrew",
"nix-index-database": "nix-index-database", "nix-index-database": "nix-index-database",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_4",
"nixpkgs-firefox-darwin": "nixpkgs-firefox-darwin",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"treefmt-nix": "treefmt-nix", "treefmt-nix": "treefmt-nix",
"zen-browser": "zen-browser" "zen-browser": "zen-browser"
@ -261,11 +566,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742595978, "lastModified": 1743756170,
"narHash": "sha256-05onsoMrLyXE4XleDCeLC3bXnC4nyUbKWInGwM7v6hU=", "narHash": "sha256-2b11EYa08oqDmF3zEBLkG1AoNn9rB1k39ew/T/mSvbU=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "b7756921b002de60fb66782effad3ce8bdb5b25d", "rev": "cff8437c5fe8c68fc3a840a21bf1f4dc801da40d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -289,6 +594,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1689347925,
"narHash": "sha256-ozenz5bFe1UUqOn7f60HRmgc01BgTGIKZ4Xl+HbocGQ=",
"owner": "nix-systems",
"repo": "default-darwin",
"rev": "2235d7e6cc29ae99878133c95e9fe5e157661ffb",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default-darwin",
"type": "github"
}
},
"treefmt-nix": { "treefmt-nix": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -296,11 +616,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742370146, "lastModified": 1743748085,
"narHash": "sha256-XRE8hL4vKIQyVMDXykFh4ceo3KSpuJF3ts8GKwh5bIU=", "narHash": "sha256-uhjnlaVTWo5iD3LXics1rp9gaKgDRQj6660+gbUU3cE=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "adc195eef5da3606891cedf80c0d9ce2d3190808", "rev": "815e4121d6a5d504c0f96e5be2dd7f871e4fd99d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -311,16 +631,17 @@
}, },
"zen-browser": { "zen-browser": {
"inputs": { "inputs": {
"home-manager": "home-manager_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1742614294, "lastModified": 1743798013,
"narHash": "sha256-bZbYlP/xqGyW2aVle742dFbc0npFnwJBzcEnXNywJgY=", "narHash": "sha256-tu1oPYFWY8dPtalV7On0DVrrNqrn4g2pYyR5yBt44NU=",
"owner": "0xc000022070", "owner": "0xc000022070",
"repo": "zen-browser-flake", "repo": "zen-browser-flake",
"rev": "7fa9ec4e14d89e568ebaac302049980df7cf0cc9", "rev": "48684cc5214f41f1e3fd64e41660fc064cf01815",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -3,13 +3,8 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
zen-browser.url = "github:0xc000022070/zen-browser-flake";
zen-browser.inputs.nixpkgs.follows = "nixpkgs";
ghostty.url = "github:ghostty-org/ghostty"; ghostty.url = "github:ghostty-org/ghostty";
nix-index-database.url = "github:nix-community/nix-index-database"; nix-index-database.url = "github:nix-community/nix-index-database";
nix-index-database.inputs.nixpkgs.follows = "nixpkgs"; nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
@ -19,6 +14,26 @@
git-hooks.inputs.nixpkgs.follows = "nixpkgs"; git-hooks.inputs.nixpkgs.follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix"; sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs.nixpkgs.follows = "nixpkgs"; sops-nix.inputs.nixpkgs.follows = "nixpkgs";
# linux-only
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
zen-browser.url = "github:0xc000022070/zen-browser-flake";
zen-browser.inputs.nixpkgs.follows = "nixpkgs";
# darwin-only
nix-darwin.url = "github:nix-darwin/nix-darwin/master";
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
mac-app-util.url = "github:hraban/mac-app-util";
nixpkgs-firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
nix-homebrew.url = "github:zhaofengli/nix-homebrew";
homebrew-core.url = "github:homebrew/homebrew-core";
homebrew-core.flake = false;
homebrew-cask.url = "github:homebrew/homebrew-cask";
homebrew-cask.flake = false;
homebrew-createzap.url = "github:nrlquaker/homebrew-createzap";
homebrew-createzap.flake = false;
}; };
outputs = { outputs = {
@ -29,33 +44,19 @@
... ...
} @ inputs: let } @ inputs: let
inherit (self) outputs; inherit (self) outputs;
system = "x86_64-linux";
dots = "/home/rayandrew/dotfiles";
user = "rayandrew"; user = "rayandrew";
pkgs = import inputs.nixpkgs { lib = nixpkgs.lib;
inherit system; commonArgs = {
config.allowUnfree = true;
};
lib = import ./lib.nix {
inherit (nixpkgs) lib;
inherit pkgs;
inherit (inputs) home-manager;
};
createCommonArgs = system: {
inherit inherit
self self
inputs inputs
nixpkgs nixpkgs
lib lib
pkgs
system
dots
; ;
specialArgs = { specialArgs = {
inherit self inputs; inherit self inputs;
}; };
}; };
commonArgs = createCommonArgs system;
# call with forAllSystems (commonArgs: function body) # call with forAllSystems (commonArgs: function body)
forAllSystems = forAllSystems =
@ -65,7 +66,10 @@
"aarch64-linux" "aarch64-linux"
"x86_64-darwin" "x86_64-darwin"
"aarch64-darwin" "aarch64-darwin"
] (system: fn (createCommonArgs system)); ] (system: fn (commonArgs // { inherit system; pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
}; }));
treefmtEval = forAllSystems ( treefmtEval = forAllSystems (
{ pkgs, ... }: { pkgs, ... }:
treefmt-nix.lib.evalModule pkgs { treefmt-nix.lib.evalModule pkgs {

View file

@ -27,7 +27,7 @@
sd sd
ugrep ugrep
unzip unzip
gpclient # gpclient
openconnect openconnect
fd fd
ripgrep ripgrep
@ -36,7 +36,9 @@
gnumake gnumake
texinfo texinfo
devenv devenv
fontconfig
] ]
++ lib.optionals pkgs.stdenv.isDarwin [ coreutils ]
++ (lib.attrValues config.custom.shell.packages); ++ (lib.attrValues config.custom.shell.packages);
services = { services = {
@ -51,6 +53,7 @@
programs = { programs = {
nh = { nh = {
enable = true; enable = true;
package = pkgs.custom.nh;
clean.enable = true; clean.enable = true;
clean.extraArgs = "--keep-since 4d --keep 3"; clean.extraArgs = "--keep-since 4d --keep 3";
flake = dots; flake = dots;
@ -62,6 +65,10 @@
enable = true; enable = true;
enableVteIntegration = true; enableVteIntegration = true;
}; };
zsh = {
enable = true;
enableVteIntegration = true;
};
gpg = { gpg = {
enable = true; enable = true;
}; };
@ -95,6 +102,7 @@
}; };
}; };
systemd.user.sessionVariables = config.home.sessionVariables;
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "25.05"; home.stateVersion = "25.05";
}; };

View file

@ -283,7 +283,7 @@
(dired-deletion-confirmer #'y-or-n-p) (dired-deletion-confirmer #'y-or-n-p)
(dired-dwim-target t) (dired-dwim-target t)
;; (dired-listing-switches "-Alh") ;; (dired-listing-switches "-Alh")
(dired-listing-switches "-AlhcF --group-directories-first") (dired-listing-switches "-AlhcF")
(dired-auto-revert-buffer t)) (dired-auto-revert-buffer t))
(use-package dired-x (use-package dired-x

View file

@ -43,11 +43,17 @@
(elpaca elpaca-use-package (elpaca elpaca-use-package
(elpaca-use-package-mode)) (elpaca-use-package-mode))
;; (defun rs/get-default-font ()
;; (cond
;; ((eq system-type 'windows-nt) "Consolas-11")
;; ((eq system-type 'gnu/linux) "Consolas-11")
;; ((eq system-type 'darwin) "Consolas-11")))
(defun rs/get-default-font () (defun rs/get-default-font ()
(cond (cond
((eq system-type 'windows-nt) "Consolas-11") ((eq system-type 'windows-nt) "Consolas-11")
((eq system-type 'gnu/linux) "Consolas-11") ((eq system-type 'gnu/linux) "Consolas-11")
((eq system-type 'darwin) "Consolas-11"))) ((eq system-type 'darwin) "SF Mono-11")))
;; Font settings ;; Font settings
;; (set-frame-font (font-spec :size 13)) ;; (set-frame-font (font-spec :size 13))

View file

@ -1,117 +0,0 @@
{
config,
lib,
pkgs,
home-dir,
...
}:
let
cfg = config.services.davmail;
configType =
with lib.types;
oneOf [
(attrsOf configType)
str
int
bool
]
// {
description = "davmail config type (str, int, bool or attribute set thereof)";
};
toStr = val: if lib.isBool val then lib.boolToString val else toString val;
linesForAttrs =
attrs:
lib.concatMap (
name:
let
value = attrs.${name};
in
if lib.isAttrs value then
map (line: name + "." + line) (linesForAttrs value)
else
[ "${name}=${toStr value}" ]
) (lib.attrNames attrs);
configFile = pkgs.writeText "davmail.properties" (
lib.concatStringsSep "\n" (linesForAttrs cfg.config)
);
in
{
options.services.davmail = {
enable = lib.mkEnableOption "davmail, an MS Exchange gateway";
url = lib.mkOption {
type = lib.types.str;
description = "Outlook Web Access URL to access the exchange server, i.e. the base webmail URL.";
example = "https://outlook.office365.com/EWS/Exchange.asmx";
};
config = lib.mkOption {
type = configType;
default = { };
description = ''
Davmail configuration. Refer to
<http://davmail.sourceforge.net/serversetup.html>
and <http://davmail.sourceforge.net/advanced.html>
for details on supported values.
'';
example = lib.literalExpression ''
{
davmail.allowRemote = true;
davmail.imapPort = 55555;
davmail.bindAddress = "10.0.1.2";
davmail.smtpSaveInSent = true;
davmail.folderSizeLimit = 10;
davmail.caldavAutoSchedule = false;
log4j.logger.rootLogger = "DEBUG";
}
'';
};
};
config = lib.mkIf cfg.enable {
services.davmail.config = {
davmail = lib.mapAttrs (name: lib.mkDefault) {
server = true;
disableUpdateCheck = true;
logFilePath = "/tmp/davmail.log";
logFileSize = "1MB";
mode = "auto";
url = cfg.url;
caldavPort = 1080;
imapPort = 1143;
ldapPort = 1389;
popPort = 1110;
smtpPort = 1025;
oauth.tokenFilePath = "${home-dir}/.config/davmail/token";
};
log4j = {
logger.davmail = lib.mkDefault "WARN";
logger.httpclient.wire = lib.mkDefault "WARN";
logger.org.apache.commons.httpclient = lib.mkDefault "WARN";
rootLogger = lib.mkDefault "WARN";
};
};
systemd.user.services.davmail = {
Unit = {
Description = "DavMail POP/IMAP/SMTP Exchange Gateway";
};
Install = {
WantedBy = [ "default.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.davmail}/bin/davmail ${configFile}";
Restart = "on-failure";
};
};
home.packages = [ pkgs.davmail ];
};
}

View file

@ -9,7 +9,6 @@
{ {
imports = [ imports = [
./davmail.nix
./neomutt ./neomutt
./mailcap.nix ./mailcap.nix
]; ];
@ -23,11 +22,11 @@
config = lib.mkIf config.custom.email.enable { config = lib.mkIf config.custom.email.enable {
services.davmail = { services.davmail = {
enable = config.custom.email.davmail; enable = config.custom.email.davmail;
url = "https://outlook.office365.com/EWS/Exchange.asmx"; settings = {
config = { "davmail.mode" = "O365Manual";
davmail.mode = "O365Manual"; "davmail.url" = "https://outlook.office365.com/EWS/Exchange.asmx";
# davmail.mode = "O365Modern"; # davmail.mode = "O365Modern";
davmail.keepDelay = 30; "davmail.keepDelay" = 30;
# log4j.logger.davmail = "DEBUG"; # log4j.logger.davmail = "DEBUG";
}; };
}; };

View file

@ -3,8 +3,10 @@
pkgs, pkgs,
inputs, inputs,
lib, lib,
system-font,
... ...
}: }:
{ {
options.custom.gui = with lib; { options.custom.gui = with lib; {
ghostty = { ghostty = {
@ -13,15 +15,16 @@
}; };
config = lib.mkIf config.custom.gui.ghostty.enable { config = lib.mkIf config.custom.gui.ghostty.enable {
home.packages = with pkgs; [ home.packages = lib.mkIf pkgs.stdenv.isLinux (with pkgs; [
inputs.ghostty.packages."${system}".default inputs.ghostty.packages."${system}".default
]; ]);
xdg.configFile."ghostty/config".text = '' xdg.configFile."ghostty/config".text = ''
gtk-single-instance = false gtk-single-instance = true
gtk-titlebar = false gtk-titlebar = false
window-decoration = server window-decoration = server
quit-after-last-window-closed = true
# gtk-adwaita = false # gtk-adwaita = false
font-family = Consolas font-family = ${system-font}
font-size = 11 font-size = 11
app-notifications = no-clipboard-copy app-notifications = no-clipboard-copy
# theme = gruber-darker # theme = gruber-darker

View file

@ -15,9 +15,17 @@
./ghostty.nix ./ghostty.nix
]; ];
options.custom.gui.default = with lib; { options.custom.gui = with lib; {
default = {
enable = mkEnableOption "Enable Default GUI"; enable = mkEnableOption "Enable Default GUI";
}; };
linux = {
enable = mkEnableOption "Enable Linux-only GUI";
};
darwin = {
enable = mkEnableOption "Enable Darwin-only GUI";
};
};
config = lib.mkIf config.custom.gui.default.enable { config = lib.mkIf config.custom.gui.default.enable {
dconf.settings = { dconf.settings = {
@ -30,6 +38,7 @@
programs.vscode = { programs.vscode = {
enable = true; enable = true;
package = pkgs.vscode;
profiles.default = { profiles.default = {
extensions = with pkgs.vscode-extensions; [ extensions = with pkgs.vscode-extensions; [
bbenoist.nix bbenoist.nix
@ -46,27 +55,26 @@
}; };
}; };
programs.firefox = {
enable = true;
# package = lib.mkIf custom.gui.darwin.enable pkgs.firefox-bin or pkgs.firefox;
package = if config.custom.gui.darwin.enable then pkgs.firefox-bin else pkgs.firefox;
};
home.sessionVariables = lib.mkIf config.custom.gui.darwin.enable {
MOZ_LEGACY_PROFILES = "1";
};
# launchd.user.envVariables = lib.mkIf config.custom.gui.darwin.enable {
# MOZ_LEGACY_PROFILES = "1";
# };
home.packages = with pkgs; [ home.packages = with pkgs; [
inputs.zen-browser.packages."${system}".twilight
# globalprotect-openconnect # globalprotect-openconnect
firefox # firefox
chromium
zoom-us
slack
teams-for-linux
skypeforlinux
zotero
spotify
arandr
webex
kitty
seahorse # gnome keyring
xfce.thunar
xfce.thunar-volman
xclip
quickemu
gf # debugger
# fonts # fonts
custom.sf-mono
custom.sf-symbols
ultimate-oldschool-pc-font-pack ultimate-oldschool-pc-font-pack
vista-fonts vista-fonts
nerd-fonts.ubuntu-mono nerd-fonts.ubuntu-mono
@ -78,6 +86,29 @@
nerd-fonts.droid-sans-mono nerd-fonts.droid-sans-mono
nerd-fonts.space-mono nerd-fonts.space-mono
nerd-fonts.dejavu-sans-mono nerd-fonts.dejavu-sans-mono
]
++ lib.optionals config.custom.gui.darwin.enable [
raycast
custom.whatsapp-for-mac
]
++ lib.optionals config.custom.gui.linux.enable [
zotero
zoom-us
spotify
slack
webex
whatsapp-for-linux
teams-for-linux
skypeforlinux
inputs.zen-browser.packages."${system}".twilight
chromium
arandr
seahorse # gnome keyring
xfce.thunar
xfce.thunar-volman
xclip
quickemu
gf # debugger
]; ];
gtk = { gtk = {
@ -89,15 +120,13 @@
}; };
qt = { qt = {
enable = true; enable = config.custom.gui.linux.enable;
platformTheme.name = "adwaita"; platformTheme.name = "adwaita";
style.name = "adwaita-dark"; style.name = "adwaita-dark";
}; };
systemd.user.sessionVariables = config.home.sessionVariables;
services.redshift = { services.redshift = {
enable = true; enable = config.custom.gui.linux.enable;
# provider = "geoclue2"; # provider = "geoclue2";
provider = "manual"; provider = "manual";
# madison # madison

39
hosts/dango/default.nix Normal file
View file

@ -0,0 +1,39 @@
{
inputs,
lib,
config,
pkgs,
system,
dots,
user,
hm,
host,
...
}: {
imports = [
];
nixpkgs.hostPlatform = system;
nix.enable = false;
users.users = {
${user} = {
home = "/Users/${user}";
};
};
custom = {
aerospace.enable = true;
};
hm.custom = {
emacs.enable = true;
latex.enable = false;
gui = {
default.enable = true;
darwin.enable = true;
ghostty.enable = true;
};
};
}

View file

@ -1,28 +1,38 @@
{ {
inputs, inputs,
lib, lib,
system,
specialArgs, specialArgs,
dots,
user ? "rayandrew", user ? "rayandrew",
... ...
}: }:
let let
mkNixosConfiguration = mkNixosConfiguration =
host: host: system:
{ let
pkgs ? ( pkgs = import inputs.nixpkgs {
import inputs.nixpkgs {
inherit system; inherit system;
config.allowUnfree = true; config.allowUnfree = true;
} overlays = [
), (import ../overlays {
}: inherit inputs;
lib.nixosSystem { inherit (pkgs) system;
})
];
};
lib = (
import ../lib.nix {
inherit (inputs.nixpkgs) lib;
inherit pkgs; inherit pkgs;
inherit (inputs) home-manager;
}
);
in
lib.nixosSystem {
inherit pkgs lib;
specialArgs = specialArgs // { specialArgs = specialArgs // {
inherit host user dots; inherit host user;
dots = "/home/${user}/dotfiles";
}; };
modules = [ modules = [
@ -37,7 +47,9 @@ let
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = specialArgs // { extraSpecialArgs = specialArgs // {
inherit host user system dots; inherit host user system;
system-font = "Consolas";
dots = "/home/${user}/dotfiles";
home-dir = config.home-manager.users.${user}.home.homeDirectory; home-dir = config.home-manager.users.${user}.home.homeDirectory;
}; };
@ -60,10 +72,80 @@ let
inputs.sops-nix.nixosModules.sops inputs.sops-nix.nixosModules.sops
]; ];
}; };
mkDarwinConfiguration =
host: system:
let
pkgs = import inputs.nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
(import ../overlays {
inherit inputs;
inherit (pkgs) system;
})
inputs.nixpkgs-firefox-darwin.overlay
];
};
lib = (
import ../lib.nix {
inherit (inputs.nixpkgs) lib;
inherit pkgs;
inherit (inputs) home-manager;
}
);
in
inputs.nix-darwin.lib.darwinSystem {
inherit pkgs lib;
specialArgs = specialArgs // {
inherit host user;
dots = "/Users/${user}/dotfiles";
};
modules = [
./${host}
../darwin
({config, ...}: {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = specialArgs // {
inherit host user system;
system-font = "SF Mono";
home-dir = config.home-manager.users.${user}.home.homeDirectory;
dots = "/Users/${user}/dotfiles";
};
users.${user} = {
imports = [
inputs.nix-index-database.hmModules.nix-index
inputs.sops-nix.homeManagerModules.sops
inputs.mac-app-util.homeManagerModules.default
../home
] ++ lib.optional(builtins.pathExists ./${host}/home.nix) ./${host}/home.nix;
};
};
})
# alias for home-manager
(lib.mkAliasOptionModule [ "hm" ] [
"home-manager"
"users"
user
])
inputs.home-manager.darwinModules.home-manager
inputs.mac-app-util.darwinModules.default
inputs.nix-homebrew.darwinModules.nix-homebrew
];
};
in in
{ {
nixosConfigurations = { nixosConfigurations = {
pickwick = mkNixosConfiguration "pickwick" { }; pickwick = mkNixosConfiguration "pickwick" "x86_64-linux";
lemur = mkNixosConfiguration "lemur" { }; lemur = mkNixosConfiguration "lemur" "x86_64-linux";
};
darwinConfigurations = {
dango = mkDarwinConfiguration "dango" "aarch64-darwin";
}; };
} }

View file

@ -1,11 +1,7 @@
{ {
inputs, inputs,
pkgs,
... ...
}: }: _: prev: {
{
nixpkgs.overlays = [
(_: prev: {
# include nixpkgs stable # include nixpkgs stable
stable = import inputs.nixpkgs-stable { stable = import inputs.nixpkgs-stable {
inherit (prev.pkgs) system; inherit (prev.pkgs) system;
@ -22,6 +18,4 @@
# use nixfmt-rfc-style as the default # use nixfmt-rfc-style as the default
nixfmt = prev.nixfmt-rfc-style; nixfmt = prev.nixfmt-rfc-style;
})
];
} }

View file

@ -8,4 +8,8 @@ let
in rec { in rec {
minimal-emacs-d = callPackage ./minimal-emacs-d { }; minimal-emacs-d = callPackage ./minimal-emacs-d { };
boomer = callPackage ./boomer { }; boomer = callPackage ./boomer { };
nh = callPackage ./nh { };
whatsapp-for-mac = callPackage ./whatsapp-for-mac { };
sf-symbols = callPackage ./sf-symbols { full = true; };
sf-mono = callPackage ./sf-mono { };
} }

71
packages/nh/default.nix Normal file
View file

@ -0,0 +1,71 @@
{
stdenv,
lib,
rustPlatform,
installShellFiles,
makeBinaryWrapper,
darwin,
fetchFromGitHub,
nix-update-script,
nvd,
nix-output-monitor,
}:
let
version = "4.0.0-beta.11";
runtimeDeps = [
nvd
nix-output-monitor
];
in
rustPlatform.buildRustPackage {
inherit version;
pname = "nh";
src = fetchFromGitHub {
owner = "viperML";
repo = "nh";
tag = "v${version}";
hash = "sha256-ILEarFQp89V6RWr5GRU/ip9dB1SEqUFQGs1QMPrk9TQ=";
};
strictDeps = true;
nativeBuildInputs = [
installShellFiles
makeBinaryWrapper
];
buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.SystemConfiguration
];
preFixup = ''
mkdir completions
$out/bin/nh completions bash > completions/nh.bash
$out/bin/nh completions zsh > completions/nh.zsh
$out/bin/nh completions fish > completions/nh.fish
installShellCompletion completions/*
'';
postFixup = ''
wrapProgram $out/bin/nh \
--prefix PATH : ${lib.makeBinPath runtimeDeps}
'';
useFetchCargoVendor = true;
cargoHash = "sha256-GnRLUV5dyQgcjBBQXzjW0dvfHqIrlBlIup4b7oL8InI=";
passthru.updateScript = nix-update-script { };
meta = {
description = "Yet another nix cli helper";
homepage = "https://github.com/viperML/nh";
license = lib.licenses.eupl12;
mainProgram = "nh";
maintainers = with lib.maintainers; [
drupol
viperML
];
};
}

View file

@ -0,0 +1,43 @@
{
lib,
stdenvNoCC,
fetchurl,
undmg,
xar,
cpio,
}:
stdenvNoCC.mkDerivation rec {
pname = "sf-mono";
version = "2025-04-05";
src = fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Mono.dmg";
sha256 = "sha256-bUoLeOOqzQb5E/ZCzq0cfbSvNO1IhW1xcaLgtV2aeUU=";
};
nativeBuildInputs = [
cpio
xar
undmg
];
unpackPhase = ''
undmg $src
xar -xf SF\ Mono\ Fonts.pkg
cd SFMonoFonts.pkg
zcat Payload | cpio -id
'';
sourceRoot = ".";
installPhase = ''
mkdir -p $out/share/fonts/truetype
cp ./Library/Fonts/* $out/share/fonts/truetype
'';
meta = {
description = "SF Mono";
homepage = "https://developer.apple.com/fonts/";
platforms = lib.platforms.all;
};
}

View file

@ -0,0 +1,63 @@
{
lib,
stdenvNoCC,
fetchurl,
undmg,
xar,
cpio,
fonts ? true,
full ? false,
app ? false,
}:
stdenvNoCC.mkDerivation rec {
pname = "sf-symbols";
version = "6";
src = fetchurl {
url = "https://devimages-cdn.apple.com/design/resources/download/SF-Symbols-${version}.dmg";
sha256 = "sha256-hG6QyidNVtI0pXO698oGVsG4awy8XWr27nEyYSUMhPo=";
};
nativeBuildInputs = [
cpio
xar
undmg
];
unpackPhase = ''
undmg $src
xar -xf SF\ Symbols.pkg
cd SFSymbols.pkg
zcat Payload | cpio -id
'';
sourceRoot = ".";
installPhase =
''
''
+ lib.optionalString fonts ''
mkdir -p $out/share/fonts/truetype
cp ./Library/Fonts/${
if full
then "*"
else "SF-Pro.ttf"
} $out/share/fonts/truetype
''
+ lib.optionalString app ''
mkdir -p $out/Applications
cp -R ./Applications/SF\ Symbols.app $out/Applications
'';
meta = {
description =
if app
then "Tool that provides consistent, highly configurable symbols for apps"
else "Fonts from SF Symbols";
homepage = "https://developer.apple.com/sf-symbols/";
platforms =
if app
then lib.platforms.darwin
else lib.platforms.all;
};
}

View file

@ -0,0 +1,58 @@
{
lib,
fetchzip,
stdenvNoCC,
writeShellApplication,
curl,
xmlstarlet,
common-updater-scripts,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "whatsapp-for-mac";
version = "2.25.8.76";
src = fetchzip {
extension = "zip";
name = "WhatsApp.app";
url = "https://web.whatsapp.com/desktop/mac_native/release/?version=${finalAttrs.version}&extension=zip&configuration=Release&branch=relbranch";
hash = "sha256-yrQSGnAr5qDNZ7ouqxHlYed2SLBCOu66aKFOzyiegaU=";
};
dontConfigure = true;
dontBuild = true;
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p "$out/Applications"
cp -r *.app "$out/Applications"
runHook postInstall
'';
passthru.updateScript = lib.getExe (writeShellApplication {
name = "whatsapp-update-script";
runtimeInputs = [
curl
xmlstarlet
common-updater-scripts
];
text = ''
url=$(curl --silent "https://web.whatsapp.com/desktop/mac_native/updates/?branch=relbranch&configuration=Release")
version=$(echo "$url" | xmlstarlet sel -t -v "substring-before(substring-after(//enclosure/@url, 'version='), '&')")
update-source-version whatsapp-for-mac "$version" --file=./pkgs/by-name/wh/whatsapp-for-mac/package.nix
'';
});
meta = {
description = "Native desktop client for WhatsApp";
homepage = "https://www.whatsapp.com/";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ iivusly ];
platforms = lib.platforms.darwin;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})