Skip to content

Instantly share code, notes, and snippets.

@DrSensor
Last active June 11, 2024 01:48
Show Gist options
  • Save DrSensor/4e0187813a9511b6e879570a1dd31aca to your computer and use it in GitHub Desktop.
Save DrSensor/4e0187813a9511b6e879570a1dd31aca to your computer and use it in GitHub Desktop.
My plan for full migration into NixOS and Wayland
{ pkgs ? import <nixpkgs>
, lib ? pkgs.lib
, desktopEnvironment
}: with pkgs;
desktopEnvironment {
session-manager = emptty;
window-manager = [ sway labwc ];
screen-display = {
use = kanshi; # autorandr
gui = wlay;
};
screen-brightness = wlsunset;
screen-lock.timer = swayidle;
screen-lock.use = mkShell {
packages = [ swaylock grim sox ];
shellHook = ''
# 1. screencapture using grim
# 2. databender/mosaic using sox
# 3. set swaylock --image from sox
'';
};
wallpaper = {
static = swaybg;
animated.gif = oguri;
animated.video = mpvpaper;
gui = wallutils;
};
notification = fnott;
systray = yambar;
launcher = fuzzel; # or rofi-wlc
terminal = mkShell {
packages = [ foot zellij ];
shellHook = ''
# run zellij multiplexer inside foot terminal
'';
};
screen-captures = mkShell {
packages = [ grim wf-recorder slurp ];
shellHook = ''
# 1. ask if you want to capture whole desktop, specific monitor, or just a region
# 2. slurp to get the region
# 3. grim to screenshots the region
# 3. or wf-record to screencasts the region
'';
};
system-gui = [ gtk4 lxappearance-gtk4 ];
}
{
general = [
auto-cpufreq # https://github.com/AdnanHodzic/auto-cpufreq
];
laptop = general ++ [
tlp # https://linrunner.de/tlp/
];
handheld = general ++ [
xsuspender # https://kernc.github.io/xsuspender
];
}
#!/bin/sh
case $context in
nvidia)
prime-run $@
;;
windows)
proton-call -r $@
;;
*)
$@
;;
esac
@gigibytes
Copy link

hi there. if you have a chance, can you please explain the desktop.nix file? I'm not sure how it works and I haven't found anything like it out there. is this basically a module you can import into a config (homemanager or regular) and it will build everything defined in desktopEnvironment?

thanks for posting this/any extra info you may give!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment