1
0
Fork 0
dotfiles/home/hosts/Pallas.nix

112 lines
2.2 KiB
Nix
Raw Permalink Normal View History

2024-11-08 22:01:20 +00:00
args@{ pkgs, lib, config, ... }:
2024-11-08 15:16:13 +00:00
2024-11-08 22:01:20 +00:00
let
secret = import ../../secret/hosts/Pallas.nix;
in
2024-11-08 15:16:13 +00:00
{
imports = [
2024-11-08 22:01:20 +00:00
../config/fonts
2024-11-08 15:16:13 +00:00
../programs/fish.nix
../programs/nushell.nix
../programs/atuin.nix
../programs/direnv.nix
../programs/fzf.nix
../programs/starship.nix
../programs/zoxide.nix
../programs/amethyst.nix
../programs/wezterm.nix
../programs/nvim
../programs/git.nix
../programs/bat.nix
../programs/btop.nix
../programs/gallery-dl.nix
../programs/gpg.nix
../programs/jq.nix
2024-11-08 22:01:20 +00:00
(import ../programs/firefox.nix (args // { inherit secret; }))
2024-11-08 15:16:13 +00:00
../programs/scripts.nix
../programs/ssh/Pallas.nix
../programs/eternal-terminal.nix
../programs/yt-dlp.nix
];
disabledModules = [ "targets/darwin/linkapps.nix" ];
home = {
stateVersion = "22.11";
packages = with pkgs; [
_1password-cli
arp-scan
curlHTTP3
dasel
dig
exiftool
fd
ffmpeg
glab
glow
hexyl
hyperfine
just
lnav
mtr
nix-tree
nix-update
nurl
parallel
q
ripgrep
socat
ssh-audit
tea
viddy
wget
xxHash
xz
];
activation.aliasApplications = lib.mkIf pkgs.stdenv.hostPlatform.isDarwin (
let
apps = pkgs.buildEnv {
name = "home-manager-applications";
paths = config.home.packages;
pathsToLink = "/Applications";
};
lastAppsFile = "${config.xdg.stateHome}/nix/.apps";
in
lib.hm.dag.entryAfter [ "writeBoundary" ] /* bash */ ''
last_apps=$(cat "${lastAppsFile}" 2>/dev/null || echo "")
next_apps=$(readlink -f ${apps}/Applications/* | sort)
if [ "$last_apps" != "$next_apps" ]; then
echo "Apps have changed. Updating macOS aliases..."
apps_path="$HOME/Applications/Home Manager Apps"
$DRY_RUN_CMD mkdir -p "$apps_path"
$DRY_RUN_CMD ${lib.getExe pkgs.fd} \
-t l -d 1 . ${apps}/Applications \
-x $DRY_RUN_CMD "${pkgs.mkalias}/bin/mkalias" \
-L {} "$apps_path/{/}"
[ -z "$DRY_RUN_CMD" ] && echo "$next_apps" > "${lastAppsFile}"
fi
''
);
};
}