feat(framework): initial Framework setup

This commit is contained in:
Pierre Martin
2022-09-02 01:26:16 +02:00
parent 0e66175517
commit b011686173
3 changed files with 166 additions and 118 deletions

View File

@@ -6,88 +6,104 @@
{
imports =
[
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./framework.nix
<home-manager/nixos>
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
# boot.loader.grub.efiSupport = true;
# boot.loader.grub.efiInstallAsRemovable = true;
# boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/nvme0n1"; # or "nodev" for efi only
# Perso only ? (and comment grub.enable / version above)
# boot.loader.systemd-boot.enable = true;
# boot.loader.efi.canTouchEfiVariables = true;
boot.cleanTmpDir = true;
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
networking.hostName = "pierre"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Gnome is forcing us to use networkManager https://nixos.org/nixos/manual/index.html#sec-networkmanager
# 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;
networking.extraHosts = "
";
hardware.bluetooth.enable = true;
# see https://nixos.wiki/wiki/Bluetooth#Enabling_A2DP_Sink
hardware.bluetooth.settings = {
General = {
Enable = "Source,Sink,Media,Socket";
MultiProfile = "multiple";
AutoEnable = true;
};
};
hardware.trackpoint.enable = true;
hardware.trackpoint.emulateWheel = true;
hardware.trackpoint.speed = 250;
hardware.trackpoint.sensitivity = 150;
# Select internationalisation properties.
console.keyMap = "fr-bepo";
# Set your time zone.
time.timeZone = "Europe/Paris";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.utf8";
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";
};
# Configure keymap in X11
services.xserver = {
enable = true;
layout = "fr";
xkbVariant = "bepo";
displayManager = {
defaultSession = "none+i3";
};
windowManager = {
i3 = {
enable = true;
};
};
# videoDrivers = [ "intel" "nvidia" ];
};
# Configure console keymap
console.keyMap = "fr";
# Define a user account. Don't forget to set a password with passwd.
users.users.pierre = {
isNormalUser = true;
description = "Pierre";
extraGroups = [ "networkmanager" "wheel" "audio" "docker" "video" ];
shell = pkgs.zsh;
packages = with pkgs; [];
};
home-manager.users.pierre = import /home/pierre/dotfiles/home.nix;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
thunderbolt
wpa_supplicant
#wpa_supplicant_gui
gitAndTools.gitFull
docker
firefox
unbound
# Yubikey
libu2f-host
yubikey-manager
yubikey-personalization-gui
pcsclite
# Basics
docker
gitAndTools.gitFull
vim
# Sound
blueman
bluez-tools
];
nix.settings.auto-optimise-store = true;
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
# Specific configuration
environment.pathsToLink = [ "/share/zsh" ];
virtualisation.docker.enable = true;
# 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; };
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
programs.zsh.enable = true; # see https://github.com/NixOS/nixpkgs/issues/20548#issuecomment-261965667
programs.light.enable = true;
@@ -99,68 +115,21 @@
services.gnome.gnome-keyring.enable = true; # see https://nixos.wiki/wiki/Visual_Studio_Code#Error_after_Sign_On
services.blueman.enable = true;
services.clamav.daemon.enable = true;
services.clamav.updater.enable = true;
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
virtualisation.docker.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Doc: https://nixos.org/manual/nixos/stable/index.html#sec-firewall
networking.firewall.enable = true;
# Enable CUPS to print documents.
nixpkgs.config.allowUnfree = true;
services.printing.enable = true;
services.printing.drivers = [
pkgs.hplip
pkgs.gutenprint
];
# Enable sound.
sound.enable = true;
hardware.pulseaudio = {
enable = true;
# NixOS allows either a lightweight build (default) or full build of PulseAudio to be installed.
# Only the full build has Bluetooth support, so it must be selected here.
package = pkgs.pulseaudioFull;
# see https://nixos.wiki/wiki/Bluetooth#Managing_audio_devices
extraConfig = "
load-module module-switch-on-connect
";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
services.xserver.layout = "fr";
services.xserver.xkbVariant = "bepo";
# services.xserver.xkbOptions = "eurosign:e";
# Enable touchpad support.
services.xserver.libinput.enable = true;
services.xserver.videoDriver = "modesetting"; # to prevent "xrandr: Configure crtc 1 failed" issues
services.xserver.displayManager.gdm.wayland = false;
services.xserver.windowManager.i3.enable = true;
# See https://nixos.wiki/wiki/Yubikey
services.udev.packages = [ pkgs.yubikey-personalization pkgs.libu2f-host ];
services.pcscd.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.pierre = {
isNormalUser = true;
uid = 1000;
home = "/home/pierre";
shell = pkgs.zsh;
extraGroups = [ "audio" "wheel" "networkmanager" "docker" "video" ];
};
system.autoUpgrade.enable = true;
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "18.09"; # Did you read the comment?
# 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?
}