nix-config/hosts/glotzbert/default.nix

157 lines
3.9 KiB
Nix
Raw Normal View History

{ zentralwerk, secretsFile, config, pkgs, ... }:
2019-01-06 16:50:26 +01:00
{
2021-02-22 12:31:58 +01:00
imports = [ ./hardware-configuration.nix ];
2020-01-20 14:24:31 +01:00
c3d2 = {
isInHq = true;
2020-06-19 18:12:42 +02:00
hq.interface = "eno1";
2020-06-19 19:32:53 +02:00
hq.enableBinaryCache = false;
2021-10-18 22:23:43 +02:00
users.k-ot = true;
users.emery = true;
2020-01-20 14:24:31 +01:00
};
2021-10-18 22:23:43 +02:00
users.users.emery.cryptHomeLuks = "/home/emery.luks.img";
2019-01-06 16:50:26 +01:00
nixpkgs.config.allowUnfree = true;
nix = {
useSandbox = true;
2020-06-19 19:32:53 +02:00
buildCores = 4;
maxJobs = 4;
};
sops.defaultSopsFile = secretsFile;
sops.secrets = {
"ceph/secret" = {};
};
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
2019-01-06 16:50:26 +01:00
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
2020-06-19 19:32:53 +02:00
boot.kernelPackages = pkgs.linuxPackages_latest;
2019-01-06 16:50:26 +01:00
networking.hostName = "glotzbert"; # Define your hostname.
2020-06-19 19:32:53 +02:00
networking.interfaces.eno1.useDHCP = true;
2019-01-06 16:50:26 +01:00
# Select internationalisation properties.
2020-06-19 19:32:53 +02:00
console = {
font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz";
keyMap = "de";
2019-01-06 16:50:26 +01:00
};
2020-06-19 19:32:53 +02:00
i18n.defaultLocale = "en_US.UTF-8";
2019-01-06 16:50:26 +01:00
2020-06-19 19:32:53 +02:00
environment.systemPackages = with pkgs; [
2021-02-22 11:45:12 +01:00
screen
chromium
firefox
mpv
kodi
ceph
2020-06-19 19:32:53 +02:00
];
2019-01-06 16:50:26 +01:00
systemd.user.services.x11vnc = {
description = "X11 VNC server";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = ''
${pkgs.x11vnc}/bin/x11vnc -shared -forever -passwd k-ot
2019-01-06 16:50:26 +01:00
'';
RestartSec = 3;
Restart = "always";
};
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
# Or disable the firewall altogether.
networking.firewall.enable = false;
# Enable sound.
sound.enable = true;
hardware.pulseaudio = {
enable = true;
# Users must be in "audio" group
systemWide = true;
support32Bit = true;
zeroconf.discovery.enable = true;
zeroconf.publish.enable = true;
tcp = {
enable = true;
anonymousClients.allowAll = true;
};
extraConfig = ''
2019-09-07 17:38:31 +02:00
load-module module-tunnel-sink server=pulsebert.hq.c3d2.de
2019-01-06 16:50:26 +01:00
'';
extraClientConf = ''
2019-09-07 17:38:31 +02:00
default-server = pulsebert.hq.c3d2.de
2019-01-06 16:50:26 +01:00
'';
};
# Enable the X11 windowing system.
services.xserver.enable = true;
services.xserver.layout = "de";
services.xserver.xkbOptions = "eurosign:e";
services.xserver.displayManager = {
2021-02-22 11:45:12 +01:00
lightdm = { enable = true; };
autoLogin = {
enable = true;
user = "k-ot";
2019-01-06 16:50:26 +01:00
};
2020-06-19 19:32:53 +02:00
defaultSession = "gnome-xorg";
2019-01-06 16:50:26 +01:00
};
services.xserver.desktopManager = {
2021-11-11 01:55:36 +01:00
gnome.enable = true;
2019-09-07 17:38:31 +02:00
kodi.enable = true;
2019-01-06 16:50:26 +01:00
};
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
# Define a user account. Don't forget to set a password with passwd.
users.groups."k-ot" = { gid = 1000; };
users.users."k-ot" = {
isNormalUser = true;
uid = 1000;
group = "k-ot";
extraGroups = [ "wheel" "networkmanager" "audio" "video" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGJJTSJdpDh82486uPiMhhyhnci4tScp5uUe7156MBC8 astro"
];
2019-01-06 16:50:26 +01:00
};
services.ceph = {
enable = true;
global.fsid = "d7c5c9c7-a227-4e33-ab43-3f4aa1eb0630";
client.enable = true;
};
fileSystems."/mnt/storage" =
let
monHosts = pkgs.lib.concatMapStringsSep "," (host:
zentralwerk.lib.config.site.net.cluster.hosts4.${host}
) [ "server5" "server6" "server8" ];
in {
fsType = "ceph";
device = "${monHosts}:/";
options = [
"_netdev"
"name=c3d2"
"secretfile=${config.sops.secrets."ceph/secret".path}"
"noatime"
"x-systemd.automount"
"x-systemd.device-timeout=5"
];
};
2019-01-06 16:50:26 +01:00
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "18.09"; # Did you read the comment?
}