1
Fork 0
mirror of https://github.com/thegeneralist01/config.git synced 2026-03-09 18:30:01 +01:00

config: command-line revamp

This commit is contained in:
TheGeneralist 2026-01-18 22:12:00 +01:00
parent 802a38f61b
commit 3f34891413
Signed by: thegeneralist01
SSH key fingerprint: SHA256:pp9qddbCNmVNoSjevdvQvM5z0DHN7LTa8qBMbcMq/R4
28 changed files with 1141 additions and 335 deletions

View file

@ -1,25 +1,31 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
...
}:
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
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
export PATH="${
lib.makeBinPath [
pkgs.coreutils
pkgs.gnugrep
pkgs.curl
pkgs.bash
]
}:$PATH"
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
'';
};
# 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
fi
'';
};
in
lib.mkIf enableAmp {
home-manager.sharedModules = [ ampHomeModule ];