Compare commits

...

6 commits

Author SHA1 Message Date
Evie Litherland-Smith 5db0b3feff Add guard for git-sync-all for non-main branch
Only pull/push non-syncing repos (currently nixos and emacs) if on the
"main" branch, echo warning message and skip otherwise.
2024-04-12 11:24:39 +01:00
Evie Litherland-Smith f8c7f1bf55 Fix missing import catch-all 2024-04-12 11:24:39 +01:00
Evie Litherland-Smith f0405343fc Add initial (and untested) river example config 2024-04-12 11:24:39 +01:00
Evie Litherland-Smith 97e8a62ece home-manager: move anything not hyprland-specific into desktop.nix 2024-04-12 11:24:39 +01:00
Evie Litherland-Smith 1a1d58a199 Move anything that's no hyprland-specific into desktop.nix 2024-04-12 11:24:39 +01:00
Evie Litherland-Smith 7e54e9f76e Change workspace 2 to be a music workspace
Update bind and waybar module accordingly
2024-04-12 11:23:23 +01:00
9 changed files with 287 additions and 228 deletions

63
home/desktop.nix Normal file
View file

@ -0,0 +1,63 @@
{
lib,
config,
pkgs,
catppuccinVariant ? "Mocha",
...
}: {
imports = [
./default.nix
./email/default.nix
./password-store/default.nix
./waybar/default.nix
./rofi/default.nix
./swaylock/default.nix
./swaync/default.nix
./avizo/default.nix
./alacritty/default.nix
./emacs/default.nix
./obs/default.nix
./cava/default.nix
];
programs.rofi.terminal = "${config.programs.alacritty.package}/bin/alacritty";
services = {
gpg-agent.pinentryFlavor = "gtk2";
avizo.enable = true;
syncthing.enable = true;
udiskie = {
enable = true;
notify = true;
automount = true;
tray = "never";
};
};
gtk = with lib.strings; let
accent = "Lavender";
size = "Standard";
in {
enable = true;
iconTheme = {
package = pkgs.catppuccin-papirus-folders.override {
accent = toLower accent;
flavor = toLower catppuccinVariant;
};
name = "Papirus-Dark";
};
cursorTheme = let
variant = "${lib.strings.toLower catppuccinVariant}Dark";
in {
package = pkgs.catppuccin-cursors.${variant};
name = "Catppuccin-${catppuccinVariant}-Dark-Cursors";
size = 32;
};
theme = {
package = with lib.strings;
pkgs.catppuccin-gtk.override {
accents = [(toLower accent)];
size = toLower size;
variant = toLower catppuccinVariant;
};
name = "Catppuccin-${catppuccinVariant}-${size}-${accent}-Dark";
};
};
}

View file

@ -5,23 +5,9 @@
fonts, fonts,
scheme, scheme,
accentColour ? "base07", accentColour ? "base07",
catppuccinVariant ? "Mocha",
... ...
}: { }: {
imports = [ imports = [../desktop.nix];
../default.nix
../email/default.nix
../password-store/default.nix
../waybar/default.nix
../rofi/default.nix
../swaylock/default.nix
../swaync/default.nix
../avizo/default.nix
../alacritty/default.nix
../emacs/default.nix
../obs/default.nix
../cava/default.nix
];
home.packages = with pkgs; [ home.packages = with pkgs; [
(writeShellScriptBin "protonmail-setup-bridge" '' (writeShellScriptBin "protonmail-setup-bridge" ''
pkill -9 -f protonmail-bridge pkill -9 -f protonmail-bridge
@ -29,54 +15,6 @@
${config.wayland.windowManager.hyprland.finalPackage}/bin/hyprctl dispatch exec "${protonmail-bridge}/bin/protonmail-bridge -n" ${config.wayland.windowManager.hyprland.finalPackage}/bin/hyprctl dispatch exec "${protonmail-bridge}/bin/protonmail-bridge -n"
'') '')
]; ];
programs = {
rofi = with pkgs; {
package = rofi-wayland;
terminal = "${config.programs.alacritty.package}/bin/alacritty";
pass.package = rofi-pass-wayland;
};
zellij.settings.copy_command = "wl-copy";
};
services = {
gpg-agent.pinentryFlavor = "gtk2";
avizo.enable = true;
syncthing.enable = true;
udiskie = {
enable = true;
notify = true;
automount = true;
tray = "never";
};
};
gtk = with lib.strings; let
accent = "Lavender";
size = "Standard";
in {
enable = true;
iconTheme = {
package = pkgs.catppuccin-papirus-folders.override {
accent = toLower accent;
flavor = toLower catppuccinVariant;
};
name = "Papirus-Dark";
};
cursorTheme = let
variant = "${lib.strings.toLower catppuccinVariant}Dark";
in {
package = pkgs.catppuccin-cursors.${variant};
name = "Catppuccin-${catppuccinVariant}-Dark-Cursors";
size = 32;
};
theme = {
package = with lib.strings;
pkgs.catppuccin-gtk.override {
accents = [(toLower accent)];
size = toLower size;
variant = toLower catppuccinVariant;
};
name = "Catppuccin-${catppuccinVariant}-${size}-${accent}-Dark";
};
};
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;
xwayland.enable = true; xwayland.enable = true;
@ -196,12 +134,10 @@
++ (lib.lists.forEach layers ignorealpha); ++ (lib.lists.forEach layers ignorealpha);
windowrule = [ windowrule = [
# Workspace binds # Workspace binds
"workspace 2, (firefox|chromium-browser|com.obsproject.Studio)"
"workspace 3, (libreoffice|soffice)(.*)" "workspace 3, (libreoffice|soffice)(.*)"
"workspace 4, (WebCord|signal)" "workspace 4, (WebCord|signal)"
"workspace 4, org.prismlauncher.PrismLauncher" "workspace 5, org.prismlauncher.PrismLauncher"
"workspace 5 silent, steam" # Keep silent to avoid popups taking focus "workspace 5 silent, steam" # Keep silent to avoid popups taking focus
"workspace 6, (x2goclient|org.remmina.Remmina|Nxplayer.bin)"
# Float + move system windows # Float + move system windows
"float, org.kde.polkit-kde-authentication-agent-1|Pinentry" "float, org.kde.polkit-kde-authentication-agent-1|Pinentry"
@ -298,10 +234,9 @@
# Common program shortcuts # Common program shortcuts
"SUPER, Return, exec, ${alacritty.package}/bin/alacritty" "SUPER, Return, exec, ${alacritty.package}/bin/alacritty"
"SUPER SHIFT, Return, exec, ${emacs.finalPackage}/bin/emacsclient -c" "SUPER, E, exec, ${emacs.finalPackage}/bin/emacsclient -c"
"SUPER, E, exec, [workspace 1] ${emacs.finalPackage}/bin/emacsclient -c" "SUPER, W, exec, ${firefox.package}/bin/firefox"
"SUPER, W, exec, [workspace 2] ${firefox.package}/bin/firefox" "SUPER, F, exec, ${pkgs.xfce.thunar}/bin/thunar"
"SUPER, F, exec, [workspace 3] ${pkgs.xfce.thunar}/bin/thunar"
# Rofi binds # Rofi binds
"SUPER, Space, exec, pkill rofi || ${rofi.finalPackage}/bin/rofi -show drun" "SUPER, Space, exec, pkill rofi || ${rofi.finalPackage}/bin/rofi -show drun"

51
home/river/default.nix Normal file
View file

@ -0,0 +1,51 @@
{config, ...}: {
imports = [../desktop.nix];
wayland.windowManager.river = {
enable = true;
xwayland.enable = true;
extraSessionVariables = {
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
MOZ_ENABLE_WAYLAND = "1";
};
systemd = {
enable = true;
variables = [
"DISPLAY"
"WAYLAND_DISPLAY"
"XDG_CURRENT_DESKTOP"
"NIXOS_OZONE_WL"
"XCURSOR_THEME"
"XCURSOR_SIZE"
];
};
settings = {
# These are currently example settings
border-width = 2;
declare-mode = [
"locked"
"normal"
"passthrough"
];
input = {
pointer-foo-bar = {
accel-profile = "flat";
events = true;
pointer-accel = -0.3;
tap = false;
};
};
map = {
normal = {
"Alt Q" = "close";
};
};
rule-add = {};
set-cursor-warp = "on-output-change";
set-repeat = "50 300";
spawn = [];
xcursor-theme = with config.gtk.cursorTheme; "${name} ${toString size}";
};
};
}

View file

@ -8,11 +8,13 @@
}: { }: {
programs.rofi = { programs.rofi = {
enable = true; enable = true;
package = pkgs.rofi-wayland;
font = fonts.monospace.name; font = fonts.monospace.name;
location = "center"; location = "center";
plugins = with pkgs; [rofi-emoji]; plugins = with pkgs; [rofi-emoji];
pass = { pass = {
enable = true; enable = true;
package = pkgs.rofi-wayland;
extraConfig = '' extraConfig = ''
USERNAME_field='login' USERNAME_field='login'
''; '';

View file

@ -46,8 +46,12 @@ for i in "${!PULL_DIRS[@]}"; do
fi fi
( (
cd "$DIRECTORY" || exit cd "$DIRECTORY" || exit
if [ "$(git branch --show-current)" = "main" ]; then
git remote set-url origin "$URL" git remote set-url origin "$URL"
git pull --ff-only git pull --ff-only
git push git push
else
echo "Not syncing repo $DIRECTORY on branch $(git branch --show-current)"
fi
) )
done done

View file

@ -63,7 +63,7 @@
format = "{icon}"; format = "{icon}";
format-icons = { format-icons = {
"1" = "󰟀 "; "1" = "󰟀 ";
"2" = "󰖟 "; "2" = "󰝚 ";
"3" = "󱧶 "; "3" = "󱧶 ";
"4" = "󰭻 "; "4" = "󰭻 ";
"5" = "󰹁 "; "5" = "󰹁 ";

View file

@ -1,16 +1,34 @@
{ {
lib,
pkgs, pkgs,
user, user,
... ...
}: { }: {
imports = [./default.nix]; imports = [./default.nix ./firefox.nix];
environment.systemPackages = with pkgs; [ nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland";
environment = {
sessionVariables = {
NIXOS_OZONE_WL = "1";
XDG_SESSION_TYPE = "wayland";
GRIM_DEFAULT_DIR = "$HOME/Pictures/Grim";
};
systemPackages = with pkgs; [
wtype
wl-clipboard
xdg-utils
libnotify libnotify
libcamera libcamera
glib glib
gsettings-desktop-schemas gsettings-desktop-schemas
hunspell hunspell
hunspellDicts.en_GB-large hunspellDicts.en_GB-large
swayimg
swaylock-effects
pamixer
pavucontrol
playerctl
brightnessctl
mpv
xarchiver xarchiver
libreoffice-fresh libreoffice-fresh
zathura zathura
@ -22,13 +40,35 @@
remmina remmina
nomachine-client nomachine-client
]; ];
};
security = { security = {
pam.services.swaylock = {};
polkit.enable = true; polkit.enable = true;
rtkit.enable = true; rtkit.enable = true;
}; };
sound.enable = false; sound.enable = false;
hardware.bluetooth.enable = true; hardware.bluetooth.enable = true;
programs = {
dconf.enable = true;
light.enable = true;
noisetorch.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
};
};
gtk.iconCache.enable = true;
qt = {
enable = true;
platformTheme = "gtk2";
style = "gtk2";
};
services = { services = {
blueman.enable = true;
gvfs = {
enable = true;
package = lib.mkForce pkgs.gnome3.gvfs;
};
accounts-daemon.enable = true; accounts-daemon.enable = true;
dbus.packages = with pkgs; [gcr]; dbus.packages = with pkgs; [gcr];
greetd = { greetd = {
@ -46,20 +86,90 @@
pulse.enable = true; pulse.enable = true;
wireplumber.enable = true; wireplumber.enable = true;
}; };
xserver.xkb = { tumbler.enable = true;
udisks2.enable = true;
xserver = {
enable = false;
xkb = {
layout = "gb"; layout = "gb";
variant = ""; variant = "";
options = "ctrl:nocaps"; options = "ctrl:nocaps";
}; };
}; };
programs = {
dconf.enable = true;
noisetorch.enable = true;
}; };
gtk.iconCache.enable = true; xdg = {
qt = { portal.enable = true;
mime = let
emacs = ["emacsclient.desktop" "emacs.desktop"];
browser = ["firefox.desktop"];
applications = {
"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" = ["org.pwmt.zathura.desktop"];
"application/epub+zip" = ["org.pwmt.zathura.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/ms-word" = ["writer.desktop"];
"x-scheme-handler/ms-powerpoint" = ["impress.desktop"];
"x-scheme-handler/ms-excel" = ["calc.desktop"];
};
in {
enable = true; enable = true;
platformTheme = "gtk2"; defaultApplications = applications;
style = "gtk2"; addedAssociations = applications;
removedAssociations = {"x-scheme-handler/zoomus" = browser;};
};
}; };
} }

View file

@ -1,136 +1,23 @@
{ {pkgs, ...}: {
lib, imports = [./desktop.nix];
pkgs,
...
}: {
imports = [./desktop.nix ./firefox.nix];
nixpkgs.config.chromium.commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland";
environment = { environment = {
sessionVariables = { sessionVariables = {
NIXOS_OZONE_WL = "1";
XDG_SESSION_TYPE = "wayland";
XDG_SESSION_DESKTOP = "Hyprland"; XDG_SESSION_DESKTOP = "Hyprland";
XDG_CURRENT_DESKTOP = "Hyprland"; XDG_CURRENT_DESKTOP = "Hyprland";
GRIM_DEFAULT_DIR = "$HOME/Pictures/Grim";
}; };
systemPackages = with pkgs; [ systemPackages = with pkgs; [
wtype
wl-clipboard
xdg-utils
hyprpaper hyprpaper
hyprpicker hyprpicker
swaylock-effects
swayimg
pamixer
pavucontrol
playerctl
brightnessctl
mpv
]; ];
}; };
security.pam.services = { services.greetd.settings = let
swaylock = {};
hyprlock = {};
};
services = {
xserver.enable = false;
blueman.enable = true;
udisks2.enable = true;
tumbler.enable = true;
gvfs = {
enable = true;
package = lib.mkForce pkgs.gnome3.gvfs;
};
greetd.settings = let
command = "Hyprland"; command = "Hyprland";
in { in {
default_session = {inherit command;}; default_session = {inherit command;};
initial_session = {inherit command;}; initial_session = {inherit command;};
}; };
}; programs.hyprland = {
xdg.portal.enable = true;
xdg.mime = let
emacs = ["emacsclient.desktop" "emacs.desktop"];
browser = ["firefox.desktop"];
applications = {
"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" = ["org.pwmt.zathura.desktop"];
"application/epub+zip" = ["org.pwmt.zathura.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/ms-word" = ["writer.desktop"];
"x-scheme-handler/ms-powerpoint" = ["impress.desktop"];
"x-scheme-handler/ms-excel" = ["calc.desktop"];
};
in {
enable = true;
defaultApplications = applications;
addedAssociations = applications;
removedAssociations = {"x-scheme-handler/zoomus" = browser;};
};
programs = {
dconf.enable = true;
light.enable = true;
thunar = {
enable = true;
plugins = with pkgs.xfce; [thunar-archive-plugin thunar-volman];
};
hyprland = {
enable = true; enable = true;
xwayland.enable = true; xwayland.enable = true;
}; };
};
} }

7
system/river.nix Normal file
View file

@ -0,0 +1,7 @@
{...}: {
imports = [./desktop.nix];
programs.river = {
enable = true;
extraPackages = [];
};
}