From 6768bdb19e1bdd59bb29f65be2f79a229ad7b3f4 Mon Sep 17 00:00:00 2001 From: Tyler Mayoff Date: Mon, 17 Feb 2025 09:11:09 -0500 Subject: [PATCH] Reorg --- dot_config/aerospace/aerospace.toml | 2 +- dot_config/flake/flake.nix | 13 ++-- dot_config/flake/home/common.nix | 16 ++--- .../flake/{home => machines}/hinge/darwin.nix | 29 +++++---- .../hinge.nix => machines/hinge/home.nix} | 8 ++- .../{home => machines}/hinge/sketchybar.nix | 0 dot_config/flake/pkgs/default.nix | 8 +-- dot_config/flake/pkgs/sbarlua/default.nix | 62 +++++++++++++++++++ run_nix-rebuild.sh | 2 +- 9 files changed, 104 insertions(+), 36 deletions(-) rename dot_config/flake/{home => machines}/hinge/darwin.nix (65%) rename dot_config/flake/{home/hinge/hinge.nix => machines/hinge/home.nix} (87%) rename dot_config/flake/{home => machines}/hinge/sketchybar.nix (100%) create mode 100644 dot_config/flake/pkgs/sbarlua/default.nix diff --git a/dot_config/aerospace/aerospace.toml b/dot_config/aerospace/aerospace.toml index de7ef24..56b326e 100644 --- a/dot_config/aerospace/aerospace.toml +++ b/dot_config/aerospace/aerospace.toml @@ -9,7 +9,7 @@ after-login-command = [] after-startup-command = [] # Start AeroSpace at login -start-at-login = true +# start-at-login = true # Normalizations. See: https://nikitabobko.github.io/AeroSpace/guide#normalization enable-normalization-flatten-containers = true diff --git a/dot_config/flake/flake.nix b/dot_config/flake/flake.nix index 01d9607..69b1ab0 100644 --- a/dot_config/flake/flake.nix +++ b/dot_config/flake/flake.nix @@ -76,13 +76,12 @@ }; darwinConfigurations."MAC-C57KK2TC69" = darwin.lib.darwinSystem { - pkgs = allPkgs."aarch64-darwin"; - specialArgs = {inherit inputs;}; + specialArgs = {inherit inputs outputs;}; modules = [ lix-module.nixosModules.default - ./home/hinge/darwin.nix + ./machines/hinge/darwin.nix home-manager.darwinModules.home-manager { @@ -90,7 +89,7 @@ home-manager.useUserPackages = true; home-manager.extraSpecialArgs = {inherit inputs outputs;}; - home-manager.users."tyler.mayoff" = import ./home/hinge/hinge.nix; + home-manager.users."tyler.mayoff" = import ./machines/hinge/home.nix; users.users."tyler.mayoff".home = "/Users/tyler.mayoff"; } ]; @@ -103,6 +102,12 @@ modules = [./home/guidebolt/guidebolt.nix]; }; + # "tyler.mayoff@MAC-C57KK2TC69" = home-manager.lib.homeManagerConfiguration { + # pkgs = allPkgs."aarch64-darwin"; + # extraSpecialArgs = {inherit inputs outputs;}; + # modules = [./home/wash/wash.nix]; + # }; + "tyler@wash" = home-manager.lib.homeManagerConfiguration { pkgs = allPkgs."x86_64-linux"; extraSpecialArgs = {inherit inputs outputs;}; diff --git a/dot_config/flake/home/common.nix b/dot_config/flake/home/common.nix index b457efc..e6cd860 100644 --- a/dot_config/flake/home/common.nix +++ b/dot_config/flake/home/common.nix @@ -16,14 +16,14 @@ ./nushell.nix ]; - nixpkgs = { - overlays = [ - outputs.overlays.additions - outputs.overlays.modifications - outputs.overlays.unstable-packages - inputs.helix.overlays.default - ]; - }; + # nixpkgs = { + # overlays = [ + # outputs.overlays.additions + # outputs.overlays.modifications + # outputs.overlays.unstable-packages + # inputs.helix.overlays.default + # ]; + # }; home.packages = with pkgs; [ # unstable.nix-output-monitor diff --git a/dot_config/flake/home/hinge/darwin.nix b/dot_config/flake/machines/hinge/darwin.nix similarity index 65% rename from dot_config/flake/home/hinge/darwin.nix rename to dot_config/flake/machines/hinge/darwin.nix index a44ab98..a1df994 100644 --- a/dot_config/flake/home/hinge/darwin.nix +++ b/dot_config/flake/machines/hinge/darwin.nix @@ -1,11 +1,9 @@ { + inputs, outputs, pkgs, - lib, ... }: { - # services.aerospace.enable = true; - imports = [ # ../fish.nix ./sketchybar.nix @@ -16,21 +14,26 @@ outputs.overlays.additions outputs.overlays.modifications outputs.overlays.unstable-packages + inputs.helix.overlays.default ]; config = { allowUnfree = true; }; + + hostPlatform = "aarch64-darwin"; }; - nix.extraOptions = - '' - auto-optimise-store = true - experimental-features = nix-command flakes - '' - + lib.optionalString (pkgs.system == "aarch64-darwin") '' - extra-platforms = x86_64-darwin aarch64-darwin - ''; + nix.settings.experimental-features = ["nix-command" "flakes"]; + + # nix.extraOptions = + # '' + # auto-optimise-store = true + # experimental-features = nix-command flakes + # '' + # + lib.optionalString (pkgs.system == "aarch64-darwin") '' + # extra-platforms = x86_64-darwin aarch64-darwin + # ''; users.knownUsers = ["tyler.mayoff"]; users.users."tyler.mayoff" = { @@ -47,7 +50,7 @@ llvmPackages_19.clang-tools sketchybar - sbarlua + # sbarlua lua @@ -55,6 +58,8 @@ jdk17 ]; + # services.aerospace.enable = true; + programs.fish.enable = true; programs.zsh.enable = true; diff --git a/dot_config/flake/home/hinge/hinge.nix b/dot_config/flake/machines/hinge/home.nix similarity index 87% rename from dot_config/flake/home/hinge/hinge.nix rename to dot_config/flake/machines/hinge/home.nix index 68b9a90..d335bd0 100644 --- a/dot_config/flake/home/hinge/hinge.nix +++ b/dot_config/flake/machines/hinge/home.nix @@ -1,8 +1,8 @@ {pkgs, ...}: { imports = [ - ../stylix.nix - ../common.nix - ../kitty.nix + # ../../home/stylix.nix + ../../home/common.nix + ../../home/kitty.nix ]; # xdg.enable = lib.mkForce false; @@ -42,5 +42,7 @@ ''; }; + programs.home-manager.enable = true; + home.stateVersion = "24.11"; } diff --git a/dot_config/flake/home/hinge/sketchybar.nix b/dot_config/flake/machines/hinge/sketchybar.nix similarity index 100% rename from dot_config/flake/home/hinge/sketchybar.nix rename to dot_config/flake/machines/hinge/sketchybar.nix diff --git a/dot_config/flake/pkgs/default.nix b/dot_config/flake/pkgs/default.nix index 952d3a4..ec3a7cc 100644 --- a/dot_config/flake/pkgs/default.nix +++ b/dot_config/flake/pkgs/default.nix @@ -1,9 +1,3 @@ pkgs: { - sbarlua = { - src = pkgs.fetchFromGitHub { - repo = "SbarLua"; - owner = "FelixKratz"; - rev = "437bd2031da38ccda75827cb7548e7baa4aa9978"; - }; - }; + sbarlua = pkgs.callPackage ./sbarlua {}; } diff --git a/dot_config/flake/pkgs/sbarlua/default.nix b/dot_config/flake/pkgs/sbarlua/default.nix new file mode 100644 index 0000000..bf1b4df --- /dev/null +++ b/dot_config/flake/pkgs/sbarlua/default.nix @@ -0,0 +1,62 @@ +{ + lib, + stdenv, + fetchFromGitHub, + gcc, + lua, + nix-update-script, + apple-sdk_15, + versionCheckHook, +}: let + inherit (stdenv.hostPlatform) system; + + target = + { + "aarch64-darwin" = "arm64"; + "x86_64-darwin" = "x86"; + } + .${system} + or (throw "Unsupported system: ${system}"); +in + stdenv.mkDerivation ( + finalAttrs: { + pname = "SBarLua"; + version = "437bd2031da38ccda75827cb7548e7baa4aa9978"; + src = fetchFromGitHub { + repo = "SbarLua"; + owner = "FelixKratz"; + rev = "437bd2031da38ccda75827cb7548e7baa4aa9978"; + hash = "sha256-F0UfNxHM389GhiPQ6/GFbeKQq5EvpiqQdvyf7ygzkPg="; + }; + + nativeBuildInputs = [ + gcc + ]; + + buildInputs = [ + apple-sdk_15 + lua + ]; + + # buildPhase = '' + # make + # ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + + ls -la + + cp ./bin/sbarlua $out/bin/sbarlua + + runHook postInstall + ''; + + meta = { + homepage = "https://github.com/FelixKratz/SbarLua"; + platforms = lib.platforms.darwin; + }; + } + ) diff --git a/run_nix-rebuild.sh b/run_nix-rebuild.sh index 9f425d1..eeaab21 100755 --- a/run_nix-rebuild.sh +++ b/run_nix-rebuild.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash [[ $(command -v nixos-rebuild) ]] && sudo nixos-rebuild switch --flake ~/.config/flake -[[ $(command -v darwin-rebuild) ]] && sudo darwin-rebuild switch --flake ~/.config/flake/ +[[ $(command -v darwin-rebuild) ]] && darwin-rebuild switch --flake ~/.config/flake/ [[ $(command -v home-manager) ]] && home-manager switch --flake ~/.config/flake/