From 5e2817460159cf08b600eb0d0150eb5eac404f2f Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 10 Jan 2025 15:02:58 -0500 Subject: [PATCH 1/2] infinitude: Initialize Macbook Pro as headless machine. --- configurations/darwin/appreciate.nix | 46 ---------------------------- configurations/darwin/infinitude.nix | 26 ++++++++++++++++ justfile | 6 ++-- modules/home/all/git.nix | 8 ++--- modules/home/darwin-only.nix | 2 +- 5 files changed, 34 insertions(+), 54 deletions(-) delete mode 100644 configurations/darwin/appreciate.nix create mode 100644 configurations/darwin/infinitude.nix diff --git a/configurations/darwin/appreciate.nix b/configurations/darwin/appreciate.nix deleted file mode 100644 index 93209e3..0000000 --- a/configurations/darwin/appreciate.nix +++ /dev/null @@ -1,46 +0,0 @@ -# Configuration for my M1 Macbook Max (using nix-darwin) -{ flake, ... }: - -let - inherit (flake) inputs; - inherit (inputs) self; -in -{ - imports = [ - self.darwinModules.default - ]; - - nixpkgs.hostPlatform = "aarch64-darwin"; - networking.hostName = "appreciate"; - - security.pam.enableSudoTouchIdAuth = true; - - system.keyboard = { - enableKeyMapping = true; - remapCapsLockToControl = true; - }; - # See https://github.com/ryan4yin/nix-darwin-kickstarter/blob/main/rich-demo/modules/system.nix - system.defaults = { - dock = { - autohide = true; - # customize Hot Corners(触发角, 鼠标移动到屏幕角落时触发的动作) - wvous-tl-corner = 2; # top-left - Mission Control - # wvous-tr-corner = 13; # top-right - Lock Screen - wvous-bl-corner = 3; # bottom-left - Application Windows - # wvous-br-corner = 4; # bottom-right - Desktop - }; - - finder = { - _FXShowPosixPathInTitle = true; # show full path in finder title - AppleShowAllExtensions = true; # show all file extensions - FXEnableExtensionChangeWarning = false; # disable warning when changing file extension - QuitMenuItem = true; # enable quit menu item - ShowPathbar = true; # show path bar - ShowStatusBar = true; # show status bar - }; - }; - - # Used for backwards compatibility, please read the changelog before changing. - # $ darwin-rebuild changelog - system.stateVersion = 4; -} diff --git a/configurations/darwin/infinitude.nix b/configurations/darwin/infinitude.nix new file mode 100644 index 0000000..88445ee --- /dev/null +++ b/configurations/darwin/infinitude.nix @@ -0,0 +1,26 @@ +# Configuration for my M1 Macbook Max as headless server +{ flake, ... }: + +let + inherit (flake) inputs; + inherit (inputs) self; +in +{ + nixos-unified.sshTarget = "srid@192.168.2.46"; + + imports = [ + self.darwinModules.default + ]; + + nixpkgs.hostPlatform = "aarch64-darwin"; + networking.hostName = "infinitude"; + + system.keyboard = { + enableKeyMapping = true; + remapCapsLockToControl = true; + }; + + # Used for backwards compatibility, please read the changelog before changing. + # $ darwin-rebuild changelog + system.stateVersion = 4; +} diff --git a/justfile b/justfile index dcd28ae..d97fe6c 100644 --- a/justfile +++ b/justfile @@ -16,10 +16,10 @@ nom: pureintent: nix run . pureintent -# Deploy to nginx gate +# Deploy to infinitude (mac) [group('deploy')] -gate: - nix run . gate +infinitude: + nix run . infinitude # Format the nix source tree fmt: diff --git a/modules/home/all/git.nix b/modules/home/all/git.nix index 94b25f7..75bad45 100644 --- a/modules/home/all/git.nix +++ b/modules/home/all/git.nix @@ -1,11 +1,11 @@ { pkgs, flake, ... }: let package = - if pkgs.stdenv.isDarwin then + #if pkgs.stdenv.isDarwin then # Upstream has broken mac package - pkgs.gitAndTools.gitFull.override { svnSupport = false; } - else - pkgs.gitAndTools.git; + # pkgs.gitAndTools.gitFull.override { svnSupport = false; } + #else + pkgs.gitAndTools.git; in { home.packages = with pkgs; [ diff --git a/modules/home/darwin-only.nix b/modules/home/darwin-only.nix index 8ad5855..c985273 100644 --- a/modules/home/darwin-only.nix +++ b/modules/home/darwin-only.nix @@ -1,7 +1,7 @@ { imports = [ ./all/zsh.nix - ./all/wezterm + # ./all/wezterm # ./all/emacs.nix ]; } From 6bdc638a7db3d30119fb21d4433802f0f47aeee8 Mon Sep 17 00:00:00 2001 From: Sridhar Ratnakumar Date: Fri, 10 Jan 2025 15:08:45 -0500 Subject: [PATCH 2/2] home: Remove GC https://github.com/nix-community/home-manager/issues/4413 --- modules/home/all/nix.nix | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/home/all/nix.nix b/modules/home/all/nix.nix index 43a1a93..4f0c8b6 100644 --- a/modules/home/all/nix.nix +++ b/modules/home/all/nix.nix @@ -1,7 +1,4 @@ { - # Garbage collect automatically every week - nix.gc.automatic = true; - # Nix configuration is managed globally by nix-darwin. # Prevent $HOME nix.conf from disrespecting it. home.file."~/.config/nix/nix.conf".text = "";