nom-nom-nix-gc/machines/framework.nix

259 lines
7.6 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ config, pkgs, lib, ... }:
let
myusers = import ../users.nix { inherit pkgs; };
sources = import ../nix/sources.nix { };
keys = import ../keys.nix { inherit lib; };
nixos-hardware = sources.nixos-hardware;
mypkgs = import ../packages.nix { inherit pkgs; };
in {
imports =
[
./framework-hardware-configuration.nix
../modules/core.nix
"${nixos-hardware}/framework/12th-gen-intel/default.nix"
"${sources.sops-nix}/modules/sops"
];
sops = {
defaultSopsFile = ../secrets/framework.yaml;
gnupg.sshKeyPaths = [ ];
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
secrets = {
vpn-extended-lan-key = {
mode = "0640";
owner = "root";
group = "systemd-network";
restartUnits = [ "systemd-networkd.service" ];
};
};
};
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Setup keyfile
boot.initrd.secrets = {
"/crypto_keyfile.bin" = null;
};
boot.initrd.systemd.enable = true;
home-manager.users.ninjatrappeur = {
home.stateVersion = "22.05";
home.file = {
".notmuch-config".source = ../raw-conf-files/email/notmuch-config;
".config/msmtp/config".source = ../raw-conf-files/email/msmtp;
};
};
# Enable swap on luks
boot.initrd.luks.devices."luks-e75004e9-b3a4-475d-95b0-1922fa2eb567".device = "/dev/disk/by-uuid/e75004e9-b3a4-475d-95b0-1922fa2eb567";
boot.initrd.luks.devices."luks-e75004e9-b3a4-475d-95b0-1922fa2eb567".keyFile = "/crypto_keyfile.bin";
networking = {
extraHosts = ''
10.25.3.41 gitlab.clearpath.ai gitlab.clearpathrobotics.com
10.25.3.105 hydra.clearpath.ai
10.25.0.169 jira.clearpathrobotics.com wiki.clearpathrobotics.com
10.26.3.91 prod-vm-devops-monitoring-01.clearpath.ai devops.clearpath.ai
10.25.3.101 jfrog.clearpathrobotics.com
10.25.3.105 prod-vm-hydra-main-01.clearpath.ai
10.25.3.241 prod-vm-hydra-worker-01.clearpath.ai
10.25.3.242 prod-vm-hydra-worker-02.clearpath.ai
10.25.11.150 prod-vm-hydra-02.clearpath.ai
10.26.3.91 prod-vm-devops-monitoring-01.clearpath.ai devops.clearpath.ai
'';
hostName = "framework";
domain = "alternativebit.fr";
wireguard.interfaces."wg-extended-lan" = {
privateKeyFile = config.sops.secrets.vpn-extended-lan-key.path;
ips = ["192.168.166.3"];
peers = [{
endpoint = "dundies.alternativebit.fr:51822";
publicKey = "ZdeqXN3Q8ZBPCWVW6pFzIBF3iS8zlVMGAj8bcePj3zk=";
allowedIPs = [
"192.168.166.1/32"
"192.168.1.0/24"
"192.168.20.0/24"
"192.168.21.0/24"
"10.25.0.0/16"
"10.26.0.0/16"
];
persistentKeepalive = 25;
}];
};
};
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "Europe/Paris";
i18n.extraLocaleSettings = {
LC_ADDRESS = "fr_FR.utf8";
LC_IDENTIFICATION = "fr_FR.utf8";
LC_MEASUREMENT = "fr_FR.utf8";
LC_MONETARY = "fr_FR.utf8";
LC_NAME = "fr_FR.utf8";
LC_NUMERIC = "fr_FR.utf8";
LC_PAPER = "fr_FR.utf8";
LC_TELEPHONE = "fr_FR.utf8";
LC_TIME = "fr_FR.utf8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager = {
sddm.enable = true;
defaultSession = "plasmawayland";
};
services.xserver.desktopManager.plasma5.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "fr";
xkbVariant = "bepo";
};
# Enable CUPS to print documents.
services.printing.enable = true;
services.nscd.enableNsncd = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
hardware.bluetooth.enable = true;
security.rtkit.enable = true;
services.syncthing = {
enable = true;
user = "ninjatrappeur";
dataDir = "/home/ninjatrappeur/.config/syncthing";
};
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.ninjatrappeur = {
isNormalUser = true;
description = "ninjatrappeur";
extraGroups = myusers.ninjatrappeur.extraGroups;
shell = myusers.ninjatrappeur.shell;
openssh.authorizedKeys.keys = lib.attrsets.attrValues keys.ninjatrappeur;
};
nix = {
settings = {
trusted-users = [ "root" "${myusers.ninjatrappeur.name}" ];
sandbox = true;
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
];
};
extraOptions = ''
builders-use-substitutes = true
experimental-features = nix-command flakes
'';
nixPath = [
"nixpkgs=${sources.nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
];
};
virtualisation.libvirtd.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages =
mypkgs.common ++ mypkgs.dev ++ mypkgs.media ++ mypkgs.graphic-apps ++ mypkgs.laptop ++ [
pkgs.element-desktop
pkgs.ninjatrappeur-pkgs.sync-mail
pkgs.notmuch
pkgs.niv
pkgs.virt-manager
# Bluetooth
pkgs.bluez
pkgs.bluedevil
pkgs.libsForQt5.bluez-qt.dev
pkgs.blueman
# Rust
pkgs.rustc
pkgs.cargo
pkgs.gcc
pkgs.rust-analyzer
pkgs.ninjatrappeur-pkgs.picobak
pkgs.carla
];
services.avahi.enable = true;
programs.zsh = {
enable = true;
ohMyZsh = {
enable = true;
theme = "af-magic";
};
autosuggestions.enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
interactiveShellInit = ''
eval "$(/run/current-system/sw/bin/direnv hook zsh)"
'';
};
# 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;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
networking.firewall.allowedUDPPorts = [ 5353 5000 8009 8000 8080 ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "22.05"; # Did you read the comment?
}