2024-09-05 18:45:09 +03:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.local.programs.communication.skype;
|
|
|
|
|
|
|
|
hostRunPackage = pkgs.writeScript "cont-run" ''
|
2024-09-28 16:52:30 +03:00
|
|
|
sudo nixos-container run skype -- su -l kira -c "$*"
|
2024-09-05 18:45:09 +03:00
|
|
|
'';
|
|
|
|
|
|
|
|
hostPackageScript = pkgs.writeScriptBin "${cfg.package.meta.mainProgram}" ''
|
|
|
|
${hostRunPackage} ${cfg.package.meta.mainProgram} $@
|
|
|
|
'';
|
|
|
|
|
|
|
|
hostSkype = pkgs.runCommand "${cfg.package.meta.mainProgram}" { } ''
|
|
|
|
mkdir $out
|
|
|
|
cp -r ${hostPackageScript}/bin $out/bin
|
|
|
|
cp -r ${cfg.package}/share $out/share
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.local.programs.communication.skype = with lib; {
|
|
|
|
enable = mkEnableOption "skype";
|
|
|
|
package = mkPackageOption pkgs "skypeforlinux" { };
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
environment.systemPackages = [ hostSkype ];
|
|
|
|
|
2024-09-27 23:13:34 +03:00
|
|
|
local.sound.systemWide = true;
|
2024-09-05 18:45:09 +03:00
|
|
|
|
|
|
|
containers.skype = {
|
|
|
|
autoStart = true;
|
|
|
|
ephemeral = true;
|
|
|
|
|
2024-09-08 02:36:45 +03:00
|
|
|
bindMounts = lib.mkMerge [
|
|
|
|
{
|
|
|
|
"/tmp/.X11-unix" = { };
|
|
|
|
}
|
|
|
|
(lib.mkIf config.hardware.graphics.enable {
|
|
|
|
"/run/opengl-driver/lib" = { };
|
|
|
|
})
|
|
|
|
(lib.mkIf config.hardware.graphics.enable32Bit {
|
|
|
|
"/run/opengl-driver-32/lib" = { };
|
|
|
|
})
|
|
|
|
];
|
2024-09-05 18:45:09 +03:00
|
|
|
|
|
|
|
config = { pkgs, ... }: {
|
|
|
|
system.stateVersion = "23.11";
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
fonts = {
|
|
|
|
inherit (config.fonts) enableDefaultPackages packages;
|
|
|
|
fontconfig = { inherit (config.fonts.fontconfig) defaultFonts; };
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.kira = {
|
|
|
|
isNormalUser = true;
|
|
|
|
home = "/home/kira";
|
|
|
|
password = "hello";
|
|
|
|
extraGroups = [ "pulse-access" ];
|
2024-09-08 02:36:45 +03:00
|
|
|
packages = [ cfg.package ];
|
2024-09-05 18:45:09 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
environment.sessionVariables = {
|
|
|
|
DISPLAY = ":0";
|
2024-09-27 23:13:34 +03:00
|
|
|
PULSE_SERVER = "tcp:127.0.0.1:4713";
|
2024-09-05 18:45:09 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|