*: 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

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
*.swp
result

View file

@ -0,0 +1,34 @@
{ config, pkgs, ... }:
{
# Package configuration
environment.systemPackages = with pkgs; [
nix-repl
( busybox.override {
extraConfig = ''
CONFIG_STATIC y
CONFIG_INSTALL_APPLET_DONT y
CONFIG_INSTALL_APPLET_SYMLINKS n
'';
})
elfutils
file
tree
pwgen
proot
parted
pv
tmux
wget
curl
git
pastebinit
gist
usbutils
pciutils
];
}

View file

@ -0,0 +1,196 @@
{ config, pkgs, ... }:
let
commonPkgs = with pkgs; [
neovim
];
goPkgs = with pkgs.goPackages; [
go
tools.bin
godef.bin
godep.bin
];
pythonPkgs = with pkgs.python2Packages; [
blockdiag
seqdiag
actdiag
nwdiag
#packetdiag
#rackdiag
];
in {
nixpkgs.config.packageOverrides = pkgs: {
neovim = pkgs.neovim.override {
vimAlias = true;
configure = {
# add custom .vimrc lines like this:
customRC = ''
set nocompatible
" leader
let mapleader = ','
set hidden
syntax on
set hlsearch
set number
" mappings to stop insert mode
imap jjj <ESC>
imap kkk <ESC>
imap lll <ESC>
imap hhh <ESC>
set scroll=11
noremap <C-n> :tabn<CR>
noremap <C-p> :tabp<CR>
let g:ctrlp_map = '<tab>'
set wildignore+=*/site/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|)$$',
\ 'file': '\v\.(exe|so|dll)$$',
\ }
"let g:ctrlp_match_func = { 'match': 'pymatcher#PyMatch' }
"let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict'
" allways show status line
set ls=2
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
"set textwidth=80
" GoDef mappings
au FileType go nmap <Leader>gds <Plug>(go-def-split)
au FileType go nmap <Leader>gdv <Plug>(go-def-vertical)
au FileType go nmap <Leader>gdt <Plug>(go-def-tab)
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
" syntastic
au FileType qf setlocal wrap linebreak
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 0
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0
if has("gui_running")
set mouse=a
else
set mouse=
endif
set wildignore+=*/site/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|)$$',
\ 'file': '\v\.(exe|so|dll)$$',
\ }
let g:go_fmt_command = "goimports"
"au BufRead,BufNewFile *.txt,*.md,*.markdown setlocal spell spelllang=de_de,en_us
" sync default register to clipboard
if has('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
endif
let g:rbpt_colorpairs = [
\ ['brown', 'RoyalBlue3'],
\ ['Darkblue', 'SeaGreen3'],
\ ['darkgray', 'DarkOrchid3'],
\ ['darkgreen', 'firebrick3'],
\ ['darkcyan', 'RoyalBlue3'],
\ ['darkred', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['brown', 'firebrick3'],
\ ['gray', 'RoyalBlue3'],
\ ['black', 'SeaGreen3'],
\ ['darkmagenta', 'DarkOrchid3'],
\ ['Darkblue', 'firebrick3'],
\ ['darkgreen', 'RoyalBlue3'],
\ ['darkcyan', 'SeaGreen3'],
\ ['darkred', 'DarkOrchid3'],
\ ['red', 'firebrick3'],
\ ]
let g:rbpt_max = 16
let g:rbpt_loadcmd_toggle = 0
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
set t_ut=
colorscheme PaperColor
" Python {{{
augroup ft_python
au!
au FileType python setlocal omnifunc=pythoncomplete#Complete
au FileType python setlocal define=^\s*\\(def\\\\|class\\)
augroup END
" }}}
'';
# vam.knownPlugins = pkgs.vimPlugins; # optional
vam.pluginDictionaries = [ # full ducomentation at github.com/MarcWeber/vim-addon-manager
"vim-addon-vim2nix"
"youcompleteme"
"vim-airline"
"vim-addon-nix"
"ctrlp"
"vim-go"
"syntastic"
"tagbar"
"vim-css-color"
"rainbow_parentheses"
"vim-colorschemes"
"vim-colorstepper"
"gitgutter"
"vim-pandoc"
"vim-pandoc-syntax"
"vim-pandoc-after"
"vimpreviewpandoc"
];
};
extraPythonPackages = with pkgs.python2Packages; [
pandocfilters
htmltreediff
html5lib
] ++ pythonPkgs;
withPython3 = false;
};
};
environment.systemPackages = commonPkgs ++ goPkgs ++ pythonPkgs;
}

View file

@ -0,0 +1,76 @@
{ config, pkgs, ... }:
{
environment.systemPackages = with pkgs; [
(vim_configurable.customize {
name = "vim";
# add custom .vimrc lines like this:
vimrcConfig.customRC = ''
set hidden
syntax on
" set hlsearch
set number
" mappings to stop insert mode
imap jjj <ESC>
imap kkk <ESC>
imap lll <ESC>
imap hhh <ESC>
set scroll=11
noremap <C-n> :tabn<CR>
noremap <C-p> :tabp<CR>
let g:ctrlp_map = '<tab>'
set wildignore+=*/site/*,*.so,*.swp,*.zip
let g:ctrlp_custom_ignore = {
\ 'dir': '\v[\/]\.(git|hg|svn|)$$',
\ 'file': '\v\.(exe|so|dll)$$',
\ }
let g:pydiction_location = '~/.vim/bundle/pydiction/complete-dict'
set ls=2 " allways show status line
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
"set textwidth=80
" GoDef mappings
au FileType go nmap <Leader>gds <Plug>(go-def-split)
au FileType go nmap <Leader>gdv <Plug>(go-def-vertical)
au FileType go nmap <Leader>gdt <Plug>(go-def-tab)
" syntastic
" au FileType qf setlocal wrap linebreak
" let g:syntastic_always_populate_loc_list = 1
" let g:syntastic_auto_loc_list = 0
" let g:syntastic_check_on_open = 1
" let g:syntastic_check_on_wq = 0
'';
vimrcConfig.vam.knownPlugins = pkgs.vimPlugins; # optional
vimrcConfig.vam.pluginDictionaries = [{
# full ducomentation at github.com/MarcWeber/vim-addon-manager
names = [
"youcompleteme"
"vim-airline"
"vim-addon-nix"
"ctrlp"
"vim-go"
"vim-colorschemes"
# "syntastic"
# "ag.vim"
# "gosu-colors"
# "tagbar"
# "molokai"
];
}
];
})
python
];
}

View file

@ -0,0 +1,13 @@
# 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, ... }:
{
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"];
};
}

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";
};
}

View file

@ -0,0 +1,276 @@
# 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, ... }:
{
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "16.03";
nix.maxJobs = 4;
nix.buildCores = 4;
nix.extraOptions = ''
gc-keep-outputs = true
gc-keep-derivations = true
'';
nixpkgs.config = {
packageOverrides = super: let self = super.pkgs; in {
linux_4_1 = super.linux_4_1.override {
kernelPatches = super.linux_4_1.kernelPatches ++ [
{ patch = ./patches/utilitepro-kernel-dts.patch; name = "utilitepro-dts"; }
{ patch = ./patches/utilitepro-kernel-dts-Makefile.patch; name = "utilitepro-dts-Makefile"; }
];
# add "CONFIG_PPP_FILTER y" option to the set of kernel options
extraConfig = ''
BTRFS_FS y
BTRFS_FS_POSIX_ACL y
FUSE_FS y
OVERLAY_FS y
BLK_DEV_DM y
DM_THIN_PROVISIONING y
NAMESPACES y
NET_NS y
PID_NS y
IPC_NS y
UTS_NS y
DEVPTS_MULTIPLE_INSTANCES y
CGROUPS y
CGROUP_CPUACCT y
CGROUP_DEVICE y
CGROUP_FREEZER y
CGROUP_SCHED y
CPUSETS y
MEMCG y
POSIX_MQUEUE y
MACVLAN m
VETH m
BRIDGE m
NF_TABLES m
NETFILTER y
NETFILTER_ADVANCED y
NF_NAT_IPV4 m
IP_NF_FILTER m
IP_NF_TARGET_MASQUERADE m
NETFILTER_XT_MATCH_ADDRTYPE m
NETFILTER_XT_MATCH_CONNTRACK m
NF_NAT m
NF_NAT_NEEDED m
BRIDGE_NETFILTER m
NETFILTER_INGRESS y
NETFILTER_NETLINK m
NETFILTER_NETLINK_ACCT m
NETFILTER_NETLINK_QUEUE m
NETFILTER_NETLINK_LOG m
NETFILTER_SYNPROXY m
NETFILTER_XTABLES m
NETFILTER_XT_MARK m
NETFILTER_XT_CONNMARK m
NETFILTER_XT_SET m
NETFILTER_XT_TARGET_AUDIT m
NETFILTER_XT_TARGET_CHECKSUM m
NETFILTER_XT_TARGET_CLASSIFY m
NETFILTER_XT_TARGET_CONNMARK m
NETFILTER_XT_TARGET_CONNSECMARK m
NETFILTER_XT_TARGET_CT m
NETFILTER_XT_TARGET_DSCP m
NETFILTER_XT_TARGET_HL m
NETFILTER_XT_TARGET_HMARK m
NETFILTER_XT_TARGET_IDLETIMER m
NETFILTER_XT_TARGET_LED m
NETFILTER_XT_TARGET_LOG m
NETFILTER_XT_TARGET_MARK m
NETFILTER_XT_NAT m
NETFILTER_XT_TARGET_NETMAP m
NETFILTER_XT_TARGET_NFLOG m
NETFILTER_XT_TARGET_NFQUEUE m
NETFILTER_XT_TARGET_NOTRACK m
NETFILTER_XT_TARGET_RATEEST m
NETFILTER_XT_TARGET_REDIRECT m
NETFILTER_XT_TARGET_TEE m
NETFILTER_XT_TARGET_TPROXY m
NETFILTER_XT_TARGET_TRACE m
NETFILTER_XT_TARGET_SECMARK m
NETFILTER_XT_TARGET_TCPMSS m
NETFILTER_XT_TARGET_TCPOPTSTRIP m
NETFILTER_XT_MATCH_ADDRTYPE m
NETFILTER_XT_MATCH_BPF m
NETFILTER_XT_MATCH_CGROUP m
NETFILTER_XT_MATCH_CLUSTER m
NETFILTER_XT_MATCH_COMMENT m
NETFILTER_XT_MATCH_CONNBYTES m
NETFILTER_XT_MATCH_CONNLABEL m
NETFILTER_XT_MATCH_CONNLIMIT m
NETFILTER_XT_MATCH_CONNMARK m
NETFILTER_XT_MATCH_CONNTRACK m
NETFILTER_XT_MATCH_CPU m
NETFILTER_XT_MATCH_DCCP m
NETFILTER_XT_MATCH_DEVGROUP m
NETFILTER_XT_MATCH_DSCP m
NETFILTER_XT_MATCH_ECN m
NETFILTER_XT_MATCH_ESP m
NETFILTER_XT_MATCH_HASHLIMIT m
NETFILTER_XT_MATCH_HELPER m
NETFILTER_XT_MATCH_HL m
NETFILTER_XT_MATCH_IPCOMP m
NETFILTER_XT_MATCH_IPRANGE m
NETFILTER_XT_MATCH_IPVS m
NETFILTER_XT_MATCH_L2TP m
NETFILTER_XT_MATCH_LENGTH m
NETFILTER_XT_MATCH_LIMIT m
NETFILTER_XT_MATCH_MAC m
NETFILTER_XT_MATCH_MARK m
NETFILTER_XT_MATCH_MULTIPORT m
NETFILTER_XT_MATCH_NFACCT m
NETFILTER_XT_MATCH_OSF m
NETFILTER_XT_MATCH_OWNER m
NETFILTER_XT_MATCH_POLICY m
NETFILTER_XT_MATCH_PHYSDEV m
NETFILTER_XT_MATCH_PKTTYPE m
NETFILTER_XT_MATCH_QUOTA m
NETFILTER_XT_MATCH_RATEEST m
NETFILTER_XT_MATCH_REALM m
NETFILTER_XT_MATCH_RECENT m
NETFILTER_XT_MATCH_SCTP m
NETFILTER_XT_MATCH_SOCKET m
NETFILTER_XT_MATCH_STATE m
NETFILTER_XT_MATCH_STATISTIC m
NETFILTER_XT_MATCH_STRING m
NETFILTER_XT_MATCH_TCPMSS m
NETFILTER_XT_MATCH_TIME m
NETFILTER_XT_MATCH_U32 m
MEMCG_KMEM y
MEMCG_SWAP y
MEMCG_SWAP_ENABLED y
BLK_CGROUP y
IOSCHED_CFQ y
BLK_DEV_THROTTLING y
CGROUP_PERF y
CGROUP_HUGETLB y
NET_CLS_CGROUP y
CGROUP_NET_PRIO y
CFS_BANDWIDTH y
FAIR_GROUP_SCHED y
RT_GROUP_SCHED y
EXT3_FS y
EXT3_FS_XATTR y
EXT3_FS_POSIX_ACL y
EXT3_FS_SECURITY y
PPP_FILTER y
HAVE_IMX_ANATOP y
HAVE_IMX_GPC y
HAVE_IMX_MMDC y
HAVE_IMX_SRC y
SOC_IMX6 y
SOC_IMX6Q y
SOC_IMX6SL y
PCI_IMX6 y
ARM_IMX6Q_CPUFREQ y
IMX_WEIM y
AHCI_IMX y
SERIAL_IMX y
SERIAL_IMX_CONSOLE y
I2C_IMX y
SPI_IMX y
PINCTRL_IMX y
PINCTRL_IMX6Q y
PINCTRL_IMX6SL y
POWER_RESET_IMX y
IMX_THERMAL y
IMX2_WDT y
IMX_IPUV3_CORE y
DRM_IMX y
DRM_IMX_FB_HELPER y
DRM_IMX_PARALLEL_DISPLAY y
DRM_IMX_TVE y
DRM_IMX_LDB y
DRM_IMX_IPUV3 y
DRM_IMX_HDMI y
MMC_SDHCI_ESDHC_IMX y
IMX_SDMA y
PWM_IMX y
DEBUG_IMX6Q_UART y
'';
};
# pkgs.linux_4_2 = "/nix/store/jc1h6mcc6sq420q2i572qba4b0xzw4gm-linux-4.3-armv7l-unknown-linux-gnueabi";
};
allowUnfree = true;
};
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
networking.hostName = "steveej-utilitepro"; # Define your hostname.
#networking.wireless.enable = true; # Enables wireless support viawpa_supplicant.
boot.kernelPackages = pkgs.linuxPackages_4_1;
boot.extraKernelParams = [
"cm_fx6_v4l_msize=128M"
"vmalloc=256M"
"root=/dev/sda3"
"rootflags=subvol=nixos"
"console=ttymxc3,115200"
];
boot.loader.generic-extlinux-compatible.enable = true;
boot.loader.grub.enable = false;
# 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:
environment.systemPackages = with pkgs; [
iptables
wget
vim
sshfsFuse
pastebinit
git
];
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.permitRootLogin = "yes";
# Disable CUPS to print documents.
services.printing.enable = false;
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" ];
hashedPassword = "removed";
openssh.authorizedKeys.keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3niN5KcIYikRhXTYZCSehI1ZQs+vvG/dZ7KxNVHslfsS+p1yTycXcZFtDDn5vtG2fAo3yksxCk+G10/AWQ+NMOcFKuAi5qTOYSLbEcHVlZ4ko8sDUe3fF79vrCqY7IWbKKjZ4DH77Qs6SXk5GIlNaIzxut8Dpv8qHnkPiPuFgrJC4oGk60ZKmCPvOEpgg9twcdI6ykIxD4Fg+hHgG1p07uSEcm9EADli8RsU3UJ1UBhXMohMC6HrKVBkBX9wTo+zY+xqXxxem6xGNnkNiZLACfhCnjXv39zh85pgFuNv7R8SzVZQ9iRoCmax/w3JtWdDjqoTGgLfJyhMMjNdjVHOx steveej@steveej-laptop"];
};
networking.firewall.enable = false;
networking.useNetworkd = true;
}

View file

@ -0,0 +1,27 @@
# 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, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
boot.initrd.availableKernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
hardware.enableAllFirmware = true;
fileSystems."/" =
{ device = "/dev/disk/by-uuid/09d1e4a2-d57b-4de8-a42b-671c4c188367";
fsType = "btrfs";
options = "subvol=nixos";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/f1e7e913-93a0-4258-88f9-f65041d91d66";
};
swapDevices = [ ];
}

View file

@ -0,0 +1,13 @@
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 992736b..6ff9735 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -296,6 +296,8 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-sabreauto.dtb \
imx6q-sabrelite.dtb \
imx6q-sabresd.dtb \
+ imx6q-sbc-fx6.dtb \
+ imx6q-sbc-fx6m.dtb \
imx6q-sbc6x.dtb \
imx6q-tbs2910.dtb \
imx6q-tx6q-1010.dtb \

File diff suppressed because it is too large Load diff

89
derivations/dev/cross.nix Normal file
View file

@ -0,0 +1,89 @@
import /home/steveej/src/github/NixOS/nixpkgs/default.nix {
crossSystem = rec {
config = "armv7l-unknown-linux-gnueabi";
bigEndian = false;
arch = "arm";
float = "hard";
fpu = "vfpv3-d16";
withTLS = true;
libc = "glibc";
platform = {
name = "armv7l-hf-multiplatform";
gcc = {
arch = "armv7-a";
fpu = "neon";
float = "hard";
};
kernelMajor = "2.6"; # Using "2.6" enables 2.6 kernel syscalls in glibc.
kernelHeadersBaseConfig = "multi_v7_defconfig";
kernelBaseConfig = "multi_v7_defconfig";
kernelArch = "arm";
kernelDTB = true;
kernelAutoModules = false;
kernelExtraConfig = ''
NAMESPACES y
BTRFS_FS y
BTRFS_FS_POSIX_ACL y
OVERLAY_FS y
FUSE_FS y
'';
kernelTarget = "zImage";
uboot = null;
};
openssl.system = "linux-generic32";
gcc = {
arch = "armv7-a";
fpu = "neon";
float = "hard";
};
};
}
# pkgs.config = {
# packageOverrides = super: let self = super.pkgs; in {
# linux_4_0 = super.linux_3_18.override {
# kernelPatches = super.linux_3_18.kernelPatches ++ [
# # we'll also add one of our own patches
# { patch = ./dts.patch; name = "dts-fix"; }
# ];
#
# # add "CONFIG_PPP_FILTER y" option to the set of kernel options
# extraConfig = ''
# HAVE_IMX_ANATOP y
# HAVE_IMX_GPC y
# HAVE_IMX_MMDC y
# HAVE_IMX_SRC y
# SOC_IMX6 y
# SOC_IMX6Q y
# SOC_IMX6SL y
# PCI_IMX6 y
# ARM_IMX6Q_CPUFREQ y
# IMX_WEIM y
# AHCI_IMX y
# SERIAL_IMX y
# SERIAL_IMX_CONSOLE y
# I2C_IMX y
# SPI_IMX y
# PINCTRL_IMX y
# PINCTRL_IMX6Q y
# PINCTRL_IMX6SL y
# POWER_RESET_IMX y
# IMX_THERMAL y
# IMX2_WDT y
# IMX_IPUV3_CORE y
# DRM_IMX y
# DRM_IMX_FB_HELPER y
# DRM_IMX_PARALLEL_DISPLAY y
# DRM_IMX_TVE y
# DRM_IMX_LDB y
# DRM_IMX_IPUV3 y
# DRM_IMX_HDMI y
# MMC_SDHCI_ESDHC_IMX y
# IMX_SDMA y
# PWM_IMX y
# DEBUG_IMX6Q_UART y
#
# PPP_FILTER y
# '';
# };
# };
# };

39
derivations/dev/go.nix Normal file
View file

@ -0,0 +1,39 @@
{
pkgs ? import /home/steveej/src/github/NixOS/nixpkgs-systemsource {},
name ? "generic",
version,
extraBuildInputs ? [] }:
let
goPackages = builtins.getAttr "go${version}Packages" pkgs;
goBuildInputs = { goPackages }: [
goPackages.go
goPackages.tools
goPackages.tools.bin
goPackages.gocode
goPackages.gocode.bin
goPackages.godef
goPackages.godef.bin
goPackages.godep
goPackages.godep.bin
goPackages.gox.bin
];
goShellHook = { goPackages, name }: ''
goname=${goPackages.go.version}_$name
export GOROOT=${goPackages.go}/share/go
export GOPATH="$HOME/.gopath_$goname"
export PATH="$HOME/.gopath_$goname/bin:$PATH"
unset name
'';
in pkgs.stdenv.mkDerivation {
inherit name;
buildInputs = extraBuildInputs ++ (goBuildInputs){ inherit goPackages; };
shellHook = (goShellHook) { inherit name; inherit goPackages; };
# go14Env = mkGoEnv {
# inherit name;
# goPackages=pkgs.go14Packages;
# };
# go15 = mkGoEnv {
# inherit name;
# goPackages=pkgs.go15Packages;
# };
}

43
derivations/dev/rkt.nix Normal file
View file

@ -0,0 +1,43 @@
{
pkgs ? import /home/steveej/src/github/NixOS/nixpkgs-systemsource {},
mkGoEnv ? import ./go.nix,
}:
let
rktBasebuildInputs = with pkgs; [
autoconf
automake
autogen
gnupg1
squashfsTools
cpio
tree
intltool
libtool
pkgconfig
libgcrypt
gperf
libcap
libseccomp
libzip
eject
iptables
bc
acl
];
in {
go15 = mkGoEnv {
inherit pkgs;
name = "rktGo15";
version = "15";
extraBuildInputs = rktBasebuildInputs;
};
go16 = mkGoEnv {
inherit pkgs;
name = "rktGo16";
version = "16";
extraBuildInputs = rktBasebuildInputs;
};
}

View file

@ -0,0 +1,29 @@
with import <nixpkgs> {};
stdenv.mkDerivation rec {
name = "nomad";
version = "0.1.2";
filename = "nomad_${version}_linux_amd64.zip";
src = fetchurl {
url = "https://releases.hashicorp.com/nomad/${version}/${filename}";
sha256 = "0d3r3n1wwlic1kg3hgghds7f3b0qhh97v8xf36mcmsnmn2ngfd9k";
};
unpackPhase = ''
unzip ${src}
'';
buildInputs = [ makeWrapper unzip ];
libPath = lib.makeLibraryPath [ ];
installPhase = ''
patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 ./nomad
mkdir -p $out/bin
cp ./nomad $out/bin/nomad
# wrapProgram $out/bin/nomad \
# --prefix LD_LIBRARY_PATH : "${libPath}"
#
'';
}

View file

@ -0,0 +1,65 @@
# 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).
{ n, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
# Define on which hard drive you want to install Grub.
boot.loader.grub.device = "/dev/sdb";
networking.hostName = "nano${toString n}"; # 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
# ];
# List services that you want to enable:
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.permitRootLogin = "yes";
# Enable CUPS to print documents.
services.printing.enable = false;
# Enable the X11 windowing system.
services.xserver.enable = false;
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";
# Enable the KDE Desktop Environment.
# services.xserver.displayManager.kdm.enable = true;
# services.xserver.desktopManager.kde4.enable = true;
# Define a user account. Don't forget to set a password with passwd.
# users.extraUsers.guest = {
# isNormalUser = true;
# uid = 1000;
# };
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "16.03";
}

View file

@ -0,0 +1,23 @@
# 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, ... }:
{
imports =
[ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/e02a410e-5044-440f-90e9-b573e51f1315";
fsType = "ext4";
};
swapDevices = [ ];
nix.maxJobs = 2;
}

26
ops/nanos@kn.nix Normal file
View file

@ -0,0 +1,26 @@
{ nixpkgs ? import <nixpkgs> {}
, nrNanos ? 1 # Number of nanos
}:
let
pkgs = nixpkgs;
webserver = { services.httpd.enable = true;
services.httpd.adminAddr = "mail@stefanjunker.de";
services.httpd.documentRoot = "${pkgs.nixops}/share/doc/nixops/";
networking.firewall.allowedTCPPorts = [ 80 ];
};
mkNano = { n }: {
imports = [
(import ./nano/configuration.nix {inherit pkgs n;})
../configuration/common/user/root.nix
];
deployment.targetEnv = "none";
deployment.targetHost = "nano${toString n}";
};
mkNanos = n: nixpkgs.lib.nameValuePair "nano${toString n}" (
mkNano { inherit n; }
);
in nixpkgs.lib.listToAttrs (map mkNanos (nixpkgs.lib.range 0 (nrNanos - 1)))