Nix-Configs/nixos.nix

197 lines
5.4 KiB
Nix
Raw Normal View History

2022-12-18 15:15:15 +00:00
# sudo nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware
# sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
2022-12-18 18:49:19 +00:00
let systemInformation = import ./system/system-information.nix; in
{ config, pkgs, lib, ... }:
2022-12-18 15:15:15 +00:00
{
2022-12-19 04:12:08 +00:00
networking.hostName = systemInformation.hostname;
2022-12-18 15:15:15 +00:00
imports =
[
2022-12-18 18:49:19 +00:00
./configs/filesystems.nix
./system/hardware-requirements.nix
2022-12-18 15:15:15 +00:00
<home-manager/nixos>
];
# Bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.kernelParams = [
# Power efficiency
# https://wiki.archlinux.org/title/Power_management#Kernel_parameters
"nmi_watchdog=0"
];
boot.kernel.sysctl = {
# Set IO batching to 2 minutes for power reasons
"vm.dirty_writeback_centisecs" = 12000;
};
2023-01-15 20:16:40 +00:00
boot.initrd.supportedFilesystems = [ "btrfs" ];
2022-12-18 15:15:15 +00:00
# Setup keyfile
boot.initrd.secrets = {
"/crypto_keyfile.bin" = null;
};
# Enable networking
networking.networkmanager.enable = true;
powerManagement.cpuFreqGovernor = "powersave";
2022-12-18 15:15:15 +00:00
# Set your time zone.
time.timeZone = "America/New_York";
# 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";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
services.logind.lidSwitch = "ignore";
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
2022-12-20 19:44:49 +00:00
services.xserver.desktopManager.gnome.enable = true;
2022-12-18 15:15:15 +00:00
# Configure keymap in X11
services.xserver = {
layout = "us";
xkbVariant = "3l";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# 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;
# 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;
};
# Define a user account. Don't forget to set a password with passwd.
users.users.ember = {
uid = 1312;
isNormalUser = true;
description = "Ember";
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.fish;
};
2022-12-18 20:10:45 +00:00
home-manager.users.ember = import ./configs/home.full.nix;
2022-12-18 15:15:15 +00:00
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
2022-12-18 15:15:15 +00:00
# List packages installed in system profile. To search, run:
environment.systemPackages = with pkgs; [
wget
gnumake
htop
wl-clipboard
unzip
vlc
2022-12-18 15:18:35 +00:00
file
2022-12-30 16:30:13 +00:00
pavucontrol
2022-12-18 15:15:15 +00:00
gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-libav gst_all_1.gst-vaapi gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-good gst_all_1.gst-plugins-ugly
];
environment.gnome.excludePackages = with pkgs.gnome; [
gnome-terminal
gnome-music
gedit
geary
totem
];
# List services that you want to enable:
services = {
flatpak = {
enable = true;
};
fwupd.enable = true;
syncthing = {
enable = true;
2022-12-19 17:25:25 +00:00
dataDir = "/home/ember";
configDir = "/home/ember/.config/syncthing";
user = "ember";
2022-12-19 17:25:25 +00:00
devices = {
2023-01-15 20:16:20 +00:00
redwood.name = "🍂 Redwood";
redwood.id =
"WY2GFMX-CQ52VBK-M3Y4JJH-4FIA6F2-NGB3S2I-SJ42D45-7FT77KH-2OGO2AZ";
2022-12-19 17:25:25 +00:00
mugwort.name = "🌿 Mugwort";
mugwort.id =
"GVJZF4E-5BYFG7U-P6KZPLL-CSM3O3H-JOJUZIX-YGZ3QXM-CHWTA4J-AG6KFQK";
kudzu.name = "🥦 Kudzu";
kudzu.id =
"RQUVE3L-D345NMM-4KUE7D6-PCJ3HIO-VFZNYJ6-BNF2YH3-6UBCXF7-NS5YKQR";
};
overrideDevices = true;
};
2022-12-18 15:15:15 +00:00
};
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
networking.firewall.enable = false;
networking.hosts = {
"162.255.119.254" = ["www.librepunk.club"];
"129.21.49.69" = ["www.librepunk.club"];
};
# 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.11"; # Did you read the comment?
# Set up hardware acceleration
# https://nixos.wiki/wiki/Accelerated_Video_Playback
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-compute-runtime
intel-media-driver # LIBVA_DRIVER_NAME=iHD
vaapiIntel # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
vaapiVdpau
libvdpau-va-gl
];
};
hardware.enableAllFirmware = true;
hardware.cpu.intel.updateMicrocode = systemInformation.isIntel;
2023-01-15 20:17:21 +00:00
hardware.cpu.amd.updateMicrocode = systemInformation.isAmd;
# high-resolution display
hardware.video.hidpi.enable = systemInformation.isHiDPI;
}