This commit is contained in:
Rasyidan Akbar F. 2025-09-26 15:50:15 +07:00
commit bcbd699c4c
11 changed files with 786 additions and 124 deletions

View file

@ -0,0 +1,48 @@
{ config, pkgs, lib, ... }:
let
inherit (lib) mkIf mkOption types;
cfg = config.rsydn.systemPackages;
in {
options.rsydn.systemPackages = {
enable = mkOption {
type = types.bool;
default = true;
description = "Enable system-wide development packages.";
};
packages = mkOption {
type = types.listOf types.package;
default = with pkgs; [
ast-grep
duckdb
ffmpeg
fzf
go
htop
jetbrains-mono
jq
lazydocker
lazygit
lorri
neovim
pandoc
postgresql_18
python312
python312Packages.uv
ripgrep
rustc
rustup
tree
vim
yq
tmux
tailscale
sqlite
wget
];
description = "System packages to install for development tooling.";
};
};
config = mkIf cfg.enable { environment.systemPackages = cfg.packages; };
}

View file

@ -0,0 +1,66 @@
{ config, lib, ... }:
let
inherit (lib) mkIf mkOption types;
cfg = config.rsydn.homebrew;
in {
options.rsydn.homebrew = {
enable = mkOption {
type = types.bool;
default = true;
description = "Whether to manage Homebrew declaratively.";
};
taps = mkOption {
type = types.listOf types.str;
default = [ ];
description = "Homebrew taps to add.";
};
brews = mkOption {
type = types.listOf types.str;
default = [
"curl"
"yt-dlp"
"nodejs"
"charmbracelet/tap/crush"
"sst/tap/opencode"
"ruff"
"libmagic"
"ghostscript"
"infisical"
"fastfetch"
];
description = "Homebrew formulae to install.";
};
casks = mkOption {
type = types.listOf types.str;
default = [
"bitwarden"
"chromium"
"dbngin"
"pgadmin14"
"docker-desktop"
"spotify"
"discord"
"obs"
"neohtop"
"orbstack"
"visual-studio-code"
"google-chrome@canary"
"mactex"
];
description = "Homebrew casks to install.";
};
};
config = mkIf cfg.enable {
homebrew = {
enable = true;
global.autoUpdate = false;
onActivation = {
autoUpdate = false;
cleanup = "zap";
upgrade = false;
};
inherit (cfg) taps brews casks;
};
};
}

50
modules/darwin/system.nix Normal file
View file

@ -0,0 +1,50 @@
{ config, pkgs, lib, ... }: {
imports = [ ./homebrew.nix ./devtools.nix ];
services.nix-daemon.enable = true;
nix = {
package = pkgs.nix;
extraOptions = ''
keep-derivations = true
keep-outputs = true
'';
settings = {
experimental-features = [ "nix-command" "flakes" ];
auto-optimise-store = true;
warn-dirty = false;
};
gc = {
automatic = true;
interval = {
Weekday = 0;
Hour = 3;
Minute = 30;
};
options = "--delete-older-than 30d";
};
};
system = {
stateVersion = "24.05";
defaults = {
NSGlobalDomain = {
ApplePressAndHoldEnabled = false;
KeyRepeat = 2;
InitialKeyRepeat = 15;
};
dock = {
autohide = true;
show-recents = false;
tilesize = 48;
};
finder = {
AppleShowAllExtensions = true;
AppleShowAllFiles = true;
};
};
};
security.pam.enableSudoTouchIdAuth = true;
}