nix/laptop/configuration.nix

179 lines
4.4 KiB
Nix
Raw Normal View History

2023-06-29 14:00:39 +02:00
# 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.
./hardware-configuration.nix
];
2023-06-29 08:32:19 +02:00
2023-06-29 14:00:39 +02:00
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Plymouth splash screen
boot.plymouth.enable = true;
2023-06-29 08:32:19 +02:00
2023-06-29 14:00:39 +02:00
# Setup keyfile
boot.initrd.secrets = {
"/crypto_keyfile.bin" = null;
2023-06-29 08:32:19 +02:00
};
2023-06-29 14:00:39 +02:00
# Plymouth troubleshooting
boot.initrd.systemd.enable = true;
boot.kernelParams = ["quiet"];
2023-06-29 08:32:19 +02:00
2023-06-29 14:00:39 +02:00
# Enable swap on luks
boot.initrd.luks.devices."luks-9704447e-6bd0-4a35-9c24-20cbab81c431".device = "/dev/disk/by-uuid/9704447e-6bd0-4a35-9c24-20cbab81c431";
boot.initrd.luks.devices."luks-9704447e-6bd0-4a35-9c24-20cbab81c431".keyFile = "/crypto_keyfile.bin";
# Enable networking
2023-06-29 08:32:19 +02:00
networking = {
2023-06-29 14:00:39 +02:00
hostName = "nixos-p1";
networkmanager = {
2023-06-29 08:32:19 +02:00
enable = true;
};
2023-06-29 14:00:39 +02:00
enableIPv6 = false;
firewall = {
2023-06-29 08:32:19 +02:00
enable = true;
2023-06-29 14:00:39 +02:00
allowedTCPPorts = [ 22 ];
allowedUDPPorts = [ ];
2023-06-29 08:32:19 +02:00
};
};
2023-06-29 14:00:39 +02:00
# Set your time zone.
time.timeZone = "Asia/Tokyo";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_US.UTF-8";
LC_IDENTIFICATION = "en_US.UTF-8";
LC_MEASUREMENT = "en_US.UTF-8";
LC_MONETARY = "en_US.UTF-8";
LC_NAME = "en_US.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "en_US.UTF-8";
LC_TELEPHONE = "en_US.UTF-8";
LC_TIME = "en_US.UTF-8";
2023-06-29 08:32:19 +02:00
};
2023-06-29 14:00:39 +02:00
# Configure the fingerprint reader
services.fprintd = {
enable = true;
tod.enable = true;
tod.driver = pkgs.libfprint-2-tod1-vfs0090;
};
# Configure keymap in X11
services.xserver = {
enable = true;
layout = "us";
xkbVariant = "";
libinput = {
2023-06-29 08:32:19 +02:00
enable = true;
2023-06-29 14:00:39 +02:00
touchpad.tapping = true;
2023-06-29 08:32:19 +02:00
};
2023-06-29 14:00:39 +02:00
# Enable the GNOME Desktop Environment.
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
# Enable nVidia drivers
videoDrivers = [ "nvidia" ];
autorun = true;
2023-06-29 08:32:19 +02:00
};
2023-06-29 14:00:39 +02:00
# Set Gnome settings:
services.gnome = {
games.enable = false;
core-utilities.enable = true;
2023-06-29 08:32:19 +02:00
};
2023-06-29 14:00:39 +02:00
# https://nixos.wiki/wiki/GNOME
environment.gnome.excludePackages = (with pkgs; [
gnome.cheese
gnome.gnome-music
gnome.epiphany
gnome.geary
gnome.totem
gnome.gnome-characters
gnome-tour
gnome.gnome-maps
]);
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
2023-06-29 08:32:19 +02:00
2023-06-29 14:00:39 +02:00
# Define a user account. Don't forget to set a password with passwd.
users.users.albert = {
isNormalUser = true;
description = "Albert J. Copeland";
extraGroups = [ "networkmanager" "wheel" ];
packages = with pkgs; [
firefox
bitwarden
steam
lutris
vlc
2023-06-29 08:32:19 +02:00
];
};
2023-06-29 14:00:39 +02:00
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# Secureboot
sbctl
# Fingerprint Reader
fprintd
# General packages
wget
vim
git
curl
htop
iftop
nload
iotop
glxinfo
tailscale
# Gnome Extensions / Packages
gnomeExtensions.dash-to-dock
gnomeExtensions.blur-my-shell
gnomeExtensions.vitals
gnomeExtensions.user-themes
gnomeExtensions.caffeine
gnome3.gnome-tweaks
];
# Enable the OpenSSH daemon and Tailscale.
services.openssh.enable = true;
services.tailscale.enable = true;
# Enable nVidia drivers:
hardware.nvidia = {
2023-06-29 08:32:19 +02:00
};
2023-06-29 14:00:39 +02:00
# 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 = "unstable"; # Did you read the comment?
2023-06-29 08:32:19 +02:00
}