diff --git a/flake.lock b/flake.lock index 93f4685..8dc3c38 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,22 @@ { "nodes": { + "brew-src": { + "flake": false, + "locked": { + "lastModified": 1781226006, + "narHash": "sha256-w4ZTuOnhYiDxjaynrMTASzp802QblBWmo3wpB8wVN4Y=", + "owner": "Homebrew", + "repo": "brew", + "rev": "109191be4988470b51a60a5ef1998520aa24c01b", + "type": "github" + }, + "original": { + "owner": "Homebrew", + "ref": "6.0.1", + "repo": "brew", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -21,6 +38,59 @@ "type": "github" } }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1781981105, + "narHash": "sha256-/1nNBbA7PrSQpTc9Qazkhl4kIPg+TNl0CjxS3UQJKlw=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "7bfff44b465909f69a442701293bc0badcf476dc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "release-26.05", + "repo": "home-manager", + "type": "github" + } + }, + "homebrew-cask": { + "flake": false, + "locked": { + "lastModified": 1782189722, + "narHash": "sha256-QcITIKAntdkgJVSOuVlJKqx4+KHBdJ70WgqjBfTimuI=", + "owner": "homebrew", + "repo": "homebrew-cask", + "rev": "3fc765b52036afb96959548c99ae252af80feead", + "type": "github" + }, + "original": { + "owner": "homebrew", + "repo": "homebrew-cask", + "type": "github" + } + }, + "homebrew-core": { + "flake": false, + "locked": { + "lastModified": 1782188147, + "narHash": "sha256-nMskIQImTBCY+4912nbs7jymt1cgdKcS34EQ21sldn4=", + "owner": "homebrew", + "repo": "homebrew-core", + "rev": "915bce047398f0401932c83e1dad1b827ffea5de", + "type": "github" + }, + "original": { + "owner": "homebrew", + "repo": "homebrew-core", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -42,6 +112,24 @@ "type": "github" } }, + "nix-homebrew": { + "inputs": { + "brew-src": "brew-src" + }, + "locked": { + "lastModified": 1781389246, + "narHash": "sha256-ORqLAo/hoJdsZC7UPAuEHev6S0+XIqKEC7vjo5prz1k=", + "owner": "zhaofengli", + "repo": "nix-homebrew", + "rev": "de7953a08ed4bb9245be043e468561c17b89130d", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "repo": "nix-homebrew", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1781808408, @@ -81,7 +169,11 @@ }, "root": { "inputs": { + "home-manager": "home-manager", + "homebrew-cask": "homebrew-cask", + "homebrew-core": "homebrew-core", "nix-darwin": "nix-darwin", + "nix-homebrew": "nix-homebrew", "nixpkgs": "nixpkgs", "nur": "nur", "secrets": "secrets", diff --git a/flake.nix b/flake.nix index 6eb999f..009b9d9 100644 --- a/flake.nix +++ b/flake.nix @@ -14,8 +14,16 @@ nix-homebrew = { url = "github:zhaofengli/nix-homebrew"; }; + homebrew-core = { + url = "github:homebrew/homebrew-core"; + flake = false; + }; + homebrew-cask = { + url = "github:homebrew/homebrew-cask"; + flake = false; + }; home-manager = { - url = "github:nix-community/home-manager/master"; + url = "github:nix-community/home-manager/release-26.05"; inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix = { @@ -75,7 +83,7 @@ modules = [ # ./hosts/base.nix ./hosts/artemis - homeConf + ./modules/home ]; specialArgs = { inherit inputs; }; }; diff --git a/hosts/artemis/default.nix b/hosts/artemis/default.nix index ae28d50..ee5cd82 100644 --- a/hosts/artemis/default.nix +++ b/hosts/artemis/default.nix @@ -1,15 +1,22 @@ { pkgs, lib, inputs, ... }: { + imports = [ + ./homebrew.nix + ./macos.nix + ]; environment.systemPackages = with pkgs; [ vscodium git ]; + security.pam.services.sudo_local.touchIdAuth = true; ids.gids.nixbld = 350; programs.fish.enable = true; environment.etc."nix-darwin".source = "/Users/nyxerinys/nix-config"; - + nixpkgs.config.allowUnfree = true; + nix.settings.extra-platforms = [ "x86_64-darwin" "aarch64-darwin" ]; + # Necessary for using flakes on this system. nix.settings.experimental-features = "nix-command flakes"; # Used for backwards compatibility, please read the changelog before changing. @@ -19,7 +26,7 @@ # The platform the configuration will be used on. nixpkgs.hostPlatform = "aarch64-darwin"; users.users.nyxerinys = { - name = "Nyx"; - home = "/Users/nyxerinys"; + name = "nyxerinys"; + home = "/Users/nyxerinys"; }; } \ No newline at end of file diff --git a/hosts/artemis/homebrew.nix b/hosts/artemis/homebrew.nix new file mode 100644 index 0000000..0b37909 --- /dev/null +++ b/hosts/artemis/homebrew.nix @@ -0,0 +1,48 @@ +{ inputs, ... }: +{ + imports = [ + inputs.nix-homebrew.darwinModules.nix-homebrew + ]; + nix-homebrew = { + # Install Homebrew under the default prefix + enable = true; + + # Apple Silicon Only: Also install Homebrew under the default Intel prefix for Rosetta 2 + enableRosetta = true; + + # User owning the Homebrew prefix + user = "nyxerinys"; + + # Optional: Declarative tap management + taps = { + "homebrew/homebrew-core" = inputs.homebrew-core; + "homebrew/homebrew-cask" = inputs.homebrew-cask; + }; + + # Optional: Enable fully-declarative tap management + # + # With mutableTaps disabled, taps can no longer be added imperatively with `brew tap`. + mutableTaps = false; + + # Optional: Declarative Homebrew tap trust entries. + # + # Note: The trust entries are _not_ removed if you remove them from those lists! + # Use the `brew untrust` command to remove a trust entry. + trust = { + formulae = [ ]; + casks = [ ]; + commands = [ ]; + taps = [ ]; + }; + }; + homebrew = { + enable = true; + onActivation.cleanup = "zap"; # Cleans packages not defined here + + # Use Mac Casks instead of standard Nix packages for GUI apps + casks = [ + "steam" # Native/Rosetta 2 macOS Steam Client + "discord" + ]; + }; +} \ No newline at end of file diff --git a/hosts/artemis/macos.nix b/hosts/artemis/macos.nix new file mode 100644 index 0000000..65fa367 --- /dev/null +++ b/hosts/artemis/macos.nix @@ -0,0 +1,34 @@ +{ ... }: +{ + system = { + primaryUser = "nyxerinys"; + defaults = { + dock = { + autohide = true; + minimize-to-application = true; + mru-spaces = false; + mineffect = "scale"; + show-recents = false; + }; + controlcenter = { + BatteryShowPercentage = true; + }; + finder = { + _FXShowPosixPathInTitle = true; + _FXSortFoldersFirst = true; + _FXEnableColumnAutoSizing = true; + AppleShowAllExtensions = true; + AppleShowAllFiles = true; + FXEnableExtensionChangeWarning = false; + FXPreferredViewStyle = "Nlsv"; + FXDefaultSearchScope = "SCcf"; + NewWindowTarget = "Home"; + ShowExternalHardDrivesOnDesktop = false; + ShowHardDrivesOnDesktop = false; + ShowMountedServersOnDesktop = false; + ShowPathbar = true; + ShowStatusBar = true; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/home/default.nix b/modules/home/default.nix new file mode 100644 index 0000000..49c648c --- /dev/null +++ b/modules/home/default.nix @@ -0,0 +1,16 @@ +{ inputs, ... }: + +{ + imports = [ + inputs.home-manager.darwinModules.home-manager + ]; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + users = { + "nyxerinys" = import ./nyxerinys; + }; + extraSpecialArgs = { inherit inputs; }; + }; +} \ No newline at end of file diff --git a/modules/home/nyxerinys/default.nix b/modules/home/nyxerinys/default.nix index fdc4c85..a3a9ba2 100644 --- a/modules/home/nyxerinys/default.nix +++ b/modules/home/nyxerinys/default.nix @@ -1,10 +1,19 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: { # Home Manager needs a bit of information about you and the # paths it should manage. home.username = "nyxerinys"; - home.homeDirectory = "/home/nyxerinys"; + home.homeDirectory = ( + if pkgs.stdenv.isDarwin then + "/Users/nyxerinys" + else + "/home/nyxerinys" + ); + home.packages = with pkgs; [ + prismlauncher + ]; + # This value determines the Home Manager release that your # configuration is compatible with. This helps avoid breakage