nixos-config/users/erwin/work.nix
Erwin Boskma de3e8a2a89
Some checks failed
/ check (push) Failing after 2m50s
livebook: Update config
2024-01-30 21:00:05 +01:00

418 lines
12 KiB
Nix

{ pkgs, config, lib, inputs, ... }:
with lib;
let
cfg = config.eboskma.users.erwin;
# remoteSessionScript = pkgs.writeShellScriptBin "remote-session" ''
# ${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --mode 2560x1440
# ${pkgs.xorg.xrandr}/bin/xrandr --output DP-4 --mode 2560x1440 --right-of DP-0
# ${pkgs.nitrogen}/bin/nitrogen --head=0 --set-auto ${toString ./wallpapers/jwst-carina-cosmic-cliffs-nircam-2560.png}
# ${pkgs.nitrogen}/bin/nitrogen --head=1 --set-auto ${toString ./wallpapers/jwst-southern-ring-nircam-miri-side-by-side-2560.png}
# systemctl --user restart polybar
# '';
# localSessionScript = pkgs.writeShellScriptBin "local-session" ''
# ${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --mode 3840x2160
# ${pkgs.xorg.xrandr}/bin/xrandr --output DP-4 --mode 3840x2160 --right-of DP-0
# ${pkgs.nitrogen}/bin/nitrogen --head=0 --set-auto ${toString ./wallpapers/jwst-carina-cosmic-cliffs-nircam-3840.png}
# ${pkgs.nitrogen}/bin/nitrogen --head=1 --set-auto ${toString ./wallpapers/jwst-southern-ring-nircam-miri-side-by-side-3840.png}
# systemctl --user restart polybar
# '';
ewwDaemon =
let
path = lib.makeBinPath (with pkgs; [ jaq pamedia bash helvum pavucontrol headsetcontrol ha-now-playing ]);
in
pkgs.writeShellScript "eww-daemon" ''
export PATH=${path}:''${PATH}
${config.home-manager.users.erwin.eboskma.programs.eww.package}/bin/eww $@
'';
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.emacs-unstable-pgtk;
# .override {
# treeSitterPlugins = builtins.attrValues (filterAttrs (_: isDerivation) pkgs.tree-sitter-grammars);
# };
daemon = true;
};
eww = {
enable = true;
package = pkgs.eww-wayland;
};
firefox = {
enable = true;
work = true;
};
fish.enable = true;
foot = {
enable = true;
server = false;
};
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;
wayvnc = true;
lock-wallpaper = ../../wallpapers/river-3840.png;
output = {
"DP-1" = {
bg = "${../../wallpapers/river-3840.png} fill";
mode = "3840x2160@60Hz";
position = "0 0";
};
"DP-3" = {
bg = "${../../wallpapers/space_shuttle_endeavour_3840.jpg} fill";
mode = "3840x2160@60Hz";
position = "3840 0";
};
};
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";
};
};
startup = [
{ command = "${ewwDaemon} --restart open bar-work"; always = true; }
# { command = "${pkgs.wayvnc}/bin/wayvnc 0.0.0.0"; always = true; }
];
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";
};
};
swaynotificationcenter.enable = true;
tmux.enable = true;
};
services = {
xbanish.enable = false;
};
};
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 = "22.11";
packages = with pkgs; [
atool
attic-client
bitwarden
blink1-tool
bottom
chromium
dbeaver
dconf
fd
ffmpeg_5-full
gnome.gnome-remote-desktop
gnome.nautilus
icemon
imagemagick
imv
incus
iotop
(jetbrains.clion.override { jdk = pkgs.jetbrains.jdk; })
libnotify
libreoffice-fresh
minio-client
mpv
nordzy-cursor-theme
pamedia
pass
podman-desktop
quintom-cursor-theme
procs
qgis
recursive
remmina
ripgrep
s-tui
solo2-cli
stress
units
unzip
xdg-utils
xkb-switch
wayvnc
winetricks
wineWowPackages.stable
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 = "elementary";
package = pkgs.pantheon.elementary-gtk-theme;
gtk.enable = true;
x11.enable = true;
};
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;
};
};
dconf.settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
};
};
gtk = {
enable = true;
theme = {
name = "elementary";
package = pkgs.pantheon.elementary-gtk-theme;
};
iconTheme = {
name = "elementary";
package = pkgs.pantheon.elementary-icon-theme;
};
gtk3 = {
bookmarks = [
"file:///home/erwin/workspace"
];
extraConfig = {
gtk-application-prefer-dark-theme = 1;
# gtk-cursor-theme-name = "elementary";
};
};
gtk4.extraConfig = {
gtk-application-prefer-dark-theme = 1;
# gtk-cursor-theme-name = "elementary";
};
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [ fcitx5-m17n fcitx5-gtk fcitx5-configtool ];
};
imports = [
../../modules/options
inputs.anyrun.nixosModules.home-manager
] ++ (map (mod: (../../home-manager/modules + "/${mod}")) (builtins.attrNames (builtins.readDir ../../home-manager/modules)));
};
services = {
livebook = {
enableUserService = true;
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";
xkbOptions = "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;
};
};
users.groups.wireshark.members = [ "erwin" ];
environment.systemPackages = with pkgs; [
headsetcontrol
];
};
}