c3terminal/config.nix
2024-12-27 01:21:46 +01:00

232 lines
5.4 KiB
Nix

{
pkgs,
lib,
config,
...
}:
let
lock = value: {
Value = value;
Status = "locked";
};
in
{
system.stateVersion = "24.11";
networking.hostName = "c3terminal";
time.timeZone = "Europe/Berlin";
facter.reportPath = ./facter.json;
programs.vim.enable = true;
programs.vim.defaultEditor = true;
console = {
enable = true;
useXkbConfig = true;
};
system.autoUpgrade = {
enable = true;
flake = "git+https://git.hamburg.ccc.de/jopejoe1/c3terminal";
dates = "5min";
};
users.users.c3terminal = {
isNormalUser = true;
password = "test";
extraGroups = [
"wheel"
"networkmanager"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFZDUoC+1lNR2JTY1Q+vhXpuLmKMdVl2OMFLVbQ3cGkw jopejoe1"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPHns90pKP8pDOKM7ziCiG7ZjO3kFvScnbq7uBlUWG5H n0th1ng"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDA/2vtzv7k2eEm7aedvy6U+hWp9SfLsjRnyY5xraBc1 toxicity@Opeth"
];
};
fonts.packages = with pkgs; [
noto-fonts
];
home-manager = {
backupFileExtension = "backup";
users.c3terminal = {
home = {
username = config.users.users.c3terminal.name;
homeDirectory = config.users.users.c3terminal.home;
stateVersion = config.system.stateVersion;
sessionVariables = {
MOZ_ENABLE_WAYLAND = 1;
};
packages = with pkgs; [
git
];
};
wayland.windowManager.sway = {
enable = true;
config = {
startup = [
{
command = "firefox-esr --kiosk c3nav.de";
}
];
fonts = {
names = [ "Noto Sans" ];
style = "regular";
size = 30.0;
};
};
extraConfig = ''
set $ws1 c3nav
default_border none
'';
};
programs = {
firefox = {
enable = true;
package = pkgs.firefox-esr;
policies = {
SupportMenu = {
Title = "Config";
URL = "https://git.hamburg.ccc.de/jopejoe1/c3terminal";
};
Preferences = {
"browser.ssb.enabled" = lock true;
#"ui.osk.detected_physical_keyboard" = lock false;
#"browser.gesture.pinch.in" = lock false;
#"browser.gesture.pinch.out" = lock false;
"zoom.maxPercent" = lock 100;
"zoom.minPercent" = lock 100;
};
};
profiles = {
default = {
id = 0;
isDefault = true;
name = "default";
};
};
};
};
};
};
users.users.root = {
password = "test";
shell = lib.mkForce (lib.getExe pkgs.bash);
extraGroups = [
"wheel"
"networkmanager"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFZDUoC+1lNR2JTY1Q+vhXpuLmKMdVl2OMFLVbQ3cGkw jopejoe1"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPHns90pKP8pDOKM7ziCiG7ZjO3kFvScnbq7uBlUWG5H n0th1ng"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDA/2vtzv7k2eEm7aedvy6U+hWp9SfLsjRnyY5xraBc1 toxicity@Opeth"
];
};
boot = {
loader = {
grub = {
#enable = true;
};
efi = {
canTouchEfiVariables = true;
};
};
};
services = {
openssh = {
enable = true;
settings = {
PermitRootLogin = "no";
PasswordAuthentication = false;
};
};
xserver = {
enable = true;
xkb.layout = "de";
displayManager = {
defaultSession = "sway";
sessionData.autologinSession = "sway";
autoLogin = {
enable = true;
user = "c3terminal";
};
lightdm = {
greeter.enable = false;
enable = true;
};
};
};
};
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
};
nix = {
settings = {
substituters = lib.mkForce [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = lib.mkForce [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
sandbox = true;
require-sigs = true;
max-jobs = "auto";
allowed-users = [ "*" ];
trusted-users = [
"root"
];
experimental-features = [
"nix-command"
"flakes"
];
use-xdg-base-directories = true;
};
package = pkgs.lix;
};
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/sdb";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}