factorize os configurations

This commit is contained in:
ant 2025-09-01 22:37:33 +02:00
parent 8de0ba7158
commit 09b1feb204
7 changed files with 134 additions and 155 deletions

View file

@ -1,13 +1,14 @@
# Edit this conle to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, ... }:
let sshKeys = with (import ../sshKeys.nix); [
moon
];
in
{
imports = [
./hardware-configuration.nix
./common.nix
./common-graphics.nix
(import ./remote-disk-unlock.nix sshKeys)
];
boot.loader = {
@ -24,30 +25,30 @@
};
# unlock over ssh
boot.initrd = {
availableKernelModules = [ "igb" ];
network = {
enable = true;
udhcpc = {
enable = true;
extraArgs = [ "--background" "--retries" "1" ];
};
flushBeforeStage2 = true;
ssh = {
enable = true;
port = 22;
authorizedKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKCTCKcHgCZOlGeCEz0+HcoYMyXzFy3l3igsG+nhMC8Z ant@moon "
];
# hostKeys = [ "/etc/secrets/initrd/ssh_host_ed25519_key" ];
hostKeys = [ "/etc/ssh/ssh_host_ed25519_key" ];
};
postCommands = ''
# Automatically ask for the password on SSH login
echo 'cryptsetup-askpass || echo "Unlock was successful; exiting SSH session" && exit 1' >> /root/.profile
'';
};
};
# boot.initrd = {
# availableKernelModules = [ "igb" ];
# network = {
# enable = true;
# udhcpc = {
# enable = true;
# extraArgs = [ "--background" "--retries" "1" ];
# };
# flushBeforeStage2 = true;
# ssh = {
# enable = true;
# port = 22;
# authorizedKeys = [
# "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKCTCKcHgCZOlGeCEz0+HcoYMyXzFy3l3igsG+nhMC8Z ant@moon "
# ];
# # hostKeys = [ "/etc/secrets/initrd/ssh_host_ed25519_key" ];
# hostKeys = [ "/etc/ssh/ssh_host_ed25519_key" ];
# };
# postCommands = ''
# # Automatically ask for the password on SSH login
# echo 'cryptsetup-askpass || echo "Unlock was successful; exiting SSH session" && exit 1' >> /root/.profile
# '';
# };
# };
hardware.bluetooth.enable = true; # enables support for Bluetooth
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
@ -87,11 +88,6 @@
fsType = "ext4";
};
hardware.graphics = {
enable = true;
enable32Bit = true;
};
# NVIDIA
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
@ -110,8 +106,6 @@
openFirewall = true;
};
networking.firewall.enable = true;
virtualisation.docker = { enable = true; };
virtualisation.libvirtd.enable = true;
programs.virt-manager.enable = true;