blob: 74abdb4d1762041299cefef08b99d428f23f73ff (
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
|
{ config, lib, pkgs, ... }:
let duid = "00:01:00:01:21:a2:4e:a8:d0:bf:9c:45:a6:ec";
in {
imports = [
../config/router.nix
# ../config/borg-backup.nix
../config/keycloak.nix
../config/dns.nix
../config/web-server.nix
../config/cgit.nix
];
orbekk.monitoring-server.enable = true;
orbekk.postfix.enable = true;
orbekk.nextcloud.enable = true;
orbekk.backups.enableServer = true;
orbekk.backups.enableClient = true;
orbekk.vpn.enable = true;
orbekk.bridge.enable = true;
orbekk.zomboid-server.enable = false;
environment.systemPackages = with pkgs; [ ipmitool ];
programs.mosh.enable = true;
orbekk.hledger-web.enable = true;
orbekk.hledger-web.journalFile =
"/var/lib/hledger-web/hledger/anniekj.journal";
services.samba = {
enable = true;
extraConfig = ''
guest account = readonly
map to guest = bad user
'';
shares = {
public = {
path = "/storage/upload";
browseable = "yes";
"read only" = "no";
"guest ok" = "yes";
"create mask" = "0666";
"directory mask" = "0777";
"force user" = "readonly";
"force group" = "readonly";
};
};
};
# services.tailscale.enable = true;
# virtualisation.lxd.enable = true;
boot = {
kernelParams = [ "console=tty0" ''console="ttyS0,115200n8"'' ];
loader.grub.extraConfig = ''
GRUB_TERMINAL="serial"
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
serial --speed 115200 --unit=0
terminal_input serial
terminal_output serial
'';
loader.grub.enable = true;
loader.grub.version = 2;
# loader.grub.devices = [ "/dev/sda" "/dev/sdb" ];
loader.grub.mirroredBoots = [
{ devices = [ "/dev/disk/by-id/ata-HGST_HDN724040ALE640_PK1334PCKEXU9X" ]; path = "/mnt/boot1"; }
{ devices = [ "/dev/disk/by-id/ata-HGST_HDN724040ALE640_PK1334PCKHV0LS" ]; path = "/mnt/boot2"; }
];
};
networking = { hostName = lib.mkForce "dragon"; };
# Required to enable password authentication for one user.
security.pam.services.sshd.unixAuth = lib.mkForce true;
services.openssh = {
enable = lib.mkDefault true;
passwordAuthentication = false;
extraConfig = ''
Match User readonly
PasswordAuthentication yes
'';
};
fileSystems = {
"/storage" = {
device = "/dev/disk/by-id/ata-HGST_HDN724040ALE640_PK1334PCKEXU9X-part3";
fsType = "btrfs";
options = [ "subvol=storage" ];
};
"/staging" = {
device = "/dev/sda3";
fsType = "btrfs";
options = [ "subvol=staging" ];
};
};
users.users.breakds = {
uid = 1101;
shell = pkgs.bashInteractive;
home = "/home/breakds";
createHome = false;
isNormalUser = true;
description = "Break Yang";
openssh.authorizedKeys.keyFiles = [ ../data/break_rsa.pub ];
};
system.stateVersion = lib.mkForce "17.09";
# hardware-configuration.nix
boot.initrd.availableKernelModules =
[ "ehci_pci" "ahci" "uhci_hcd" "xhci_pci" "usb_storage" "sd_mod" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = {
device = "/dev/disk/by-id/ata-HGST_HDN724040ALE640_PK1334PCKEXU9X-part3";
fsType = "btrfs";
options = [
"subvol=system/dragon-nixos,device=/dev/disk/by-id/ata-HGST_HDN724040ALE640_PK1334PCKHV0LS-part3,device=/dev/disk/by-id/ata-HGST_HDN724040ALE640_PK1334PCKEXU9X-part3,degraded"
];
};
fileSystems."/mnt/boot1" = {
device = "/dev/disk/by-id/ata-HGST_HDN724040ALE640_PK1334PCKEXU9X-part4";
options = ["nofail"];
};
fileSystems."/mnt/boot2" = {
device = "/dev/disk/by-id/ata-HGST_HDN724040ALE640_PK1334PCKHV0LS-part4";
options = ["nofail"];
};
swapDevices = [ ];
nix.settings.trusted-users = [ "builder" ];
nix.settings.max-jobs = lib.mkDefault 8;
powerManagement.cpuFreqGovernor = "ondemand";
hardware.enableRedistributableFirmware = lib.mkDefault true;
}
|