factorize os configurations
This commit is contained in:
parent
8de0ba7158
commit
09b1feb204
7 changed files with 134 additions and 155 deletions
|
|
@ -1,78 +1,41 @@
|
|||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
sshKeys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAM15boHYClgaBXAIyWSjbJd3W/bwcIE6YZwLu/K+Ipp ant@nixos"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKCTCKcHgCZOlGeCEz0+HcoYMyXzFy3l3igsG+nhMC8Z ant@moon"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB5zrLxiyG6T5eupXT/wqhvtt8Cuak4DtPEzCyksqa1a ant@allegro"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKt6WkeBNowTOqSv1GAvTSIMReaMDvltOKGpUC2jStGG ant@hs"
|
||||
sshKeys = with (import ../../sshKeys.nix); [
|
||||
basado
|
||||
moon
|
||||
allegro
|
||||
hs
|
||||
];
|
||||
domain = "antoinev.freeboxos.fr";
|
||||
# ./ssh/authorized_keys_root;
|
||||
in {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./syncthing.nix
|
||||
./disks.nix
|
||||
./backup.nix
|
||||
../common.nix
|
||||
(import ../remote-disk-unlock.nix sshKeys)
|
||||
];
|
||||
|
||||
nix.settings = { experimental-features = [ "nix-command" "flakes" ]; };
|
||||
|
||||
boot.kernelParams = [ "ip=dhcp" ];
|
||||
boot = {
|
||||
loader.systemd-boot.enable = true;
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
initrd = {
|
||||
availableKernelModules = [ "r8169" ];
|
||||
network = {
|
||||
enable = true;
|
||||
ssh = {
|
||||
enable = true;
|
||||
port = 22;
|
||||
authorizedKeys = sshKeys;
|
||||
hostKeys = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
shell = "/bin/cryptsetup-askpass";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
hardware = {
|
||||
graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
extraPackages = with pkgs; [ nvidia-vaapi-driver ];
|
||||
};
|
||||
nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_535;
|
||||
};
|
||||
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
extraPackages = with pkgs; [ nvidia-vaapi-driver ];
|
||||
|
||||
};
|
||||
|
||||
hardware.nvidia.package =
|
||||
config.boot.kernelPackages.nvidiaPackages.legacy_535;
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
networking.hostName = "hs"; # Define your hostname.
|
||||
networking.networkmanager.enable = true;
|
||||
networking.domain = domain;
|
||||
|
||||
time.timeZone = "Europe/Paris";
|
||||
i18n.defaultLocale = "fr_FR.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
LC_ADDRESS = "fr_FR.UTF-8";
|
||||
LC_IDENTIFICATION = "fr_FR.UTF-8";
|
||||
LC_MEASUREMENT = "fr_FR.UTF-8";
|
||||
LC_MONETARY = "fr_FR.UTF-8";
|
||||
LC_NAME = "fr_FR.UTF-8";
|
||||
LC_NUMERIC = "fr_FR.UTF-8";
|
||||
LC_PAPER = "fr_FR.UTF-8";
|
||||
LC_TELEPHONE = "fr_FR.UTF-8";
|
||||
LC_TIME = "fr_FR.UTF-8";
|
||||
};
|
||||
services.xserver.xkb = {
|
||||
layout = "fr";
|
||||
variant = "";
|
||||
};
|
||||
console.keyMap = "fr";
|
||||
|
||||
users.users.ant = {
|
||||
isNormalUser = true;
|
||||
description = "ant";
|
||||
|
|
@ -88,30 +51,10 @@ in {
|
|||
nixpkgs.config.allowUnfree = true;
|
||||
environment.systemPackages = with pkgs; [ neovim tmux nh git curl wget htop ];
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
# programs.gnupg.agent = {
|
||||
# enable = true;
|
||||
# enableSSHSupport = true;
|
||||
# };
|
||||
|
||||
# List services that you want to enable:
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings.PasswordAuthentication = false;
|
||||
};
|
||||
users.users.root.openssh.authorizedKeys.keys = sshKeys;
|
||||
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
set -gx fish_greeting
|
||||
'';
|
||||
};
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
|
||||
# Open ports in the firewall.
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
|
|
@ -120,11 +63,8 @@ in {
|
|||
25565
|
||||
];
|
||||
networking.firewall.allowedUDPPorts = [ 25565 ];
|
||||
# Or disable the firewall altogether.
|
||||
# networking.firewall.enable = false;
|
||||
|
||||
networking.interfaces.enp10s0.wakeOnLan.enable = true;
|
||||
|
||||
systemd.services.ragnamod = {
|
||||
enable = false;
|
||||
after = [ "network.target" ];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue