-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.nix
119 lines (96 loc) · 2.62 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
{ pkgs, ... }:
{
home.stateVersion = "24.05";
home.username = "nktfh100";
home.packages = with pkgs; [
# General
htop
wget
neofetch
bitwarden
google-chrome
stremio # Media center
psmisc # To use fuser
# Video/Audio
vlc
audacity
obs-studio
# Social
discord
# Dev
docker
gh # Github CLI
gnumake # Make
jetbrains.webstorm
jetbrains.pycharm-community-bin
# Coding language specific
# Nix
# nixfmt-classic
# JS/TS
nodejs_20
yarn
# Global npm packages
nodePackages_latest.vercel
# Python
python312
# Python packages
python312Packages.flake8 # Linter
python312Packages.black # Formatter
# Go
gopls # Go language server
delve # Go debugger
];
# Make firefox the default browser
xdg.mimeApps.defaultApplications = {
"text/html" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ];
"x-scheme-handler/https" = [ "firefox.desktop" ];
};
programs.home-manager.enable = true;
programs.command-not-found.enable = true;
programs.bash = {
enable = true;
shellAliases = {
la = "ls -a";
nix-code = "code /etc/nixos";
nix-garbage = "sudo nix-env --delete-generations old && sudo nix-store --gc && sudo nix-collect-garbage -d && sudo nix store optimise && sudo rm -rf ~/.local/share/Trash/*";
py = "python";
dcb = "docker compose build";
dcu = "docker compose up";
dcud = "docker compose up";
dcd = "docker compose down";
dcsa = "docker stop $(docker ps -a -q)";
dc = "docker compose";
};
bashrcExtra = ''
nix-rebuild() {
local flake_name="nktfh100-$1"
local rebuild_subcommand=$2
shift 2
local extra_args="$@"
if [[ "$flake_name" != "$(hostname)" ]]; then
echo "Warning: The flake name '$flake_name' does not match the current hostname '$(hostname)'."
read -p "Do you want to proceed? (y/N): " confirmation
if [[ "$confirmation" != "y" && "$confirmation" != "Y" ]]; then
echo "Aborted."
return 1
fi
fi
cd /etc/nixos && git add . && cd - > /dev/null && sudo nixos-rebuild "$rebuild_subcommand" --flake "/etc/nixos?submodules=1#$flake_name" $extra_args
}
kill-port() {
sudo fuser -k $1/tcp
}
'';
};
programs.git = {
enable = true;
userName = "nktfh100";
userEmail = "[email protected]";
extraConfig = {
credential.helper = "store";
http.postBuffer = "524288000";
submodules.recurse = "true";
};
};
}