flake/home/default.nix

85 lines
2 KiB
Nix
Raw Normal View History

{
2024-02-06 10:08:36 +00:00
inputs,
pkgs,
config,
lib,
...
}: {
home = {
# for nix-on-droid
username = lib.mkDefault "guanranwang";
homeDirectory =
lib.mkDefault
(
if pkgs.stdenv.hostPlatform.isDarwin
then "/Users/${config.home.username}"
else "/home/${config.home.username}"
);
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
stateVersion = "23.05";
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# Default applications
imports = [
2024-02-27 07:38:36 +00:00
inputs.nur.hmModules.nur
2024-03-26 08:49:35 +00:00
./applications/atuin
2024-04-22 18:35:50 +00:00
./applications/bash
2024-03-26 08:49:35 +00:00
./applications/bat
./applications/eza
2024-04-22 18:35:50 +00:00
./applications/fish
./applications/git
2024-01-01 13:31:28 +00:00
./applications/gpg
2024-07-03 13:01:39 +00:00
./applications/neovim
./applications/skim
2024-03-26 08:49:35 +00:00
./applications/starship
./applications/tealdeer
2024-07-03 13:01:39 +00:00
./applications/tmux
];
2024-07-03 11:15:17 +00:00
programs.jq.enable = true;
2024-03-26 08:49:35 +00:00
programs.ripgrep.enable = true;
programs.zoxide.enable = true;
2024-06-14 23:25:48 +00:00
home.packages =
(with pkgs; [
fd
fastfetch
])
++ lib.optionals pkgs.stdenv.hostPlatform.isLinux (with pkgs; [
trashy
]);
2024-03-26 08:49:35 +00:00
home.shellAliases = {
".." = "cd ..";
"farsee" = "curl -F 'c=@-' 'https://fars.ee/'"; # pb
};
2024-06-05 09:51:01 +00:00
2024-06-12 13:27:05 +00:00
programs.fish.functions = let
jq = lib.getExe pkgs.jq;
nix = lib.getExe pkgs.nix;
curl = lib.getExe pkgs.curl;
in {
"pb" = ''
2024-06-05 09:51:01 +00:00
${jq} -Rns '{text: inputs}' | \
${curl} -s -H 'Content-Type: application/json' --data-binary @- https://pb.ny4.dev | \
${jq} -r '. | "https://pb.ny4.dev\(.path)"'
'';
2024-06-12 13:27:05 +00:00
"getmnter" = ''
${nix} eval nixpkgs#{$argv}.meta.maintainers --json | \
2024-06-14 17:59:56 +00:00
${jq} '.[].github | "@" + .' -r
2024-06-12 13:27:05 +00:00
'';
2024-06-05 09:51:01 +00:00
};
}