system/modules/nixos/programs/editors/jetbrains-idea.nix

48 lines
1.1 KiB
Nix

{ config, pkgs, lib, ... }:
let
cfg = config.local.programs.editors.jetbrains-idea;
in
{
options.local.programs.editors.jetbrains-idea = with lib; {
enable = mkEnableOption "jetbrains idea-community";
package = mkPackageOption pkgs.jetbrains "idea-community" { };
};
config = lib.mkIf cfg.enable {
containers.jetbrains-idea = {
autoStart = true;
ephemeral = true;
bindMounts = {
"/tmp/.X11-unix" = { };
"/home/john/projects" = {
isReadOnly = false;
hostPath = "/home/jan/containers/jetbrains-idea/projects";
};
};
config = { pkgs, ... }: {
system.stateVersion = "23.11";
fonts = {
inherit (config.fonts) enableDefaultPackages packages;
fontconfig = { inherit (config.fonts.fontconfig) defaultFonts; };
};
users.users.john = {
isNormalUser = true;
home = "/home/john";
password = "hello";
extraGroups = [ "pulse-access" ];
packages = [ cfg.package ];
};
environment.sessionVariables = {
DISPLAY = ":0";
};
};
};
};
}