Skip to content

Commit 00a0e8b

Browse files
committed
home-manager modules
1 parent 19b0ac9 commit 00a0e8b

File tree

9 files changed

+86
-52
lines changed

9 files changed

+86
-52
lines changed

flake.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
inherit pkgs;
3131

3232
modules = [
33-
./modules/home.nix
33+
./modules/home-manager
3434
{
3535
home = {
3636
inherit homeDirectory username;
Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
...
55
}: {
66
home = {
7-
# Specify packages not explicitly configured below
87
packages = with pkgs; [
9-
colima
10-
docker
118
entr
129
fd
1310
httpie
@@ -16,6 +13,7 @@
1613
jq
1714
nodejs
1815
pandoc
16+
python3
1917
ripgrep
2018
tree
2119
tree-sitter
@@ -65,19 +63,8 @@
6563
src = pkgs.fetchFromGitHub {
6664
owner = "PatrickF1";
6765
repo = "fzf.fish";
68-
rev = "6d8e962f3ed84e42583cec1ec4861d4f0e6c4eb3";
69-
sha256 = "sha256-0rnd8oJzLw8x/U7OLqoOMQpK81gRc7DTxZRSHxN9YlM";
70-
};
71-
}
72-
# Need this when using Fish as a default macOS shell in order to pick
73-
# up ~/.nix-profile/bin
74-
{
75-
name = "nix-env";
76-
src = pkgs.fetchFromGitHub {
77-
owner = "lilyball";
78-
repo = "nix-env.fish";
79-
rev = "00c6cc762427efe08ac0bd0d1b1d12048d3ca727";
80-
sha256 = "1hrl22dd0aaszdanhvddvqz3aq40jp9zi2zn0v1hjnf7fx4bgpma";
66+
rev = "8920367cf85eee5218cc25a11e209d46e2591e7a";
67+
sha256 = "sha256-T8KYLA/r/gOKvAivKRoeqIwE2pINlxFQtZJHpOy9GMM=";
8168
};
8269
}
8370
];
@@ -98,27 +85,7 @@
9885
set fish_color_escape white
9986
set fish_color_autosuggestion brblack
10087
'';
101-
# Send OSC 133 escape sequences to signal prompt and ouput start and end.
102-
interactiveShellInit = ''
103-
function terminal_integration_preprompt --on-event fish_prompt
104-
printf "\033]133;A;\007"
105-
end
106-
107-
# TODO not used yet.
108-
function terminal_integration_postprompt
109-
printf "\033]133;B;\007"
110-
end
111-
112-
function terminal_integration_preexec --on-event fish_preexec
113-
printf "\033]133;C;\007"
114-
end
115-
116-
function terminal_integration_postexec --on-event fish_postexec
117-
printf "\033]133;D;\007"
118-
end
119-
'';
12088
shellAliases = {
121-
ipython = "ipython --no-banner";
12289
rm = "rm -i";
12390
cp = "cp -i";
12491
mv = "mv -i";
@@ -129,7 +96,6 @@
12996
# An abbreviation will expand after <space> or <Enter> is hit
13097
shellAbbrs = {
13198
b = "bat";
132-
ip = "ipython";
13399
g = "git";
134100
ga = "git add";
135101
gap = "git add -p";
@@ -161,8 +127,6 @@
161127
gswc = "git switch -c";
162128
gswm = "git switch main";
163129
h = "http";
164-
hme = "home-manager --flake ~/Code/dotfiles edit";
165-
hms = "home-manager --flake ~/Code/dotfiles switch";
166130
iexm = "iex -S mix";
167131
m = "make";
168132
o = "open";
@@ -218,10 +182,8 @@
218182

219183
ghostty = {
220184
enable = true;
221-
# Ghostty package is broken on macOS, must install app manually.
222-
package = null;
223185
settings = {
224-
theme = "Rose Pine Dawn";
186+
theme = "TokyoNight Moon";
225187
command = "${config.home.profileDirectory}/bin/fish";
226188
# Move between panes with cmd+opt+{h,j,k,l}.
227189
keybind = [
@@ -296,7 +258,7 @@
296258
helix = {
297259
enable = true;
298260
settings = {
299-
theme = "rose_pine_dawn";
261+
theme = "tokyonight_moon";
300262
editor = {
301263
bufferline = "multiple";
302264
color-modes = true;
@@ -337,11 +299,4 @@
337299
enableFishIntegration = true;
338300
};
339301
};
340-
341-
# Requires telling Hammerspoon to look for configuration in the right place:
342-
# defaults write org.hammerspoon.Hammerspoon MJConfigFile "${XDG_CONFIG_HOME:-$HOME/.config}/hammerspoon/init.lua"
343-
xdg.configFile.hammerspoon = {
344-
source = ../hammerspoon;
345-
recursive = true;
346-
};
347302
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
config,
3+
pkgs,
4+
lib,
5+
...
6+
}:
7+
let
8+
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
9+
in {
10+
config = lib.mkIf isDarwin {
11+
home = {
12+
packages = with pkgs; [
13+
colima
14+
docker
15+
];
16+
};
17+
18+
programs = {
19+
fish = {
20+
plugins = [
21+
# Need this when using Fish as a default macOS shell in order to pick
22+
# up ~/.nix-profile/bin
23+
{
24+
name = "nix-env";
25+
src = pkgs.fetchFromGitHub {
26+
owner = "lilyball";
27+
repo = "nix-env.fish";
28+
rev = "7b65bd228429e852c8fdfa07601159130a818cfa";
29+
sha256 = "sha256-RG/0rfhgq6aEKNZ0XwIqOaZ6K5S4+/Y5EEMnIdtfPhk=";
30+
};
31+
}
32+
];
33+
};
34+
35+
git = {
36+
settings = {
37+
core = {
38+
# If git uses `ssh` from Nix the macOS-specific configuration in
39+
# `~/.ssh/config` won't be seen as valid
40+
# https://github.com/NixOS/nixpkgs/issues/15686#issuecomment-865928923
41+
sshCommand = "/usr/bin/ssh";
42+
};
43+
};
44+
};
45+
46+
ghostty = {
47+
# Ghostty package is broken on macOS, must install app manually.
48+
package = null;
49+
};
50+
};
51+
52+
# Requires telling Hammerspoon to look for configuration in the right place:
53+
# defaults write org.hammerspoon.Hammerspoon MJConfigFile "${XDG_CONFIG_HOME:-$HOME/.config}/hammerspoon/init.lua"
54+
xdg.configFile.hammerspoon = {
55+
source = ./hammerspoon;
56+
recursive = true;
57+
};
58+
};
59+
}

hammerspoon/Spoons/WindowHalfsAndThirds.spoon/docs.json renamed to modules/home-manager/darwin/hammerspoon/Spoons/WindowHalfsAndThirds.spoon/docs.json

File renamed without changes.

hammerspoon/Spoons/WindowHalfsAndThirds.spoon/init.lua renamed to modules/home-manager/darwin/hammerspoon/Spoons/WindowHalfsAndThirds.spoon/init.lua

File renamed without changes.

hammerspoon/init.lua renamed to modules/home-manager/darwin/hammerspoon/init.lua

File renamed without changes.

modules/home-manager/default.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{ ... }:
2+
{
3+
imports = [
4+
./common.nix
5+
./darwin
6+
./linux
7+
];
8+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
config,
3+
pkgs,
4+
lib,
5+
...
6+
}:
7+
let
8+
isLinux = pkgs.stdenv.hostPlatform.isLinux;
9+
in {
10+
config = lib.mkIf isLinux {
11+
};
12+
}

modules/macos.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ in {
1515
useGlobalPkgs = true;
1616
useUserPackages = true;
1717
users."${username}" = {
18-
imports = [./home.nix];
18+
imports = [./home-manager];
1919
home = {
2020
inherit homeDirectory username;
2121
stateVersion = "23.11";

0 commit comments

Comments
 (0)