diff --git a/darwin/common/aerospace.nix b/darwin/common/aerospace.nix new file mode 100644 index 00000000..bc5a4ff5 --- /dev/null +++ b/darwin/common/aerospace.nix @@ -0,0 +1,119 @@ +{ pkgs, ... }: +{ + services.aerospace = { + enable = false; + package = pkgs.aerospace; + settings = { + enable-normalization-opposite-orientation-for-nested-containers = true; + enable-normalization-flatten-containers = true; + on-focused-monitor-changed = [ "move-mouse monitor-lazy-center" ]; + key-mapping.preset = "qwerty"; + + gaps = { + outer.top = 8; + outer.right = 8; + outer.bottom = 8; + outer.left = 8; + inner.horizontal = 8; + inner.vertical = 8; + }; + + mode.main.binding = { + alt-enter = "exec-and-forget open -n '/Applications/Nix Apps/Alacritty.app'"; + alt-backtick = "exec-and-forget /Applications/1Password.app/Contents/MacOS/1Password --quick-access"; + alt-f = "fullscreen"; + + 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-shift-1 = "move-node-to-workspace 1"; + alt-shift-2 = "move-node-to-workspace 2"; + alt-shift-3 = "move-node-to-workspace 3"; + alt-shift-4 = "move-node-to-workspace 4"; + alt-shift-5 = "move-node-to-workspace 5"; + alt-shift-6 = "move-node-to-workspace 6"; + alt-shift-7 = "move-node-to-workspace 7"; + alt-shift-8 = "move-node-to-workspace 8"; + alt-shift-9 = "move-node-to-workspace 9"; + + # See: https://nikitabobko.github.io/AeroSpace/commands#layout + alt-a = "layout tiles horizontal vertical"; + alt-comma = "layout accordion horizontal vertical"; + alt-shift-space = "layout floating tiling"; + + # alt-h = "split horizontal"; + # alt-v = "split vertical"; + + # See: https://nikitabobko.github.io/AeroSpace/commands#focus + alt-left = "focus left"; + alt-down = "focus down"; + alt-up = "focus up"; + alt-right = "focus right"; + + # See: https://nikitabobko.github.io/AeroSpace/commands#move + alt-shift-left = "move left"; + alt-shift-down = "move down"; + alt-shift-up = "move up"; + alt-shift-right = "move right"; + + # See: https://nikitabobko.github.io/AeroSpace/commands#resize + alt-shift-minus = "resize smart -50"; + alt-shift-equal = "resize smart +50"; + + # See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth + alt-tab = "workspace-back-and-forth"; + + alt-r = "mode resize"; + alt-shift-semicolon = "mode service"; + }; + + mode.resize.binding = { + # Resize the window + left = "resize width -50"; + up = "resize height +50"; + down = "resize height -50"; + right = "resize width +50"; + enter = "mode main"; + esc = "mode main"; + }; + + mode.service.binding = { + esc = "mode main"; + r = [ + "flatten-workspace-tree" + "mode main" + ]; + f = [ + "layout floating tiling" + "mode main" + ]; + + left = [ + "join-with left" + "mode main" + ]; + right = [ + "join-with right" + "mode main" + ]; + up = [ + "join-with up" + "mode main" + ]; + down = [ + "join-with down" + "mode main" + ]; + }; + + on-window-detected = [ ]; + }; + }; +} diff --git a/darwin/common/default.nix b/darwin/common/default.nix new file mode 100644 index 00000000..1e25c83e --- /dev/null +++ b/darwin/common/default.nix @@ -0,0 +1,9 @@ +{ ... }: +{ + imports = [ + ./fonts.nix + ./macos-defaults.nix + ./packages.nix + ./ssh-agent.nix + ]; +} diff --git a/darwin/common/fonts.nix b/darwin/common/fonts.nix new file mode 100644 index 00000000..29bdc54b --- /dev/null +++ b/darwin/common/fonts.nix @@ -0,0 +1,13 @@ +{ self, pkgs, ... }: +let + theme = import "${self}/lib/theme" { inherit pkgs; }; +in +{ + fonts = { + packages = [ + theme.fonts.default.package + theme.fonts.iconFont.package + theme.fonts.monospace.package + ]; + }; +} diff --git a/darwin/common/macos-defaults.nix b/darwin/common/macos-defaults.nix new file mode 100644 index 00000000..d66464e7 --- /dev/null +++ b/darwin/common/macos-defaults.nix @@ -0,0 +1,105 @@ +{ hostname, ... }: +{ + system.defaults = { + CustomUserPreferences = { + "com.apple.AdLib" = { + allowApplePersonalizedAdvertising = false; + }; + "com.apple.controlcenter" = { + BatteryShowPercentage = true; + }; + "com.apple.desktopservices" = { + # Avoid creating .DS_Store files on network or USB volumes + DSDontWriteNetworkStores = true; + DSDontWriteUSBStores = true; + }; + "com.apple.finder" = { + _FXSortFoldersFirst = true; + FXDefaultSearchScope = "SCcf"; # Search current folder by default + ShowExternalHardDrivesOnDesktop = false; + ShowHardDrivesOnDesktop = false; + ShowMountedServersOnDesktop = false; + ShowRemovableMediaOnDesktop = false; + }; + # Prevent Photos from opening automatically + "com.apple.ImageCapture".disableHotPlug = true; + "com.apple.screencapture" = { + location = "~/Pictures/Screenshots"; + type = "png"; + }; + "com.apple.SoftwareUpdate" = { + AutomaticCheckEnabled = true; + # Check for software updates daily, not just once per week + ScheduleFrequency = 1; + # Download newly available updates in background + AutomaticDownload = 0; + # Install System data files & security updates + CriticalUpdateInstall = 1; + }; + "com.apple.TimeMachine".DoNotOfferNewDisksForBackup = true; + # Turn on app auto-update + "com.apple.commerce".AutoUpdate = true; + }; + NSGlobalDomain = { + AppleICUForce24HourTime = true; + # AppleInterfaceStyle = "Dark"; + # AppleInterfaceStyleSwitchesAutomatically = false; + AppleMeasurementUnits = "Centimeters"; + AppleMetricUnits = 1; + AppleTemperatureUnit = "Celsius"; + InitialKeyRepeat = 15; + KeyRepeat = 2; + NSAutomaticCapitalizationEnabled = false; + NSAutomaticDashSubstitutionEnabled = false; + NSAutomaticPeriodSubstitutionEnabled = false; + NSAutomaticQuoteSubstitutionEnabled = false; + NSAutomaticSpellingCorrectionEnabled = true; + NSNavPanelExpandedStateForSaveMode = true; + NSNavPanelExpandedStateForSaveMode2 = true; + NSWindowShouldDragOnGesture = true; + # _HIHideMenuBar = true; + }; + SoftwareUpdate = { + AutomaticallyInstallMacOSUpdates = false; + }; + dock = { + orientation = "bottom"; + # persistent-apps = [ + # "/System/Applications/Launchpad.app" + # ]; + # show-recents = false; + # tilesize = 48; + # Disable hot corners + wvous-bl-corner = 1; + wvous-br-corner = 1; + wvous-tl-corner = 1; + wvous-tr-corner = 1; + }; + finder = { + _FXShowPosixPathInTitle = true; + FXEnableExtensionChangeWarning = false; + FXPreferredViewStyle = "Nlsv"; + AppleShowAllExtensions = true; + AppleShowAllFiles = true; + QuitMenuItem = true; + ShowPathbar = true; + ShowStatusBar = true; + }; + menuExtraClock = { + ShowAMPM = false; + ShowDate = 1; # Always + Show24Hour = true; + ShowSeconds = false; + }; + screensaver = { + askForPassword = true; + askForPasswordDelay = 300; + }; + smb.NetBIOSName = hostname; + trackpad = { + Clicking = true; + TrackpadRightClick = true; # enable two finger right click + # TrackpadThreeFingerDrag = true; # enable three finger drag + }; + }; +} diff --git a/darwin/common/packages.nix b/darwin/common/packages.nix new file mode 100644 index 00000000..29e8656f --- /dev/null +++ b/darwin/common/packages.nix @@ -0,0 +1,49 @@ +{ + pkgs, + lib, + self, + ... +}: +let + inherit ((import "${self}/host/common/base/packages.nix" { inherit pkgs lib; })) basePackages; +in +{ + homebrew = { + brews = [ ]; + casks = [ + "1password" + "1password-cli" + "bambu-studio" + "bartender" + "easy-move+resize" + "iterm2" + "google-chrome" + "obsidian" + "rambox" + "raycast" + "signal" + "soundsource" + "sublime-merge" + "tailscale" + "todoist" + "visual-studio-code" + "vlc" + "zen-browser" + "zoom" + ]; + masApps = { }; + taps = [ ]; + }; + + environment.systemPackages = + basePackages + ++ (with pkgs; [ + coreutils-full + gnugrep + gnused + m-cli + mas + plistwatch + yubikey-manager + ]); +} diff --git a/darwin/common/scripts/build-all.sh b/darwin/common/scripts/build-all.sh new file mode 100644 index 00000000..b8d41525 --- /dev/null +++ b/darwin/common/scripts/build-all.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# if nh-home is in the PATH then use it +if command -v nh-home &> /dev/null; then + nh-home build +else + nix run nixpkgs#home-manager -- build --flake "$HOME/nixos-config" -L +fi +build-host diff --git a/darwin/common/scripts/build-host.sh b/darwin/common/scripts/build-host.sh new file mode 100644 index 00000000..6366e99b --- /dev/null +++ b/darwin/common/scripts/build-host.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +HOST=$(hostname) +if [ -e ~/nixos-config ]; then + all_cores=$(nproc) + build_cores=$(printf "%.0f" "$(echo "${all_cores} * 0.75" | bc)") + echo "Building nix-darwin ❄️ with ${build_cores} cores" + pushd ~/nixos-config + nom build ".#darwinConfigurations.${HOST}.config.system.build.toplevel" --cores "${build_cores}" + popd +else + echo "ERROR! No nix-config found in ~/nixos-config" +fi diff --git a/darwin/common/scripts/default.nix b/darwin/common/scripts/default.nix new file mode 100644 index 00000000..d02bab9d --- /dev/null +++ b/darwin/common/scripts/default.nix @@ -0,0 +1,54 @@ +{ pkgs, ... }: +let + build-all = pkgs.writeShellApplication { + name = "build-all"; + runtimeInputs = with pkgs; [ + coreutils-full + ]; + text = builtins.readFile ./build-all.sh; + }; + + build-host = pkgs.writeShellApplication { + name = "build-host"; + runtimeInputs = with pkgs; [ + bc + coreutils-full + nix-output-monitor + ]; + text = builtins.readFile ./build-host.sh; + }; + + install-homebrew = pkgs.writeShellApplication { + name = "install-homebrew"; + runtimeInputs = with pkgs; [ + curl + ]; + text = builtins.readFile ./install-homebrew.sh; + }; + + switch-all = pkgs.writeShellApplication { + name = "switch-all"; + runtimeInputs = with pkgs; [ + coreutils-full + ]; + text = builtins.readFile ./switch-all.sh; + }; + + switch-host = pkgs.writeShellApplication { + name = "switch-host"; + runtimeInputs = with pkgs; [ + bc + coreutils-full + ]; + text = builtins.readFile ./switch-host.sh; + }; +in +{ + environment.systemPackages = [ + build-all + build-host + install-homebrew + switch-all + switch-host + ]; +} diff --git a/darwin/common/scripts/install-homebrew.sh b/darwin/common/scripts/install-homebrew.sh new file mode 100644 index 00000000..b394cd2f --- /dev/null +++ b/darwin/common/scripts/install-homebrew.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" diff --git a/darwin/common/scripts/switch-all.sh b/darwin/common/scripts/switch-all.sh new file mode 100644 index 00000000..fc641b45 --- /dev/null +++ b/darwin/common/scripts/switch-all.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# if nh-home is in the PATH then use it +if command -v nh-home &> /dev/null; then + nh-home build +else + nix run nixpkgs#home-manager -- switch --flake "$HOME/nixos-config" -L +fi +switch-host diff --git a/darwin/common/scripts/switch-host.sh b/darwin/common/scripts/switch-host.sh new file mode 100644 index 00000000..0aea6d4d --- /dev/null +++ b/darwin/common/scripts/switch-host.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +if [ -e "${HOME}/nixos-config" ]; then + all_cores=$(sysctl -n hw.logicalcpu) + build_cores=$(printf "%.0f" "$(echo "${all_cores} * 0.75" | bc)") + echo "Switch nix-darwin ❄️ with ${build_cores} cores" + nix run nix-darwin -- switch --flake "${HOME}/nixos-config" --cores "${build_cores}" -L +else + echo "ERROR! No nix-config found in ${HOME}/nixos-config" +fi diff --git a/darwin/common/ssh-agent.nix b/darwin/common/ssh-agent.nix new file mode 100644 index 00000000..8d1b0013 --- /dev/null +++ b/darwin/common/ssh-agent.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +{ + launchd = { + user = { + agents = { + openssh-ssh-agent = { + serviceConfig = { + KeepAlive = true; + RunAtLoad = true; + ProgramArguments = [ + "sh" + "-c" + "${pkgs.openssh}/bin/ssh-agent -D -a ~/.ssh/agent" + ]; + }; + }; + }; + }; + }; +} diff --git a/darwin/default.nix b/darwin/default.nix new file mode 100644 index 00000000..3f57d81b --- /dev/null +++ b/darwin/default.nix @@ -0,0 +1,100 @@ +{ + hostname, + inputs, + lib, + outputs, + pkgs, + platform, + + ... +}: + +{ + imports = [ + ./${hostname} + ./common + ./common/scripts + ]; + + networking = { + hostName = hostname; + computerName = hostname; + }; + + environment = { + shells = [ pkgs.zsh ]; + variables = { + SSH_AUTH_SOCK = "~/.ssh/agent"; + }; + }; + + homebrew = { + enable = true; + onActivation = { + autoUpdate = true; + upgrade = true; + cleanup = "zap"; + }; + }; + + nixpkgs = { + hostPlatform = lib.mkDefault "${platform}"; + + overlays = [ + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + inputs.agenix.overlays.default + ]; + + config = { + allowUnfree = true; + joypixels.acceptLicense = true; + }; + }; + + nix = { + optimise.automatic = true; + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + warn-dirty = false; + trusted-users = [ + "jon" + ]; + }; + }; + + # Enable TouchID for sudo authentication + security.pam.enableSudoTouchIdAuth = true; + + services = { + activate-system.enable = true; + nix-daemon.enable = true; + tailscale.enable = true; + }; + + system = { + # Nix Darwin state version. + stateVersion = 5; + # activationScripts run every time you boot the system or execute `darwin-rebuild` + activationScripts = { + diff = { + supportsDryActivation = true; + text = '' + ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff /run/current-system "$systemConfig" + ''; + }; + + postUserActivation.text = '' + # reload the settings and apply them without the need to logout/login + /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u + + # disable the built-in ssh agent + launchctl disable user/$UID/com.openssh.ssh-agent + ''; + }; + }; +} diff --git a/darwin/mars/default.nix b/darwin/mars/default.nix new file mode 100644 index 00000000..7a30a9b1 --- /dev/null +++ b/darwin/mars/default.nix @@ -0,0 +1,6 @@ +{ self, ... }: +{ + imports = [ + "${self}/darwin/common/aerospace.nix" + ]; +} diff --git a/flake.lock b/flake.lock index c734c29f..075552fa 100644 --- a/flake.lock +++ b/flake.lock @@ -292,6 +292,26 @@ "type": "github" } }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "unstable" + ] + }, + "locked": { + "lastModified": 1731454423, + "narHash": "sha256-TtwvgFxUa0wyptLhQbKaixgNW1UXf3+TDqfX3Kp63oM=", + "owner": "LnL7", + "repo": "nix-darwin", + "rev": "6c71c49e2448e51ad830ed211024e6d0edc50116", + "type": "github" + }, + "original": { + "owner": "LnL7", + "repo": "nix-darwin", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1730919458, @@ -393,6 +413,7 @@ "lanzaboote": "lanzaboote", "libations": "libations", "master": "master", + "nix-darwin": "nix-darwin", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_2", "unstable": "unstable", diff --git a/flake.nix b/flake.nix index 7b7957d7..6d1d3240 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,9 @@ master.url = "github:nixos/nixpkgs/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + nix-darwin.url = "github:LnL7/nix-darwin"; + nix-darwin.inputs.nixpkgs.follows = "unstable"; + agenix.url = "github:ryantm/agenix"; agenix.inputs.nixpkgs.follows = "unstable"; @@ -63,6 +66,10 @@ hostname = "kara"; desktop = "hyprland"; }; + "${username}@mars" = libx.mkHome { + hostname = "mars"; + system = "aarch64-darwin"; + }; # Headless machines "${username}@hugin" = libx.mkHome { hostname = "hugin"; }; "${username}@thor" = libx.mkHome { hostname = "thor"; }; @@ -102,6 +109,14 @@ }; }; + #nix run nix-darwin -- switch --flake ~/nix-config + #nix build .#darwinConfigurations.{hostname}.config.system.build.toplevel + darwinConfigurations = { + mars = libx.mkDarwin { + hostname = "mars"; + }; + }; + # Custom packages; acessible via 'nix build', 'nix shell', etc packages = libx.forAllSystems ( system: diff --git a/home/common/desktop/alacritty.nix b/home/common/desktop/alacritty.nix index a5ec1f1e..cea0e491 100644 --- a/home/common/desktop/alacritty.nix +++ b/home/common/desktop/alacritty.nix @@ -7,10 +7,6 @@ in enable = true; catppuccin.enable = true; settings = { - env = { - TERM = "alacritty"; - }; - window = { padding = { x = 20; @@ -26,7 +22,7 @@ in font = { normal.family = "${theme.fonts.monospace.name}"; - size = 14; + size = if pkgs.stdenv.isLinux then 14 else 18; }; }; }; diff --git a/home/common/dev/base.nix b/home/common/dev/base.nix index cc0b17d5..df524b30 100644 --- a/home/common/dev/base.nix +++ b/home/common/dev/base.nix @@ -1,53 +1,57 @@ { pkgs, ... }: { - home.packages = with pkgs; [ - # Rust tooling - cargo - rust-analyzer - rustfmt - rustc - - gnumake - gcc - - nodejs - nodePackages_latest.prettier - - spread - - # Container tooling - dive - kubectl - skopeo - - # Go tooling - go - go-tools - gofumpt - gopls - - # Nix tooling - deadnix - nil - nix-init - # My custom wrapper that does nixfmt + deadnix + statix - nixfmt-plus - nixfmt-rfc-style - nurl - statix - - # Python tooling - ruff - uv - (pkgs.python3.withPackages ( - p: with p; [ - tox - virtualenv - ] - )) - - # Shell tooling - shellcheck - shfmt - ]; + home.packages = + with pkgs; + [ + # Rust tooling + cargo + rust-analyzer + rustfmt + rustc + + gnumake + gcc + + nodejs + nodePackages_latest.prettier + + # Container tooling + dive + kubectl + skopeo + + # Go tooling + go + go-tools + gofumpt + gopls + + # Nix tooling + deadnix + nil + nix-init + # My custom wrapper that does nixfmt + deadnix + statix + nixfmt-plus + nixfmt-rfc-style + nurl + statix + + # Python tooling + ruff + uv + (pkgs.python3.withPackages ( + p: with p; [ + tox + virtualenv + ] + )) + + # Shell tooling + shellcheck + shfmt + ] + ++ lib.optionals pkgs.stdenv.isLinux [ + # TODO(jnsgruk): Fix the upstream package so it builds on Darwin too. + spread + ]; } diff --git a/home/common/shell/default.nix b/home/common/shell/default.nix index b29ff06e..e37c76b3 100644 --- a/home/common/shell/default.nix +++ b/home/common/shell/default.nix @@ -1,4 +1,8 @@ -{ pkgs, self, ... }: +{ + pkgs, + self, + ... +}: let theme = import "${self}/lib/theme" { inherit pkgs; }; in @@ -13,8 +17,8 @@ in ./starship.nix ./tmux.nix ./vim.nix - ./xdg.nix ./zsh.nix + ./xdg.nix ]; catppuccin = { diff --git a/home/common/shell/fastfetch.jsonc b/home/common/shell/fastfetch.jsonc index 5bfd48d7..f0aae529 100644 --- a/home/common/shell/fastfetch.jsonc +++ b/home/common/shell/fastfetch.jsonc @@ -9,11 +9,13 @@ }, "display": { "separator": "", - "binaryPrefix": "si", "size": { + "binaryPrefix": "si", "ndigits": 0 }, - "keyWidth": 4 + "key": { + "width": 4 + } }, "modules": [ "break", diff --git a/home/common/shell/xdg.nix b/home/common/shell/xdg.nix index 3904f687..503c4b52 100644 --- a/home/common/shell/xdg.nix +++ b/home/common/shell/xdg.nix @@ -1,4 +1,9 @@ -{ config, lib, ... }: +{ + config, + lib, + pkgs, + ... +}: { xdg = { enable = true; @@ -8,7 +13,7 @@ dataHome = config.home.homeDirectory + "/.local/share"; stateHome = config.home.homeDirectory + "/.local/state"; - userDirs = { + userDirs = lib.mkIf pkgs.stdenv.isLinux { enable = true; createDirectories = lib.mkDefault true; diff --git a/home/common/shell/zsh.nix b/home/common/shell/zsh.nix index 28d93403..8427dd00 100644 --- a/home/common/shell/zsh.nix +++ b/home/common/shell/zsh.nix @@ -1,3 +1,4 @@ +{ pkgs, lib, ... }: { programs = { zsh = { @@ -162,7 +163,6 @@ jsrw = "juju status --watch 1s --color --relations"; jdl = "juju debug-log"; - open = "xdg-open"; k = "kubectl"; opget = "op item get \"$(op item list --format=json | jq -r '.[].title' | fzf)\""; diff --git a/home/common/users/jon/mars.nix b/home/common/users/jon/mars.nix new file mode 100644 index 00000000..663f5de4 --- /dev/null +++ b/home/common/users/jon/mars.nix @@ -0,0 +1,21 @@ +{ self, ... }: +{ + imports = [ + "${self}/home/common/desktop/alacritty.nix" + "${self}/home/common/dev/base.nix" + ]; + + services = { + syncthing = { + enable = true; + extraOptions = [ + "-gui-address=mars.tailnet-d5da.ts.net:8384" + "-home=/Users/jon/.syncthing" + ]; + }; + }; + + programs.zsh.sessionVariables = { + SSH_AUTH_SOCK = "/Users/jon/.ssh/agent"; + }; +} diff --git a/home/default.nix b/home/default.nix index ad15d5b2..47382f45 100644 --- a/home/default.nix +++ b/home/default.nix @@ -6,8 +6,12 @@ stateVersion, username, inputs, + pkgs, ... }: +let + inherit (pkgs.stdenv) isDarwin; +in { # Only import desktop configuration if the host is desktop enabled # Only import user specific configuration if they have bespoke settings @@ -28,7 +32,7 @@ home = { inherit username stateVersion; - homeDirectory = "/home/${username}"; + homeDirectory = if isDarwin then "/Users/jon" else "/home/${username}"; }; nixpkgs = { diff --git a/host/common/base/packages.nix b/host/common/base/packages.nix index e73a90a1..8b423c5b 100644 --- a/host/common/base/packages.nix +++ b/host/common/base/packages.nix @@ -1,33 +1,37 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { - basePackages = with pkgs; [ - unstable._1password-cli - agenix - bat - binutils - curl - cyme - dig - dua - duf - eza - fd - file - git - jq - killall - nfs-utils - ntfs3g - pciutils - ripgrep - rsync - tpm2-tss - traceroute - tree - unzip - usbutils - vim - wget - yq-go - ]; + basePackages = + with pkgs; + [ + agenix + bat + binutils + curl + cyme + dig + dua + duf + eza + fd + file + git + jq + killall + ntfs3g + openssh + pciutils + ripgrep + rsync + tree + unzip + vim + wget + yq-go + ] + ++ lib.optionals pkgs.stdenv.isLinux [ + nfs-utils + tpm2-tss + traceroute + usbutils + ]; } diff --git a/lib/default.nix b/lib/default.nix index 8c3260ef..42db4f26 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -18,5 +18,10 @@ let }; in { - inherit (helpers) mkHome mkHost forAllSystems; + inherit (helpers) + mkHome + mkHost + mkDarwin + forAllSystems + ; } diff --git a/lib/helpers.nix b/lib/helpers.nix index 28050948..f8fb8e0a 100644 --- a/lib/helpers.nix +++ b/lib/helpers.nix @@ -61,6 +61,28 @@ ]; }; + mkDarwin = + { + desktop ? "aqua", + hostname, + platform ? "aarch64-darwin", + }: + inputs.nix-darwin.lib.darwinSystem { + specialArgs = { + inherit + self + inputs + outputs + desktop + hostname + username + platform + stateVersion + ; + }; + modules = [ ../darwin ]; + }; + forAllSystems = inputs.nixpkgs.lib.genAttrs [ "aarch64-linux" "i686-linux" diff --git a/lib/theme/default.nix b/lib/theme/default.nix index d97d26a2..b372c68f 100644 --- a/lib/theme/default.nix +++ b/lib/theme/default.nix @@ -32,7 +32,7 @@ rec { name = "Catppuccin-Macchiato-Blue"; package = pkgs.catppuccin-kvantum.override { variant = catppuccin.flavor; - accent = catppuccin.accent; + inherit (catppuccin) accent; }; }; diff --git a/overlays/default.nix b/overlays/default.nix index 38d59ccd..9bcf20fe 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -3,7 +3,7 @@ # This one brings our custom packages from the 'pkgs' directory additions = final: _prev: import ../pkgs { pkgs = final; }; - modifications = final: prev: { + modifications = _final: _prev: { # example = prev.example.overrideAttrs (oldAttrs: rec { # ... # });