From 927d3930a2e6f1b2ea3a90e9ecc4211f5b300c86 Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Thu, 17 Nov 2016 20:40:45 +0100 Subject: [PATCH] *: mv {,nixos}-configuration, restructure vim pkgs --- configuration/common/pkg/neovim.nix | 211 ------------------ configuration/common/pkg/vim.nix | 76 ------- configuration/steveej-laptop/boot.nix | 52 ----- configuration/steveej-laptop/pkg.nix | 155 ------------- configuration/steveej-laptop/user.nix | 23 -- .../common/pkg/default.nix | 0 nixos-configuration/common/pkg/neovim.nix | 10 + nixos-configuration/common/pkg/vim.nix | 9 + .../common/user/root.nix | 0 nixos-configuration/steveej-laptop/boot.nix | 19 ++ .../steveej-laptop/configuration.nix | 0 .../steveej-laptop/hw.nix | 0 nixos-configuration/steveej-laptop/pkg.nix | 83 +++++++ .../steveej-laptop/system.nix | 36 +-- nixos-configuration/steveej-laptop/user.nix | 28 +++ .../steveej-laptop2/configuration.nix | 0 .../hardware-configuration.nix | 0 .../steveej-utilitepro/configuration.nix | 0 .../hardware-configuration.nix | 0 .../utilitepro-kernel-dts-Makefile.patch | 0 .../patches/utilitepro-kernel-dts.patch | 0 pkg-configuration/vim-derivates/commonrc.nix | 104 +++++++++ pkg-configuration/vim-derivates/neovim.nix | 33 +++ pkg-configuration/vim-derivates/vim.nix | 30 +++ 24 files changed, 338 insertions(+), 531 deletions(-) delete mode 100644 configuration/common/pkg/neovim.nix delete mode 100644 configuration/common/pkg/vim.nix delete mode 100644 configuration/steveej-laptop/boot.nix delete mode 100644 configuration/steveej-laptop/pkg.nix delete mode 100644 configuration/steveej-laptop/user.nix rename {configuration => nixos-configuration}/common/pkg/default.nix (100%) create mode 100644 nixos-configuration/common/pkg/neovim.nix create mode 100644 nixos-configuration/common/pkg/vim.nix rename {configuration => nixos-configuration}/common/user/root.nix (100%) create mode 100644 nixos-configuration/steveej-laptop/boot.nix rename {configuration => nixos-configuration}/steveej-laptop/configuration.nix (100%) rename {configuration => nixos-configuration}/steveej-laptop/hw.nix (100%) create mode 100644 nixos-configuration/steveej-laptop/pkg.nix rename {configuration => nixos-configuration}/steveej-laptop/system.nix (86%) create mode 100644 nixos-configuration/steveej-laptop/user.nix rename {configuration => nixos-configuration}/steveej-laptop2/configuration.nix (100%) rename {configuration => nixos-configuration}/steveej-laptop2/hardware-configuration.nix (100%) rename {configuration => nixos-configuration}/steveej-utilitepro/configuration.nix (100%) rename {configuration => nixos-configuration}/steveej-utilitepro/hardware-configuration.nix (100%) rename {configuration => nixos-configuration}/steveej-utilitepro/patches/utilitepro-kernel-dts-Makefile.patch (100%) rename {configuration => nixos-configuration}/steveej-utilitepro/patches/utilitepro-kernel-dts.patch (100%) create mode 100644 pkg-configuration/vim-derivates/commonrc.nix create mode 100644 pkg-configuration/vim-derivates/neovim.nix create mode 100644 pkg-configuration/vim-derivates/vim.nix diff --git a/configuration/common/pkg/neovim.nix b/configuration/common/pkg/neovim.nix deleted file mode 100644 index f1a4819..0000000 --- a/configuration/common/pkg/neovim.nix +++ /dev/null @@ -1,211 +0,0 @@ -{ config, pkgs, ... }: -let - gitpkgs = import {}; - commonPkgs = with pkgs; [ - xsel - ]; - - goPkgs = with gitpkgs; [ - go_1_6 - gotools.bin -# godef.bin - godep -# go-errcheck.bin - ]; - pythonPkgs = with pkgs.python2Packages; [ - ]; - -in { - environment.systemPackages = commonPkgs ++ goPkgs ++ pythonPkgs ++ [ - (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 - imap kkk - imap lll - imap hhh - set scroll=11 - - noremap :tabn - noremap :tabp - let g:ctrlp_map = '' - 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 - - 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)$$', - \ } - " } - - " spelling {{{ - au BufRead,BufNewFile *.md,*.markdown setlocal spell spelllang=en_us,de_de - " }}} - - " sync default register to clipboard { - if has('unnamedplus') - set clipboard=unnamedplus - else - set clipboard=unnamed - endif - " } - - " colored brackets { - 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 - " }}} - - " YAML {{{ - augroup ft_yaml - au! - setlocal autoindent sw=2 et tabstop=2 shiftwidth=2 softtabstop=2 - augroup END - " }}} - - " vim-go { - let g:go_highlight_functions = 1 - let g:go_highlight_methods = 1 - let g:go_highlight_structs = 1 - let g:go_highlight_interfaces = 1 - let g:go_highlight_operators = 1 - let g:go_highlight_build_constraints = 1 - let g:go_fmt_command = 'gofmt' - let g:go_fmt_options= '-s' - let g:go_def_mode = 'godef' - let g:go_def_reuse_buffer = 0 - - au FileType go nmap gds (go-def-split) - au FileType go nmap gdv (go-def-vertical) - au FileType go nmap gdt (go-def-tab) - " } - - " deoplete { -" let g:deoplete#enable_at_startup = 1 -" let g:deoplete#enable_smart_case = 1 - " } - ''; - - 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" - "vim-css-color" - "rainbow_parentheses" - "vim-colorschemes" - "vim-colorstepper" - "vim-signify" - ]; - }; - extraPythonPackages = with pkgs.python2Packages; [ - ] ++ pythonPkgs; - withPython3 = true; - }) - ]; -} diff --git a/configuration/common/pkg/vim.nix b/configuration/common/pkg/vim.nix deleted file mode 100644 index ab24cee..0000000 --- a/configuration/common/pkg/vim.nix +++ /dev/null @@ -1,76 +0,0 @@ -{ 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 - imap kkk - imap lll - imap hhh - set scroll=11 - - noremap :tabn - noremap :tabp - let g:ctrlp_map = '' - 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 gds (go-def-split) - au FileType go nmap gdv (go-def-vertical) - au FileType go nmap gdt (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 - ]; -} diff --git a/configuration/steveej-laptop/boot.nix b/configuration/steveej-laptop/boot.nix deleted file mode 100644 index 70ee1ad..0000000 --- a/configuration/steveej-laptop/boot.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - #boot.kernelPackages = 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.5.0-v7r11/0001-block-cgroups-kconfig-build-bits-for-BFQ-v7r11-4.5.0.patch"; - # sha256 = "1j6h831kj32c9slzm4vhjvd8m17gbwh713kcpc54z9i02fwyq6ax"; - # }; - # } - # { - # name = "bfq2"; - # patch = pkgs.fetchurl { - # url = "ftp://teambelgium.net/bfq/patches/4.5.0-v7r11/0002-block-introduce-the-BFQ-v7r11-I-O-sched-for-4.5.0.patch"; - # sha256 = "1q8nf7fcp72s2xz2pfl22sv4w5fm4hzgciljrkd3g7gj5xvi27lw"; - # }; - # } - # { - # name = "bfq3"; - # patch = pkgs.fetchurl { - # url = "ftp://teambelgium.net/bfq/patches/4.5.0-v7r11/0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r11-for.patch"; - # sha256 = "1q2j7g3cfwi52psxgwa06hadl6c2fh87ckm07pyaj35n6524gjg0"; - # }; - # } - # ]; - # extraConfig = '' - # BFQ_GROUP_IOSCHED y - # IOSCHED_BFQ y - # DEFAULT_BFQ y - # ''; - # }) - # pkgs.linuxPackages_latest - #); - - boot.kernelPackages = pkgs.linuxPackages_4_6; - - # 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; -} diff --git a/configuration/steveej-laptop/pkg.nix b/configuration/steveej-laptop/pkg.nix deleted file mode 100644 index dbafe00..0000000 --- a/configuration/steveej-laptop/pkg.nix +++ /dev/null @@ -1,155 +0,0 @@ -{ config, - pkgs, - ... }: - -let - gitpkgs = import {}; -in -{ - nixpkgs.config = { - allowBroken = false; - - 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"; - # }; - # }); - - go = pkgs.go_1_6; - bluez = pkgs.bluez5; - - 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.5.0-v7r11/0001-block-cgroups-kconfig-build-bits-for-BFQ-v7r11-4.5.0.patch"; - sha256 = "1j6h831kj32c9slzm4vhjvd8m17gbwh713kcpc54z9i02fwyq6ax"; - }; - } - { - name = "bfq2"; - patch = pkgs.fetchurl { - url = "ftp://teambelgium.net/bfq/patches/4.5.0-v7r11/0002-block-introduce-the-BFQ-v7r11-I-O-sched-for-4.5.0.patch"; - sha256 = "1q8nf7fcp72s2xz2pfl22sv4w5fm4hzgciljrkd3g7gj5xvi27lw"; - }; - } - { - name = "bfq3"; - patch = pkgs.fetchurl { - url = "ftp://teambelgium.net/bfq/patches/4.5.0-v7r11/0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r11-for.patch"; - sha256 = "1q2j7g3cfwi52psxgwa06hadl6c2fh87ckm07pyaj35n6524gjg0"; - }; - } - ]; - 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; - }; - - }; - - allowUnfree = true; - - chromium = { - enablePepperFlash = true; - enablePepperPDF = true; - }; - - firefox = { - enableGoogleTalkPlugin = true; - enableAdobeFlash = false; - }; - - pidgin = { - openssl = true; - gnutls = true; - }; - - keepass = pkgs.keepass.override { - plugins = [ pkgs.keepass-keefox ]; - }; - - }; - - imports = - [ - ../common/pkg/default.nix - ../common/pkg/neovim.nix - ]; - - environment.systemPackages = with pkgs; [ - androidsdk_4_4 - - nixops - nox - ansible - - gnupg - picocom - roxterm - xorg.xbacklight - coreutils - lsof - - xscreensaver - chromium - firefox-wrapper - seafile-client - - qpdfview - thunderbird - keepass - - pidgin - hexchat - skype - - teamviewer - x11_ssh_askpass - gnome3.dconf # needed by virtmanager - virtmanager - qemu - vagrant - - vlc - audacity - pavucontrol - - gimp - inkscape - pdftk - imagemagick - - iptables - nftables - iperf - - #pandoc - pythonFull - - gitpkgs.rkt - gitpkgs.flannel - gitpkgs.remmina - gitpkgs.spotify - gitpkgs.manuskript -# gitpkgs.zoom-us - ]; -} diff --git a/configuration/steveej-laptop/user.nix b/configuration/steveej-laptop/user.nix deleted file mode 100644 index 8e8d266..0000000 --- a/configuration/steveej-laptop/user.nix +++ /dev/null @@ -1,23 +0,0 @@ - -{ config, pkgs, ... }: -{ - imports = - [ - ../common/user/root.nix - ]; - - users.extraUsers.steveej = { - uid = 1000; - isNormalUser = true; - home = "/home/steveej"; - extraGroups = [ "wheel" "libvirtd" "networkmanager" "vboxusers" ]; - hashedPassword = "removed"; - }; - users.extraUsers.steveej2 = { - uid = 1001; - isNormalUser = true; - home = "/home/steveej2"; - extraGroups = [ "wheel" "libvirtd" ]; - hashedPassword = "removed"; - }; -} diff --git a/configuration/common/pkg/default.nix b/nixos-configuration/common/pkg/default.nix similarity index 100% rename from configuration/common/pkg/default.nix rename to nixos-configuration/common/pkg/default.nix diff --git a/nixos-configuration/common/pkg/neovim.nix b/nixos-configuration/common/pkg/neovim.nix new file mode 100644 index 0000000..2226a39 --- /dev/null +++ b/nixos-configuration/common/pkg/neovim.nix @@ -0,0 +1,10 @@ +{ config +, pkgs +, ... } @ args: + +{ + environment.systemPackages = [ + pkgs.xsel + (import ../../../pkg-configuration/vim-derivates/neovim.nix args) + ]; +} diff --git a/nixos-configuration/common/pkg/vim.nix b/nixos-configuration/common/pkg/vim.nix new file mode 100644 index 0000000..d3cd726 --- /dev/null +++ b/nixos-configuration/common/pkg/vim.nix @@ -0,0 +1,9 @@ +{ pkgs +, ... } @ args: + +{ + environment.systemPackages = [ + pkgs.xsel + (import ../../../pkg-configuration/vim-derivates/vim.nix (args // { name = "vim"; })) + ]; +} diff --git a/configuration/common/user/root.nix b/nixos-configuration/common/user/root.nix similarity index 100% rename from configuration/common/user/root.nix rename to nixos-configuration/common/user/root.nix diff --git a/nixos-configuration/steveej-laptop/boot.nix b/nixos-configuration/steveej-laptop/boot.nix new file mode 100644 index 0000000..08fe544 --- /dev/null +++ b/nixos-configuration/steveej-laptop/boot.nix @@ -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; +} diff --git a/configuration/steveej-laptop/configuration.nix b/nixos-configuration/steveej-laptop/configuration.nix similarity index 100% rename from configuration/steveej-laptop/configuration.nix rename to nixos-configuration/steveej-laptop/configuration.nix diff --git a/configuration/steveej-laptop/hw.nix b/nixos-configuration/steveej-laptop/hw.nix similarity index 100% rename from configuration/steveej-laptop/hw.nix rename to nixos-configuration/steveej-laptop/hw.nix diff --git a/nixos-configuration/steveej-laptop/pkg.nix b/nixos-configuration/steveej-laptop/pkg.nix new file mode 100644 index 0000000..762ce77 --- /dev/null +++ b/nixos-configuration/steveej-laptop/pkg.nix @@ -0,0 +1,83 @@ +{ config, + pkgs, + ... }: + +let + gitpkgs = import {}; +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; [ + ]; +} diff --git a/configuration/steveej-laptop/system.nix b/nixos-configuration/steveej-laptop/system.nix similarity index 86% rename from configuration/steveej-laptop/system.nix rename to nixos-configuration/steveej-laptop/system.nix index 60e8b24..1bb876f 100644 --- a/configuration/steveej-laptop/system.nix +++ b/nixos-configuration/steveej-laptop/system.nix @@ -4,13 +4,16 @@ nix.binaryCachePublicKeys = [ "hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs=" ]; nix.binaryCaches = [ "https://cache.nixos.org" - "http://hydra.nixos.org" + "https://hydra.nixos.org" ]; nix.trustedBinaryCaches = [ "https://cache.nixos.org" - "http://hydra.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. @@ -105,15 +108,10 @@ drivers = [ pkgs.hplip ]; }; - services.etcd.enable = true; - + services.pcscd.enable = true; services.xserver = { - synaptics.enable = true; - synaptics.palmDetect = true; - synaptics.horizEdgeScroll = true; - synaptics.horizontalScroll = true; - synaptics.twoFingerScroll = true; - synaptics.vertEdgeScroll = true; + libinput.enable = true; + libinput.naturalScrolling = true; videoDrivers = [ "qxl" "intel" ]; enable = true; @@ -122,7 +120,8 @@ windowManager.qtile.enable = true; windowManager.default = "qtile"; desktopManager = { - xterm.enable = false; + xterm.enable = true; + gnome3.enable = false; xfce.enable = true; }; @@ -141,16 +140,25 @@ sessionCommands = '' xscreensaver -no-splash & ${pkgs.networkmanagerapplet}/bin/nm-applet & - $(sleep 2; xmodmap /home/steveej/.Xmodmap) & + $(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; diff --git a/nixos-configuration/steveej-laptop/user.nix b/nixos-configuration/steveej-laptop/user.nix new file mode 100644 index 0000000..ef1fb2f --- /dev/null +++ b/nixos-configuration/steveej-laptop/user.nix @@ -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; +} diff --git a/configuration/steveej-laptop2/configuration.nix b/nixos-configuration/steveej-laptop2/configuration.nix similarity index 100% rename from configuration/steveej-laptop2/configuration.nix rename to nixos-configuration/steveej-laptop2/configuration.nix diff --git a/configuration/steveej-laptop2/hardware-configuration.nix b/nixos-configuration/steveej-laptop2/hardware-configuration.nix similarity index 100% rename from configuration/steveej-laptop2/hardware-configuration.nix rename to nixos-configuration/steveej-laptop2/hardware-configuration.nix diff --git a/configuration/steveej-utilitepro/configuration.nix b/nixos-configuration/steveej-utilitepro/configuration.nix similarity index 100% rename from configuration/steveej-utilitepro/configuration.nix rename to nixos-configuration/steveej-utilitepro/configuration.nix diff --git a/configuration/steveej-utilitepro/hardware-configuration.nix b/nixos-configuration/steveej-utilitepro/hardware-configuration.nix similarity index 100% rename from configuration/steveej-utilitepro/hardware-configuration.nix rename to nixos-configuration/steveej-utilitepro/hardware-configuration.nix diff --git a/configuration/steveej-utilitepro/patches/utilitepro-kernel-dts-Makefile.patch b/nixos-configuration/steveej-utilitepro/patches/utilitepro-kernel-dts-Makefile.patch similarity index 100% rename from configuration/steveej-utilitepro/patches/utilitepro-kernel-dts-Makefile.patch rename to nixos-configuration/steveej-utilitepro/patches/utilitepro-kernel-dts-Makefile.patch diff --git a/configuration/steveej-utilitepro/patches/utilitepro-kernel-dts.patch b/nixos-configuration/steveej-utilitepro/patches/utilitepro-kernel-dts.patch similarity index 100% rename from configuration/steveej-utilitepro/patches/utilitepro-kernel-dts.patch rename to nixos-configuration/steveej-utilitepro/patches/utilitepro-kernel-dts.patch diff --git a/pkg-configuration/vim-derivates/commonrc.nix b/pkg-configuration/vim-derivates/commonrc.nix new file mode 100644 index 0000000..932b943 --- /dev/null +++ b/pkg-configuration/vim-derivates/commonrc.nix @@ -0,0 +1,104 @@ +{}: +'' +set nocompatible + +" leader +let mapleader = ',' + +set hidden +syntax on +set hlsearch +set number + +" mappings to stop insert mode +imap jjj +imap kkk +imap lll +imap hhh +set scroll=11 + +noremap :tabn +noremap :tabp +let g:ctrlp_map = '' +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 + +set wildignore+=*/site/*,*.so,*.swp,*.zip +let g:ctrlp_custom_ignore = { + \ 'dir': '\v[\/]\.(git|hg|svn|)$$', + \ 'file': '\v\.(exe|so|dll)$$', + \ } +" } + +" spelling {{{ +au BufRead,BufNewFile *.txt,*.tex,*.md,*.markdown setlocal spell spelllang=en_us,de_de +" }}} + +" sync default register to clipboard { +if has('unnamedplus') + set clipboard=unnamedplus +else + set clipboard=unnamed +endif +" } + +" colored brackets { +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 +" }}} + +" YAML {{{ +augroup ft_yaml + au! + setlocal autoindent sw=2 et tabstop=2 shiftwidth=2 softtabstop=2 +augroup END +" }}} +'' diff --git a/pkg-configuration/vim-derivates/neovim.nix b/pkg-configuration/vim-derivates/neovim.nix new file mode 100644 index 0000000..c514d07 --- /dev/null +++ b/pkg-configuration/vim-derivates/neovim.nix @@ -0,0 +1,33 @@ +{ pkgs +, additionalRC ? "" +, additionalPlugins ? [] +, ... }: + +pkgs.neovim.override { + vimAlias = true; + configure = { + # add custom .vimrc lines like this: + customRC = (import ./commonrc.nix {}) + '' + " deoplete { + let g:deoplete#enable_at_startup = 1 + let g:deoplete#enable_smart_case = 1 + " } + '' + additionalRC; + + vam.knownPlugins = pkgs.vimPlugins; # optional + vam.pluginDictionaries = [ # full ducomentation at github.com/MarcWeber/vim-addon-manager + "vim-addon-vim2nix" + "vim-airline" + "vim-addon-nix" + "ctrlp" + "vim-css-color" + "rainbow_parentheses" + "vim-colorschemes" + "vim-colorstepper" + "vim-signify" + "deoplete-nvim" + ] ++ additionalPlugins; + }; + extraPythonPackages = []; + withPython3 = true; +} diff --git a/pkg-configuration/vim-derivates/vim.nix b/pkg-configuration/vim-derivates/vim.nix new file mode 100644 index 0000000..8924bc5 --- /dev/null +++ b/pkg-configuration/vim-derivates/vim.nix @@ -0,0 +1,30 @@ +{ pkgs +, name +, additionalRC ? "" +, additionalPlugins ? [] +, ... } @ args : + +pkgs.vim_configurable.customize { + inherit name; + # add custom .vimrc lines like this: + vimrcConfig.customRC = (import ./commonrc.nix {}) + '' + '' + additionalRC; + + vimrcConfig.vam.knownPlugins = pkgs.vimPlugins; # optional + vimrcConfig.vam.pluginDictionaries = [{ + # full ducomentation at github.com/MarcWeber/vim-addon-manager + names = [ + "vim-addon-vim2nix" + "vim-airline" + "vim-addon-nix" + "ctrlp" + "syntastic" + "vim-css-color" + "rainbow_parentheses" + "vim-colorschemes" + "vim-colorstepper" + "vim-signify" + "youcompleteme" + ] ++ additionalPlugins; + }]; +}