forked from juspay/nixos-unified-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
134 lines (119 loc) · 3.25 KB
/
default.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
133
134
{ flake, pkgs, ... }:
{
imports = [
./nix-index.nix
./neovim.nix # Comment this out if you do not want to setup Neovim.
];
# Recommended Nix settings
nix = {
registry.nixpkgs.flake = flake.inputs.nixpkgs; # https://yusef.napora.org/blog/pinning-nixpkgs-flake/
# FIXME: Waiting for this to be merged:
# https://github.com/nix-community/home-manager/pull/4031
# nixPath = [ "nixpkgs=${flake.inputs.nixpkgs}" ]; # Enables use of `nix-shell -p ...` etc
# Garbage collect the Nix store
gc = {
automatic = true;
# Change how often the garbage collector runs (default: weekly)
# frequency = "monthly";
};
};
# Nix packages to install to $HOME
#
# Search for packages here: https://search.nixos.org/packages
home.packages = with pkgs; [
# Unix tools
ripgrep # Better `grep`
fd
sd
tree
# Nix dev
cachix
nil # Nix language server
nix-info
nixpkgs-fmt
nixci
nix-health
# Dev
tmate
# On ubuntu, we need this less for `man home-configuration.nix`'s pager to
# work.
less
];
home.shellAliases = {
g = "git";
lg = "lazygit";
};
# Programs natively supported by home-manager.
programs = {
# on macOS, you probably don't need this
bash = {
enable = true;
initExtra = ''
# Make Nix and home-manager installed things available in PATH.
export PATH=/run/current-system/sw/bin/:/nix/var/nix/profiles/default/bin:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:$PATH
'';
};
# For macOS's default shell.
zsh = {
enable = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
envExtra = ''
# Make Nix and home-manager installed things available in PATH.
export PATH=/run/current-system/sw/bin/:/nix/var/nix/profiles/default/bin:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:$PATH
'';
};
# Better `cat`
bat.enable = true;
# Type `z <pat>` to cd to some directory
zoxide.enable = true;
# Type `<ctrl> + r` to fuzzy search your shell history
fzf.enable = true;
jq.enable = true;
# Install btop https://github.com/aristocratos/btop
btop.enable = true;
starship = {
enable = true;
settings = {
username = {
style_user = "blue bold";
style_root = "red bold";
format = "[$user]($style) ";
disabled = false;
show_always = true;
};
hostname = {
ssh_only = false;
ssh_symbol = "🌐 ";
format = "on [$hostname](bold red) ";
trim_at = ".local";
disabled = false;
};
};
};
# https://nixos.asia/en/direnv
direnv = {
enable = true;
nix-direnv.enable = true;
config.global = {
# Make direnv messages less verbose
hide_env_diff = true;
};
};
# https://nixos.asia/en/git
git = {
enable = true;
# userName = "John Doe";
# userEmail = "[email protected]";
ignores = [ "*~" "*.swp" ];
aliases = {
ci = "commit";
};
extraConfig = {
# init.defaultBranch = "master";
# pull.rebase = "false";
};
};
lazygit.enable = true;
};
}