Update
This commit is contained in:
parent
50dbdd98c5
commit
99a388b850
5 changed files with 65 additions and 37 deletions
|
@ -30,6 +30,38 @@
|
|||
modules = [ ../home-manager/${type}.nix ];
|
||||
};
|
||||
|
||||
# Helper function for generating container configs
|
||||
mkContainer = {
|
||||
container,
|
||||
username ? "albert",
|
||||
desktop ? null,
|
||||
gpu ? null,
|
||||
system ? "x86_64-linux",
|
||||
theme ? "stylix",
|
||||
type ? "default",
|
||||
repo ? "nixpkgs",
|
||||
unfree ? false
|
||||
}: {
|
||||
autoStart = true;
|
||||
privateNetwork = false;
|
||||
specialArgs = { inherit desktop container username stateVersion gpu system theme; };
|
||||
config = { lib, container, username, desktop, gpu, system, theme, type, repo, unfree, pkgs, stateVersion}: {
|
||||
# Choose whether to pull from stable or unstable
|
||||
pkgs = import inputs.${repo} {
|
||||
inherit system;
|
||||
config.allowUnfree = unfree;
|
||||
hostPlatform = system;
|
||||
};
|
||||
# Some packages (ie, Vintage Story) I want to keep on unstable no matter what default repo I use
|
||||
pkgs-unstable = import inputs.nixpkgs-unstable {
|
||||
inherit system;
|
||||
config.allowUnfree = unfree;
|
||||
hostPlatform = system;
|
||||
};
|
||||
imports = [ ../nixos/containers/rdesktop ];
|
||||
};
|
||||
};
|
||||
|
||||
# Helper function for generating host configs
|
||||
mkHost = {
|
||||
hostname,
|
||||
|
@ -42,7 +74,7 @@
|
|||
repo ? "nixpkgs",
|
||||
unfree ? false
|
||||
}:inputs.${repo}.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu system theme;
|
||||
specialArgs = { inherit inputs outputs desktop hostname username hmStateVersion stateVersion gpu system theme self;
|
||||
# Choose whether to pull from stable or unstable
|
||||
pkgs = import inputs.${repo} {
|
||||
inherit system;
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
{ username, stateVersion, desktop, ... }: {
|
||||
networking.firewall.allowedTCPPorts = [ 3390 ];
|
||||
|
||||
containers.rdesktop = {
|
||||
autoStart = true;
|
||||
privateNetwork = false;
|
||||
specialArgs = { inherit username stateVersion desktop; };
|
||||
config = { config, pkgs, lib, username, stateVersion, desktop, ... }: {
|
||||
networking.hostName = "nixos-rdesktop";
|
||||
system.stateVersion = stateVersion;
|
||||
|
||||
imports = [
|
||||
../common/desktops/${desktop}
|
||||
../users/${username}
|
||||
];
|
||||
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 3390 ];
|
||||
};
|
||||
|
||||
services.xrdp = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
port = 3390;
|
||||
defaultWindowManager = "xfce4-session";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
18
nixos/containers/rdesktop/default.nix
Normal file
18
nixos/containers/rdesktop/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ username, stateVersion, desktop, ... }: {
|
||||
imports = [
|
||||
../../common/desktops/${desktop}
|
||||
../../users/${username}
|
||||
];
|
||||
|
||||
networking.firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [ 3390 ];
|
||||
};
|
||||
|
||||
services.xrdp = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
port = 3390;
|
||||
defaultWindowManager = "xfce4-session";
|
||||
};
|
||||
}
|
8
nixos/hosts/framework-server/containers.nix
Normal file
8
nixos/hosts/framework-server/containers.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ self, inputs, outputs, username, stateVersion, hmStateVersion, config, lib, pkgs, modulesPath, system, ... }:
|
||||
let
|
||||
libx = import ../../../lib {inherit self inputs outputs stateVersion hmStateVersion; };
|
||||
in {
|
||||
containers = {
|
||||
rdesktop = libx.mkContainer { container = "rdesktop"; };
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ username, stateVersion, inputs, config, lib, pkgs, modulesPath, system, ... }: {
|
||||
{ self, inputs, outputs, username, stateVersion, hmStateVersion, config, lib, pkgs, modulesPath, system, ... }: {
|
||||
imports = [
|
||||
inputs.nixos-hardware.nixosModules.framework-13th-gen-intel
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
|
@ -8,7 +8,7 @@
|
|||
../../common/modules/ssh-luks.nix
|
||||
../../common/services/docker.nix
|
||||
../../common/services/tailscale-autoconnect.nix
|
||||
( import ../../containers/rdesktop.nix { desktop = "xfce"; stateVersion = stateVersion; username = username;} )
|
||||
./containers.nix
|
||||
./disks.nix
|
||||
./builder.nix
|
||||
./wireguard.nix
|
||||
|
|
Loading…
Reference in a new issue