nix-configs/modules/desktop/default.nix

242 lines
7.2 KiB
Nix
Raw Normal View History

2023-02-13 11:54:21 +00:00
{ config, lib, pkgs, ... }:
let
cfg = config.jade.desktop;
2023-04-22 11:10:34 +00:00
window-screenshot = pkgs.writeShellScriptBin "window-screenshot.sh" (builtins.readFile ../../other/scripts/desktop/window-screenshot.sh);
2023-02-13 11:54:21 +00:00
# desktop-ctl = pkgs.writeShellScriptBin "desktop-ctl.sh" (builtins.readFile ../scripts/desktop/desktop-ctl.sh);
2023-04-22 11:10:34 +00:00
desktop-ctl = import ../../other/scripts/desktop/desktopctl.nix { inherit pkgs; };
2023-02-13 11:54:21 +00:00
# search and open in browser
2023-04-22 11:10:34 +00:00
searchwolf = import ../../other/scripts/desktop/searchwolf.nix { inherit pkgs; };
2023-02-13 11:54:21 +00:00
# permaclip
2023-04-22 11:10:34 +00:00
pc-get = pkgs.writeShellScriptBin "pc-get.sh" (builtins.readFile ../../other/scripts/desktop/permaclip/pc-get.sh);
pc-set = pkgs.writeShellScriptBin "pc-set.sh" (builtins.readFile ../../other/scripts/desktop/permaclip/pc-set.sh);
em-record = pkgs.writeShellScriptBin "em-record.sh" (builtins.readFile ../../other/scripts/desktop/macros/record.sh);
em-play = pkgs.writeShellScriptBin "em-play.sh" (builtins.readFile ../../other/scripts/desktop/macros/play.sh);
em-play-loop = pkgs.writeShellScriptBin "em-play-loop.sh" (builtins.readFile ../../other/scripts/desktop/macros/play-loop.sh);
ocr-screenshot = pkgs.writeShellScriptBin "ocr-screenshot.sh" (builtins.readFile ../../other/scripts/desktop/ocr-screenshot.sh);
2023-02-13 11:54:21 +00:00
# rofi calculator copied from https://github.com/barbuk/menu-qalc
2023-04-22 11:10:34 +00:00
menu-qalc = pkgs.writeShellScriptBin "menu-qalc" (builtins.readFile ../../other/scripts/desktop/menu-qalc.sh);
2023-02-13 11:54:21 +00:00
#bitw = pkgs.buildGo118Module rec {
#pname = "bitw";
#version = "0.1.0";
#src = pkgs.fetchFromGitHub {
#owner = "mvdan";
#repo = "bitw";
#rev = "9da6ca0287ae8e4b1aa7fcdf7c4e8c2736718c3b";
#sha256 = "sha256-qe9y6BEsfsEiPFXlM/SFliSd+2fnfDMHyw/O6EE5hpA=";
#};
#nativeBuildInputs = with pkgs; [ gitMinimal ];
#doCheck = false;
#vendorHash = "sha256-KQr0DtyH3xzlFwsDl3MGLRRLQC4+EtdTOG7IhmNCzV4=";
#vendorHash = null;
#GOFLAGS = "-mod=readonly";
#proxyVendor = true;
#deleteVendor = true;
#preBuild = ''
#go mod vendor
#'';
#};
in with lib; {
imports = (mkIf cfg.enable [
./audio.nix
./gaming.nix
./creative.nix # TODO: more fine grained choices, not every setup needs fspy or rawtherapee
./compositing.nix
./ios-compat.nix
./syncthing.nix
./kdeconnect.nix
./themeing.nix
./cloud.nix
./networking.nix
./polybar.nix
./social.nix
#./xkeysnail.nix
2023-02-26 20:50:52 +00:00
./mail.nix
2023-03-20 22:40:08 +00:00
./specific-hardware
2023-04-22 10:52:11 +00:00
./xmonad.nix
./i3
2023-02-13 11:54:21 +00:00
]).content;
options.jade.desktop = {
enable = mkEnableOption "Enable the i3 setup";
};
config = mkIf cfg.enable {
fonts.fonts = with pkgs; [
2023-07-29 15:19:17 +00:00
(nerdfonts.override { fonts = [ "FiraCode" ]; })
montserrat
noto-fonts
atkinson-hyperlegible
2023-02-13 11:54:21 +00:00
];
2023-07-29 15:19:17 +00:00
fonts.fontDir.enable = true;
2023-02-13 11:54:21 +00:00
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-mozc
fcitx5-gtk
];
};
2023-02-13 11:54:21 +00:00
hardware.bluetooth.enable = true;
hardware.keyboard.uhk.enable = true;
2023-03-20 22:40:08 +00:00
#hardware.spacenavd.enable = true;
2023-02-13 11:54:21 +00:00
programs.seahorse.enable = true;
security.pam.services.jade.enableGnomeKeyring = true;
virtualisation.libvirtd.enable = true;
2023-09-08 23:10:22 +00:00
# environment.systemPackages = with pkgs; [ gnome.gdm ];
2023-02-13 11:54:21 +00:00
services = {
printing.enable = true;
gnome.gnome-keyring.enable = true;
xserver = {
layout = "us";
xkbVariant = "altgr-intl";
enable = true;
wacom.enable = true;
libinput = {
enable = true;
};
desktopManager = {
xterm.enable = false;
};
displayManager = {
2023-04-22 10:52:11 +00:00
#defaultSession = "none+i3";
2023-02-13 11:54:21 +00:00
gdm.enable = true;
};
2023-04-22 10:52:11 +00:00
windowManager.xmonad = {
2023-02-13 11:54:21 +00:00
enable = true;
};
};
};
# sensible modules:
# - [x] audio
# - [x] compositing (picom configs)
# - [x] gaming (steam, lutris, prism...)
# - [x] cloud (pw manager, nextcloud, fluent reader)
# - [x] syncthing
# - [x] social (evolution, discord, matrix?)
# - [ ] set up mail accounts properly
# - [x] creative (obs, blender, gimp n shit)
# - [x] apple-stuff (ifuse etc)
# - [x] themeing
# - [x] vpn/networking stuff
# - [ ] keymap
# - [ ] seperate keymap by modules like autostarts
# - [x] kdeconnect
# - [x] polybar
# - [ ] bluetooth
# - [ ] spacenav support (with custom systemd service)
# - [ ] wacom config
# - [x] xkeysnail
# - [ ] oneko
# also useful:
# - every custom script its own flake n stuff
2023-09-08 23:10:22 +00:00
programs.xss-lock = {
enable = true;
lockerCommand = "${pkgs.i3lock}/bin/i3lock";
};
services.illum.enable = true;
services.avahi.enable = true;
services.smartd = {
enable = true;
notifications.x11.enable = true;
notifications.test = true;
};
2023-09-25 17:24:42 +00:00
services.colord.enable = true;
2023-09-08 23:10:22 +00:00
2023-02-13 11:54:21 +00:00
home-manager.users.jade = { pkgs, ... }: {
2023-09-08 23:10:22 +00:00
programs.bat = {
# TODO: more config
enable = true;
};
programs.exa = {
# TODO: more config
enable = true;
};
programs.nushell = {
enable = true;
package = config.users.defaultUserShell;
configFile.source = ../../other/config.nu;
2023-09-25 17:24:42 +00:00
extraConfig = ''
source ${pkgs.nu_scripts}/share/nu_scripts/modules/nix/nix.nu;
'';
2023-09-08 23:10:22 +00:00
};
programs.ripgrep = {
enable = true;
};
services.dunst = {
enable = true;
settings = {
global = {
dmenu = "${pkgs.rofi}/bin/rofi -theme gruvbox-dark -dmenu -p dunst";
browser = "${pkgs.librewolf}/bin/librewolf";
mouse_left_click = "context";
mouse_middle_click = "close_current";
background = "#282828";
foreground = "#ebdbb2";
frame_color = "#504945";
frame_width = 2;
};
};
};
programs.rofi = {
enable = true;
theme = ../../other/rofi-themes/applauncher.rasi;
};
2023-02-13 11:54:21 +00:00
home.packages = with pkgs; [
2023-09-08 23:10:22 +00:00
#nushell
nu_scripts direnv
magic-wormhole-rs
2023-09-25 17:24:42 +00:00
argyllcms
displaycal
2023-09-08 23:10:22 +00:00
# carapace completer
carapace
i3lock rofimoji feh xorg.xinput arandr flameshot
2023-04-22 11:10:34 +00:00
tesseract5 imagemagick xclip xmacro libwacom wacomtablet xorg.xev
2023-04-22 10:52:11 +00:00
2023-02-13 11:54:21 +00:00
# categories
2023-03-20 22:40:08 +00:00
# filemanager
2023-04-22 11:10:34 +00:00
xfce.thunar xfce.tumbler xfce.thunar-archive-plugin gnome.file-roller
2023-03-20 22:40:08 +00:00
# media/file viewers
2023-04-22 11:10:34 +00:00
vlc evince nomacs
2023-02-13 11:54:21 +00:00
# from environment.systemPackages cleanup
2023-04-22 11:10:34 +00:00
font-manager xdotool xorg.xwininfo gparted librewolf firefox uhk-agent
2023-09-08 23:10:22 +00:00
cool-retro-term xdg-desktop-portal-gtk obsidian zettlr virt-manager
ddccontrol-db firebird-emu gitg gpick qdirstat ffmpeg_5
2023-02-13 11:54:21 +00:00
# external
2023-09-08 23:10:22 +00:00
libnotify i3lock rofi rofimoji feh xorg.xinput arandr
2023-04-22 12:57:32 +00:00
flameshot tesseract5 imagemagick xclip kitty xmacro
2023-09-08 23:10:22 +00:00
brightnessctl drawing libqalculate ddgr jq
2023-02-13 11:54:21 +00:00
# custom scripts
2023-04-22 11:10:34 +00:00
window-screenshot desktop-ctl em-record em-play em-play-loop
ocr-screenshot menu-qalc pc-get pc-set searchwolf
2023-02-13 11:54:21 +00:00
# meow
oneko
];
xsession = {
enable = true;
};
};
};
}