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 ];
}

View file

@ -4,6 +4,7 @@ in {
options.dnsServers = mkOption {
default = [
"100.100.100.100#shorthair-wall.ts.net"
"1.1.1.1#"
];
};
}

View file

@ -30,6 +30,8 @@ in {
builders-use-substitutes = true;
};
nix.package = pkgs.nixVersions.nix_2_30;
nix.distributedBuilds = true;
nix.buildMachines = if (config.networking.hostName != "thegeneralist-central") then [{
hostName = "thegeneralist-central";

View file

@ -71,6 +71,14 @@ alias rb = nh os switch . -v -- --show-trace --verbose
def greeting [] {
let quotes = [
"What is impossible for you is not impossible for me."
"Why do we fall, Master Wayne? So that we can learn to pick ourselves up. - Alfred Pennyworth"
"Endure, Master Wayne. Take it. Theyll hate you for it, but thats the point of Batman. He can be the outcast. He can make the choice… that no one else can make. The right choice. - Alfred Pennyworth"
"— I never said thank you. — And you will never have to."
"A hero can be anyone, even a man doing something as simple and reassuring as putting a coat on a young boy's shoulders to let him know that the world hadn't ended. - Batman"
"— Come with me. Save yourself. You don't owe these ppl anymore, you've given them everything.\n —Not everything. Not yet."
"The night is always darkest before the dawn, but I promise you, the dawn is coming. - Harvey Dent"
"It's not who you are underneath, but what you do that defines you. - Batman"
"The idea was to be a symbol. Batman... could be anybody. That was the point. - Bruce Wayne"
]
echo ($quotes | get (random int 0..(($quotes | length) - 1)))
}

View file

@ -1,71 +1,106 @@
{ config, pkgs, lib, ... }: let
inherit (lib) readFile getExe mkIf optionalAttrs;
in {
{
config,
pkgs,
lib,
...
}:
let
inherit (lib)
readFile
getExe
mkAfter
mkIf
optionalAttrs
;
in
{
# TODO: starship + change the zoxide src
# TODO: Rust tooling
environment = optionalAttrs config.onLinux {
sessionVariables.SHELLS = [ (getExe pkgs.nushell) (getExe pkgs.zsh) ];
} // {
shells = mkIf (!config.onLinux) [ pkgs.nushell pkgs.zsh ];
environment =
optionalAttrs config.onLinux {
sessionVariables.SHELLS = [
(getExe pkgs.nushell)
(getExe pkgs.zsh)
];
}
// {
shells = mkIf (!config.onLinux) [
pkgs.nushell
pkgs.zsh
];
systemPackages = with pkgs; [
nushell
fish
zoxide
vivid
ripgrep
yazi
jq
yq-go
eza
fzf
gh
fastfetch
carapace
];
systemPackages = with pkgs; [
nushell
fish
zoxide
vivid
ripgrep
yazi
jq
yq-go
eza
fzf
gh
fastfetch
carapace
bat
bat-extras.core
];
shellAliases = {
v = "nvim .";
ff = "fastfetch --load-config examples/10.jsonc";
g = "glimpse --interactive -o both -f llm.md";
gg = "open llm.md | save -r /dev/stdout | ^xclip -sel c";
rn = "yazi";
c = "clear";
e = "exa";
el = "exa -la";
l = "ls -a";
ll = "ls -la";
cl = "c; l";
ap = "cd ~/personal";
ad = "cd ~/Downloads";
ab = "cd ~/books";
a = "cd ~";
ah = "cd ~/dotfiles/hosts/thegeneralist";
ai3 = "nvim /home/thegeneralist/dotfiles/hosts/thegeneralist/dotfiles/i3/config";
rb = "nh os switch . -v -- --show-trace --verbose";
shellAliases = {
v = "nvim .";
vi = "vim";
vim = "nvim";
ff = "fastfetch --load-config examples/10.jsonc";
g = "glimpse --interactive -o both -f llm.md";
gg = "open llm.md | save -r /dev/stdout | ^xclip -sel c";
rn = "yazi";
cat = "bat";
c = "clear";
e = "exa";
ea = "exa -a";
el = "exa -la";
l = "ls -a";
la = "ls -a";
ll = "ls -la";
cl = "c; l";
ap = "cd ~/personal";
ad = "cd ~/Downloads";
ab = "cd ~/books";
a = "cd ~";
ah = "cd ~/dotfiles/hosts/thegeneralist";
ai3 = "nvim /home/thegeneralist/dotfiles/hosts/thegeneralist/dotfiles/i3/config";
rb = "nh os switch . -v -- --show-trace --verbose";
};
};
};
home-manager.sharedModules = [
({
home.file = {
".zshrc" = let
configFile = ./config.nu;
envFile = ./env.nu;
in {
text = "exec nu --env-config ${envFile} --config ${configFile}";
force = true;
{
home = {
sessionPath = [ "$HOME/.amp/bin" "$HOME/.npm-packages/bin" "/opt/homebrew/bin" ];
file = {
".zshrc" =
let
configFile = ./config.nu;
envFile = ./env.nu;
in
{
text = "exec nu --env-config ${envFile} --config ${configFile}";
force = true;
};
".config/nushell/zoxide.nu".source = pkgs.runCommand "zoxide.nu" { } ''
${getExe pkgs.zoxide} init nushell --cmd cd > $out
'';
".config/nushell/ls_colors.txt".source = pkgs.runCommand "ls_colors.txt" { } ''
${getExe pkgs.vivid} generate gruvbox-dark-hard > $out
'';
};
".config/nushell/zoxide.nu".source = pkgs.runCommand "zoxide.nu" {} ''
${getExe pkgs.zoxide} init nushell --cmd cd > $out
'';
".config/nushell/ls_colors.txt".source = pkgs.runCommand "ls_colors.txt" {} ''
${getExe pkgs.vivid} generate gruvbox-dark-hard > $out
'';
};
})
}
(homeArgs: {
programs.nushell = {
enable = true;

View file

@ -18,6 +18,7 @@ source ~/.config/nushell/zoxide.nu
# Extra PATHs
# $env.PATH = [
# # ($env.HOME | path join ".amp/bin")
# # "/home/thegeneralist/AppImages"
# # ($env.HOME | path join "personal/zen")
# # ($env.HOME | path join ".local/scripts")