*: mv {,nixos}-configuration, restructure vim pkgs

This commit is contained in:
steveej 2016-11-17 20:40:45 +01:00
parent 24ad0d3bc0
commit 927d3930a2
24 changed files with 338 additions and 531 deletions

View file

@ -0,0 +1,19 @@
{ config, lib, pkgs, ... }:
{
boot.kernelPackages = pkgs.linuxPackages_latest;
#boot.kernelPackages = pkgs.myLinuxPackages;
# 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.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 = [
./pkg.nix
./hw.nix
./system.nix
./user.nix
./boot.nix
];
}

View file

@ -0,0 +1,56 @@
# 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;
hardware.trackpoint.emulateWheel = 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 = "luksSSD1";
device = "/dev/disk/by-uuid/2274dc28-7a48-4355-bc27-2d73f7a2744e";
preLVM = false;
allowDiscards = true;
}
];
}

View file

@ -0,0 +1,83 @@
{ config,
pkgs,
... }:
let
gitpkgs = import <gitpkgs> {};
in
{
nixpkgs.config = {
allowBroken = false;
allowUnfree = true;
packageOverrides = pkgs: rec {
# Version override example:
# rustracerd = pkgs.lib.overrideDerivation pkgs.rustracerd (attrs: rec {
# version = "2016-08-23";
# name = "racerd-${version}";
# src = pkgs.fetchgit {
# url = "git://github.com/jwilm/racerd.git";
# rev = "813d8214f50e8f77b5d8adf5173173209c8f6d74";
# sha256 = "07p4kvrc529khb1afrgwfkdb9nh3nvsk1v2p2b1rdaqvkpgwqr74";
# };
# });
myLinuxPackages = pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor
(pkgs.linux_latest.override {
kernelPatches = pkgs.linux_latest.kernelPatches ++ [
{
name = "bfq1";
patch = pkgs.fetchurl {
url = "ftp://teambelgium.net/bfq/patches/4.7.0-v8r3/0001-block-cgroups-kconfig-build-bits-for-BFQ-v7r11-4.7.0.patch";
sha256 = "116jfdgjgmy1fv6kzz7dm1c7rjy1pbsfzzcjv5mgsb7pnaxq3gd6";
};
}
{
name = "bfq2";
patch = pkgs.fetchurl {
url = "ftp://teambelgium.net/bfq/patches/4.7.0-v8r3/0002-block-introduce-the-BFQ-v7r11-I-O-sched-for-4.7.0.patch";
sha256 = "0wjmnym2ycglx42f513n97b45x3xqi33q7z4cs0aiz0zbblm8jql";
};
}
{
name = "bfq3";
patch = pkgs.fetchurl {
url = "ftp://teambelgium.net/bfq/patches/4.7.0-v8r3/0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r11-for.patch";
sha256 = "0898aklynxb9dr0nb0kdhc2incjkjihds9dakxvdy0mwjqr0jd6v";
};
}
{
name = "bfq4";
patch = pkgs.fetchurl {
url = "ftp://teambelgium.net/bfq/patches/4.7.0-v8r3/0004-block-bfq-turn-BFQ-v7r11-for-4.7.0-into-BFQ-v8r3-for.patch";
sha256 = "09ya3g39zk9k3hzjx4fkl60qkxdgzllnx3kk9dyi7lvydmhp4y6v";
};
}
];
extraConfig = ''
BFQ_GROUP_IOSCHED y
IOSCHED_BFQ y
DEFAULT_BFQ y
'';
})
pkgs.linuxPackages_latest
);
libvirt = pkgs.libvirt.override {
xen = null;
};
libvirt-glib = pkgs.libvirt-glib.override {
xen = null;
};
};
};
imports =
[
../common/pkg/default.nix
../common/pkg/neovim.nix
];
environment.systemPackages = with pkgs; [
];
}

View file

@ -0,0 +1,187 @@
{ config, lib, pkgs, ... }:
{
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;
# 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 = ''
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
'';
};
# 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";
#time.timeZone = "America/Los_Angeles";
# Services
services.gpm.enable = true;
services.openssh.enable = true;
services.openssh.permitRootLogin = "yes";
services.teamviewer.enable = true;
services.printing = {
enable = true;
drivers = [ pkgs.hplip ];
};
services.pcscd.enable = true;
services.xserver = {
libinput.enable = true;
libinput.naturalScrolling = true;
videoDrivers = [ "qxl" "intel" ];
enable = true;
layout = "us";
windowManager.qtile.enable = true;
windowManager.default = "qtile";
desktopManager = {
xterm.enable = true;
gnome3.enable = false;
xfce.enable = true;
};
displayManager = {
slim = {
enable = true;
theme = pkgs.fetchFromGitHub {
owner = "steveej";
repo = "nixos-slim-theme";
rev = "eec04a624113db835f2b5960d305e242da9dbc2a";
sha256 = "146zmr5rzwxq5mz6b7108a3ksf3nvqxrr8bvi82jsw6xqji4i5f5";
};
autoLogin = true;
defaultUser = "steveej";
};
sessionCommands = ''
xscreensaver -no-splash &
${pkgs.networkmanagerapplet}/bin/nm-applet &
$(sleep 2; xmodmap ~/.Xmodmap) &
'';
};
};
services.udev.packages = [
pkgs.libu2f-host
pkgs.yubikey-personalization
];
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"
''
# + builtins.readFile (pkgs.fetchurl {
# url="https://raw.githubusercontent.com/Yubico/libu2f-host/master/70-u2f.rules";
# sha256="1vmvk6pybvw92y97xbf8gm08x54f4zhvjawmbc37f25g2x97kgrf";
# })
;
services.resolved.enable = false;
# hardware related services
hardware = {
bluetooth.enable = true;
pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
support32Bit = true;
};
};
# virtualization
virtualisation = {
libvirtd.enable = true;
virtualbox.host.enable = true;
virtualbox.host.addNetworkInterface = true;
};
system.activationScripts.bin = ''
echo "setting up /bin..."
ln -sfn ${pkgs.bash}/bin/bash /tmp/.binbash
mv /tmp/.binbash /bin/bash
'';
}

View file

@ -0,0 +1,28 @@
{ config, pkgs, ... }:
{
imports =
[
../common/user/root.nix
];
users.extraUsers.steveej = {
uid = 1000;
isNormalUser = true;
home = "/home/steveej";
extraGroups = [
"wheel"
"libvirtd"
"networkmanager"
"vboxusers"
"users"
"input"
"audio"
"video"
];
hashedPassword = "removed";
};
security.pam.enableU2F = true;
security.pam.services.steveej.u2fAuth = true;
}