210 lines
5.0 KiB
Nix
210 lines
5.0 KiB
Nix
# Edit this configuration file 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, ... }:
|
||
|
||
{
|
||
imports =
|
||
[ # Include the results of the hardware scan.
|
||
<nixpkgs/nixos/modules/services/hardware/sane_extra_backends/brscan4.nix>
|
||
./hardware-configuration.nix
|
||
./services.nix
|
||
./packages.nix
|
||
# ./vpn.nix
|
||
# ./VPN.nix
|
||
../modules/prometheus-node.nix
|
||
../modules/syncthing.nix
|
||
];
|
||
|
||
# Use the systemd-boot EFI boot loader.
|
||
boot.loader = {
|
||
systemd-boot.enable = true;
|
||
efi.canTouchEfiVariables = true;
|
||
};
|
||
|
||
programs = {
|
||
htop = {
|
||
enable = true;
|
||
settings.show_cpu_temperature = 1;
|
||
};
|
||
fish = {
|
||
enable = true;
|
||
interactiveShellInit = ''
|
||
set -gx EDITOR nvim
|
||
'';
|
||
shellAliases = {
|
||
ll = "ls -l";
|
||
ls = "lsd";
|
||
cat = "bat";
|
||
sysrs = "sudo nixos-rebuild switch";
|
||
sysup = "sudo nixos-rebuild switch --upgrade";
|
||
sysclean = "sudo nix-collect-garbage -d; and sudo nix-store --optimise";
|
||
nvim = "nvim -u ~/.config/nvim/init.lua";
|
||
};
|
||
};
|
||
ssh = {
|
||
setXAuthLocation = true;
|
||
forwardX11 = true;
|
||
};
|
||
};
|
||
sound.enable = true;
|
||
# hardware
|
||
hardware = {
|
||
logitech = {
|
||
wireless.enable = true;
|
||
wireless.enableGraphical = true;
|
||
};
|
||
pulseaudio = {
|
||
enable = true;
|
||
extraConfig =''
|
||
load-module module-switch-on-connect
|
||
extraModules = [ pkgs.pulseaudio-modules-bt ];
|
||
'';
|
||
package = pkgs.pulseaudioFull;
|
||
};
|
||
sane = {
|
||
enable = true;
|
||
brscan4 = {
|
||
enable = true;
|
||
};
|
||
dsseries = {
|
||
enable = true;
|
||
};
|
||
};
|
||
bluetooth = {
|
||
enable = true;
|
||
settings = {
|
||
General = {
|
||
Enable = "Source,Sink,Media,Socket";
|
||
};
|
||
};
|
||
};
|
||
opengl = {
|
||
enable = true;
|
||
extraPackages = with pkgs; [
|
||
intel-media-driver # LIBVA_DRIVER_NAME=iHD
|
||
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
|
||
vaapiVdpau
|
||
libvdpau-va-gl
|
||
];
|
||
};
|
||
};
|
||
|
||
# Video acceleration
|
||
nixpkgs.config.packageOverrides = pkgs: {
|
||
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
|
||
};
|
||
|
||
security = {
|
||
apparmor.enable = true;
|
||
pam = {
|
||
u2f = {
|
||
enable = true;
|
||
control = "requisite";
|
||
};
|
||
services = {
|
||
login.u2fAuth = true;
|
||
lightdm.u2fAuth = true;
|
||
};
|
||
};
|
||
};
|
||
|
||
networking.hostName = "Alexos"; # Define your hostname.
|
||
|
||
# Set your time zone.
|
||
time.timeZone = "Europe/Paris";
|
||
|
||
networking = {
|
||
dhcpcd.enable = true;
|
||
networkmanager = {
|
||
enable = true;
|
||
unmanaged = [ "interface-name:ve-*" ];
|
||
};
|
||
firewall = {
|
||
enable = true;
|
||
allowedTCPPorts = [ 24800 6600 1194 ];
|
||
allowedTCPPortRanges = [
|
||
{ from = 1714; to = 1764; } # KDE Connect
|
||
];
|
||
allowedUDPPortRanges = [
|
||
{ from = 1714; to = 1764; } # KDE Connect
|
||
];
|
||
};
|
||
};
|
||
|
||
i18n.defaultLocale = "fr_FR.UTF-8";
|
||
console = {
|
||
font = "Lat2-Terminus16";
|
||
keyMap = "fr";
|
||
};
|
||
|
||
fonts = {
|
||
fontDir.enable = true;
|
||
enableGhostscriptFonts = true;
|
||
fonts = with pkgs; [
|
||
corefonts
|
||
vistafonts
|
||
powerline-fonts
|
||
inconsolata
|
||
terminus_font
|
||
proggyfonts
|
||
dejavu_fonts
|
||
font-awesome
|
||
nerdfonts
|
||
source-code-pro
|
||
source-sans-pro
|
||
source-serif-pro
|
||
iosevka
|
||
roboto-mono
|
||
fira-code
|
||
];
|
||
};
|
||
|
||
nix.settings.auto-optimise-store = true;
|
||
nix.gc = {
|
||
automatic = true;
|
||
dates = "weekly";
|
||
persistent = true;
|
||
options = "--delete-older-than 10d";
|
||
};
|
||
|
||
# clean /tmp at boot
|
||
boot.tmp.cleanOnBoot = true;
|
||
|
||
nixpkgs.config = {
|
||
allowUnfree = true;
|
||
};
|
||
|
||
system.stateVersion = "21.05"; # Did you read the comment?
|
||
|
||
environment.variables = {
|
||
EDITOR = "nvim";
|
||
BROWSER = "firefox";
|
||
LESS = "--quit-if-one-screen --RAW-CONTROL-CHARS";
|
||
TERMINAL = "xfce4-terminal";
|
||
PRIVATE_BROWSER = "firefox -private";
|
||
};
|
||
|
||
users = {
|
||
users.ntp.group = "ntp";
|
||
groups.ntp = {};
|
||
defaultUserShell = "/run/current-system/sw/bin/fish";
|
||
extraUsers.oem = {
|
||
isNormalUser = true;
|
||
home = "/home/oem";
|
||
description = "oem";
|
||
extraGroups = [ "wheel" "networkmanager" "plocate" ];
|
||
hashedPassword = "$6$TWZqEbF3s7f4Yx8s$xsUheHLM75u1IdvD/6AWnk9c8El2FgGiU5C4mnZddWl8hFaGF2nPojHqvj2l7muJwQ6c8f7A4MRpAKh7PezuN/";
|
||
};
|
||
extraUsers.alexandre = {
|
||
isNormalUser = true;
|
||
home = "/home/alexandre";
|
||
description = "alexandre";
|
||
extraGroups = [ "wheel" "networkmanager" "docker" "libvirtd" "qemu-libvirtd" "vboxusers" "scanner" "lp" "plocate" ];
|
||
hashedPassword = "$6$7m77oPQxa$W9YnRLo1X2eqztBHwpoH8diHGkBno5O39AMyL9Qm8y8I6uW63H2Nwx4p239OG5zhOxA8J1lZvHTQ3hKPSP9mT/";
|
||
};
|
||
};
|
||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||
}
|