nixos-config/machines/maui.nix
Christoph Heiss 3c80b32440
All checks were successful
flake / build (push) Successful in 3m1s
machines: maui: add some useful git send-email aliases
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-08-23 11:16:27 +02:00

91 lines
2.7 KiB
Nix

{ config, lib, pkgs, ... }:
{
imports = [
../system/home-manager/common.nix
../system/home-manager/desktop.nix
../secrets/machines/maui.nix
];
home = rec {
username = "cheiss";
homeDirectory = "/home/${username}";
packages = (with pkgs; [ rust-analyzer samply sipcalc swaks ])
++ (with pkgs.nodePackages; [ bash-language-server prettier ])
++ (with pkgs.nixgl; [ nixGLIntel nixVulkanIntel ]);
sessionVariables = {
NIX_PATH = "nixpkgs=${lib.cleanSource pkgs.path}";
PATH =
"${homeDirectory}/.nix-profile/bin:/nix/var/nix/profiles/default/bin:$PATH";
};
};
my = {
emails.work.enable = true;
terminal.fontSize = 10.5;
};
programs.git = {
signing.signByDefault = false;
extraConfig.sendemail.suppresscc = "all";
};
programs.zsh.shellAliases = {
gsm-pve = "git send-email --to=pve-devel@lists.proxmox.com";
gsm-pbs = "git send-email --to=pbs-devel@lists.proxmox.com";
gsm-pmg = "git send-email --to=pmg-devel@lists.proxmox.com";
};
# Nix's swaylock is broken when using on Debian due to some PAM
# incompatibilities. Work around that by simply running Debians
# `swaylock`.
programs.swaylock.package = pkgs.writeShellScriptBin "swaylock" ''
exec /usr/bin/swaylock
'';
wayland.windowManager.sway = {
package = let
swayCfg = config.wayland.windowManager.sway;
swayPkg = pkgs.sway.override {
inherit (swayCfg) extraSessionCommands extraOptions;
withBaseWrapper = swayCfg.wrapperFeatures.base;
withGtkWrapper = swayCfg.wrapperFeatures.gtk;
};
in pkgs.symlinkJoin {
name = "sway-nixgl-wrapper";
paths = [
(pkgs.writeShellScriptBin "sway" ''
exec ${pkgs.nixgl.nixGLIntel}/bin/nixGLIntel ${swayPkg}/bin/sway
'')
swayPkg
];
};
# Just hangs as sway obviously(!) never exits ..
# Broken by this unsolicited commit:
# https://github.com/nix-community/home-manager/commit/3a435342e2e5e2bff1d3331c2bd9e70f25693ea2
# Committing straight to `master`, of course! Who wants to review breaking
# changes anyway ..
checkConfig = false;
extraSessionCommands = ''
export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/openssh_agent
'';
config.assigns = {
"2" = [{ app_id = "firefox"; }];
"5" = [{ app_id = "signal"; }];
};
};
xdg.systemDirs.data = [ "$HOME/.nix-profile/share" ];
home.activation.linkSystemd =
let services = [ "xdg-desktop-portal" "xdg-desktop-portal-wlr" ];
in lib.hm.dag.entryBefore [ "reloadSystemd" ] (lib.concatMapStrings (s: ''
ln -sf \
"$(readlink "$HOME/.nix-profile/share/systemd/user/${s}.service")" \
"$HOME/.config/systemd/user/${s}.service"
'') services);
}