-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathcontainer-config.nix
77 lines (67 loc) · 1.38 KB
/
container-config.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
pkgs,
inputs,
...
}: let
get-host-ip = "$(ip route | grep default | cut -d' ' -f3)";
in {
boot.isContainer = true;
environment = {
shellInit = "export DISPLAY=${get-host-ip}:0";
systemPackages = builtins.concatLists (builtins.attrValues (import ./packages.nix {inherit pkgs inputs;}));
};
networking = {
nat = {
enable = true;
internalInterfaces = ["ve-rednix"];
externalInterface = "eth0";
};
useDHCP = false;
hostName = "RedNix";
firewall = {
enable = true;
allowPing = true;
allowedTCPPorts = [];
};
};
# nix config
nix = {
settings.extra-experimental-features = [
"nix-command"
"flakes"
];
};
# nixpkgs config
nixpkgs.config = {
allowUnfree = true;
allowInsecurePredicate = p: true;
segger-jlink.acceptLicense = true;
};
# services
services = {
getty.autologinUser = "rednix";
openssh = {
enable = true;
settings.X11Forwarding = true;
};
avahi = {
enable = true;
browseDomains = [];
wideArea = false;
nssmdns = true;
};
unbound = {
enable = true;
settings.server = {};
};
};
system.stateVersion = "23.11";
# users
users.users.rednix = {
isNormalUser = true;
uid = 1000;
description = "RedNix container user";
password = "rednix";
extraGroups = ["wheel"];
};
}