nix/roles/desktop.nix
2022-02-13 00:31:58 +01:00

229 lines
5.2 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
let
colors = config.colors;
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
unstable = import <nixos-unstable> { config.allowUnfree = true; };
in {
programs.sway = {
enable = true;
extraPackages = with pkgs; [
bemenu
brightnessctl
grim
i3status-rust
kanshi
mako
redshift-wlr
slurp
swayidle
swaylock
wf-recorder
xwayland
];
extraSessionCommands = "";
};
xdg.portal = {
enable = true;
gtkUsePortal = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr ];
};
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
colors = {
background = "#282a36";
foreground = "#f8f8f2";
black = "#1E2029";
red = "#ff5555";
green = "#50fa7b";
yellow = "#f1fa8c";
cyan = "#8be9fd";
magenta = "#bd93f9";
blue = "#61bfff";
white = "#ffffff";
};
environment = {
etc = {
"sway/config".source = ../dotfiles/sway/config;
"sway/status.toml".source = ../dotfiles/sway/status.toml;
"xdg/alacritty/alacritty.yml".text = ''
font:
normal:
family: CaskaydiaCove Nerd Font
size: 12
background_opacity: 0.98
draw_bold_text_with_bright_colors: true
colors:
primary:
background: "${colors.background}"
foreground: "${colors.foreground}"
normal:
black: "${colors.black}"
red: "${colors.red}"
green: "${colors.green}"
yellow: "${colors.yellow}"
cyan: "${colors.cyan}"
magenta: "${colors.magenta}"
blue: "${colors.blue}"
white: "${colors.white}"
window:
dynamic_title: true
env:
TERM: xterm-256color
key_bindings:
- { key: Escape, mods: Control, action: ToggleViMode }
'';
};
};
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
security.polkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
jack.enable = true;
config.pipewire = {
"context.properties" = { "default.clock.rate" = 48000; };
};
};
services.udev.packages = [
(pkgs.writeTextFile {
name = "uinput.rules";
text = ''
KERNEL=="uinput", GROUP="users", MODE="0660", OPTIONS+="static_node=uinput"
'';
destination = "/etc/udev/rules.d/80-uinput.rules";
})
];
fonts.enableDefaultFonts = true;
fonts.fontconfig.antialias = true;
fonts.fonts = with pkgs; [
corefonts
emacs-all-the-icons-fonts
fira-code
noto-fonts
noto-fonts-emoji
(nerdfonts.override { fonts = [ "CascadiaCode" "Meslo" ]; })
];
nixpkgs.config.allowUnfree = true;
environment.pathsToLink = [ "/libexec" ];
environment.systemPackages = with pkgs; [
polkit_gnome
# firefox also needs:
#
# gfx.webrenderer.enabled = true
# widget.wayland-dmabuf-vaapi.enabled = true
#
# check in `about:support` that
# * Composing -> Webrenderer
firefox-wayland
libva
libva-utils
mesa
librsvg
mypaint
mypaint-brushes
arc-theme
capitaine-cursors
dracula-theme
elementary-xfce-icon-theme
glib
gsettings-desktop-schemas
gtk-engine-murrine
gtk_engines
hicolor-icon-theme
lxappearance
numix-icon-theme
imv
inkscape
libqrencode
libreoffice
libsecret
lxappearance
mpv
mumble
neofetch
nodePackages.insect
pavucontrol
pcmanfm
pulseeffects-pw
unstable.alacritty
unstable.keepassxc
unstable.noisetorch
solaar
gdk-pixbuf
clipman
gebaar-libinput
wdisplays
wl-clipboard
xdg_utils
xfce.thunar
xfce.thunar-volman
ydotool
(pkgs.writeTextFile {
name = "startsway";
destination = "/bin/startsway";
executable = true;
text = ''
#! ${pkgs.bash}/bin/bash
export GTK_ICON_THEME=Dracula
export GTK_THEME=Dracula
export _JAVA_AWT_WM_NOREPARENTING=1
export MOZ_ENABLE_WAYLAND=1
export MOZ_USE_XINPUT2=1
export QT_AUTO_SCREEN_SCALE_FACTOR=0
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_FORCE_DPI=96
export SDL_VIDEODRIVER=wayland
export XDG_CURRENT_DESKTOP=sway
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
export XDG_SESSION_TYPE=wayland
${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway
'';
})
];
hardware.bluetooth.enable = true;
services.blueman.enable = true;
services.syncthing = {
enable = true;
dataDir = "/home/stefan";
openDefaultPorts = true;
user = "stefan";
group = "users";
};
services.printing.enable = true;
services.printing.drivers = [ pkgs.gutenprint ];
services.avahi.enable = true;
services.avahi.nssmdns = true;
hardware.opengl = { enable = true; };
}