new stuff

This commit is contained in:
TheGeneralist 2026-01-08 21:15:12 +01:00
parent 6014ad7d7a
commit 01c8bfce80
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
18 changed files with 721 additions and 285 deletions

26
modules/common/amp.nix Normal file
View file

@ -0,0 +1,26 @@
{ config, lib, pkgs, ... }:
let
enableAmp = (!config.onLinux) || (!config.isServer);
ampHomeModule = { lib, pkgs, ... }: {
home.sessionPath = [ "$HOME/.amp/bin" ];
home.activation.ampInstall = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
amp_bin="$HOME/.amp/bin/amp"
if [ -x "$amp_bin" ]; then
exit 0
fi
export PATH="${lib.makeBinPath [
pkgs.coreutils
pkgs.gnugrep
pkgs.curl
pkgs.bash
]}:$PATH"
# Prevent installer from trying to mutate shell rc files (Home Manager manages those).
SHELL="amp-installer" ${pkgs.curl}/bin/curl -fsSL https://ampcode.com/install.sh | ${pkgs.bash}/bin/bash
'';
};
in
lib.mkIf enableAmp {
home-manager.sharedModules = [ ampHomeModule ];
}