summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorseth <[email protected]>2023-07-23 22:20:29 -0400
committerseth <[email protected]>2023-07-24 03:56:43 +0000
commit9934332f70b51640878fff8c0e7852532f069996 (patch)
tree01488a73a541d21aca10841f4e2ccab1985a92d2 /modules
parent418fb8a9c75cfa4c10e0257d3aec43443cadca2a (diff)
modules/darwin: init desktop module
Diffstat (limited to 'modules')
-rw-r--r--modules/darwin/default.nix1
-rw-r--r--modules/darwin/desktop/default.nix22
-rw-r--r--modules/darwin/desktop/homebrew.nix38
3 files changed, 61 insertions, 0 deletions
diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix
index 0199860..ed9c7e1 100644
--- a/modules/darwin/default.nix
+++ b/modules/darwin/default.nix
@@ -1,5 +1,6 @@
_: {
imports = [
./base
+ ./desktop
];
}
diff --git a/modules/darwin/desktop/default.nix b/modules/darwin/desktop/default.nix
new file mode 100644
index 0000000..e4693a7
--- /dev/null
+++ b/modules/darwin/desktop/default.nix
@@ -0,0 +1,22 @@
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}: let
+ cfg = config.getchoo.desktop;
+ inherit (lib) mkDefault mkEnableOption mkIf;
+in {
+ options.getchoo.desktop.enable = mkEnableOption "base nixos module";
+
+ imports = [
+ ./homebrew.nix
+ ];
+
+ config = mkIf cfg.enable {
+ fonts.fonts = with pkgs;
+ mkDefault [
+ (nerdfonts.override {fonts = ["FiraCode"];})
+ ];
+ };
+}
diff --git a/modules/darwin/desktop/homebrew.nix b/modules/darwin/desktop/homebrew.nix
new file mode 100644
index 0000000..d1e3649
--- /dev/null
+++ b/modules/darwin/desktop/homebrew.nix
@@ -0,0 +1,38 @@
+{
+ config,
+ lib,
+ ...
+}: let
+ cfg = config.getchoo.desktop.homebrew;
+ inherit (lib) mkDefault mkEnableOption mkIf;
+in {
+ options.getchoo.desktop.homebrew.enable = mkEnableOption "enable homebrew support";
+
+ config = mkIf cfg.enable {
+ homebrew = {
+ enable = mkDefault true;
+ caskArgs.require_sha = true;
+ onActivation = mkDefault {
+ autoUpdate = true;
+ cleanup = "uninstall";
+ upgrade = true;
+ };
+
+ casks = let
+ # thanks @nekowinston :p
+ skipSha = name: {
+ inherit name;
+ args = {require_sha = false;};
+ };
+ noQuarantine = name: {
+ inherit name;
+ args = {no_quarantine = true;};
+ };
+ in
+ mkDefault [
+ "firefox"
+ (lib.recursiveUpdate (noQuarantine "chromium") (skipSha "chromium"))
+ ];
+ };
+ };
+}