Skip to content

Instantly share code, notes, and snippets.

Created April 2, 2017 23:55
Show Gist options
  • Save anonymous/3f57b9835f02cf40b4d42cfc185af7dd to your computer and use it in GitHub Desktop.
Save anonymous/3f57b9835f02cf40b4d42cfc185af7dd to your computer and use it in GitHub Desktop.
# 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
];
hardware.cpu.intel.updateMicrocode = true;
hardware.bluetooth.enable = true;
sound.enable = true;
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "amara"; # Define your hostname.
networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Select internationalisation properties.
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "us";
defaultLocale = "en_US.UTF-8";
};
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
wget
gitAndTools.gitFull
emacs
neovim
qutebrowser
ntfs3g
vifm
acpi
manpages
htop
udiskie
pcmanfm
arc-theme
arc-icon-theme
"qt5.qtwebengine"
lxappearance
source-sans-pro
i3blocks
unzip
unrar
feh
];
# Allow non-free
nixpkgs.config.allowUnfree = true;
# List services that you want to enable:
services.nixosManual.showManual = true;
# Set fish as default shell
programs.fish.enable =true;
users.defaultUserShell = "/run/current-system/sw/bin/fish";
# Create a systemd user service for emacs daemon. This is useful because
# systemd will take care of launching emacs in the background and I
# will just have to connect to it through emacs-client. This is a
# user service. This means I have to pass the "--user" option to
# systemd when I want to control the service.
systemd.user.services.emacs = {
description = "Emacs: the extensible, self-documenting text editor";
serviceConfig = {
Type = "forking";
ExecStart = "${pkgs.emacs}/bin/emacs --daemon";
ExecStop = "${pkgs.emacs}/bin/emacsclient --eval (kill-emacs)";
Restart = "always";
};
# I want the emacs service to be started with the rest of the user services
wantedBy = [ "default.target" ];
};
# 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;
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable the X11 windowing system.
services.xserver = {
libinput.enable = true;
libinput.disableWhileTyping = true;
libinput.tapping = true;
enable = true;
layout = "us";
xkbOptions = "terminate:ctrl_alt_bksp, ctrl:nocaps";
videoDrivers = [ "intel" ];
windowManager.i3.enable = true;
};
# TODO
# displayManager.sessionCommands = ''
# ${pkgs.xorg.xhost}/bin/xhost +SI:localuser:$USER
# '';
# };
# services.xserver.windowManager.exwm = {
# enable = true;
# enableDefaultConfig = false;
environment.variables = {
GTK_DATA_PREFIX = "/run/current-system/sw";
};
environment.pathsToLink = [
"/share"
];
services.xserver.displayManager.sessionCommands = ''
export GDK_PIXBUF_MODULE_FILE=`echo ${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/*/loaders.cache`
'';
nixpkgs.config.packageOverrides = pkgs: rec {
qt4 = pkgs.qt4.override {
gtkStyle = true;
};
qt5.base = pkgs.qt5.base.override {
gtkStyle = true;
};
};
# Define a user account. Don't forget to set a password with ‘passwd’.
users.extraUsers.taohansen = {
isNormalUser = true;
uid = 1000;
# users.extraGroups.wheel.gid = 0;
extraGroups = ["wheel" "disk" "audio" "cdrom" "video" "systemd-journal"];
};
security.sudo = {
enable = true;
wheelNeedsPassword = false;
};
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "17.09";
system.autoUpgrade.enable = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment