2023-02-11 00:08:58 +01: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’).
|
|
|
|
|
|
2023-02-12 23:33:57 +01:00
|
|
|
|
{ inputs, outputs, lib, pkgs, config, ... }:
|
2023-02-11 00:08:58 +01:00
|
|
|
|
|
|
|
|
|
{
|
2023-02-12 23:33:57 +01:00
|
|
|
|
imports = [
|
|
|
|
|
# Include the results of the hardware scan.
|
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
];
|
2023-02-11 00:08:58 +01:00
|
|
|
|
|
|
|
|
|
### Set boot options
|
|
|
|
|
boot = {
|
|
|
|
|
# Use the systemd-boot boot loader.
|
|
|
|
|
loader = {
|
|
|
|
|
systemd-boot.enable = true;
|
|
|
|
|
efi.canTouchEfiVariables = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Enable running aarch64 binaries using qemu
|
|
|
|
|
binfmt = {
|
|
|
|
|
emulatedSystems = [
|
|
|
|
|
"aarch64-linux"
|
|
|
|
|
"wasm32-wasi"
|
|
|
|
|
"x86_64-windows"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Clean temporary directory on boot
|
|
|
|
|
cleanTmpDir = true;
|
|
|
|
|
|
|
|
|
|
# Enable support for nfs and ntfs
|
|
|
|
|
supportedFilesystems = [
|
|
|
|
|
"cifs"
|
|
|
|
|
"ntfs"
|
|
|
|
|
"nfs"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
networking.hostName = "homix"; # Define your hostname.
|
|
|
|
|
### Pick only one of the below networking options.
|
|
|
|
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
|
|
|
# networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
|
|
|
|
|
|
|
|
|
### Set your time zone.
|
|
|
|
|
time.timeZone = "Europe/Sofia";
|
|
|
|
|
|
|
|
|
|
### Configure network proxy if necessary
|
|
|
|
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
|
|
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
|
|
|
|
|
|
|
|
### Select internationalisation properties.
|
|
|
|
|
# i18n.defaultLocale = "en_US.UTF-8";
|
|
|
|
|
# console = {
|
|
|
|
|
# font = "Lat2-Terminus16";
|
|
|
|
|
# keyMap = "us";
|
|
|
|
|
# useXkbConfig = true; # use xkbOptions in tty.
|
|
|
|
|
# };
|
|
|
|
|
|
|
|
|
|
nix = {
|
|
|
|
|
package = pkgs.nixFlakes;
|
2023-02-12 23:33:57 +01:00
|
|
|
|
|
|
|
|
|
# Enable flakes, the new `nix` commands and better support for flakes in it
|
2023-02-11 00:08:58 +01:00
|
|
|
|
extraOptions = ''
|
|
|
|
|
experimental-features = nix-command flakes repl-flake
|
|
|
|
|
'';
|
2023-02-12 23:33:57 +01:00
|
|
|
|
|
|
|
|
|
# This will add each flake input as a registry
|
|
|
|
|
# To make nix3 commands consistent with your flake
|
|
|
|
|
registry = lib.mapAttrs (_: value: { flake = value; }) inputs;
|
|
|
|
|
|
|
|
|
|
# This will additionally add your inputs to the system's legacy channels
|
|
|
|
|
# Making legacy nix commands consistent as well, awesome!
|
|
|
|
|
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
|
|
|
|
|
|
2023-02-11 00:08:58 +01:00
|
|
|
|
settings = {
|
|
|
|
|
trusted-users = [
|
|
|
|
|
"root"
|
|
|
|
|
"reo101"
|
|
|
|
|
];
|
2023-02-12 23:33:57 +01:00
|
|
|
|
|
|
|
|
|
# Add nix-community and rix101 cachix caches
|
2023-02-11 00:08:58 +01:00
|
|
|
|
substituters = [
|
|
|
|
|
"https://rix101.cachix.org"
|
|
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
|
];
|
|
|
|
|
trusted-public-keys = [
|
|
|
|
|
"rix101.cachix.org-1:2u9ZGi93zY3hJXQyoHkNBZpJK+GiXQyYf9J5TLzCpFY="
|
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-12 23:33:57 +01:00
|
|
|
|
nixpkgs = {
|
|
|
|
|
config = {
|
|
|
|
|
allowUnfree = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-02-11 00:08:58 +01:00
|
|
|
|
|
2023-02-21 22:31:38 +01:00
|
|
|
|
### Fonts
|
|
|
|
|
fonts.fontconfig.enable = true;
|
|
|
|
|
|
2023-02-11 00:08:58 +01:00
|
|
|
|
### NVIDIA
|
|
|
|
|
services.xserver = {
|
|
|
|
|
videoDrivers = [ "nvidia" ];
|
|
|
|
|
};
|
|
|
|
|
hardware.opengl.enable = true;
|
|
|
|
|
hardware.nvidia = {
|
|
|
|
|
open = true;
|
|
|
|
|
# powerManagement.enable = true;
|
|
|
|
|
modesetting.enable = true;
|
|
|
|
|
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
|
|
|
# package = config.boot.kernelPackages.nvidiaPackages.beta;
|
|
|
|
|
};
|
|
|
|
|
environment.sessionVariables = {
|
|
|
|
|
"_JAVA_AWT_WM_NONREPARENTING" = "1";
|
|
|
|
|
"LIBVA_DRIVER_NAME" = "nvidia";
|
|
|
|
|
"XDG_SESSION_TYPE" = "wayland";
|
|
|
|
|
"GBM_BACKEND" = "nvidia-drm";
|
|
|
|
|
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
|
|
|
|
|
"WLR_NO_HARDWARE_CURSORS" = "1";
|
|
|
|
|
"MOZ_DISABLE_RDD_SANDBOX" = "1";
|
|
|
|
|
"EGL_PLATFORM" = "wayland";
|
2023-02-17 01:46:09 +01:00
|
|
|
|
"XDG_CURRENT_DESKTOP" = "sway"; # river
|
2023-02-11 00:08:58 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
### Wayland specific
|
|
|
|
|
services.xserver = {
|
|
|
|
|
enable = true;
|
|
|
|
|
displayManager = {
|
|
|
|
|
defaultSession = "river";
|
|
|
|
|
sessionPackages = with pkgs; [
|
|
|
|
|
river
|
|
|
|
|
];
|
|
|
|
|
gdm = {
|
|
|
|
|
enable = true;
|
|
|
|
|
wayland = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-02-17 01:46:09 +01:00
|
|
|
|
# Enable desktop portal
|
|
|
|
|
xdg.portal.extraPortals = [
|
|
|
|
|
pkgs.xdg-desktop-portal-gtk
|
2023-03-06 17:29:53 +01:00
|
|
|
|
pkgs.xdg-desktop-portal-wlr
|
2023-02-17 01:46:09 +01:00
|
|
|
|
];
|
|
|
|
|
|
2023-02-11 00:08:58 +01:00
|
|
|
|
## X11 specific
|
|
|
|
|
services.xserver = {
|
|
|
|
|
layout = "us,bg";
|
|
|
|
|
xkbVariant = ",phonetic";
|
|
|
|
|
xkbOptions = "grp:lalt_lshift_toggle";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
### Enable the OpenSSH daemon.
|
|
|
|
|
services.openssh.enable = true;
|
|
|
|
|
|
|
|
|
|
### Enable CUPS to print documents.
|
|
|
|
|
# services.printing.enable = true;
|
|
|
|
|
|
|
|
|
|
### Enable sound.
|
|
|
|
|
security.rtkit.enable = true;
|
|
|
|
|
services.pipewire = {
|
|
|
|
|
enable = true;
|
|
|
|
|
alsa = {
|
|
|
|
|
enable = true;
|
|
|
|
|
support32Bit = true;
|
|
|
|
|
};
|
|
|
|
|
pulse = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
jack = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-02-17 01:46:09 +01:00
|
|
|
|
services.dbus = {
|
|
|
|
|
enable = true;
|
|
|
|
|
packages = [ pkgs.dconf ];
|
|
|
|
|
};
|
2023-02-11 00:08:58 +01:00
|
|
|
|
|
|
|
|
|
### 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.reo101 = {
|
|
|
|
|
isNormalUser = true;
|
|
|
|
|
shell = pkgs.zsh;
|
|
|
|
|
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
home-manager = {
|
|
|
|
|
backupFileExtension = "hm-bak";
|
|
|
|
|
useUserPackages = true;
|
|
|
|
|
useGlobalPkgs = false;
|
|
|
|
|
|
2023-02-12 23:33:57 +01:00
|
|
|
|
extraSpecialArgs = { inherit inputs outputs; };
|
2023-02-11 00:08:58 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
### Enable plymouth (bootscreen customizations)
|
2023-02-12 23:33:57 +01:00
|
|
|
|
boot.plymouth = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
2023-02-11 00:08:58 +01:00
|
|
|
|
|
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
|
# $ nix search wget
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
river
|
|
|
|
|
xdg-desktop-portal
|
2023-02-17 01:46:09 +01:00
|
|
|
|
xdg-desktop-portal-wlr
|
2023-02-11 00:08:58 +01:00
|
|
|
|
neovim
|
|
|
|
|
wget
|
|
|
|
|
git
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
### Jellyfin
|
2023-02-12 23:33:57 +01:00
|
|
|
|
reo101.jellyfin = {
|
|
|
|
|
enable = true;
|
2023-02-11 00:08:58 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
### Transmission
|
|
|
|
|
services.transmission = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Open ports in the firewall.
|
|
|
|
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
|
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
|
|
|
# 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. It‘s 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?
|
|
|
|
|
|
|
|
|
|
}
|