nixos-config/machines/maui.nix
Christoph Heiss bfe1324be4
machines: maui: add swaks to home packages
Signed-off-by: Christoph Heiss <christoph@c8h4.io>
2024-05-21 12:23:44 +02:00

79 lines
2.3 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 sipcalc swaks ])
++ (with pkgs.nodePackages; [ bash-language-server prettier ])
++ (with pkgs.nixgl; [ nixGLIntel nixVulkanIntel ]);
sessionVariables.NIX_PATH = "nixpkgs=${lib.cleanSource pkgs.path}";
};
my = {
emails.work.enable = true;
terminal.fontSize = 10.5;
};
programs.git.signing.signByDefault = false;
# Nix's swaylock is broken when using on Debian due to some PAM
# incompatibilites. 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" ]
(builtins.concatStringsSep "\n" (map (s: ''
ln -sf \
"$(readlink "$HOME/.nix-profile/share/systemd/user/${s}.service")" \
"$HOME/.config/systemd/user/${s}.service"
'') services));
}