This commit is contained in:
albert 2024-03-22 22:36:01 +09:00
parent 2960b29fb1
commit 45c6da610d
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
3 changed files with 19 additions and 16 deletions

View file

@ -33,24 +33,28 @@
mkContainer = { mkContainer = {
hostname, hostname,
username ? "albert", username ? "albert",
desktop ? null,
system ? "x86_64-linux", system ? "x86_64-linux",
theme ? "stylix", theme ? "stylix",
type ? "default",
repo ? "nixpkgs", repo ? "nixpkgs",
unfree ? false unfree ? false,
pkgs ? import inputs.${repo}
{ inherit system; config.allowUnfree = unfree; hostPlatform = system; },
pkgs-unstable ? import inputs.nixpkgs-unstable
{ inherit system; config.allowUnfree = unfree; hostPlatform = system; }
}: { }: {
bindMounts = import ../nixos/containers/${hostname}/mounts.nix; bindMounts = import ../nixos/containers/${hostname}/mounts.nix;
autoStart = true; autoStart = true;
privateNetwork = false; privateNetwork = false;
specialArgs = { inherit inputs unfree repo hostname username theme system; }; specialArgs = { inherit pkgs-unstable hostname username desktop theme system repo unfree stateVersion; };
config = { inputs, unfree, repo, hostname, username, theme, system, ... }: { config = { lib, config, pkgs-unstable, hostname, username, desktop, theme, system, repo, stateVersion, ... }: {
# Choose whether to pull from stable or unstable # Choose whether to pull from stable or unstable
# pkgs-unstable will always be inherited from the host system
nixpkgs.pkgs = import inputs.${repo} { nixpkgs.pkgs = import inputs.${repo} {
inherit system; inherit system;
config.allowUnfree = unfree; config.allowUnfree = unfree;
hostPlatform = system; hostPlatform = system;
}; };
imports = [ imports = [
../nixos/containers ../nixos/containers
]; ];

View file

@ -1,8 +1,7 @@
{ ... }: { { lib, desktop, ... }: {
imports = [ imports = [
../../common/software/packages.nix ../../common/software/packages.nix
../../common/desktops/plasma6 ] ++ lib.optional (builtins.isString desktop) ../../common/desktops/${desktop};
];
networking.firewall.allowedTCPPorts = [ 3389 ]; networking.firewall.allowedTCPPorts = [ 3389 ];
services.xrdp.enable = true; services.xrdp.enable = true;

View file

@ -6,6 +6,6 @@ in {
# Set up the bridge network: # Set up the bridge network:
containers = { containers = {
rdesktop = libx.mkContainer { hostname = "rdesktop"; unfree = true; repo = "nixpkgs-unstable"; }; rdesktop = libx.mkContainer { hostname = "rdesktop"; unfree = true; repo = "nixpkgs-unstable"; desktop = "xfce"; };
}; };
} }