summaryrefslogtreecommitdiff
path: root/nix_archive/hosts/moyo/container.nix
blob: 23e7b029c122d45d416ab2473f503e758102bdff (plain)
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{ config, lib, pkgs, modulesPath, ... }: {
  imports = [
    "${modulesPath}/virtualisation/lxc-container.nix"
  ];

  boot.isContainer = true;

  nix = {
    settings = {
      experimental-features = [ "nix-command" "flakes" ];
      auto-optimise-store = true;
      download-buffer-size = 134217728;
    };
    gc.automatic = false;
    optimise.automatic = true;
  };

  nixpkgs.config.allowUnfree = true;
  hardware.enableRedistributableFirmware = true;

  users.users.andrew = {
    isNormalUser = true;
    uid = 1000;
    extraGroups = [ "wheel" ];
  };
  nix.settings.trusted-users = [ "andrew" ];

  nix.settings.system-features = [ "gccarch-znver1" ];
  nixpkgs.hostPlatform = {
    #gcc.arch = "znver1";
    #gcc.tune = "znver1";
    system = "x86_64-linux";
  };

  time.timeZone = "America/New_York";
  i18n.defaultLocale = "en_US.UTF-8";

  networking = {
    hostName = "the-p";
    useDHCP = false;
    dhcpcd.enable = false;
    useHostResolvConf = false;
    wireless.enable = false;
    firewall = {
      enable = false;
      allowedTCPPorts = [ 22 25565 ];
      allowedUDPPorts = [ ];
    };
  };

  systemd.network = {
    enable = true;
    networks."50-eth0" = {
      matchConfig.Name = "eth0";
      networkConfig = {
        DHCP = "ipv4";
        IPv6AcceptRA = true;
      };
      linkConfig.RequiredForOnline = "routable";
    };
  };

  users.defaultUserShell = pkgs.bashInteractive;

  programs.screen = {
    enable = true;
    screenrc = ''
      termcapinfo xterm* ti@:te@
    '';
  };

  environment.systemPackages = with pkgs; [
    git # flakes
    kitty.terminfo
    htop
    jq
    ((vim-full.override {
      features = "small";
      guiSupport = "off";
      luaSupport = false;
      pythonSupport = false;
      rubySupport = false;
      cscopeSupport = false;
      netbeansSupport = false;
      ximSupport = false;
      ftNixSupport = false;
      sodiumSupport = false;
    }).customize {
      name = "vi";
      vimrcConfig = { customRC = ""; };
    })
    #jdk23
    graalvm-ce
  ];

  system.stateVersion = "25.05";
}