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 = {
hostname,
username ? "albert",
desktop ? null,
system ? "x86_64-linux",
theme ? "stylix",
type ? "default",
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;
autoStart = true;
privateNetwork = false;
specialArgs = { inherit inputs unfree repo hostname username theme system; };
config = { inputs, unfree, repo, hostname, username, theme, system, ... }: {
specialArgs = { inherit pkgs-unstable hostname username desktop theme system repo unfree stateVersion; };
config = { lib, config, pkgs-unstable, hostname, username, desktop, theme, system, repo, stateVersion, ... }: {
# Choose whether to pull from stable or unstable
# pkgs-unstable will always be inherited from the host system
nixpkgs.pkgs = import inputs.${repo} {
inherit system;
config.allowUnfree = unfree;
hostPlatform = system;
};
imports = [
../nixos/containers
];

View file

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

View file

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