stevee-laptop2: init

This commit is contained in:
steveej 2016-10-05 19:01:40 +02:00
parent 391763982d
commit 220ee4f7fe
2 changed files with 221 additions and 0 deletions

View file

@ -0,0 +1,150 @@
# 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, ... }:
{
nixpkgs.config.allowUnfree = true;
nix.binaryCachePublicKeys = [ "hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=" ];
nix.binaryCaches = [
"https://cache.nixos.org"
"https://hydra.nixos.org"
];
nix.trustedBinaryCaches = [
"https://cache.nixos.org"
"https://hydra.nixos.org"
];
nix.daemonNiceLevel = 19;
nix.daemonIONiceLevel = 7;
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
networking.hostName = "steveej-laptop2"; # Define your hostname.
fonts = {
enableCoreFonts = true;
};
i18n = {
defaultLocale = "en_US.UTF-8";
};
# Set your time zone.
time.timeZone = "Europe/Amsterdam";
networking.firewall.enable = false;
networking.networkmanager = {
enable = true;
unmanaged = [
"interface-name:veth*"
"interface-name:virbr*"
"interface-name:br*"
"interface-name:*vbox*"
"interface-name:*cni*"
];
};
programs.bash = {
enableCompletion = true;
promptInit = ''
function exitstatus() {
if [[ $? -eq 0 ]]; then
printf ''
else
printf ''
fi
}
function nixshellEval {
if [[ "$1" != "" ]]; then
printf "»$1« "
fi
}
function setPS1 {
if test "$TERM" != "dumb"; then
# Provide a nice prompt.
BLUE="\[\033[0;34m\]"
RED="\[\033[1;31m\]"
GREEN="\[\033[1;32m\]"
NO_COLOR="\[\033[0m\]"
PROMPT_COLOR=$RED
let $UID && PROMPT_COLOR=$GREEN
PS1="$PROMPT_COLOR\u$NO_COLOR@\h \$(exitstatus) \$(nixshellEval $1)$BLUE\w$NO_COLOR\n$PROMPT_COLOR\\$ $NO_COLOR"
if test "$TERM" = "xterm"; then
PS1="\[\033]2;\h:\u:\w\007\]$PS1"
fi
fi
}
setPS1
'';
};
services.xserver = {
libinput.enable = true;
libinput.naturalScrolling = true;
videoDrivers = [ "qxl" "intel" ];
enable = true;
layout = "us";
windowManager.qtile.enable = true;
desktopManager = {
xterm.enable = false;
gnome3.enable = true;
};
displayManager = {
slim = {
enable = true;
theme = pkgs.fetchFromGitHub {
owner = "steveej";
repo = "nixos-slim-theme";
rev = "eec04a624113db835f2b5960d305e242da9dbc2a";
sha256 = "146zmr5rzwxq5mz6b7108a3ksf3nvqxrr8bvi82jsw6xqji4i5f5";
};
autoLogin = false;
defaultUser = "steveej";
};
# sessionCommands = ''
# xscreensaver -no-splash &
# ${pkgs.networkmanagerapplet}/bin/nm-applet &
# $(sleep 2; xmodmap /home/steveej/.Xmodmap) &
# '';
};
};
users.mutableUsers = false;
users.extraUsers.root = {
hashedPassword = "removed";
openssh.authorizedKeys.keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3niN5KcIYikRhXTYZCSehI1ZQs+vvG/dZ7KxNVHslfsS+p1yTycXcZFtDDn5vtG2fAo3yksxCk+G10/AWQ+NMOcFKuAi5qTOYSLbEcHVlZ4ko8sDUe3fF79vrCqY7IWbKKjZ4DH77Qs6SXk5GIlNaIzxut8Dpv8qHnkPiPuFgrJC4oGk60ZKmCPvOEpgg9twcdI6ykIxD4Fg+hHgG1p07uSEcm9EADli8RsU3UJ1UBhXMohMC6HrKVBkBX9wTo+zY+xqXxxem6xGNnkNiZLACfhCnjXv39zh85pgFuNv7R8SzVZQ9iRoCmax/w3JtWdDjqoTGgLfJyhMMjNdjVHOx steveej@steveej-laptop"];
};
users.extraUsers.steveej = {
uid = 1000;
isNormalUser = true;
home = "/home/steveej";
extraGroups = [ "wheel" "libvirtd" "networkmanager" "vboxusers" ];
hashedPassword = "removed";
};
services.gpm.enable = true;
services.openssh.enable = true;
services.openssh.permitRootLogin = "yes";
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
xorg.xmodmap
wget
vim
roxterm
];
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "16.09";
}

View file

@ -0,0 +1,71 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
boot.initrd.availableKernelModules = [
"xhci_pci" "ehci_pci" "ahci" "usbhid" "sd_mod"
];
boot.kernelModules = [
"nf_conntrack_proto_gre"
"nf_conntrack_pptp"
"kvm-intel"
];
boot.extraModulePackages = [ ];
nix.maxJobs = lib.mkDefault 2;
nix.buildCores = 2;
boot.kernelPackages = pkgs.linuxPackages_latest;
# Bootloader, initrd and Kernel
boot.loader.grub.enable = true;
boot.loader.grub.enableCryptodisk = true;
boot.loader.grub.version = 2;
# Workaround for nm-pptp
boot.tmpOnTmpfs = true;
hardware.enableAllFirmware = true;
hardware.trackpoint.emulateWheel = true;
fileSystems."/" = { device = "/dev/disk/by-uuid/c428a7e0-cd80-4ae7-90fb-530a9676278e";
fsType = "btrfs";
options = [
"defaults"
"compress=lzo"
"subvol=nixos"
];
};
fileSystems."/home" = { device = "/dev/disk/by-uuid/c428a7e0-cd80-4ae7-90fb-530a9676278e";
fsType = "btrfs";
options = [
"defaults"
"compress=lzo"
"subvol=home"
];
};
fileSystems."/var/lib/rkt" = {
fsType = "tmpfs";
};
fileSystems."/var/lib/cni" = {
fsType = "tmpfs";
};
swapDevices = [ ];
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sda";
boot.initrd.luks.devices = [ {
name = "luksroot";
device = "/dev/disk/by-uuid/4ac7f8ba-4dea-41e8-99ea-b794aace24a1";
preLVM = false;
allowDiscards = true;
}
];
}