Skip to content

Commit

Permalink
Point home-manager back to main repo
Browse files Browse the repository at this point in the history
  • Loading branch information
sestrella committed Jan 5, 2025
1 parent 3cd6640 commit f3337fb
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
11 changes: 5 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
devenv.url = "github:cachix/devenv";
home-manager-diff.url = "github:pedorich-n/home-manager-diff";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:sestrella/home-manager/ghostty_validate_config";
home-manager.url = "github:nix-community/home-manager";
mac-app-util.url = "github:hraban/mac-app-util";
nixd.url = "github:nix-community/nixd";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
Expand Down
36 changes: 27 additions & 9 deletions home/helix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,31 @@
};
};

home.activation.helixTheme = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
mkdir -p ~/.config/helix/themes
style=$(/usr/bin/defaults read -g AppleInterfaceStyle 2> /dev/null || echo "Light")
if [ "$style" == "Dark" ]; then
ln -sf ${config.programs.helix.package}/lib/runtime/themes/solarized_dark.toml ~/.config/helix/themes/solarized.toml
else
ln -sf ${config.programs.helix.package}/lib/runtime/themes/solarized_light.toml ~/.config/helix/themes/solarized.toml
fi
'';
# TODO: Test this approach
launchd.agents.sync-helix-theme = {
enable = true;
config = {
ProgramArguments =
let
script = pkgs.writeScript "sync-helix-theme" ''
mkdir =p ~/.config/helix/themes
if [ "$1" == "dark" ]; then
ln -sf ${config.programs.helix.package}/lib/runtime/themes/solarized_dark.toml ~/.config/helix/themes/solarized.toml
else
ln -sf ${config.programs.helix.package}/lib/runtime/themes/solarized_light.toml ~/.config/helix/themes/solarized.toml
fi
'';
in
[
"/opt/homebrew/bin/dark-notify"
"-c"
"${script}/bin/sync-helix-theme"
];
RunAtLoad = true;
KeepAlive = {
Crashed = true;
SuccessfulExit = false;
};
};
};
}

0 comments on commit f3337fb

Please sign in to comment.