nixos-config/users/erwin/work.nix

444 lines
12 KiB
Nix

{
pkgs,
config,
lib,
inputs,
...
}:
with lib;
let
cfg = config.eboskma.users.erwin;
homeCfg = config.home-manager.users.erwin;
workspacePartition = builtins.concatLists (
builtins.attrValues (
builtins.mapAttrs
(
name: workspaces:
let
output = if name == "right" then "DP-1" else "DP-3";
in
builtins.map (ws: {
inherit output;
workspace = toString ws;
}) workspaces
)
(builtins.partition (n: (trivial.mod n 2) != 0) (lists.range 1 10))
)
);
in
{
config = mkIf cfg.work {
home-manager.users.erwin = {
_module.args.flake-inputs = inputs;
eboskma = {
var.workSystem = true;
programs = {
alacritty.enable = false;
anyrun.enable = true;
atuin.enable = true;
bat.enable = true;
cargo = {
enable = true;
settings = {
registries.crates-io = {
protocol = "sparse";
};
};
};
dropbox.enable = true;
dunst.enable = false;
emacs = {
enable = true;
package = pkgs.emacs29-pgtk;
daemon = true;
};
eww = {
enable = false;
};
firefox = {
enable = true;
work = true;
};
fish.enable = true;
foot = {
enable = true;
server = false;
fontSize = 16;
};
git = {
enable = true;
name = "Erwin Boskma";
email = "erwin@horus.nu";
signingKey = "~/.ssh/id_ed25519_sk_horus.pub";
signingKeyFormat = "ssh";
};
gpg.enable = true;
i3 = {
enable = false;
startupCommands = [
{
command = "${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --primary --left-of DP-4";
notification = false;
}
{
command = "${pkgs.xorg.xset}/bin/xset +dpms dpms 900 1200 1500";
notification = false;
}
{
command = "${pkgs.dropbox}/bin/dropbox start";
notification = false;
}
];
};
mpd.enable = true;
neovim.enable = true;
nushell.enable = true;
picom.enable = false;
polybar.enable = false;
rclone = {
enable = true;
mounts = [
{
remote = "org-roam";
local = "/home/erwin/org-roam";
remoteConfig = {
type = "sftp";
host = "zh2088.rsync.net";
user = "zh2088";
key_file = "~/.ssh/rsync-net";
};
}
];
};
rofi = {
enable = true;
package = pkgs.rofi-wayland;
terminal = config.home-manager.users.erwin.wayland.windowManager.sway.config.terminal;
};
ssh.enable = true;
starship.enable = true;
sway = {
enable = true;
package = pkgs.sway;
swayidle = false;
lock-wallpaper = "${homeCfg.home.homeDirectory}/.wallpapers/river-3840.png";
output = {
"DP-1" = {
bg = "${../../wallpapers/river-3840.png} fill";
mode = "3840x2160@60Hz";
position = "0 0";
};
"DP-3" = {
bg = "${../../wallpapers/river-3840.png} fill";
mode = "3840x2160@60Hz";
position = "3840 0";
};
"HDMI-A-1" = {
bg = "${../../wallpapers/river-3840.png} fill";
scale = "1.5";
disable = "disable";
};
};
input = {
"1241:662:USB-HID_Keyboard" = {
xkb_layout = "us,us";
xkb_variant = "colemak,";
xkb_options = "lv3:ralt_switch,eurosign:5,caps:backspace,ctrl:nocaps,grp:sclk_toggle,grp_led:scroll";
xkb_numlock = "enabled";
};
"1133:49257:Logitech_USB_Laser_Mouse" = {
natural_scroll = "enabled";
pointer_accel = "1";
};
};
workspaceOutputs = workspacePartition;
extraKeybindings = {
"Ctrl+Alt+1" = "exec ${pkgs.wayvnc}/bin/wayvncctl output-set DP-1";
"Ctrl+Alt+2" = "exec ${pkgs.wayvnc}/bin/wayvncctl output-set DP-3";
"Mod4+Ctrl+l" = "output DP-1 enable, output DP-3 enable, output HDMI-A-1 disable";
"Mod4+Ctrl+r" = "output DP-1 disable, output DP-3 disable, output HDMI-A-1 enable";
};
};
swaynotificationcenter.enable = true;
tmux.enable = true;
waybar = {
enable = true;
sway = true;
profile = "work";
cpuTempPath = "/sys/class/hwmon/hwmon1/temp2_input";
};
};
services = {
kanshi.enable = false;
xbanish.enable = false;
wayvnc = {
enable = true;
};
};
};
programs = {
home-manager.enable = true;
command-not-found.enable = true;
};
services = {
gnome-keyring = {
enable = true;
components = [
"pkcs11"
"ssh"
"secrets"
];
};
udiskie = {
enable = true;
tray = "auto";
notify = true;
settings = {
program_options = {
menu = "nested";
};
device_config = [
{
device_file = "/dev/loop*";
ignore = true;
}
];
};
};
};
home = {
username = "erwin";
homeDirectory = "/home/erwin";
sessionVariables = {
EDITOR = "${config.home-manager.users.erwin.eboskma.programs.emacs.package}/bin/emacsclient -c";
};
stateVersion = "24.05";
packages =
with pkgs;
[
atool
attic-client
# bitwarden
bitwarden-cli
blink1-tool
bottles
bottom
(chromium.override { enableWideVine = true; })
dbeaver-bin
dconf
devenv
doggo
easyeffects
fd
ffmpeg-full
icemon
imagemagick
(imv.override {
withBackends = [
"libtiff"
"libjpeg"
"libpng"
"librsvg"
"libheif"
];
})
incus
iotop
# (jetbrains.clion.override { jdk = pkgs.jetbrains.jdk; })
libnotify
libreoffice-fresh
minio-client
mpv
nautilus
pamedia
pass
picocom
procs
qgis
recursive
remmina
ripgrep
s-tui
stress
units
unzip
xdg-utils
xkb-switch
wayvnc
# winetricks
# wineWowPackages.waylandFull
wl-clipboard
zathura
zeal
]
++ (with gst_all_1; [
gstreamer
gstreamer.dev
gst-plugins-base
gst-plugins-good
gst-plugins-bad
gst-plugins-ugly
gst-libav
gst-vaapi
]);
pointerCursor = {
name = "catppuccin-mocha-dark-cursors";
package = pkgs.catppuccin-cursors.mochaDark;
gtk.enable = true;
x11.enable = true;
size = 48;
};
file.".wallpapers".source = ../../wallpapers;
};
xdg = {
enable = true;
mime.enable = true;
mimeApps = {
enable = true;
defaultApplications = {
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"x-scheme-handler/chrome" = "firefox.desktop";
"x-scheme-handler/terminal" = "${cfg.terminal}.desktop";
"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";
"application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop";
};
associations = {
added = {
"image/jpeg" = "feh.desktop";
"image/png" = "feh.desktop";
"image/gif" = "feh.desktop";
"application/zip" = "org.gnome.FileRoller.desktop";
"application/pdf" = "org.pwmt.zathura-pdf-mupdf.desktop";
};
};
};
userDirs = {
enable = true;
createDirectories = true;
};
configFile = {
"gtk-4.0/assets".source = "${homeCfg.gtk.theme.package}/share/themes/${homeCfg.gtk.theme.name}/gtk-4.0/assets";
"gtk-4.0/gtk.css".source = "${homeCfg.gtk.theme.package}/share/themes/${homeCfg.gtk.theme.name}/gtk-4.0/gtk.css";
"gtk-4.0/gtk-dark.css".source = "${homeCfg.gtk.theme.package}/share/themes/${homeCfg.gtk.theme.name}/gtk-4.0/gtk-dark.css";
};
};
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
gtk = {
enable = true;
theme = {
name = "Orchis-Dark";
package = pkgs.orchis-theme.override {
tweaks = [
"compact"
"macos"
];
border-radius = 5;
};
};
iconTheme = {
name = "elementary";
package = pkgs.pantheon.elementary-icon-theme;
};
gtk3 = {
bookmarks = [ "file:///home/erwin/workspace" ];
extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
};
gtk4 = {
extraConfig = {
gtk-application-prefer-dark-theme = 1;
};
};
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-m17n
fcitx5-gtk
fcitx5-configtool
];
};
imports =
[
../../modules/options
inputs.anyrun.homeManagerModules.default
]
++ (map (mod: (../../home-manager/modules + "/${mod}")) (
builtins.attrNames (builtins.readDir ../../home-manager/modules)
));
};
services = {
livebook = {
enableUserService = false;
environmentFile = pkgs.writeText "livebook-env" ''
LIVEBOOK_TOKEN_ENABLED=false
LIVEBOOK_IDENTITY_PROVIDER=tailscale:/run/tailscale/tailscaled.sock
LIVEBOOK_AWS_CREDENTIALS=true
LIVEBOOK_IP=100.119.162.110
'';
};
teamviewer.enable = true;
udev.packages = with pkgs; [ headsetcontrol ];
xserver = {
# layout = "us,us";
# xkbVariant = "colemak,";
# xkbModel = "pc105";
xkb.options = "eurosign:5,lv5:ralt_switch,lv3:rwin_switch";
upscaleDefaultCursor = false;
exportConfiguration = true;
windowManager.i3 = {
enable = false;
package = pkgs.i3-gaps;
extraPackages = with pkgs; [ i3lock-color ];
};
};
};
programs = {
bandwhich.enable = true;
wireshark = {
enable = true;
package = pkgs.wireshark;
};
trippy.enable = true;
};
users.groups.wireshark.members = [ "erwin" ];
environment.systemPackages = with pkgs; [ headsetcontrol ];
};
}