-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.nix
132 lines (119 loc) · 3.98 KB
/
home.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
{
# config,
pkgs,
# lib,
user,
inputs,
private,
...
}: let
isMac = pkgs.system == "aarch64-darwin";
in {
home-manager = {
backupFileExtension = "bak";
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {
private = private;
};
};
# verbose = true;
home-manager.users.${user} = {
config,
lib,
pkgs,
...
}: {
programs.bash.enable = true;
programs.home-manager.enable = true;
imports =
[
inputs.nixvim.homeManagerModules.nixvim
./programs/fish.nix
./programs/general.nix
./programs/git.nix
./programs/gitui.nix
./programs/helix.nix
./programs/neovim.nix
./programs/nushell.nix
./programs/ssh.nix
./programs/starship.nix
./programs/vscode.nix
./programs/zellij.nix
./programs/zsh.nix
]
# ++ ((lib.optionals (lib.hasAttr "personal" private && private.personal)) [
# # personal only
# ])
++ ((lib.optionals isMac) [
./home-darwin-defaults.nix
]);
xdg.configFile = {
"ghostty/config".source = ./files/ghostty;
# "ghostty/config".text = builtins.readFile ./files/ghostty;
};
home = {
stateVersion = "22.05";
# TODO: pkgs.callPackage ./environment_variables.nix {private = private;};
sessionVariables = {
# BORG_PASSPHRASE = "${private.borgSecret}";
DOTFILES_DIR = "${config.home.homeDirectory}/dotfiles";
EDITOR = "nvim";
GITHUB_TOKEN = "${private.githubSecret}";
GOPATH = "${config.home.homeDirectory}/go";
GOPROXY = "direct";
GOSUMDB = "off";
ICLOUD_DIR = "${config.home.homeDirectory}/Library/Mobile Documents/com~apple~CloudDocs";
LESS = "-R";
N_PREFIX = "$HOME/.n";
NOTES_DIR = "${config.home.homeDirectory}/projects/sheeley/notes";
PRIVATE_CMD_DIR = "${config.home.homeDirectory}/projects/sheeley/infrastructure/cmd";
PRIVATE_DATA_DIR = "${config.home.homeDirectory}/projects/sheeley/infrastructure/data";
PRIVATE_TOOLS_DIR = "${config.home.homeDirectory}/projects/sheeley/infrastructure";
TOOLS_DIR = "${config.home.homeDirectory}/dotfiles/bin";
WORK_NOTES_DIR = "${config.home.homeDirectory}/Library/Mobile Documents/iCloud~md~obsidian/Documents/Apple Notes";
WORKMACHINE = "false";
# Starship spcific
STARSHIP_LOG = "error";
};
# this sometimes doesn't work with fish
# https://github.com/LnL7/nix-darwin/issues/122
sessionPath = pkgs.callPackage ./environment_path.nix {};
packages = pkgs.callPackage ./packages.nix {
lib = lib;
private = private;
};
file = {
".mongorc.js".text = builtins.readFile ./files/.mongorc.js;
".swiftformat".text = builtins.readFile ./files/.swiftformat;
# ".swiftlint.yml".text = builtins.readFile ./files/.swiftlint.yml;
# ".vim/ftdetect/toml.vim".text = "autocmd BufNewFile,BufRead *.toml set filetype=toml";
# for right now, seems more effective to just copy .npmrc
# link instead of make a real file because this needs to be modified to login/etc
# ".npmrc".source = config.lib.file.mkOutOfStoreSymlink ./files/.npmrc;
# ".config/rclone/rclone.conf".source = pkgs.substituteAll {
# name = "rclone.conf";
# src = ./files/rclone.conf;
# user = "${private.borgUser}";
# };
};
shellAliases = {
cat = "bat";
cddot = "cd ~/dotfiles";
cdgo = "cd $GOPATH/src";
cdicloud = "cd $ICLOUD_DIR";
cdinfra = "cd $PRIVATE_TOOLS_DIR";
cdnotes = "cd $NOTES_DIR";
cdproj = "cd $HOME/projects/sheeley";
cdscratch = "cd ~/scratch";
cdtools = "cd $TOOLS_DIR";
cdwork = "cd ~/work";
cdworknotes = "cd $WORK_NOTES_DIR";
clone = "git clone";
la = "ls -la";
v = "vim .";
vdot = "vim ~/dotfiles";
};
};
};
}