modules/editors: add jetbrains-idea container

This commit is contained in:
Dmitriy Pleshevskiy 2024-09-09 02:15:44 +03:00
parent d5be2c18f9
commit c0c761e740
Signed by: pleshevskiy
GPG key ID: 17041163DA10A9A2
3 changed files with 54 additions and 0 deletions

View file

@ -5,5 +5,6 @@
./pass.nix
./browsers
./communication
./editors
];
}

View file

@ -0,0 +1,5 @@
{ ... }:
{
imports = [ ./jetbrains-idea.nix ];
}

View file

@ -0,0 +1,48 @@
{ 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";
};
};
};
};
}