mirror of
https://github.com/sstent/vmimages.git
synced 2026-01-25 22:51:49 +00:00
first commit
This commit is contained in:
68
modules/gnome/default.nix
Normal file
68
modules/gnome/default.nix
Normal file
@@ -0,0 +1,68 @@
|
||||
# This is your system's configuration file.
|
||||
# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix)
|
||||
|
||||
{ lib, config, pkgs, ... }: {
|
||||
|
||||
#define option to enable this
|
||||
options.mymods.gnome.enable = lib.mkEnableOption "Enable Gnome Env";
|
||||
|
||||
config = lib.mkIf config.mymods.gnome.enable {
|
||||
users.users.gdm.extraGroups = [ "video" ];
|
||||
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
modules = [ pkgs.xorg.xf86videofbdev ];
|
||||
videoDrivers = [ "hyperv_fb" ];
|
||||
displayManager.gdm.enable = true;
|
||||
desktopManager.gnome.enable = true;
|
||||
displayManager.startx.enable = true;
|
||||
};
|
||||
|
||||
environment.gnome.excludePackages = (with pkgs; [ gnome-photos gnome-tour ])
|
||||
++ (with pkgs.gnome; [
|
||||
cheese # webcam tool
|
||||
gnome-music
|
||||
#gnome-terminal
|
||||
#gedit # text editor
|
||||
epiphany # web browser
|
||||
geary # email reader
|
||||
#evince # document viewer
|
||||
gnome-characters
|
||||
totem # video player
|
||||
tali # poker game
|
||||
iagno # go game
|
||||
hitori # sudoku game
|
||||
atomix # puzzle game
|
||||
]);
|
||||
|
||||
## https://github.com/NixOS/nixpkgs/issues/126265
|
||||
## watch https://github.com/NixOS/nixpkgs/pull/83928
|
||||
services.xrdp = {
|
||||
# enable = true;
|
||||
# defaultWindowManager = "${pkgs.gnome3.gnome-shell}/bin/gnome-shell";
|
||||
package = pkgs.xrdp.overrideAttrs (oldAttrs: {
|
||||
configureFlags = oldAttrs.configureFlags ++ [ "--enable-vsock" ];
|
||||
postInstall = oldAttrs.postInstall + ''
|
||||
substituteInPlace $out/etc/xrdp/xrdp.ini \
|
||||
--replace "port=3389" "port=vsock://-1:3389" \
|
||||
--replace "security_layer=negotiate" "security_layer=rdp" \
|
||||
--replace "crypt_level=high" "crypt_level=none" \
|
||||
--replace "bitmap_compression=true" "bitmap_compression=false"
|
||||
|
||||
substituteInPlace $out/etc/xrdp/sesman.ini \
|
||||
--replace "X11DisplayOffset=10" "X11DisplayOffset=0" \
|
||||
--replace "FuseMountName=thinclient_drives" "FuseMountName=shared_drives"
|
||||
'';
|
||||
});
|
||||
};
|
||||
# --replace "use_vsock=false" "use_vsock=true" \
|
||||
|
||||
environment.etc."X11/Xwrapper.config".text = ''
|
||||
allowed_users=anybody
|
||||
'';
|
||||
services.xrdp.enable = true;
|
||||
services.xrdp.defaultWindowManager = "gnome-shell";
|
||||
networking.firewall.allowedTCPPorts = [ 3389 ];
|
||||
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user