diff --git a/flake.nix b/flake.nix index e697ba0..564e5ad 100644 --- a/flake.nix +++ b/flake.nix @@ -7,12 +7,15 @@ url = "github:nix-community/home-manager/release-24.11"; inputs.nixpkgs.follows = "nixpkgs"; }; + nix-darwin.url = "github:LnL7/nix-darwin"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = { self, nixpkgs, home-manager, + nix-darwin, ... } @ inputs: let inherit (self) outputs; @@ -22,5 +25,11 @@ specialArgs = {inherit inputs outputs;}; modules = [./hosts/dnsc-server]; }; + + darwinConfigurations.dnsc-mac = nixpkgs.lib.nixosSystem { + system = "aarch64-darwin"; + specialArgs = {inherit inputs outputs;}; + modules = [./hosts/dnsc-mac]; + }; }; } diff --git a/home/darwin.nix b/home/darwin.nix new file mode 100644 index 0000000..0107903 --- /dev/null +++ b/home/darwin.nix @@ -0,0 +1,15 @@ +{ config, pkgs, ... }: + +{ + home.username = "dennis"; + home.homeDirectory = "/Users/dennis"; + home.stateVersion = "24.11"; + + programs.home-manager.enable = true; + + programs.git = { + enable = true; + userName = "Dennis Schoepf"; + userEmail = "me@dnsc.io"; + }; +} diff --git a/home/default.nix b/home/server.nix similarity index 100% rename from home/default.nix rename to home/server.nix diff --git a/hosts/dnsc-mac/default.nix b/hosts/dnsc-mac/default.nix new file mode 100644 index 0000000..f5d4bf3 --- /dev/null +++ b/hosts/dnsc-mac/default.nix @@ -0,0 +1,91 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + + # Setting the user + networking.hostName = "dnsc-mac"; + networking.computerName = "dnsc-mac"; + system.defaults.smb.NetBIOSName = "dnsc-mac"; + + users.users."dennis"= { + home = "/Users/dennis"; + description = username; + }; + + nix.settings.trusted-users = [ username ]; + + # System Packages + environment.systemPackages = with pkgs; [ + git + neovim + ]; + + # Homebrew + homebrew = { + enable = true; + + onActivation = { + autoUpdate = false; + # 'zap': uninstalls all formulae(and related files) not listed here. + # cleanup = "zap"; + }; + + taps = [ + "homebrew/services" + ]; + + # `brew install` + # TODO Feel free to add your favorite apps here. + brews = [ + # "aria2" # download tool + ]; + + # `brew install --cask` + # TODO Feel free to add your favorite apps here. + casks = [ + # "google-chrome" + ]; + }; + + # Programgs + programs.fish.enable = true; + + # System settings + system = { + stateVersion = 5; + activationScripts.postUserActivation.text = '' + /System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u + ''; + + defaults = { + menuExtraClock.Show24Hour = true; # show 24 hour clock + }; + }; + + # Add ability to used TouchID for sudo authentication + security.pam.enableSudoTouchIdAuth = true; + + # Home Manager Setup + # Home Manager Setup + home-manager = { + extraSpecialArgs = { inherit inputs outputs; }; + users = { + dennis = import ../../home/server; + }; + }; + + # Nix settings + services.nix-daemon.enable = true; + nix.package = pkgs.nix; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 1w"; + }; + nix.settings.auto-optimise-store = true; +} diff --git a/hosts/dnsc-server/default.nix b/hosts/dnsc-server/default.nix index b0210e1..c92d9cd 100644 --- a/hosts/dnsc-server/default.nix +++ b/hosts/dnsc-server/default.nix @@ -60,7 +60,7 @@ home-manager = { extraSpecialArgs = { inherit inputs outputs; }; users = { - dennis = import ../../home; + dennis = import ../../home/server; }; };