*: add config

This commit is contained in:
steveej 2015-10-23 01:26:53 +02:00
commit 80c42c7e45
22 changed files with 3229 additions and 0 deletions

View file

@ -0,0 +1,17 @@
{ config, lib, pkgs, ... }:
{
# Bootloader, initrd and Kernel
boot.loader.grub.enable = true;
boot.loader.grub.enableCryptodisk = true;
boot.loader.grub.version = 2;
# Workaround for nm-pptp
boot.kernelModules = [
"nf_conntrack_proto_gre"
"nf_conntrack_pptp"
];
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.tmpOnTmpfs = true;
}

View file

@ -0,0 +1,15 @@
# 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 = [
./hw.nix
./boot.nix
./system.nix
./pkg.nix
./user.nix
];
}

View file

@ -0,0 +1,60 @@
# 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, ... }:
{
nix.maxJobs = 2;
nix.buildCores = 4;
hardware.enableAllFirmware = true;
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "sd_mod" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" = { device = "/dev/disk/by-uuid/be9be32e-1fb0-45c3-9714-390ee2e6c184";
fsType = "btrfs";
options = [
"defaults"
"compress=lzo"
"discard"
"subvol=nixos"
];
};
fileSystems."/home" = { device = "/dev/disk/by-uuid/be9be32e-1fb0-45c3-9714-390ee2e6c184";
fsType = "btrfs";
options = [
"defaults"
"compress=lzo"
"discard"
"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 = "luksSSD2";
# device = "/dev/disk/by-partuuid/bbcb4838-1f05-4c1a-b014-947d2e536b14";
# preLVM = true;
# allowDiscards = true;
# } {
name = "luksSSD1";
device = "/dev/disk/by-uuid/2274dc28-7a48-4355-bc27-2d73f7a2744e";
preLVM = false;
allowDiscards = true;
}
];
}

View file

@ -0,0 +1,103 @@
{ config, pkgs, ... }:
{
nixpkgs.config = {
allowBroken = false;
packageOverrides = pkgs: rec {
goPackages = pkgs.go16Packages;
bluez = pkgs.bluez5;
#vimPlugins = pkgs.recurseIntoAttrs (pkgs.callPackage /home/steveej/src/github/NixOS/nixpkgs-systemsource/pkgs/misc/vim-plugins { });
linuxPackages = pkgs.linuxPackages_latest;
#pythonFull = pkgs.python27.buildEnv.override {
# extraLibs = with pkgs.pythonPackages; [];
#};
};
allowUnfree = true;
chromium = {
enablePepperFlash = true;
enablePepperPDF = true;
};
firefox = {
enableGoogleTalkPlugin = true;
enableAdobeFlash = false;
};
pidgin = {
openssl = true;
gnutls = true;
};
# TODO: implement support for this
# libvirt = {
# xenSupport = false;
# };
};
imports =
[
../common/pkg/default.nix
../common/pkg/neovim.nix
];
environment.systemPackages = with pkgs; [
androidsdk_4_4
nixops
ansible
gnupg
picocom
xfce.terminal
xorg.xbacklight
coreutils
lsof
xscreensaver
firefox-wrapper
chromium
qpdfview
thunderbird
pidgin
hexchat
skype
x2goclient
remmina
teamviewer
gnome3.dconf # needed by virtmanager
virtmanager
linuxPackages.virtualbox
x11_ssh_askpass
spotify
vlc
audacity
pavucontrol
gimp
inkscape
pdftk
rkt
iptables
nftables
iperf
pandoc
pythonFull
];
}

View file

@ -0,0 +1,140 @@
{ config, lib, pkgs, ... }:
{
nix.binaryCachePublicKeys = [ "hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=" ];
nix.binaryCaches = [
"https://cache.nixos.org"
"http://hydra.nixos.org"
];
nix.trustedBinaryCaches = [
"https://cache.nixos.org"
"http://hydra.nixos.org"
];
# The NixOS release to be compatible with for stateful data such as databases.
# system.stateVersion = "unstable";
networking.hostName = "steveej-laptop"; # Define your hostname.
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 = ''
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=" $BLUE\W/ $PROMPT_COLOR\\$ $NO_COLOR"
if test "$TERM" = "xterm"; then
PS1="\[\033]2;\h:\u:\w\007\]$PS1"
fi
fi
'';
};
# Package configuration
environment.systemPackages = with pkgs; [
xorg.xmodmap
];
environment.sessionVariables = {
EDITOR = "vim";
NIXPKGS_ALLOW_UNFREE = "1";
# Don't create .pyc files.
PYTHONDONTWRITEBYTECODE = "1";
};
environment.etc."lvm/lvm.conf".text = ''
devices {
issue_discards = 1
}
'';
# Fonts, I18N, Date ...
fonts = {
enableCoreFonts = true;
};
i18n = {
consoleFont = "lat9w-16";
defaultLocale = "en_US.UTF-8";
};
time.timeZone = "Europe/Berlin";
# Services
services.gpm.enable = true;
services.openssh.enable = true;
services.openssh.permitRootLogin = "yes";
services.teamviewer.enable = true;
services.printing.enable = true; # uses cups
services.xserver = {
synaptics.enable = true;
videoDrivers = [ "qxl" "intel" ];
enable = true;
layout = "us";
windowManager.qtile.enable = true;
windowManager.default = "qtile";
desktopManager = {
xterm.enable = false;
xfce.enable = true;
};
displayManager = {
slim = {
enable = true;
theme = /home/steveej/src/github/steveej/nixos-slim-theme;
# theme = pkgs.fetchurl {
# url = "mirror://sourceforge/project/slim.berlios/slim-rear-window.tar.gz";
# sha256 = "04cmwdgcvxd3srhwcnqmmfdj0avkql7570y14vv98zmnrh33f4hb";
# };
# autoLogin = {
# enable = true;
# user = "steveej";
# delay = 0;
# };
};
sessionCommands = ''
xscreensaver -no-splash &
${pkgs.networkmanagerapplet}/bin/nm-applet &
$(sleep 2; xmodmap /home/steveej/.Xmodmap) &
'';
};
};
services.udev.extraRules = ''
# OnePlusOne
ATTR{idVendor}=="05c6", ATTR{idProduct}=="6764", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"
ATTR{idVendor}=="05c6", ATTR{idProduct}=="6765", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"
'';
hardware = {
bluetooth.enable = true;
pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
support32Bit = true;
};
};
virtualisation.libvirtd.enable = true;
virtualisation.virtualbox.host.enable = true;
}

View file

@ -0,0 +1,23 @@
{ config, pkgs, ... }:
{
imports =
[
../common/user/root.nix
];
users.extraUsers.steveej = {
uid = 1000;
isNormalUser = true;
home = "/home/steveej";
extraGroups = [ "wheel" "libvirtd" "networkmanager" ];
hashedPassword = "removed";
};
users.extraUsers.steveej2 = {
uid = 1001;
isNormalUser = true;
home = "/home/steveej2";
extraGroups = [ "wheel" "libvirtd" ];
hashedPassword = "removed";
};
}