Personal dotfiles for Linux, mostly for Nixpkgs/NixOS-based and Termux setups. Mirrored using GitLab's push mirroring feature. gitlab.com/andreijiroh-dev/dotfiles
linux dotfiles
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

get cooked on configs

Signed-off-by: Andrei Jiroh Halili <ajhalili2006@andreijiroh.dev>

+124 -210
+90
.bashrc
··· 1 + #!/usr/bin/env bash 2 + #shellcheck disable=SC1091 3 + 4 + # My base bash shell customizations outside Home Manager, to make things 5 + # portable at least. 6 + # SPDX-License-Identifier: MPL-2.0 7 + 8 + # do feature detection if keychain is installed 9 + if command -v keychain >> /dev/null; then 10 + FF_KEYCHAIN=1 11 + else 12 + FF_KEYCHAIN=0 13 + fi 14 + 15 + try_1password_ssh_agent() { 16 + export OP_SSH_AUTH_SOCK="$HOME/.1password/agent.sock" 17 + if [[ ! -S "$OP_SSH_AUTH_SOCK" ]]; then 18 + echo "[ssh-agent-loader::1password] 1Password SSH agent isn't enabled or desktop app isn't installed yet" 19 + return 1 20 + fi 21 + 22 + echo "[ssh-agent-loader::1password] attempting to use 1Password SSH agent" 23 + if ! SSH_AUTH_SOCK=$OP_SSH_AUTH_SOCK ssh-add -l >> /dev/null 2>&1; then 24 + echo "[ssh-agent-loader::1password] something went wrong while checking for 1Password SSH agent availability" 25 + echo "[ssh-agent-loader::1password] unlock the desktop app first or enable SSH agent from settings" 26 + return 1 27 + fi 28 + export SSH_AUTH_SOCK=$OP_SSH_AUTH_SOCK 29 + unset OP_SSH_AUTH_SOCK 30 + } 31 + 32 + try_keychain_ssh_agent() { 33 + if [[ $FF_KEYCHAIN == "1" ]]; then 34 + echo "[ssh-agent-loader::keychain] attempting to use keychain for SSH agents" 35 + eval "$(keychain --eval --agents ssh,gpg)" 36 + fi 37 + } 38 + 39 + ssh-agent-loader() { 40 + if [[ $1 == "" || $1 == "auto" ]]; then 41 + unset SSH_AGENT_PID SSH_AUTH_SOCK 42 + if try_1password_ssh_agent; then 43 + return 44 + elif try_keychain_ssh_agent; then 45 + return 46 + else 47 + echo "[ssh-agent-loader] SSH agent seems to be failed to load at the moment" 48 + echo "[ssh-agent-loader] try again later by manually invoking the shell function" 49 + return 1 50 + fi 51 + elif [[ $1 == "1passowrd" || $1 == "op" ]]; then 52 + unset SSH_AGENT_PID SSH_AUTH_SOCK 53 + try_1password_ssh_agent 54 + elif [[ $1 == "keychain" ]]; then 55 + try_keychain_ssh_agent 56 + else 57 + echo "ssh-agent-loader [auto|[1password|op|1p]|keychain]" 58 + return 1 59 + fi 60 + } 61 + 62 + command -v direnv >> /dev/null && eval "$(direnv hook bash)" 63 + 64 + # Technically a hack in case we don't use home-manager switch 65 + if [ -L "$HOME/.nix-profile" ] && [ -e "$HOME/.nix-profile" ]; then 66 + export PATH="$HOME/.nix-profile/bin:$HOME:$PATH" 67 + if [ -f "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then 68 + source "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" 69 + # Don't return yet, since we still do some stuff after that. 70 + #return 71 + fi 72 + fi 73 + 74 + export PATH="$HOME/bin:$HOME/.local/bin:$PATH" 75 + export DOCKER_BUILDKIT=1 76 + 77 + # Check if we're running bash shell inside VS Code and update EDITOR and 78 + # GIT_EDITOR accordingly. We'll probably figure it out for desktop, but in the 79 + # meanwhile, just stick to nano at the moment. 80 + if [[ -n $VSCODE_IPC_HOOK_CLI ]]; then 81 + EDITOR="code --wait" 82 + ssh-agent-loader auto 83 + elif [[ -n "$SSH_CONNECTION" ]]; then 84 + EDITOR="nano" 85 + ssh-agent-loader keychain 86 + else 87 + EDITOR="nano" 88 + ssh-agent-loader auto 89 + fi 90 + export EDITOR GIT_EDITOR=$EDITOR
-17
.config/home-manager/home.nix
··· 1 - { config, ... }: 2 - 3 - { 4 - imports = [ 5 - ../nixos/shared/home-manager/main.nix 6 - ]; 7 - 8 - # Home Manager needs a bit of information about you and the paths it should 9 - # manage. Also don't ask how we got here on the roleplaying part on the main 10 - # nixpkgs branch of the dotfiles. 11 - # TODO: Update the username and homeDirectory when switching between host-specific 12 - # branches. 13 - home = { 14 - username = "gildedguy"; 15 - homeDirectory = "/home/gildedguy"; 16 - }; 17 - }
-193
.config/home-manager/meta.nix
··· 1 - # This is the meta configuration for my dotfiles with home-manager, except 2 - # some home.{username,userDirectory} configs to ensure portability between 3 - # hosts 4 - 5 - { config, pkgs, lib, ... }: 6 - 7 - { 8 - # https://fnordig.de/til/nix/home-manager-allow-unfree.html 9 - nixpkgs = { 10 - config = { 11 - allowUnfree = true; 12 - # https://github.com/nix-community/home-manager/issues/2942 13 - allowUnfreePredicate = (_: true); 14 - }; 15 - }; 16 - 17 - # This value determines the Home Manager release that your configuration is 18 - # compatible with. This helps avoid breakage when a new Home Manager release 19 - # introduces backwards incompatible changes. 20 - # 21 - # You should not change this value, even if you update Home Manager. If you do 22 - # want to update the value, then make sure to first check the Home Manager 23 - # release notes. 24 - home.stateVersion = "24.11"; # Please read the comment before changing. 25 - 26 - # The home.packages option allows you to install Nix packages into your 27 - # environment. 28 - home.packages = with pkgs; [ 29 - # # Adds the 'hello' command to your environment. It prints a friendly 30 - # # "Hello, world!" when run. 31 - # pkgs.hello 32 - 33 - # # It is sometimes useful to fine-tune packages, for example, by applying 34 - # # overrides. You can do that directly here, just don't forget the 35 - # # parentheses. Maybe you want to install Nerd Fonts with a limited number of 36 - # # fonts? 37 - # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) 38 - 39 - # # You can also create simple shell scripts directly inside your 40 - # # configuration. For example, this adds a command 'my-hello' to your 41 - # # environment: 42 - # (pkgs.writeShellScriptBin "my-hello" '' 43 - # echo "Hello, ${config.home.username}!" 44 - # '') 45 - 46 - ## devtools ## 47 - # https://httpie.io 48 - httpie 49 - # https://devenv.sh 50 - devenv 51 - # https://cli.github.com 52 - gh 53 - # bet we'll going to have a field day since Copilot is now available for free 54 - # (this is seperate from the gh copilot extension for those asking) 55 - # context: https://github.blog/news-insights/product-news/github-copilot-in-vscode-free/ 56 - github-copilot-cli 57 - # markdownlint 58 - markdownlint-cli 59 - # https://doppler.com 60 - doppler 61 - direnv 62 - shellcheck 63 - hadolint 64 - 65 - ## programming languages 66 - deno 67 - nodejs_22 68 - python313 69 - pipx 70 - pipenv 71 - 72 - ## language servers ## 73 - # nix language server - https://github.com/oxalica/nil 74 - nil 75 - # https://github.com/alesbrelih/gitlab-ci-ls 76 - gitlab-ci-ls 77 - ]; 78 - 79 - home.sessionPath = [ 80 - "${config.home.homeDirectory}/bin" 81 - ]; 82 - 83 - # Home Manager is pretty good at managing dotfiles. The primary way to manage 84 - # plain files is through 'home.file'. 85 - home.file = { 86 - # # Building this configuration will create a copy of 'dotfiles/screenrc' in 87 - # # the Nix store. Activating the configuration will then make '~/.screenrc' a 88 - # # symlink to the Nix store copy. 89 - # ".screenrc".source = dotfiles/screenrc; 90 - 91 - # # You can also set the file content immediately. 92 - # ".gradle/gradle.properties".text = '' 93 - # org.gradle.console=verbose 94 - # org.gradle.daemon.idletimeout=3600000 95 - # ''; 96 - }; 97 - 98 - # Home Manager can also manage your environment variables through 99 - # 'home.sessionVariables'. These will be explicitly sourced when using a 100 - # shell provided by Home Manager. If you don't want to manage your shell 101 - # through Home Manager then you have to manually source 'hm-session-vars.sh' 102 - # located at either 103 - # 104 - # ~/.nix-profile/etc/profile.d/hm-session-vars.sh 105 - # 106 - # or 107 - # 108 - # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh 109 - # 110 - # or 111 - # 112 - # /etc/profiles/per-user/gildedguy/etc/profile.d/hm-session-vars.sh 113 - # 114 - home.sessionVariables = { 115 - EDITOR = "nano"; 116 - NIXOS_ALLOW_UNFREE = "1"; # for impure builds 117 - GIT_EDITOR = "code --wait"; 118 - VISUAL = "code --wait"; 119 - DOCKER_BUILDKIT = "1"; 120 - }; 121 - 122 - # Let Home Manager install and manage itself. 123 - programs.home-manager.enable = true; 124 - 125 - # let me cook with the configs, starting with git 126 - programs.git = { 127 - enable = true; 128 - package = pkgs.gitAndTools.gitFull; 129 - lfs = { 130 - enable = true; 131 - }; 132 - userName = "Andrei Jiroh Halili"; 133 - userEmail = "ajhalili2006@andreijiroh.dev"; 134 - aliases = { 135 - signoff = "commit --signoff"; 136 - amend = "commit -a --amend"; 137 - remotes = "remote -v"; 138 - root = "rev-parse --show-toplevel"; 139 - unstage = "restore --staged"; 140 - stats = "status"; 141 - }; 142 - extraConfig = { 143 - format = { 144 - signOff = true; 145 - }; 146 - init = { 147 - defaultBranch = "main"; 148 - }; 149 - 150 - # https://groups.google.com/g/binary-transparency/c/f-BI4o8HZW0 151 - transfer = { 152 - fsckobjects = true; 153 - }; 154 - fetch = { 155 - fsckobjects = true; 156 - }; 157 - receive = { 158 - fsckobjects = true; 159 - }; 160 - push = { 161 - autoSetupRemote = true; 162 - }; 163 - 164 - 165 - }; 166 - }; 167 - 168 - programs.vscode = { 169 - enable = true; 170 - package = pkgs.vscode; 171 - enableExtensionUpdateCheck = true; 172 - mutableExtensionsDir = true; 173 - # userSettings = { 174 - # "nix.enableLanguageServer" = true; 175 - # "nix.serverPath" = "nil"; 176 - # "window.customTitleBarVisibility" = "auto"; 177 - # "window.titleBarStyle" = "custom"; 178 - # "window.menuBarVisibility" = "classic"; 179 - # "redhat.telemetry.enabled" = true; 180 - # "github.copilot.editor.enableAutoCompletions" = false; 181 - # "github.copilot.chat.followUps" = "always"; 182 - # "github.copilot.chat.terminalChatLocation" = "terminal"; 183 - # "git.confirmSync" = false; 184 - # "microsoft-authentication.implementation" = "msal"; 185 - # "workbench.colorTheme" = "GitHub Dark Colorblind (Beta)"; 186 - # "workbench.iconTheme" = "material-icon-theme"; 187 - # "workbench.productIconTheme" = "material-product-icons"; 188 - # }; 189 - # We're importing what's generated from nix4vscode here as a workaround 190 - # for now. 191 - #extensions = lib.attrsets.mapAttrsToList (_: v: v) vscExts; 192 - }; 193 - }
+29
.profile
··· 1 + #!/usr/bin/env sh 2 + 3 + # ~/.profile: executed by the command interpreter for login shells. 4 + # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login 5 + # exists. 6 + # see /usr/share/doc/bash/examples/startup-files for examples. 7 + # the files are located in the bash-doc package. 8 + 9 + # the default umask is set in /etc/profile; for setting the umask 10 + # for ssh logins, install and configure the libpam-umask package. 11 + #umask 022 12 + 13 + # if running bash 14 + if [ -n "$BASH_VERSION" ]; then 15 + # include .bashrc if it exists 16 + if [ -f "$HOME/.bashrc" ]; then 17 + . "$HOME/.bashrc" 18 + fi 19 + fi 20 + 21 + # set PATH so it includes user's private bin if it exists 22 + if [ -d "$HOME/bin" ] ; then 23 + PATH="$HOME/bin:$PATH" 24 + fi 25 + 26 + # set PATH so it includes user's private bin if it exists 27 + if [ -d "$HOME/.local/bin" ] ; then 28 + PATH="$HOME/.local/bin:$PATH" 29 + fi
+5
.ssh/git/allowed_signers
··· 1 + # @ajhalili2006's keys 2 + ajhalili2006@andreijiroh.dev ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEXuD3hJwInlcHs3wkXWAWNo8es3bPAd2e8ipjyqgGp2 SSH Key - main personal key, circa 2022 3 + ajhalili2006@andreijiroh.dev ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCzMlrUe7qMA1P0lP56lq2dKTrwFU6CrVltQ9um+PhOMLkoi31kAlujHtWF6mqGRLXcK0Ao/0Wqug++r82Zu0u7dpAv8LCExtaRRMzagwPkEe4OOqUBOpS6mggfsik8mNA+1UtpkXJ+ZiB4cXtNKEZC0jtxWOTXSV67qgkSxuO+YBWB+7pnESkB0KorqwOoWGGUVfYQtbKUAt6VqM4s6dn7saXqwmN0tCPO6a+4L4mazkYjFD11HhktYsjP9dvnxYSOtMrSFb9JOXRST2LdiIJgwg+HTqBSWGO7aBRHMJaTF3ajlbMtKDQI/EcNQLyGgX6yFdjjzz9DRY+2oU0vPTytdqM2BKsfLlR0GVg7BVL7TZPaLJ1lgpCl4Z1oClW9FOzhnYJVT0W+IKPsnYsFPfv/BVgjWF7YtLdc5zqFJ31PULtikCyd0I6Kt95YD0HdrlR2faWcBHI8KKEAwCCanodGnK/xTOxisTX2dXOxx3mvR/L3Wil2ca5hnD+vt500/o8= SSH Key - ajhalili2006@launchpad.net 4 + ajhalili2006@agmail.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEXuD3hJwInlcHs3wkXWAWNo8es3bPAd2e8ipjyqgGp2 SSH Key - main personal key, circa 2022 5 + ajhalili2006@gmail.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCzMlrUe7qMA1P0lP56lq2dKTrwFU6CrVltQ9um+PhOMLkoi31kAlujHtWF6mqGRLXcK0Ao/0Wqug++r82Zu0u7dpAv8LCExtaRRMzagwPkEe4OOqUBOpS6mggfsik8mNA+1UtpkXJ+ZiB4cXtNKEZC0jtxWOTXSV67qgkSxuO+YBWB+7pnESkB0KorqwOoWGGUVfYQtbKUAt6VqM4s6dn7saXqwmN0tCPO6a+4L4mazkYjFD11HhktYsjP9dvnxYSOtMrSFb9JOXRST2LdiIJgwg+HTqBSWGO7aBRHMJaTF3ajlbMtKDQI/EcNQLyGgX6yFdjjzz9DRY+2oU0vPTytdqM2BKsfLlR0GVg7BVL7TZPaLJ1lgpCl4Z1oClW9FOzhnYJVT0W+IKPsnYsFPfv/BVgjWF7YtLdc5zqFJ31PULtikCyd0I6Kt95YD0HdrlR2faWcBHI8KKEAwCCanodGnK/xTOxisTX2dXOxx3mvR/L3Wil2ca5hnD+vt500/o8= SSH Key - ajhalili2006@launchpad.net