This commit is contained in:
albert 2024-03-22 22:10:30 +09:00
parent eff13f8fc6
commit 2960b29fb1
No known key found for this signature in database
GPG key ID: 64F6C4EB46C4543A
4 changed files with 16 additions and 31 deletions

View file

@ -33,24 +33,24 @@
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
tskey ? null,
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 pkgs pkgs-unstable hostname username desktop theme system repo unfree stateVersion tskey; }; specialArgs = { inherit inputs unfree repo hostname username theme system; };
config = { lib, config, pkgs, pkgs-unstable, hostname, username, desktop, theme, system, repo, stateVersion, tskey, ... }: { config = { inputs, unfree, repo, hostname, username, theme, system, ... }: {
system.stateVersion = 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 = [ imports = [
../nixos/containers ../nixos/containers
]; ];

View file

@ -5,6 +5,5 @@
../common/modules/nixos.nix ../common/modules/nixos.nix
../common/modules/networking.nix ../common/modules/networking.nix
]; ];
networking.hostName = "${hostname}"; networking.hostName = "${hostname}";
} }

View file

@ -1,15 +1,9 @@
{ desktop, ... }: { { ... }: {
imports = [ imports = [
../../common/desktops/${desktop}
../../common/software/packages.nix ../../common/software/packages.nix
../../common/desktops/plasma6
]; ];
system.stateVersion = "24.05";
networking.firewall.allowedTCPPorts = [ 3389 ]; networking.firewall.allowedTCPPorts = [ 3389 ];
services.xrdp.enable = true;
services.xrdp = {
enable = true;
openFirewall = true;
};
} }

View file

@ -1,19 +1,11 @@
{ self, inputs, outputs, stateVersion, hmStateVersion, pkgs, pkgs-unstable, ... }: { self, inputs, outputs, stateVersion, hmStateVersion, pkgs, pkgs-unstable, ... }:
let let
libx = import ../../../lib { libx = import ../../../lib { inherit self inputs outputs stateVersion hmStateVersion; };
inherit self inputs outputs hmStateVersion pkgs-unstable pkgs;
stateVersion = "24.05";
};
in { in {
# TODO: Set up Tailscale key # TODO: Set up Tailscale key
# Set up the bridge network: # Set up the bridge network:
containers = { containers = {
rdesktop = libx.mkContainer { rdesktop = libx.mkContainer { hostname = "rdesktop"; unfree = true; repo = "nixpkgs-unstable"; };
hostname = "rdesktop";
desktop = "plasma6";
unfree = true;
repo = "nixpkgs-unstable";
};
}; };
} }