nixos-config/modules/desktop/default.nix
2021-12-06 09:58:39 +01:00

193 lines
4.5 KiB
Nix

{ lib, pkgs, config, inputs, self-overlay, ha-now-playing-overlay, pamedia-overlay, ... }:
with lib;
let
cfg = config.eboskma.desktop;
bt = config.eboskma.bluetooth;
in
{
# imports = [ ../../users/erwin.nix ../../users/root.nix ];
options.eboskma.desktop = {
enable = mkEnableOption "Enable default desktop configuration";
home-manager = mkOption {
type = types.bool;
default = false;
description = ''
Enable home-manager for this desktop
'';
};
};
config = mkIf cfg.enable {
home-manager.users.erwin = mkIf cfg.home-manager {
_module.args.flake-inputs = inputs;
programs.home-manager.enable = true;
programs.command-not-found.enable = true;
services.blueman-applet.enable = bt.enable;
home.username = "erwin";
home.homeDirectory = "/home/erwin";
home.sessionVariables = {
EDITOR = "${pkgs.neovim}/bin/nvim";
};
nixpkgs.config = { allowUnfree = true; };
home.stateVersion = "21.11";
eboskma = {
programs = {
alacritty.enable = true;
bat.enable = true;
dunst.enable = true;
electron = {
enable = true;
wayland = true;
};
firefox = {
enable = true;
work = config.eboskma.base.work;
};
fish.enable = true;
git = {
enable = true;
name = "Erwin Boskma";
email = "erwin@datarift.nl";
signingKey = "EE7ADEFE1D943C7B";
};
gpg.enable = true;
rofi.enable = true;
vscode.enable = true;
sway.enable = true;
tmux.enable = true;
waybar.enable = true;
};
};
home.packages = with pkgs; [
bitwarden
bottom
fd
git
gnome.nautilus
imagemagick
(jetbrains.clion.override { jdk = pkgs.jetbrains.jdk; })
neovim
nomachine-client
pamedia
pass
procs
ripgrep
signal-desktop
steam
steamcmd
steam-tui
tdesktop
unzip
wl-clipboard
];
xdg = {
enable = true;
};
gtk = {
enable = true;
theme = {
name = "Arc-Dark";
package = pkgs.arc-theme;
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
};
gtk3.extraConfig = {
gtk-application-prefer-dark-theme = true;
};
};
imports = [
{
nixpkgs.overlays = [
self-overlay
ha-now-playing-overlay
pamedia-overlay
];
}
../../home-manager/modules/alacritty
../../home-manager/modules/bat
../../home-manager/modules/dunst
../../home-manager/modules/electron
../../home-manager/modules/firefox
../../home-manager/modules/fish
../../home-manager/modules/git
../../home-manager/modules/gpg
../../home-manager/modules/rofi
../../home-manager/modules/vscode
../../home-manager/modules/sway
../../home-manager/modules/tmux
../../home-manager/modules/waybar
];
};
programs = {
dconf.enable = true;
sway = {
enable = true;
wrapperFeatures = {
gtk = true;
base = true;
};
extraPackages = with pkgs; [ swaylock-effects swayidle ];
};
steam.enable = true;
};
xdg = {
mime.enable = true;
menus.enable = true;
icons.enable = true;
sounds.enable = true;
autostart.enable = true;
portal = {
enable = true;
wlr.enable = true;
extraPortals = with pkgs; [ xdg-desktop-portal-gtk ];
gtkUsePortal = true;
};
};
services = {
dbus.packages = [ pkgs.gcr ];
avahi.publish.workstation = true;
};
security = {
pam.services.swaylock = {
text = ''
auth include login
'';
};
pki.certificates = [ (builtins.readFile ./horus-ca.pem) ];
};
environment.sessionVariables = {
_JAVA_AWT_WM_NONREPARENTING = "1";
MOZ_ENABLE_WAYLAND = "1";
MOZ_DBUS_REMOTE = "1";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
QT_QPA_PLATFORMTHEME = "qt5ct";
SDL_VIDEODRIVER = "wayland";
SSH_AUTH_SOCK = ''''${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh'';
AMD_VULKAN_ICD = "RADV";
};
};
}