Compare commits

..

No commits in common. "e572387f9928b6f3f0abffcfe3f5cfb9aef69ac8" and "3316abb573bb39aa5ee6b1217119721f978a9ced" have entirely different histories.

4 changed files with 18 additions and 14 deletions

View file

@ -39,7 +39,6 @@
print.enable = true; print.enable = true;
pointer.enable = true; pointer.enable = true;
networking.enable = true; networking.enable = true;
networking.powersave = true;
}; };
dev = { dev = {
enable = true; enable = true;

View file

@ -3,6 +3,12 @@
with lib; with lib;
let let
cfg = config.modules.desktop.awww; cfg = config.modules.desktop.awww;
# TODO: this whole thing is a little silly, but i cant find a better way to ref it in the scripts
# maybe we can reference the config in the scripts? in a let of course :)
wallpapersFolder = "${pkgs.my.wallpapers}/share/backgrounds";
lastWallpaper = "$XDG_DATA_HOME/awww-last-wallpaper";
lastWallpaperSym = "$XDG_DATA_HOME/awww-last-wallpaper-sym";
in { in {
options.modules.desktop.awww = { options.modules.desktop.awww = {
enable = mkEnableOption "Enable awww, an Answer to your Wayland Wallpaper Woes"; enable = mkEnableOption "Enable awww, an Answer to your Wayland Wallpaper Woes";
@ -13,17 +19,17 @@ in {
}; };
wallpapersFolder = mkOption { wallpapersFolder = mkOption {
type = types.str; type = types.str;
default = "${pkgs.my.wallpapers}/share/backgrounds"; default = wallpapersFolder;
example = "$XDG_PICTURES_DIR/wallpapers"; example = "$XDG_PICTURES_DIR/wallpapers";
}; };
lastWallpaper = mkOption { lastWallpaper = mkOption {
type = types.str; type = types.str;
default = "$XDG_DATA_HOME/awww-last-wallpaper"; default = lastWallpaper;
example = "$XDG_DATA_HOME/awww-last-wallpaper"; example = "$XDG_DATA_HOME/awww-last-wallpaper";
}; };
lastWallpaperSym = mkOption { lastWallpaperSym = mkOption {
type = types.str; type = types.str;
default = "$XDG_DATA_HOME/awww-last-wallpaper-sym"; default = lastWallpaperSym;
example = "$XDG_DATA_HOME/awww-last-wallpaper-sym"; example = "$XDG_DATA_HOME/awww-last-wallpaper-sym";
}; };
setScript = mkOption { setScript = mkOption {
@ -31,12 +37,12 @@ in {
default = pkgs.writeShellScript "awww-set" '' default = pkgs.writeShellScript "awww-set" ''
set -euo pipefail set -euo pipefail
if [ ! -f "${cfg.lastWallpaper}" ]; then if [ ! -f "${lastWallpaper}" ]; then
echo "$(ls ${cfg.wallpapersFolder} | shuf -n 1)" > "${cfg.lastWallpaper}" echo "$(ls ${wallpapersFolder} | shuf -n 1)" > "${lastWallpaper}"
fi fi
ln -sf "${cfg.wallpapersFolder}/$(cat ${cfg.lastWallpaper})" "${cfg.lastWallpaperSym}" # in case the hash of the pkg changes ln -sf "${wallpapersFolder}/$(cat ${lastWallpaper})" "${lastWallpaperSym}" # in case the hash of the pkg changes
${lib.getExe cfg.package} img "${cfg.wallpapersFolder}/$(cat ${cfg.lastWallpaper})" --transition-type none ${lib.getExe cfg.package} img "${wallpapersFolder}/$(cat ${lastWallpaper})" --transition-type none
''; '';
}; };
swapScript = mkOption { swapScript = mkOption {
@ -44,15 +50,15 @@ in {
default = pkgs.writeShellScript "awww-swap" '' default = pkgs.writeShellScript "awww-swap" ''
set -euo pipefail set -euo pipefail
file=$(ls ${cfg.wallpapersFolder} | ${lib.getExe config.modules.desktop.rofi.package} -dmenu -sep '\n' -i -p "select a wallpaper") file=$(ls ${wallpapersFolder} | ${lib.getExe config.modules.desktop.rofi.package} -dmenu -sep '\n' -i -p "select a wallpaper")
wallpaper="${cfg.wallpapersFolder}/$file" wallpaper="${wallpapersFolder}/$file"
[ ! -f "$wallpaper" ] && exit 1 [ ! -f "$wallpaper" ] && exit 1
${lib.getExe cfg.package} img "$wallpaper" --transition-type grow --transition-fps 60 --transition-pos 1.0,1.0 --transition-duration 1.5 ${lib.getExe cfg.package} img "$wallpaper" --transition-type grow --transition-fps 60 --transition-pos 1.0,1.0 --transition-duration 1.5
ln -sf "$wallpaper" "${cfg.lastWallpaperSym}" ln -sf "$wallpaper" "${lastWallpaperSym}"
echo "$file" > "${cfg.lastWallpaper}" echo "$file" > "${lastWallpaper}"
''; '';
}; };
}; };

View file

@ -16,6 +16,7 @@ in {
modules.desktop.fonts.enable = true; modules.desktop.fonts.enable = true;
modules.desktop.fonts.baseFonts = true; modules.desktop.fonts.baseFonts = true;
modules.desktop.thumbnailers.enable = true; modules.desktop.thumbnailers.enable = true;
systemd.services.systemd-udev-settle.enable = false;
# mounting, trash, and mtp support # mounting, trash, and mtp support
services.gvfs.enable = true; services.gvfs.enable = true;

View file

@ -6,13 +6,11 @@ let
in { in {
options.modules.hardware.networking = { options.modules.hardware.networking = {
enable = mkEnableOption "Enable NetworkManager, a daemon for configuring network interfaces"; enable = mkEnableOption "Enable NetworkManager, a daemon for configuring network interfaces";
powersave = mkEnableOption "Enable power saving options over Wi-Fi";
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
networking.networkmanager.wifi.backend = "iwd"; networking.networkmanager.wifi.backend = "iwd";
networking.networkmanager.wifi.powersave = cfg.powersave;
networking.wireless.iwd.settings.Settings.AutoConnect = true; networking.wireless.iwd.settings.Settings.AutoConnect = true;
systemd.services.NetworkManager-wait-online.enable = false; systemd.services.NetworkManager-wait-online.enable = false;