nixos-config/modules/desktop/default.nix

320 lines
8.3 KiB
Nix
Raw Normal View History

{ lib
, pkgs
, config
, inputs
, self-overlay
, ...
2022-03-01 22:19:03 +01:00
}:
with lib; let
2021-11-22 08:04:54 +01:00
cfg = config.eboskma.desktop;
bt = config.eboskma.bluetooth;
in
{
2021-11-26 22:21:16 +01:00
# imports = [ ../../users/erwin.nix ../../users/root.nix ];
2021-11-12 17:10:17 +01:00
options.eboskma.desktop = {
enable = mkEnableOption "Enable default desktop configuration";
home-manager = mkOption {
type = types.bool;
default = false;
description = ''
Enable home-manager for this desktop
'';
};
2022-02-15 16:03:36 +01:00
terminal = mkOption {
type = types.str;
default = "foot";
description = "Terminal emulator to use. Specify the .desktop filename, e.g. 'foot' or 'Alacritty'";
};
2021-11-12 17:10:17 +01:00
};
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;
2021-11-22 08:04:54 +01:00
services.blueman-applet.enable = bt.enable;
2021-11-12 17:10:17 +01:00
home.username = "erwin";
home.homeDirectory = "/home/erwin";
2021-11-21 19:07:12 +01:00
home.sessionVariables = {
EDITOR = "${pkgs.neovim}/bin/nvim";
};
2021-11-12 17:10:17 +01:00
nixpkgs.config = { allowUnfree = true; };
2021-11-12 17:10:17 +01:00
home.stateVersion = "21.11";
eboskma = {
programs = {
2021-11-17 16:32:18 +01:00
alacritty.enable = true;
2021-11-21 19:07:12 +01:00
bat.enable = true;
dropbox.enable = true;
dunst.enable = false;
2022-03-28 14:26:33 +02:00
emacs = {
enable = true;
daemon = true;
};
electron = {
enable = true;
wayland = true;
};
2021-11-17 16:32:18 +01:00
firefox = {
enable = true;
work = config.eboskma.base.work;
};
fish.enable = true;
2021-12-18 16:23:14 +01:00
foot.enable = true;
2021-11-21 19:07:12 +01:00
git = {
enable = true;
name = "Erwin Boskma";
email = "erwin@datarift.nl";
signingKey = "EE7ADEFE1D943C7B";
};
2021-11-17 16:32:18 +01:00
gpg.enable = true;
2021-12-18 16:23:14 +01:00
neovim.enable = true;
obs-studio.enable = true;
2021-11-12 17:10:17 +01:00
rofi.enable = true;
2021-11-17 16:32:18 +01:00
vscode.enable = true;
2022-02-03 22:57:53 +01:00
solvespace.enable = true;
2021-12-24 17:57:22 +01:00
ssh.enable = true;
2021-11-17 16:32:18 +01:00
sway.enable = true;
tea = {
enable = true;
settings = {
logins = [
{
name = "datarift";
url = "https://git.datarift.nl";
token = "abc";
default = true;
ssh_host = "git.datarift.nl";
user = "erwin";
}
];
};
};
2021-11-21 19:07:12 +01:00
tmux.enable = true;
2021-11-12 17:10:17 +01:00
waybar.enable = true;
zathura.enable = true;
2021-11-12 17:10:17 +01:00
};
};
2022-03-01 22:19:03 +01:00
home.packages = with pkgs;
[
bandwhich
bitwarden
2022-05-24 21:32:00 +02:00
blink1-tool
2022-03-01 22:19:03 +01:00
bottom
fd
ffmpeg
ffmpeg.bin
git
gnome.nautilus
imagemagick
imv
iotop
(jetbrains.clion.override { jdk = pkgs.jetbrains.jdk; })
kicad
2022-06-01 09:15:25 +02:00
libnotify
2022-03-01 22:19:03 +01:00
mpv
nomachine-client
2022-05-11 16:27:42 +02:00
nordzy-cursor-theme
2022-03-01 22:19:03 +01:00
pamedia
pass
quintom-cursor-theme
procs
ripgrep
2022-03-14 11:19:11 +01:00
solo2-cli
2022-03-01 22:19:03 +01:00
steam
steamcmd
steam-tui
unzip
xdg-utils
wireshark
wl-clipboard
]
++ (with gst_all_1; [ gstreamer gstreamer.dev gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav gst-vaapi ]);
2021-11-12 17:10:17 +01:00
2021-11-17 16:32:18 +01:00
xdg = {
enable = true;
2021-12-24 17:57:22 +01:00
mime.enable = true;
2022-01-15 14:48:51 +01:00
mimeApps = {
enable = true;
defaultApplications = {
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"x-scheme-handler/chrome" = "firefox.desktop";
2022-02-15 16:03:36 +01:00
"x-scheme-handler/terminal" = "${cfg.terminal}.desktop";
2022-01-15 14:48:51 +01:00
"text/html" = "firefox.desktop";
"application/x-extension-htm" = "firefox.desktop";
"application/x-extension-html" = "firefox.desktop";
"application/x-extension-shtml" = "firefox.desktop";
"application/xhtml+xml" = "firefox.desktop";
"application/x-extension-xhtml" = "firefox.desktop";
"application/x-extension-xht" = "firefox.desktop";
};
associations = {
added = {
"image/jpeg" = "imv.desktop";
"image/png" = "imv.desktop";
"image/gif" = "imv.desktop";
"application/zip" = "org.gnome.FileRoller.desktop";
};
};
};
2021-12-24 17:57:22 +01:00
userDirs = {
enable = true;
createDirectories = true;
};
2021-11-17 16:32:18 +01:00
};
2022-02-09 08:13:16 +01:00
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [ fcitx5-m17n fcitx5-gtk fcitx5-configtool ];
2022-02-09 08:13:16 +01:00
};
2022-02-02 21:26:10 +01:00
2021-11-21 19:07:12 +01:00
gtk = {
enable = true;
theme = {
name = "Arc-Dark";
package = pkgs.arc-theme;
};
iconTheme = {
name = "Papirus-Dark";
package = pkgs.papirus-icon-theme;
2021-11-21 19:07:12 +01:00
};
2021-12-24 17:57:22 +01:00
gtk3 = {
bookmarks = [
"file:///home/erwin/workspace"
];
extraConfig = {
gtk-application-prefer-dark-theme = true;
2022-05-11 16:27:42 +02:00
# gtk-cursor-theme-name = "Quintom_Ink";
gtk-cursor-theme-name = "Nordzy-cursors";
2021-12-24 17:57:22 +01:00
};
2021-11-21 19:07:12 +01:00
};
};
2021-11-12 17:10:17 +01:00
imports = [
2021-11-16 00:22:18 +01:00
{
2021-11-21 19:07:12 +01:00
nixpkgs.overlays = [
self-overlay
2022-01-24 11:17:44 +01:00
inputs.ha-now-playing.overlays.${pkgs.system}
inputs.pamedia.overlays.${pkgs.system}
2022-02-09 08:13:16 +01:00
inputs.emacs-overlay.overlay
2021-11-21 19:07:12 +01:00
];
2021-11-16 00:22:18 +01:00
}
2021-11-17 16:32:18 +01:00
../../home-manager/modules/alacritty
2021-11-21 19:07:12 +01:00
../../home-manager/modules/bat
../../home-manager/modules/dropbox
2021-11-25 17:18:13 +01:00
../../home-manager/modules/dunst
2022-02-03 22:57:53 +01:00
../../home-manager/modules/emacs
../../home-manager/modules/electron
2021-11-17 16:32:18 +01:00
../../home-manager/modules/firefox
../../home-manager/modules/fish
2021-12-18 16:23:14 +01:00
../../home-manager/modules/foot
2021-11-21 19:07:12 +01:00
../../home-manager/modules/git
2021-11-17 16:32:18 +01:00
../../home-manager/modules/gpg
2021-12-18 16:23:14 +01:00
../../home-manager/modules/neovim
../../home-manager/modules/obs-studio
2021-11-17 16:32:18 +01:00
../../home-manager/modules/rofi
../../home-manager/modules/vscode
2022-02-03 22:57:53 +01:00
../../home-manager/modules/solvespace
2021-12-24 17:57:22 +01:00
../../home-manager/modules/ssh
2021-11-12 17:10:17 +01:00
../../home-manager/modules/sway
../../home-manager/modules/tea
2021-11-21 19:07:12 +01:00
../../home-manager/modules/tmux
2021-11-12 17:10:17 +01:00
../../home-manager/modules/waybar
../../home-manager/modules/zathura
2021-11-12 17:10:17 +01:00
];
};
2021-11-16 00:22:18 +01:00
2021-11-21 19:07:12 +01:00
programs = {
dconf.enable = true;
2022-01-31 08:10:31 +01:00
seahorse.enable = true;
steam.enable = true;
2021-11-21 19:07:12 +01:00
sway = {
enable = true;
wrapperFeatures = {
gtk = true;
base = true;
};
2022-02-03 22:57:53 +01:00
extraPackages = with pkgs; [
swaylock-effects
# swaylock
swayidle
swaynotificationcenter
2022-02-03 22:57:53 +01:00
];
2021-11-21 19:07:12 +01:00
};
};
2021-11-17 16:32:18 +01:00
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 ];
2021-11-17 16:32:18 +01:00
gtkUsePortal = true;
};
};
services = {
dbus.packages = [ pkgs.gcr ];
2021-12-06 09:58:39 +01:00
avahi.publish.workstation = true;
2022-01-31 08:10:31 +01:00
gvfs.enable = true;
2022-03-18 21:14:51 +01:00
pcscd.enable = true;
ratbagd.enable = true;
2021-11-21 19:07:12 +01:00
};
2021-11-17 16:32:18 +01:00
2021-11-25 17:18:13 +01:00
security = {
pam.services.swaylock = {
2022-02-03 22:57:53 +01:00
# text = ''
# auth include login
# '';
unixAuth = true;
setLoginUid = true;
enableGnomeKeyring = true;
allowNullPassword = true;
updateWtmp = true;
startSession = true;
2021-11-25 17:18:13 +01:00
};
pki.certificates = [ (builtins.readFile ./horus-ca.pem) ];
2021-11-16 00:22:18 +01:00
};
2021-11-22 18:56:59 +01:00
2022-03-18 21:14:51 +01:00
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";
# NIXOS_OZONE_WL = "1";
};
2021-11-22 18:56:59 +01:00
2022-03-18 21:14:51 +01:00
etc = {
"X11/xkb".source = "${pkgs.xkeyboard_config}/etc/X11/xkb";
};
systemPackages = with pkgs; [
piper
];
2021-12-18 16:23:14 +01:00
};
2021-11-12 17:10:17 +01:00
};
}