diff options
author | Freya Murphy <fmurphy@redcom.com> | 2025-09-18 08:44:20 -0400 |
---|---|---|
committer | Freya Murphy <fmurphy@redcom.com> | 2025-09-18 20:37:46 -0400 |
commit | 09a3b5d5a0dac93f4b469bab7913b997ba5ffcc5 (patch) | |
tree | 39ad6611657ff68b81d01069572c3f1c76329409 | |
parent | fix typo (diff) | |
download | dotfiles-nix-09a3b5d5a0dac93f4b469bab7913b997ba5ffcc5.tar.gz dotfiles-nix-09a3b5d5a0dac93f4b469bab7913b997ba5ffcc5.tar.bz2 dotfiles-nix-09a3b5d5a0dac93f4b469bab7913b997ba5ffcc5.zip |
hosts: add work vm
-rw-r--r-- | flake.nix | 4 | ||||
-rw-r--r-- | home/zsh/zshrc | 44 | ||||
-rw-r--r-- | hosts/work/default.nix | 32 | ||||
-rw-r--r-- | lib/default.nix | 4 | ||||
-rw-r--r-- | nix.conf | 1 | ||||
-rw-r--r-- | options.nix | 9 | ||||
-rw-r--r-- | system/default.nix | 2 |
7 files changed, 86 insertions, 10 deletions
@@ -92,9 +92,10 @@ modules = [ ./home ./options.nix - (self.lib.customConfig hostModule.config) + (self.lib.homeConfig hostModule.config) { nixpkgs.config.allowUnfree = true; + programs.home-manager.enable = nixpkgs.lib.mkForce false; } ]; }; @@ -111,6 +112,7 @@ kaworu = mkHome ./hosts/kaworu "x86_64-linux"; thinkpad = mkHome ./hosts/thinkpad "x86_64-linux"; wsl = mkHome ./hosts/wsl "x86_64-linux"; + kagamine = mkHome ./hosts/work "x86_64-linux"; }; lib = import ./lib { diff --git a/home/zsh/zshrc b/home/zsh/zshrc index 6a366a0..346faef 100644 --- a/home/zsh/zshrc +++ b/home/zsh/zshrc @@ -3,6 +3,16 @@ # export 'SHELL' to child processes export SHELL +# set lang +export LANG=en_US.UTF-8 +export LC_ALL=en_US.UTF-8 + +# set history +HISTSIZE=10000 +SAVEHIST=10000 +HISTFILE=~/.histfile + +# check for non-interactive shell if [[ $- != *i* ]] then # We are being invoked from a non-interactive shell. If this @@ -14,6 +24,17 @@ then return fi +# load zsh plugins +setopt extendedglob +bindkey -v +tabs + +autoload compinit +compinit + +autoload -U colors && colors +setopt promptsubst + # update PATH PATH=$PATH:$HOME/.local/bin PATH=$PATH:$HOME/.cargo/bin @@ -23,11 +44,22 @@ PATH=$PATH:$HOME/.cargo/bin set -o vi set show-mode-in-prompt on -# Set shell prompt using starship +# fallback zsh prompt +function prompt_char { + if [ $UID -eq 0 ]; then echo '#'; else echo '$'; fi +} + +function git_prompt_info() { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo "%F{13} [${ref#refs/heads/}]%{$reset_color%}" +} + +PROMPT='%(!.%F{9}.%F{10})%n@%m: %F{15}%c%F{12}$(git_prompt_info)%F{12}$(prompt_char)%F{15} ' +PROMPT2='%_%F{12}:%F{15} ' + +# set shell prompt using starship if command -v "starship" > /dev/null; then eval "$(starship init zsh)" -else - export PS1="$$USER: " fi # aliases @@ -56,9 +88,6 @@ export LESS_TERMCAP_ue=$'\e[0m' export LESS_TERMCAP_us=$'\e[1;35m' export GROFF_NO_SGR=1 -# compinit -autoload compinit && compinit - # keybinds bindkey "\e[1;5D" backward-word bindkey "\e[1;5C" forward-word @@ -72,3 +101,6 @@ bindkey "\e\d" undo # gpg export GPG_TTY=$(tty) export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + +# tmux +alias tmux="tmux -u" diff --git a/hosts/work/default.nix b/hosts/work/default.nix new file mode 100644 index 0000000..7427945 --- /dev/null +++ b/hosts/work/default.nix @@ -0,0 +1,32 @@ +# Work +# System configuration for work vm +{ + lib, + config, + pkgs, + inputs, + ... +}: { + # options + hostName = "work"; + user = "fmurphy"; + minimal = true; + + # packages + extraHome = { + home.packages = with pkgs; [ + inputs.self.packages.${system}.arcanist + ]; + + programs.git = { + signing.signByDefault = lib.mkForce false; + }; + }; + + # modules + development = { + c.enable = true; + lua.enable = true; + web.enable = true; + }; +} diff --git a/lib/default.nix b/lib/default.nix index 67d1cba..2da5bd9 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -4,7 +4,7 @@ in { inherit (files) getFiles certs sshKeys gpgKeys; - customConfig = config: { + homeConfig = config: { inherit (config) # System Information @@ -37,5 +37,5 @@ in { virt autoRun ; - }; + } // config.extraHome; } diff --git a/nix.conf b/nix.conf new file mode 100644 index 0000000..c7d7291 --- /dev/null +++ b/nix.conf @@ -0,0 +1 @@ +experimental-features = nix-command flakes diff --git a/options.nix b/options.nix index 1a569c2..db68544 100644 --- a/options.nix +++ b/options.nix @@ -474,5 +474,14 @@ in { "element-desktop" ]; }; + + # + # Extra home configuration + # + extraHome = mkOption { + type = types.attrs; + description = "Extra home manager configuration"; + default = {}; + }; }; } diff --git a/system/default.nix b/system/default.nix index 824c99f..9760184 100644 --- a/system/default.nix +++ b/system/default.nix @@ -49,7 +49,7 @@ imports = [ ../home ../options.nix - (inputs.self.lib.customConfig config) + (inputs.self.lib.homeConfig config) ]; }; |