Move some config from home/default.nix and nixos system config

Add options to desktop.nix from home/default.nix that are
desktop-relevant.

Add mimeapp config back from nixos system config

Move fd, ripgrep to enabled programs, remmina to enable service

Emacs config now imports shell config to ensure requirements are met
instead of duplicating some

Move Zsh config into it's own file zsh.nix
This commit is contained in:
Evie Litherland-Smith 2024-06-07 10:51:35 +01:00
parent 6c4723e9b9
commit 22dbc09500
9 changed files with 269 additions and 176 deletions

View file

@ -1,10 +1,4 @@
{ {config, ...}: {
config,
lib,
pkgs,
catppuccinVariant ? "Mocha",
...
}: {
imports = [ imports = [
# Programs # Programs
../programs/desktop/default.nix ../programs/desktop/default.nix
@ -22,99 +16,8 @@
]; ];
programs.home-manager.enable = true; programs.home-manager.enable = true;
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
services = {
gpg-agent.pinentryPackage = pkgs.pinentry-gtk2;
avizo.enable = true;
syncthing.enable = true;
udiskie = {
enable = true;
notify = true;
automount = true;
tray = "never";
};
};
gtk = with lib.strings; let
accent = "Lavender";
variant = catppuccinVariant;
type =
if variant == "Latte"
then "Light"
else "Dark";
inverseType =
if type == "Light"
then "Dark"
else "Light";
in {
enable = true;
iconTheme = {
package = pkgs.catppuccin-papirus-folders.override {
accent = toLower accent;
flavor = toLower variant;
};
name = "Papirus-Dark";
};
cursorTheme = {
package = pkgs.catppuccin-cursors."${toLower variant}${inverseType}";
name = "Catppuccin-${variant}-${inverseType}-Cursors";
size = 32;
};
theme = let
size = "Standard";
in {
package = pkgs.catppuccin-gtk.override {
accents = [(toLower accent)];
size = toLower size;
variant = toLower variant;
};
name = "Catppuccin-${variant}-${size}-${accent}-${type}";
};
};
xdg = {
userDirs = {
enable = true;
createDirectories = true;
extraConfig = {
XDG_PROJECTS_DIR = "${config.home.homeDirectory}/Projects";
};
};
};
xresources.properties = with config.scheme.withHashtag; {
"*background" = base00;
"*foreground" = base05;
"*color0" = base00;
"*color1" = red;
"*color2" = green;
"*color3" = yellow;
"*color4" = blue;
"*color5" = magenta;
"*color6" = cyan;
"*color7" = base04;
"*color8" = base01;
"*color9" = red;
"*color10" = green;
"*color11" = yellow;
"*color12" = blue;
"*color13" = magenta;
"*color14" = cyan;
"*color15" = base05;
};
home = { home = {
homeDirectory = "/home/${config.home.username}"; homeDirectory = "/home/${config.home.username}";
packages = with pkgs; [
rclone
git-sync
pinentry
fd
ripgrep
ffmpeg
mpv
evince
libreoffice-fresh
inkscape
remmina
webcord
signal-desktop
];
stateVersion = "23.05"; stateVersion = "23.05";
}; };
} }

View file

@ -17,13 +17,4 @@
proton.primary = lib.mkForce false; proton.primary = lib.mkForce false;
outlook.primary = lib.mkForce true; outlook.primary = lib.mkForce true;
}; };
xdg.configFile."teams-for-linux/config.json".text = builtins.toJSON {
awayOnSystemIdle = true;
closeAppOnCross = true;
electronCLIFlags = lib.mkIf config.wayland.windowManager.sway.enable [["ozone-platform" "wayland"]];
followSystemTheme = false;
notificationMethod = "electron";
optInTeamsV2 = true;
spellCheckerLanguages = ["en_GB"];
};
} }

View file

@ -1,4 +1,10 @@
{pkgs, ...}: { {
config,
lib,
pkgs,
catppuccinVariant ? "Mocha",
...
}: {
imports = [ imports = [
./sway/default.nix ./sway/default.nix
./niri/default.nix ./niri/default.nix
@ -13,6 +19,14 @@
./wlogout/default.nix ./wlogout/default.nix
]; ];
home.packages = with pkgs; [ home.packages = with pkgs; [
pinentry
ffmpeg
evince
libreoffice-fresh
inkscape
webcord
signal-desktop
swayimg
swaybg swaybg
(writeShellScriptBin "set-background" '' (writeShellScriptBin "set-background" ''
${swaybg}/bin/swaybg -m fill -i ${./wallpapers/landscapes/tropic_island_day.jpg} ${swaybg}/bin/swaybg -m fill -i ${./wallpapers/landscapes/tropic_island_day.jpg}
@ -29,4 +43,96 @@
systemctl --user restart davmail systemctl --user restart davmail
'') '')
]; ];
services = {
avizo.enable = true;
gpg-agent.pinentryPackage = pkgs.pinentry-gtk2;
remmina.enable = true;
syncthing.enable = true;
udiskie = {
enable = true;
notify = true;
automount = true;
tray = "never";
};
};
programs.mpv.enable = true;
gtk = with lib.strings; let
accent = "Lavender";
variant = catppuccinVariant;
type =
if variant == "Latte"
then "Light"
else "Dark";
inverseType =
if type == "Light"
then "Dark"
else "Light";
in {
enable = true;
iconTheme = {
package = pkgs.catppuccin-papirus-folders.override {
accent = toLower accent;
flavor = toLower variant;
};
name = "Papirus-Dark";
};
cursorTheme = {
package = pkgs.catppuccin-cursors."${toLower variant}${inverseType}";
name = "Catppuccin-${variant}-${inverseType}-Cursors";
size = 32;
};
theme = let
size = "Standard";
in {
package = pkgs.catppuccin-gtk.override {
accents = [(toLower accent)];
size = toLower size;
variant = toLower variant;
};
name = "Catppuccin-${variant}-${size}-${accent}-${type}";
};
};
xdg = {
mime.enable = true;
mimeApps = let
defaultApplications = import ./mimeapps.nix;
in {
enable = true;
inherit defaultApplications;
associations = {
added = defaultApplications;
removed = {
"x-scheme-handler/zoomus" = config.xdg.mimeApps.defaultApplications."x-scheme-handler/http";
"x-scheme-handler/msteams" = ["teams-for-linux.desktop"];
};
};
};
userDirs = {
enable = true;
createDirectories = true;
extraConfig = {
XDG_PROJECTS_DIR = "${config.home.homeDirectory}/Projects";
};
};
};
xresources.properties = with config.scheme.withHashtag; {
"*background" = base00;
"*foreground" = base05;
"*color0" = base00;
"*color1" = red;
"*color2" = green;
"*color3" = yellow;
"*color4" = blue;
"*color5" = magenta;
"*color6" = cyan;
"*color7" = base04;
"*color8" = base01;
"*color9" = red;
"*color10" = green;
"*color11" = yellow;
"*color12" = blue;
"*color13" = magenta;
"*color14" = cyan;
"*color15" = base05;
};
} }

View file

@ -0,0 +1,68 @@
let
emacs = ["emacsclient.desktop" "emacs.desktop"];
browser = ["firefox.desktop" "nyxt.desktop"];
in {
"inode/directory" = ["thunar.desktop"];
"inode/symlink" = ["thunar.desktop"];
"image/jpeg" = ["swayimg.desktop"];
"image/png" = ["swayimg.desktop"];
"video/mp4" = ["mpv.desktop"];
"text/plain" = emacs;
"text/richtext" = emacs;
"text/org" = emacs;
"text/markdown" = emacs;
"text/rust" = emacs;
"text/csv" = emacs;
"text/html" = emacs;
"text/css" = emacs;
"text/tab-separated-values" = emacs;
"text/x-emacs-lisp" = emacs;
"text/x-fortran" = emacs;
"text/x-idl" = emacs;
"text/x-log" = emacs;
"text/x-lua" = emacs;
"text/x-makefile" = emacs;
"text/x-python" = emacs;
"text/x-python3" = emacs;
"text/x-readme" = emacs;
"text/x-scheme" = emacs;
"text/x-tex" = emacs;
"text/x-texinfo" = emacs;
"application/json" = emacs;
"application/toml" = emacs;
"application/yaml" = emacs;
"application/xml" = emacs;
"application/rss+xml" = emacs;
"application/xhtml+xml" = emacs;
"application/oxps" = emacs;
"application/x-shellscript" = emacs;
"application/pdf" = ["evince.desktop"];
"application/epub+zip" = ["evince.desktop"];
"application/msword" = ["writer.desktop"];
"application/zip" = ["xarchiver.desktop"];
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xhtml" = browser;
"application/x-extension-xht" = browser;
"application/x-mozilla-bookmarks" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/chrome" = browser;
"x-scheme-handler/webcal" = browser;
"x-scheme-handler/unknown" = emacs;
"x-scheme-handler/prusaslicer" = ["PrusaSlicerURLProtocol.desktop"];
"x-scheme-handler/ms-word" = ["writer.desktop"];
"x-scheme-handler/ms-powerpoint" = ["impress.desktop"];
"x-scheme-handler/ms-excel" = ["calc.desktop"];
}

View file

@ -5,6 +5,7 @@
... ...
}: { }: {
imports = [ imports = [
../shell/default.nix
./python/default.nix ./python/default.nix
./lua/default.nix ./lua/default.nix
]; ];
@ -139,8 +140,6 @@
imagemagick imagemagick
languagetool languagetool
wordnet wordnet
fd
ripgrep
graphviz # For org-roam graph graphviz # For org-roam graph
mp3info # For EMMS mp3info # For EMMS

View file

@ -5,31 +5,40 @@
}: { }: {
programs.bottom = { programs.bottom = {
enable = true; enable = true;
settings.colors = with config.scheme.withHashtag; let settings = {
rainbow = [red yellow green cyan blue magenta]; flags = {
in { group_processes = true;
table_header_color = base05; temperature_type = "celsius";
all_cpu_color = base05; battery = true;
avg_cpu_color = base05; enable_gpu = true;
cpu_core_colors = rainbow; enable_cache_memory = true;
ram_color = red; };
cache_color = green; colors = with config.scheme.withHashtag; let
swap_color = blue; rainbow = [red yellow green cyan blue magenta];
rx_color = green; in {
tx_color = blue; table_header_color = base05;
widget_title_color = config.scheme.withHashtag.${accentColour}; all_cpu_color = base05;
border_color = base02; avg_cpu_color = base05;
highlighted_border_color = config.scheme.withHashtag.${accentColour}; cpu_core_colors = rainbow;
text_color = base05; ram_color = red;
graph_color = base04; cache_color = green;
cursor_color = base02; swap_color = blue;
selected_text_color = base05; rx_color = green;
selected_bg_color = base01; tx_color = blue;
high_battery_color = green; widget_title_color = config.scheme.withHashtag.${accentColour};
medium_battery_color = yellow; border_color = base02;
low_battery_color = red; highlighted_border_color = config.scheme.withHashtag.${accentColour};
gpu_core_colors = rainbow; text_color = base05;
arc_color = cyan; graph_color = base04;
cursor_color = base02;
selected_text_color = base05;
selected_bg_color = base01;
high_battery_color = green;
medium_battery_color = yellow;
low_battery_color = red;
gpu_core_colors = rainbow;
arc_color = cyan;
};
}; };
}; };
} }

View file

@ -5,23 +5,18 @@
... ...
}: { }: {
imports = [ imports = [
./bottom.nix
./fastfetch.nix
./git.nix ./git.nix
./ssh.nix ./ssh.nix
./starship.nix ./starship.nix
./bottom.nix ./zsh.nix
./zellij.nix ];
home.packages = with pkgs; [
rclone
git-sync
du-dust
]; ];
xdg.configFile = let
variants = ["Latte" "Frappe" "Macchiato" "Mocha"];
mkVariant = variant: let
fname = "catppuccin${variant}.tmTheme";
in {
name = "bat/themes/${fname}";
value = {source = ./. + "/${fname}";};
};
in
builtins.listToAttrs
(lib.lists.forEach variants mkVariant);
programs = { programs = {
bash.enable = true; bash.enable = true;
bat = { bat = {
@ -41,39 +36,25 @@
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;
}; };
fd.enable = true;
fzf = { fzf = {
enable = true; enable = true;
defaultCommand = "${pkgs.fd}/bin/fd --type f"; defaultCommand = "${pkgs.fd}/bin/fd --type f";
changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d"; changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d";
fileWidgetCommand = "${pkgs.fd}/bin/fd --type f"; fileWidgetCommand = "${pkgs.fd}/bin/fd --type f";
}; };
zsh = { jq.enable = true;
enable = true; ripgrep.enable = true;
enableCompletion = true;
autocd = true;
autosuggestion.enable = true;
defaultKeymap = "emacs";
syntaxHighlighting = {
enable = true;
highlighters = ["brackets" "cursor"];
};
historySubstringSearch.enable = true;
history = {
extended = true;
share = true;
ignoreDups = true;
ignoreAllDups = true;
ignoreSpace = true;
expireDuplicatesFirst = true;
};
initExtra = ''
## completion config and styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' menu 'select=long-list'
## transient prompt
source ${./transient.zsh}
'';
};
}; };
xdg.configFile = let
variants = ["Latte" "Frappe" "Macchiato" "Mocha"];
mkVariant = variant: let
fname = "catppuccin${variant}.tmTheme";
in {
name = "bat/themes/${fname}";
value = {source = ./. + "/${fname}";};
};
in
builtins.listToAttrs
(lib.lists.forEach variants mkVariant);
} }

View file

@ -0,0 +1,6 @@
{...}: {
programs.fastfetch = {
enable = true;
settings = {};
};
}

30
programs/shell/zsh.nix Normal file
View file

@ -0,0 +1,30 @@
{...}: {
programs.zsh = {
enable = true;
enableCompletion = true;
autocd = true;
autosuggestion.enable = true;
defaultKeymap = "emacs";
syntaxHighlighting = {
enable = true;
highlighters = ["brackets" "cursor"];
};
historySubstringSearch.enable = true;
history = {
extended = true;
share = true;
ignoreDups = true;
ignoreAllDups = true;
ignoreSpace = true;
expireDuplicatesFirst = true;
};
initExtra = ''
## completion config and styling
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' menu 'select=long-list'
## transient prompt
source ${./transient.zsh}
'';
};
}