users/ryan/home.nix

b33f5b96e8b659a28e29d7df3fa63669b1e7b316 · 3.9 KB · 151 lines raw

1 { config, pkgs, lib, ... }:
2
3 {
4 # This value determines the Home Manager release that your configuration is
5 # compatible with. This helps avoid breakage when a new Home Manager release
6 # introduces backwards incompatible changes.
7 #
8 # You should not change this value, even if you update Home Manager. If you do
9 # want to update the value, then make sure to first check the Home Manager
10 # release notes.
11 imports = [ ./modules ];
12 home.stateVersion = "26.05"; # Please read the comment before changing.
13
14 news.display = "silent";
15
16 # My own modules
17 ryan.neovim.enable = true;
18
19 programs.starship = {
20 enable = true;
21 settings = {
22 add_newline = false;
23 character = {
24 success_symbol = "[➜](bold green)";
25 error_symbol = "[➜](bold red)";
26 };
27 time = {
28 disabled = false;
29 format = "\[ $time \]($style)";
30 time_format = "%T";
31 };
32 };
33 };
34
35 programs.zen-browser = {
36 enable = true;
37 package = null; # managed via homebrew
38 darwinDefaultsId = "app.zen-browser.zen";
39 policies = import ./zen/zenPolicies.nix;
40 profiles.default = import ./zen/zenProfile.nix;
41 };
42
43 programs.eza = {
44 enable = true;
45 enableZshIntegration = true;
46 };
47
48 programs.gpg.enable = true;
49
50 programs.git = {
51 enable = true;
52 signing.signByDefault = true;
53 settings = {
54 user = {
55 name = "Ryan Schanzenbacher";
56 email = "ryan@rschanz.org";
57 };
58 core.pager = "${pkgs.delta}/bin/delta";
59 init.defaultBranch = "main";
60 merge.conflictStyle = "zdiff3";
61 interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
62 delta = {
63 navigate = true;
64 side-by-side = true;
65 };
66 };
67 };
68
69 services.gpg-agent = {
70 enable = true;
71 enableSshSupport = true;
72 };
73
74 programs.zsh = {
75 enable = true;
76 initContent = ''
77 export GPG_TTY="$(tty)"
78 export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
79 gpgconf --launch gpg-agent
80 gpg-connect-agent updatestartuptty /bye > /dev/null
81 '';
82 shellAliases = {
83 cat = "bat --paging=never";
84 diff = "delta";
85 };
86 };
87
88 # The home.packages option allows you to install Nix packages into your
89 # environment.
90 home.packages = with pkgs; [
91 git
92 yt-dlp
93 aerc
94 gdu
95 taskwarrior3
96 delta
97 bat
98 pass
99 pandoc
100 iina # Media player (frontend to mpv essentially)
101 kubectl
102 talhelper
103 talosctl
104 ];
105
106 # Home Manager is pretty good at managing dotfiles. The primary way to manage
107 # plain files is through 'home.file'.
108 home.file = {
109 # # Building this configuration will create a copy of 'dotfiles/screenrc' in
110 # # the Nix store. Activating the configuration will then make '~/.screenrc' a
111 # # symlink to the Nix store copy.
112 # ".screenrc".source = dotfiles/screenrc;
113
114 # # You can also set the file content immediately.
115 # ".gradle/gradle.properties".text = ''
116 # org.gradle.console=verbose
117 # org.gradle.daemon.idletimeout=3600000
118 # '';
119 };
120
121 # Install User apps to subdir for dock stuff
122 targets.darwin.linkApps.directory = "Applications/User Apps";
123
124 # Symlink System apps into the user apps "system" dir
125 home.activation.linkSystemApps = lib.hm.dag.entryAfter ["writeBoundary"] ''
126 if [[ -z "$HOME" ]]; then
127 echo "ERROR: HOME was not defined. This should not happen. Bailing! ">&2
128 exit 1
129 fi
130
131 $DRY_RUN_CMD mkdir -p "$HOME/Applications/System Apps"
132
133 $DRY_RUN_CMD rm -rf "$HOME/Applications/System Apps/"*.app
134
135 $DRY_RUN_CMD find /Applications /System/Applications -maxdepth 2 -name "*.app" \
136 -prune -exec ln -sf {} "$HOME/Applications/System Apps/" \;
137 '';
138
139 xdg.configFile."aerc" = {
140 source = ./aerc;
141 recursive = true;
142 };
143
144 home.sessionVariables = {
145 XDG_CONFIG_HOME = "${config.home.homeDirectory}/.config";
146 EDITOR = "${pkgs.neovim}/bin/nvim";
147 };
148
149 # Let Home Manager install and manage itself.
150 programs.home-manager.enable = true;
151 }