Skip to content

Commit 5dee150

Browse files
committed
feat(nix): ✨⬆️ magic
1 parent d5a011f commit 5dee150

File tree

18 files changed

+359
-172
lines changed

18 files changed

+359
-172
lines changed

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"nixEnvSelector.nixFile": "${workspaceFolder}/flake.nix"
3+
}

home/alacritty/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ in
5959
animation = "EaseOutQuint";
6060
duration = 0;
6161
};
62-
inherit (aura_theme) colors;
62+
colors = lib.mkIf (!config.sof.catppuccin.enable) aura_theme.colors;
6363
cursor = {
6464
style = {
6565
shape = "Beam";

home/aws/default.nix

+36-38
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,47 @@
1313
};
1414
};
1515

16-
config =
17-
lib.mkIf config.sof.aws.enable {
18-
home.packages = builtins.attrValues {
19-
inherit (pkgs)
20-
awsbck
21-
awsls
22-
awsume
23-
cw
24-
e1s
25-
pacu
26-
rain
27-
ssmsh
28-
yatas
29-
;
30-
};
16+
config = lib.mkIf config.sof.aws.enable {
17+
home.packages = builtins.attrValues {
18+
inherit (pkgs)
19+
awsbck
20+
awsls
21+
awsume
22+
cw
23+
e1s
24+
pacu
25+
rain
26+
ssmsh
27+
yatas
28+
;
29+
};
3130

32-
programs = {
33-
awscli = {
34-
enable = true;
35-
};
31+
programs = {
32+
awscli = {
33+
enable = true;
3634
};
35+
};
3736

38-
# aws-cli does not work well with xdg base directories
39-
# https://github.com/aws/aws-sdk/issues/30#issuecomment-532208981
40-
home.sessionVariables = {
41-
AWS_CONFIG_FILE = "${config.xdg.configHome}/aws/config";
42-
AWS_CLI_HISTORY_FILE = "${config.xdg.dataHome}/aws/history";
43-
AWS_CREDENTIALS_FILE = "${config.xdg.dataHome}/aws/credentials";
44-
AWS_SHARED_CREDENTIALS_FILE = "${config.xdg.dataHome}/aws/shared-credentials";
45-
AWS_WEB_IDENTITY_TOKEN_FILE = "${config.xdg.dataHome}/aws/token";
46-
};
47-
}
48-
// lib.mkIf config.sof.boxxy.enable {
49-
programs.boxxy = lib.mkIf config.sof.boxxy.enable {
50-
rules = {
37+
# aws-cli does not work well with xdg base directories
38+
# https://github.com/aws/aws-sdk/issues/30#issuecomment-532208981
39+
home.sessionVariables = {
40+
AWS_CONFIG_FILE = "${config.xdg.configHome}/aws/config";
41+
AWS_CLI_HISTORY_FILE = "${config.xdg.dataHome}/aws/history";
42+
AWS_CREDENTIALS_FILE = "${config.xdg.dataHome}/aws/credentials";
43+
AWS_SHARED_CREDENTIALS_FILE = "${config.xdg.dataHome}/aws/shared-credentials";
44+
AWS_WEB_IDENTITY_TOKEN_FILE = "${config.xdg.dataHome}/aws/token";
45+
};
46+
47+
programs.boxxy = lib.mkIf config.sof.boxxy.enable {
48+
rules = [
49+
{
5150
name = "redirect aws-cli from ~/.aws to ${config.xdg.configHome}/aws";
5251
target = "~/.aws";
5352
rewrite = "${config.xdg.configHome}/aws";
54-
};
55-
};
56-
57-
home.shellAliases = {
58-
aws = "boxxy aws";
59-
};
53+
}
54+
];
6055
};
56+
57+
home.shellAliases = lib.mkIf config.sof.boxxy.enable { aws = "boxxy aws"; };
58+
};
6159
}

home/bat/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
bat = {
1919
enable = true;
2020
config = {
21-
theme = "Dracula";
21+
theme = lib.mkIf (!config.sof.catppuccin.enable) "Dracula";
2222
};
2323
# https://github.com/eth-p/bat-extras
2424
extraPackages = builtins.attrValues {

home/catppuccin/default.nix

+92-8
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,100 @@
1313
};
1414
};
1515

16-
config = lib.mkIf config.sof.catppuccin.enable {
17-
catppuccin = {
18-
enable = lib.mkForce false;
16+
config =
17+
let
1918
accent = flake.config.affineUser.theme.catppuccinAccent;
2019
flavor = flake.config.affineUser.theme.catppuccinFlavor;
21-
};
22-
programs = {
23-
gitui = {
24-
catppuccin.enable = true;
20+
in
21+
lib.mkIf config.sof.catppuccin.enable {
22+
catppuccin = {
23+
inherit accent flavor;
24+
enable = lib.mkDefault true;
25+
};
26+
programs = {
27+
bat = {
28+
catppuccin.enable = true;
29+
};
30+
bottom = {
31+
catppuccin.enable = true;
32+
};
33+
cava = {
34+
catppuccin.enable = true;
35+
};
36+
fzf = {
37+
catppuccin.enable = true;
38+
};
39+
gh-dash = {
40+
catppuccin.enable = true;
41+
};
42+
git = {
43+
delta = {
44+
catppuccin.enable = true;
45+
};
46+
};
47+
gitui = {
48+
catppuccin.enable = true;
49+
};
50+
helix = {
51+
catppuccin.enable = true;
52+
};
53+
kitty = {
54+
catppuccin.enable = true;
55+
};
56+
lazygit = {
57+
catppuccin.enable = true;
58+
};
59+
micro = {
60+
catppuccin.enable = true;
61+
};
62+
mpv = {
63+
catppuccin.enable = true;
64+
};
65+
yazi = {
66+
catppuccin.enable = true;
67+
};
68+
zellij = {
69+
catppuccin.enable = true;
70+
};
71+
zsh = {
72+
syntaxHighlighting = {
73+
catppuccin.enable = true;
74+
};
75+
};
76+
};
77+
gtk = {
78+
catppuccin = {
79+
inherit accent flavor;
80+
enable = true;
81+
cursor = {
82+
inherit accent flavor;
83+
enable = true;
84+
};
85+
gnomeShellTheme = true;
86+
icon = {
87+
inherit accent flavor;
88+
enable = true;
89+
};
90+
};
91+
};
92+
qt = {
93+
style = {
94+
catppuccin = {
95+
enable = true;
96+
};
97+
};
98+
};
99+
services = {
100+
dunst = {
101+
catppuccin = {
102+
enable = true;
103+
};
104+
};
105+
mako = {
106+
catppuccin = {
107+
enable = true;
108+
};
109+
};
25110
};
26111
};
27-
};
28112
}

home/default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
./misc/commandline
1919
./atuin
2020
./autojump
21+
./aws
2122
./bat
2223
./broot
2324
./carapace

home/firefox/default.nix

+8-1
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,17 @@
1515
};
1616

1717
config = lib.mkIf config.sof.firefox.enable {
18+
home.sessionVariables = {
19+
MOZ_ENABLE_WAYLAND = "0";
20+
};
21+
warnings = lib.optional (config.sof.nushell.enable) ''
22+
Firefox currently renders through XWayland due to explicit sync issues.
23+
''; # https://bugzilla.mozilla.org/show_bug.cgi?id=1898476
24+
1825
programs = {
1926
firefox = {
2027
enable = true;
21-
package = pkgs.firefox-beta;
28+
package = pkgs.firefox;
2229
profiles = {
2330
default = {
2431
id = 0;

home/flameshot/default.nix

+27-10
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
1-
{ flake, ... }:
21
{
3-
services = {
4-
flameshot = {
5-
enable = true;
6-
settings = {
7-
General = {
8-
savePath = "/home/${flake.config.affineUser.name}/Pictures";
9-
saveAsFileExtension = ".png";
10-
uiColor = "#2d0096";
11-
checkForUpdates = false;
2+
config,
3+
flake,
4+
lib,
5+
pkgs,
6+
...
7+
}:
8+
{
9+
_file = ./default.nix;
10+
11+
options.sof.flameshot = {
12+
enable = lib.mkEnableOption "Soaffine Flameshot Home Configuration" // {
13+
default = true;
14+
};
15+
};
16+
17+
config = lib.mkIf config.sof.flameshot.enable {
18+
home.packages = builtins.attrValues { inherit (pkgs) grim; };
19+
services = {
20+
flameshot = {
21+
enable = true;
22+
settings = {
23+
General = {
24+
savePath = "/home/${flake.config.affineUser.name}/Pictures";
25+
saveAsFileExtension = ".png";
26+
uiColor = "#2d0096";
27+
checkForUpdates = false;
28+
};
1229
};
1330
};
1431
};

home/fonts/default.nix

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
1-
_: {
2-
fonts = {
3-
fontconfig.enable = true;
1+
{ config, lib, ... }:
2+
{
3+
_file = ./default.nix;
4+
5+
options.sof.fonts = {
6+
enable = lib.mkEnableOption "Soaffine Fonts Home Configuration" // {
7+
default = true;
8+
};
9+
};
10+
11+
config = lib.mkIf config.sof.fonts.enable {
12+
fonts = {
13+
fontconfig = {
14+
enable = true;
15+
defaultFonts = {
16+
emoji = [ "Noto Color Emoji" ];
17+
monospace = [ "Noto Color Emoji" ];
18+
sansSerif = [ "Noto Color Emoji" ];
19+
serif = [
20+
"Noto Serif"
21+
"Noto Color Emoji"
22+
];
23+
};
24+
};
25+
};
426
};
527
}

home/fzf/default.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
programs = {
1313
fzf = {
1414
enable = true;
15-
colors = {
15+
colors = lib.mkIf (!config.sof.catppuccin.enable) {
1616
fg = "#cbccc6";
1717
bg = "#1f2430";
1818
hl = "#707a8c";

home/git/default.nix

-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@
2525
delta = {
2626
enable = true;
2727
options = {
28-
features = "decorations";
29-
decorations = {
30-
commit-decoration-style = "bold cyan box ul";
31-
};
3228
hyperlinks = true;
3329
hyperlinks-file-link-format = "vscode://file/{path}:{line}";
3430
line-numbers = true;

home/gitui/default.nix

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
programs = {
1313
gitui = {
1414
enable = true;
15-
catppuccin.enable = true;
1615
};
1716
};
1817
};

0 commit comments

Comments
 (0)