diff --git a/mise/config.toml b/mise/config.toml deleted file mode 100644 index d71a5f7..0000000 --- a/mise/config.toml +++ /dev/null @@ -1,24 +0,0 @@ -[tools] -ruby = "latest" -java = "latest" -zig = "latest" -maven = "latest" -node = "latest" -go = "latest" -gleam = "latest" -"npm:@themackabu/yarn2" = "latest" -"npm:create-dmg" = "latest" -"npm:pierre" = "latest" -python = "latest" -kotlin = "latest" -"npm:prettier" = "latest" -"npm:typescript" = "latest" -"npm:typescript-language-server" = "latest" -"npm:eslint" = "latest" -"npm:opencommit" = "latest" -"npm:@biomejs/biome" = "2.0.0" -"npm:opencode-ai" = "latest" - -[settings] -experimental = true -idiomatic_version_file_enable_tools = ["node"] diff --git a/nix/configuration.nix b/nix/configuration.nix new file mode 100644 index 0000000..2d63708 --- /dev/null +++ b/nix/configuration.nix @@ -0,0 +1,56 @@ +{ pkgs, self, inputs, username, hostname, ... }: { + nixpkgs.config.allowUnfree = true; + + system.stateVersion = 6; + system.primaryUser = username; + system.configurationRevision = self.rev or self.dirtyRev or null; + + users.users.${username}.name = username; + security.pam.services.sudo_local.touchIdAuth = true; + + programs.zsh.interactiveShellInit = '' + fpath=(/usr/local/share/zsh/site-functions $fpath) + ''; + + environment.shellAliases = { + rebuild = "nix develop /etc/nix-darwin --command apply"; + nix-size = "nix path-info --json --json-format 1 --all | jq -r 'map(.narSize) | add | @text' | numfmt --to=iec --suffix=B"; + }; + + environment.etc."php-fpm.conf".text = '' + [global] + error_log = /tmp/php-fpm.log + + [www] + user = ${username} + group = staff + listen = 127.0.0.1:9000 + pm = dynamic + pm.max_children = 5 + pm.start_servers = 2 + pm.min_spare_servers = 1 + pm.max_spare_servers = 3 + ''; + + launchd.daemons.php-fpm = { + serviceConfig = { + Label = "org.nixos.php-fpm"; + ProgramArguments = [ + "${pkgs.php}/bin/php-fpm" + "--nodaemonize" + "--fpm-config" "/etc/php-fpm.conf" + ]; + KeepAlive = true; + RunAtLoad = true; + StandardErrorPath = "/tmp/php-fpm.log"; + }; + }; + + determinateNix = { + enable = true; + customSettings = { + eval-cores = 0; + extra-experimental-features = [ "build-time-fetch-tree" ]; + }; + }; +} \ No newline at end of file diff --git a/nix/flake.lock b/nix/flake.lock new file mode 100644 index 0000000..45d7516 --- /dev/null +++ b/nix/flake.lock @@ -0,0 +1,239 @@ +{ + "nodes": { + "determinate": { + "inputs": { + "determinate-nixd-aarch64-darwin": "determinate-nixd-aarch64-darwin", + "determinate-nixd-aarch64-linux": "determinate-nixd-aarch64-linux", + "determinate-nixd-x86_64-linux": "determinate-nixd-x86_64-linux", + "nix": "nix", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772669230, + "narHash": "sha256-y5euTOVqJ4YlooZbpi6F/LW9PqZZ+PjNquIses9ODy4=", + "rev": "dc4d71b197a9bce053178291da2ead757cdf93bc", + "revCount": 406, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/3.17.0/019cbb55-3789-7f90-87bf-d0580468ebf6/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/determinate/3" + } + }, + "determinate-nixd-aarch64-darwin": { + "flake": false, + "locked": { + "narHash": "sha256-4psYG30Pl0R1zAHXDHfjR39ybe/QEfcA8C5h0eEKVx8=", + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.17.0/macOS" + }, + "original": { + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.17.0/macOS" + } + }, + "determinate-nixd-aarch64-linux": { + "flake": false, + "locked": { + "narHash": "sha256-a++ZpOrqzWsBHNR2K8H3B48LoFKIvK5VfodJgXSlsFE=", + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.17.0/aarch64-linux" + }, + "original": { + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.17.0/aarch64-linux" + } + }, + "determinate-nixd-x86_64-linux": { + "flake": false, + "locked": { + "narHash": "sha256-Q+SViaRHSg0FR6x26qCpqc3n6vJZ6PHpdHWV8XZ4ih0=", + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.17.0/x86_64-linux" + }, + "original": { + "type": "file", + "url": "https://install.determinate.systems/determinate-nixd/tag/v3.17.0/x86_64-linux" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "determinate", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748821116, + "narHash": "sha256-F82+gS044J1APL0n4hH50GYdPRv/5JWm34oCJYmVKdE=", + "rev": "49f0870db23e8c1ca0b5259734a02cd9e1e371a1", + "revCount": 377, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/hercules-ci/flake-parts/0.1.377%2Brev-49f0870db23e8c1ca0b5259734a02cd9e1e371a1/01972f28-554a-73f8-91f4-d488cc502f08/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/hercules-ci/flake-parts/0.1" + } + }, + "git-hooks-nix": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": [ + "determinate", + "nix" + ], + "nixpkgs": [ + "determinate", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747372754, + "narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=", + "rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46", + "revCount": 1026, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/cachix/git-hooks.nix/0.1.1026%2Brev-80479b6ec16fefd9c1db3ea13aeb038c60530f46/0196d79a-1b35-7b8e-a021-c894fb62163d/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/cachix/git-hooks.nix/0.1.941" + } + }, + "nix": { + "inputs": { + "flake-parts": "flake-parts", + "git-hooks-nix": "git-hooks-nix", + "nixpkgs": "nixpkgs", + "nixpkgs-23-11": "nixpkgs-23-11", + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1772664055, + "narHash": "sha256-RtKKd4aefzHEzV9sKa8bQdZIY67GJMV0nRS1QZ2E94g=", + "rev": "3a96d5668a8df84c2c8d006a04212c17839b977f", + "revCount": 24783, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/nix-src/3.17.0/019cbb2e-8d12-7212-a98f-73fd1f2342a2/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/DeterminateSystems/nix-src/%2A" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1773000227, + "narHash": "sha256-zm3ftUQw0MPumYi91HovoGhgyZBlM4o3Zy0LhPNwzXE=", + "owner": "nix-darwin", + "repo": "nix-darwin", + "rev": "da529ac9e46f25ed5616fd634079a5f3c579135f", + "type": "github" + }, + "original": { + "owner": "nix-darwin", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1761597516, + "narHash": "sha256-wxX7u6D2rpkJLWkZ2E932SIvDJW8+ON/0Yy8+a5vsDU=", + "rev": "daf6dc47aa4b44791372d6139ab7b25269184d55", + "revCount": 811874, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2505.811874%2Brev-daf6dc47aa4b44791372d6139ab7b25269184d55/019a3494-3498-707e-9086-1fb81badc7fe/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2505" + } + }, + "nixpkgs-23-11": { + "locked": { + "lastModified": 1717159533, + "narHash": "sha256-oamiKNfr2MS6yH64rUn99mIZjc45nGJlj9eGth/3Xuw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a62e6edd6d5e1fa0329b8653c801147986f8d446", + "type": "github" + } + }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1773628058, + "narHash": "sha256-hpXH0z3K9xv0fHaje136KY872VT2T5uwxtezlAskQgY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "f8573b9c935cfaa162dd62cc9e75ae2db86f85df", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "determinate": "determinate", + "nix-darwin": "nix-darwin", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/nix/flake.nix b/nix/flake.nix new file mode 100644 index 0000000..8410617 --- /dev/null +++ b/nix/flake.nix @@ -0,0 +1,51 @@ +{ + description = "mackbook"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nix-darwin.url = "github:nix-darwin/nix-darwin/master"; + nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; + + determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/3"; + determinate.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs@{ + self, + nix-darwin, + nixpkgs, + determinate + }: + + let + username = "themackabu"; + hostname = "MackBook-Pro"; + system = "aarch64-darwin"; + in + + { + darwinConfigurations."${hostname}-${system}" = nix-darwin.lib.darwinSystem { + inherit system; + specialArgs = { inherit inputs self username hostname; }; + modules = [ + determinate.darwinModules.default + ./configuration.nix + ./packages.nix + ./homebrew.nix + ]; + }; + + devShells.${system}.default = + let pkgs = import nixpkgs { inherit system; }; + in pkgs.mkShellNoCC { + packages = [(pkgs.writeShellApplication { + name = "apply"; + runtimeInputs = [ nix-darwin.packages.${system}.darwin-rebuild ]; + text = ''sudo darwin-rebuild switch --flake ".#${hostname}-${system}"''; + }) + self.formatter.${system}]; + }; + + formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt; + }; +} \ No newline at end of file diff --git a/nix/homebrew.nix b/nix/homebrew.nix new file mode 100644 index 0000000..fc40f7f --- /dev/null +++ b/nix/homebrew.nix @@ -0,0 +1,76 @@ +{ ... }: { + homebrew = { + enable = true; + onActivation.cleanup = "zap"; + + taps = [ + "charmbracelet/tap" + "dante-biase/x2x" + "encoredev/tap" + "gromgit/fuse" + "jandedobbeleer/oh-my-posh" + "kdabir/tap" + "keith/formulae" + "louisbrunner/valgrind" + "majd/repo" + "modularml/packages" + "ngrok/ngrok" + "paninihouse/brewer-cmd" + "pkgxdev/made" + "pls-rs/pls" + "plutov/tap" + "rvigo/cl" + "supabase/tap" + "unhappychoice/tap" + "withgraphite/tap" + "xenodium/macosrec" + "xwmx/taps" + ]; + + brews = [ + "charmbracelet/tap/crush" + "encoredev/tap/encore" + "keith/formulae/dyld-shared-cache-extractor" + "pls-rs/pls/pls" + "withgraphite/tap/graphite" + "macos-trash" + "mas" + "hfsutils" + "mtools" + "build2" + "edencommon" + "eget" + "felinks" + "gitlogue" + "has" + "msedit" + "mvfst" + "oak" + "picotool" + "pkgx" + "rubyfmt" + "so" + "sshs" + "superfile" + "supabase" + "tre-command" + "walk" + ]; + + casks = [ + "android-platform-tools" + "asset-catalog-tinkerer" + "background-music" + "codex" + "gcc-arm-embedded" + "ipatool" + "jd-gui" + "macfuse" + "ngrok" + "oq" + "quarto" + "swiftdefaultappsprefpane" + "xquartz" + ]; + }; +} diff --git a/nix/packages.nix b/nix/packages.nix new file mode 100644 index 0000000..d92f1cf --- /dev/null +++ b/nix/packages.nix @@ -0,0 +1,188 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + # shells & terminal + bash + zsh + tmux + btop + htop + ctop + broot + nnn + yazi + + # core + git + git-lfs + git-filter-repo + gh + lazygit + gitui + curl + wget + + # editors + neovim + nano + micro + + # languages & runtimes + php + dart + cmake + ninja + automake + gnumake + bison + re2c + ccache + + # cross-compilation + pkgsCross.aarch64-embedded.buildPackages.gcc # aarch64-elf-gcc / aarch64-none-elf + pkgsCross.aarch64-embedded.buildPackages.binutils # aarch64-elf-binutils + pkgsCross.x86_64-embedded.buildPackages.gcc # x86_64-elf-gcc + pkgsCross.x86_64-embedded.buildPackages.binutils # x86_64-elf-binutils + pkgsCross.x86_64-embedded.buildPackages.gdb # x86_64-elf-gdb + pkgsCross.mingwW64.buildPackages.gcc # mingw-w64 (Windows) + pkgsCross.musl64.buildPackages.gcc # x86_64-linux-musl (musl-cross) + pkgsCross.aarch64-multiplatform-musl.buildPackages.gcc # aarch64-linux-musl + pkgsCross.aarch64-multiplatform.buildPackages.gcc # aarch64-unknown-linux-gnu + pkgsCross.gnu64.buildPackages.gcc # x86_64-unknown-linux-gnu + + # llvm/clang + llvmPackages_latest.clang + llvmPackages_latest.llvm + llvmPackages_latest.lldb + llvmPackages_latest.lld + + # python packages (pulled from python3Packages) + (python3.withPackages (ps: with ps; [ + numpy + pillow + cryptography + setuptools + ])) + + # misc lang tooling + go-task + kotlin-language-server + rebar3 + luarocks + typst + + # infrastructure & cloud + flyctl + terraform + terraform-ls + caddy + nginx + redis + mysql80 + postgresql_16 + minio-client + vault + rclone + docker-compose + docker-credential-helpers + lima + qemu + dive + + # networking + nmap + masscan + iperf3 + netcat-gnu + socat + websocat + inetutils + rtmpdump + + # search & text + ack + ripgrep + jq + yj + cloc + pandoc + parallel + glow + mdcat + + # file & disk tools + bat + lsd + tree + duf + ncdu + pv + binutils + binwalk + sleuthkit + wimlib + upx + woff2 + bloaty + cdrtools + + # image & media + imagemagick + ffmpeg + catimg + timg + viu + sox + mpv + atomicparsley + + # fun + cowsay + fortune + figlet + toilet + lolcat + cmatrix + sl + + # security & crypto + nmap + gopass + pinentry_mac + + # monitoring & benchmarking + hyperfine + wrk + hurl + + # misc cli + pay-respects + navi + watch + wakeonlan + smartmontools + + # nix tools + nix-tree + + # libraries + libffi + libyaml + gdbm + glfw + portaudio + SDL2_ttf + extra-cmake-modules + gd + + # misc + quilt + msgpack-tools + wtfutil + ffuf + dosfstools + e2fsprogs + nasm + gnutar + time + ]; +}