Skip to content

Instantly share code, notes, and snippets.

@bdashore3
Created June 29, 2021 15:19
Show Gist options
  • Save bdashore3/02d7000157fa4c26c70ba2bdd928632b to your computer and use it in GitHub Desktop.
Save bdashore3/02d7000157fa4c26c70ba2bdd928632b to your computer and use it in GitHub Desktop.
configuration.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 =
[
(fetchTarball "https://github.com/msteen/nixos-vsliveshare/tarball/master")
<home-manager/nixos>
# Include the results of the hardware scan.
./hardware-configuration.nix
];
swapDevices = [
{
device = "/swapfile";
priority = 100;
size = 20000;
}
];
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
intel-media-driver
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
extraPackages32 = with pkgs.pkgsi686Linux; [ vaapiIntel ];
};
hardware.pulseaudio.support32Bit = true;
# Use the GRUB boot loader.
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
grub = {
devices = [ "nodev" ];
efiSupport = true;
enable = true;
version = 2;
};
};
networking.hostName = "kingremote"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Set your time zone.
time.timeZone = "America/New_York";
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.wlp1s0.useDHCP = true;
# 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";
};
# Enable the GNOME 3 Desktop Environment using XORG.
services = {
xserver = {
enable = true;
displayManager.gdm.enable = true;
displayManager.gdm.wayland = false;
desktopManager.gnome3.enable = true;
};
vsliveshare = {
enable = true;
extensionsDir = "$HOME/.vscode/extensions";
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/61cc1f0dc07c2f786e0acfd07444548486f4153b";
};
dbus.packages = [ pkgs.gnome3.dconf ];
udev.packages = [
pkgs.gnome3.gnome-settings-daemon
pkgs.android-udev-rules
];
};
# Configure keymap in X11
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
nixpkgs.config = {
# Allow proprietary packages
allowUnfree = true;
# Unstable channel alias
packageOverrides = pkgs: {
# pass the nixpkgs config to the unstable alias # to ensure `allowUnfree = true;` is propagated:
unstable = import <nixos-unstable> {
config = config.nixpkgs.config;
};
};
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# System tools
flatpak
file
nano
htop
ffmpeg
bash-completion
wget
curl
tlp
unstable.pulseeffects
unzip
zip
# Base packages
firefox
git
vulkan-tools
pavucontrol
vlc
ffmpegthumbnailer
pgmanage
postgresql_12
# Gnome
gnome3.gnome-tweaks
chrome-gnome-shell
gnome3.networkmanagerapplet
gnome3.adwaita-icon-theme
gnome3.gnome-shell
gnome3.gnome-software
libappindicator-gtk3
];
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.kingbri = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "adbusers" ]; # Enable ‘sudo’ for the user.
packages = with pkgs; [
cmake
meson
gcc
gnumake
hicolor-icon-theme
gnome-icon-theme
binutils
clang-tools
rustup
rust-analyzer
discord
libreoffice
unstable.vscode-with-extensions
tdesktop
steam
youtubeDL
];
};
# Enable the firefox gnome shell extension
nixpkgs.config.firefox.enableGnomeExtensions = true;
services.gnome3.chrome-gnome-shell.enable = true;
services.tlp.enable = true;
services.pgmanage = {
enable = true;
connections = {
"local" = "hostaddr=127.0.0.1 port=5432 dbname=postgres";
};
};
services.postgresql = {
enable = true;
package = pkgs.postgresql_12;
enableTCPIP = true;
authentication = pkgs.lib.mkForce ''
# Generated file; do not edit!
# TYPE DATABASE USER ADDRESS METHOD
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
'';
};
# Fix microphone recording issues
hardware.pulseaudio.configFile = pkgs.runCommand "default.pa" {} ''
sed 's/module-udev-detect$/module-udev-detect tsched=0/' \
${pkgs.pulseaudio}/etc/pulse/default.pa > $out
'';
# Fix headphone channel reversal issues
hardware.pulseaudio.extraConfig = ''
load-module module-remap-sink sink_name=reverse-stereo master=0 channels=2 master_channel_map=front-right,front-left channel_map=front-left,front-right
set-default-sink reverse-stereo
'';
# 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.adb.enable = true;
# List services that you want to enable:
# 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;
# 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 = "20.09"; # Did you read the comment?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment