diff options
author | aszlig <aszlig@redmoonstudios.org> | 2017-06-22 00:39:53 +0200 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2017-06-22 00:39:53 +0200 |
commit | 3e94e96826f522c31e054bae1b5fd1af2cbfb309 (patch) | |
tree | 9c23966184ed4b2bd8437019281d61c6a6cd1fef | |
parent | bd3547a7194ab01a33346fcff837e7c8cd50a5f7 (diff) | |
parent | 4ba315934a9d3727a0bc0ff392c706d9bda57ce7 (diff) |
Subtree-merge https://github.com/devhell/nixosconf
This introduces a new participant of the vuizvui project, @devhell. Welcome abord :-) So far the whole repository is now inside the devhell/ subdirectory and we now need to factor out the configs into the vuizvui ecosystem.
23 files changed, 1343 insertions, 0 deletions
diff --git a/devhell/README.md b/devhell/README.md new file mode 100644 index 00000000..d8d987c7 --- /dev/null +++ b/devhell/README.md @@ -0,0 +1,34 @@ +# nixosconf +_NixOS configuration for my current machines._ + +Feel free to use and adapt as you wish. + +In case you've wondered where to start, normally it's enough to simply import +the `entry-*.nix` file, respective of the machine you want to build (naturally +you can also just rename the files to reflect your own configuration/machine +names), into your `/etc/nixos/configuration.nix`, for example: +``` +{ config, pkgs, lib, ... }: + +{ + imports = + [ + /home/<username>/nixosconf/entry-<machinename>.nix + ]; +} +``` + +**NOTE:** This NixOS configuration is geared towards people running NixOS +_unstable_ or `nixpkgs` [master branch](https://github.com/NixOS/nixpkgs). This +also means that if `nixos-rebuild switch` encounters an error, then it is likely +that whatever caused the error has not yet been included in the latest Hydra +channel update (this is assuming that you are using the _unstable_ channel). +Therefore your best bet is to either disable the culprit in the configuration +or just wait until the [unstable channel](https://hydra.nixos.org/job/nixos/trunk-combined/tested#tabs-constituents) +has been updated. Or, of course, run directly from `nixpkgs` master branch. + +**NOTE 2:** Unless you have access to a Hydra build farm/machine you will most +likely want to remove the `binaryCaches` option in the `machine_common.nix` +file. This also means that you can ignore the `release.nix` file. Unless, of +course, you have access to a Hydra, in which case you'll still want to adapt +the `binaryCache` option. diff --git a/devhell/entry-eris.nix b/devhell/entry-eris.nix new file mode 100644 index 00000000..96c4cc15 --- /dev/null +++ b/devhell/entry-eris.nix @@ -0,0 +1,14 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ + ./machines/machine_eris.nix + ./network/network_eris.nix + ./services/services_eris.nix + ./pkgs/pkgs_eris.nix + ./overrides/overrides.nix + ./users/users_dev.nix + ]; +} + diff --git a/devhell/entry-skunkworks.nix b/devhell/entry-skunkworks.nix new file mode 100644 index 00000000..c53cb751 --- /dev/null +++ b/devhell/entry-skunkworks.nix @@ -0,0 +1,14 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ + ./machines/machine_skunkworks.nix + ./network/network_skunkworks.nix + ./services/services_skunkworks.nix + ./pkgs/pkgs_skunkworks.nix + ./overrides/overrides.nix + ./users/users_dev.nix + ]; +} + diff --git a/devhell/entry-titan.nix b/devhell/entry-titan.nix new file mode 100644 index 00000000..2b178190 --- /dev/null +++ b/devhell/entry-titan.nix @@ -0,0 +1,14 @@ +{ config, pkgs, lib, ... }: + +{ + imports = + [ + ./machines/machine_titan.nix + ./network/network_titan.nix + ./services/services_titan.nix + ./pkgs/pkgs_titan.nix + ./overrides/overrides.nix + ./users/users_dev.nix + ]; +} + diff --git a/devhell/machines/machine_common.nix b/devhell/machines/machine_common.nix new file mode 100644 index 00000000..b7fb5215 --- /dev/null +++ b/devhell/machines/machine_common.nix @@ -0,0 +1,109 @@ +{ config, pkgs, lib, ... }: + +{ + boot = { + kernelPackages = pkgs.linuxPackages_latest; + cleanTmpDir = true; + }; + + nix = { + buildCores = 0; + useSandbox = true; + binaryCaches = [ + "https://headcounter.org/hydra/" + "https://cache.nixos.org/" + ]; + requireSignedBinaryCaches = true; + binaryCachePublicKeys = [ + "headcounter.org:/7YANMvnQnyvcVB6rgFTdb8p5LG1OTXaO+21CaOSBzg=" + "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" + ]; + nixPath = lib.mkOptionDefault [ "nixpkgs=/home/dev/git/remote/other_github/nixpkgs" ]; + }; + + time = { + timeZone = "Europe/London"; + }; + + system = { + fsPackages = with pkgs; [ + sshfsFuse + fuse + cryptsetup + ]; + }; + + hardware = { + enableAllFirmware = true; + cpu.intel.updateMicrocode = true; + opengl = { + s3tcSupport = true; + driSupport32Bit = true; + }; + pulseaudio = { + enable = true; + systemWide = false; + }; + }; + + programs = { + ssh = { + startAgent = false; + }; + zsh = { + enable = true; + enableCompletion = true; + }; + bash = { + enableCompletion = true; + promptInit = '' + # Provide a nice prompt. + PROMPT_COLOR="1;31m" + let $UID && PROMPT_COLOR="1;32m" + PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] " + if test "$TERM" = "xterm"; then + PS1="\[\033]2;\h:\u:\w\007\]$PS1" + fi + eval `dircolors ~/.dir_colors` + ''; + }; + }; + + environment = { + shells = [ "/run/current-system/sw/bin/zsh" ]; + sessionVariables.TERM = "xterm-256color"; + }; + + fonts = { + fontconfig = { + enable = true; + ultimate = { + enable = true; + }; + }; + enableGhostscriptFonts = true; + enableCoreFonts = true; + fonts = with pkgs; [ + clearlyU + cm_unicode + dejavu_fonts + dosemu_fonts + font-awesome-ttf + freefont_ttf + hack-font + inconsolata + powerline-fonts + proggyfonts + source-code-pro + source-sans-pro + source-serif-pro + terminus_font + tewi-font + ttf_bitstream_vera + ubuntu_font_family + unifont + vistafonts + wqy_microhei + ] ++ lib.filter lib.isDerivation (lib.attrValues lohit-fonts); + }; +} diff --git a/devhell/machines/machine_eris.nix b/devhell/machines/machine_eris.nix new file mode 100644 index 00000000..60b6944c --- /dev/null +++ b/devhell/machines/machine_eris.nix @@ -0,0 +1,60 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./machine_common.nix ]; + + boot = { + loader = { + timeout = 2; + systemd-boot = { + enable = true; + }; + + efi.canTouchEfiVariables = true; + }; + + initrd = { + availableKernelModules = [ "ehci_pci" "ahci" "usb_storage" ]; + kernelModules = [ "fuse" ]; + postDeviceCommands = '' + echo noop > /sys/block/sda/queue/scheduler + ''; + }; + + kernelModules = [ "tp_smapi" ]; + extraModulePackages = [ config.boot.kernelPackages.tp_smapi ]; + }; + + hardware = { + opengl = { + extraPackages = [ pkgs.vaapiIntel ]; + }; + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/4788e218-db0f-4fd6-916e-e0c484906eb0"; + fsType = "btrfs"; + options = [ + "autodefrag" + "space_cache" + "compress=lzo" + "noatime" + "ssd" + ]; + }; + + swapDevices = [ ]; + + nix = { + maxJobs = 4; + extraOptions = '' + auto-optimise-store = true + ''; + }; + + i18n = { + consoleFont = "lat9w-16"; + consoleKeyMap = "uk"; + defaultLocale = "en_GB.UTF-8"; + }; +} diff --git a/devhell/machines/machine_skunkworks.nix b/devhell/machines/machine_skunkworks.nix new file mode 100644 index 00000000..12ad9687 --- /dev/null +++ b/devhell/machines/machine_skunkworks.nix @@ -0,0 +1,79 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./machine_common.nix ]; + + boot = { + loader.grub = { + enable = true; + version = 2; + devices = [ + "/dev/disk/by-id/ata-ST31500541AS_6XW0NK21" + "/dev/disk/by-id/ata-ST31500541AS_6XW0P0CW" + "/dev/disk/by-id/ata-Samsung_SSD_850_EVO_250GB_S21PNSAG848626F" + "/dev/disk/by-id/ata-Samsung_SSD_850_EVO_250GB_S21PNSAG848674K" + ]; + }; + + initrd = { + availableKernelModules = [ "ehci_pci" "ahci" "firewire_ohci" "usbhid" "usb_storage" ]; + kernelModules = [ "fuse" ]; + }; + + kernelParams = [ "pci=noaer" ]; + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + blacklistedKernelModules = [ "pcspkr" ]; + }; + + hardware = { + opengl = { + extraPackages = [ pkgs.vaapiVdpau ]; + }; + }; + + fileSystems."/" = { + label = "nixos"; + fsType = "btrfs"; + options = [ + "autodefrag" + "space_cache" + "compress=lzo" + "noatime" + "ssd" + ]; + }; + + fileSystems."/home" = { + label = "home"; + fsType = "btrfs"; + options = [ + "autodefrag" + "space_cache" + "compress=lzo" + "noatime" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/16bd9abd-6af5-4a24-8ea5-58adc51e9641"; } + { device = "/dev/disk/by-uuid/279708cb-f9c3-4a37-a064-80ff85a66f88"; } + { device = "/dev/disk/by-uuid/0c2409c3-e824-4759-a9ad-9bfcea1e73bb"; } + { device = "/dev/disk/by-uuid/3f1835a8-5587-4963-9b6c-66ecb36059de"; } + ]; + + nix.maxJobs = 8; + + i18n = { + consoleFont = "lat9w-16"; + consoleKeyMap = "dvorak"; + defaultLocale = "en_US.UTF-8"; + }; + + powerManagement.powerUpCommands = '' + ${pkgs.hdparm}/sbin/hdparm -B 255 \ + /dev/disk/by-id/ata-ST31500541AS_6XW0NK21 + ${pkgs.hdparm}/sbin/hdparm -B 255 \ + /dev/disk/by-id/ata-ST31500541AS_6XW0P0CW + ''; +} diff --git a/devhell/machines/machine_titan.nix b/devhell/machines/machine_titan.nix new file mode 100644 index 00000000..5a0018fb --- /dev/null +++ b/devhell/machines/machine_titan.nix @@ -0,0 +1,62 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./machine_common.nix ]; + + boot = { + loader = { + timeout = 2; + systemd-boot = { + enable = true; + }; + + efi.canTouchEfiVariables = true; + }; + + initrd = { + availableKernelModules = [ "xhci_hcd" "ehci_pci" "ahci" "usb_storage" ]; + kernelModules = [ "fuse" ]; + }; + + kernelModules = [ "kvm-intel" ]; + extraModulePackages = [ ]; + + kernelParams = [ "elevator=noop" ]; + }; + + hardware = { + opengl = { + enable = true; + extraPackages = [ pkgs.libvdpau-va-gl pkgs.vaapiVdpau pkgs.vaapiIntel ]; + }; + }; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/09d1155f-e7dd-4754-ae01-44da2517d5f0"; + fsType = "btrfs"; + options = [ + "autodefrag" + "space_cache" + "compress=lzo" + "noatime" + "ssd" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/fecde631-8661-4a0e-88e6-5ce5b551847a"; } + ]; + + nix = { + maxJobs = 4; + extraOptions = '' + auto-optimise-store = true + ''; + }; + + i18n = { + consoleFont = "lat9w-16"; + consoleKeyMap = "uk"; + defaultLocale = "en_GB.UTF-8"; + }; +} diff --git a/devhell/network/network_common.nix b/devhell/network/network_common.nix new file mode 100644 index 00000000..e54c78fc --- /dev/null +++ b/devhell/network/network_common.nix @@ -0,0 +1,5 @@ +{ config, pkgs, lib, ... }: + +{ + networking.firewall.enable = false; +} diff --git a/devhell/network/network_eris.nix b/devhell/network/network_eris.nix new file mode 100644 index 00000000..e55f319f --- /dev/null +++ b/devhell/network/network_eris.nix @@ -0,0 +1,8 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./network_common.nix ]; + + networking.hostName = "eris"; + networking.networkmanager.enable = true; +} diff --git a/devhell/network/network_skunkworks.nix b/devhell/network/network_skunkworks.nix new file mode 100644 index 00000000..fe943e1d --- /dev/null +++ b/devhell/network/network_skunkworks.nix @@ -0,0 +1,9 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./network_common.nix ]; + + networking.hostName = "skunkworks"; + networking.wireless.enable = false; + networking.useNetworkd = true; +} diff --git a/devhell/network/network_titan.nix b/devhell/network/network_titan.nix new file mode 100644 index 00000000..06b34dcd --- /dev/null +++ b/devhell/network/network_titan.nix @@ -0,0 +1,11 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./network_common.nix ]; + + networking.hostName = "titan"; + networking.wireless.enable = true; + networking.connman.enable = true; + networking.wicd.enable = false; + networking.networkmanager.enable = false; +} diff --git a/devhell/overrides/overrides.nix b/devhell/overrides/overrides.nix new file mode 100644 index 00000000..3e07a75c --- /dev/null +++ b/devhell/overrides/overrides.nix @@ -0,0 +1,25 @@ +{ config, pkgs, lib, ... }: + +with lib; + +{ + nixpkgs.config.packageOverrides = pkgs: { + gnupg = pkgs.gnupg21; + + ncmpcpp = pkgs.ncmpcpp.override { + visualizerSupport = true; + clockSupport = true; + }; + + sox = pkgs.sox.override { + enableLame = true; + }; + + # XXX: Very ugly workaround see https://github.com/openlab-aux/vuizvui/commit/a93b7583084ff9084d73873d80d8dc428406593c + haskellPackages = pkgs.haskellPackages.override { + ghc = pkgs.haskellPackages.ghc.overrideDerivation (const { + forceRebuild = true; + }); + }; + }; +} diff --git a/devhell/pkgs/pkgs_common.nix b/devhell/pkgs/pkgs_common.nix new file mode 100644 index 00000000..e723fb5e --- /dev/null +++ b/devhell/pkgs/pkgs_common.nix @@ -0,0 +1,299 @@ +{ config, pkgs, lib, ... }: + +{ + nixpkgs.config = { + pulseaudio = true; + + allowUnfree = true; + + systemd = { + enableKDbus = true; + }; + + conky = { + weatherMetarSupport = true; + mpdSupport = true; + wirelessSupport = true; + x11Support = false; + }; + + firefox = { + enableGTK3 = true; + enableOfficalBranding = true; + }; + + virtualbox = { + enableExtensionPack = true; + }; + + mpv = { + youtubeSupport = true; + }; + }; + + environment.systemPackages = with pkgs; [ + #attic + #emacs + #gitAndTools.git-annex + #ipfs + #john + #lxappearance + #sleuthkit + #texmacs + #tribler + #vimiv + #zotero + abcde + abook + accountsservice + antiword + apg + arandr + arc-theme + ascii + aspell + aspellDicts.de + aspellDicts.en + atftp + atom + audacity + axel + bc + beets + biber + bind + binutils + brotli + bup + cacert + cataclysm-dda + cava + ccrypt + chromaprint + chromium + cifs_utils + cipherscan + cmake + cmatrix + colordiff + compton + conky + cryptsetup + ctodo + cuetools + darkstat + dcfldd + ddrescue + dhcping + dmenu + dmidecode + docker + dos2unix + dosbox + duff + dynamic-colors + e2fsprogs + easytag + electrum + enhanced-ctorrent + ethtool + evince + fbida + fdupes + feh + ffmpeg-full + figlet + file + firefox + flac + foremost + freerdpUnstable + fuse_exfat + gajim + gcc + gdb + ghostscript + gimp + gitAndTools.git-extras + gitAndTools.git-remote-hg + gitAndTools.git2cl + gitAndTools.gitFastExport + gitAndTools.gitFull + gitAndTools.gitRemoteGcrypt + gitAndTools.gitSVN + gitAndTools.gitflow + gitAndTools.svn2git + gitAndTools.tig + glxinfo + gnome3.dconf + gnome3.defaultIconTheme + gnome3.gnome_themes_standard + gnufdisk + gnupg + gnupg1compat + gource + gparted + gpgme + gpicview + gptfdisk + graphviz + gstreamer + handbrake + hdparm + heimdall + hexedit + hplipWithPlugin + htop + i3lock + i3status + icedtea_web + iftop + imagemagick + impressive + inkscape + iotop + iptraf-ng + ipv6calc + jfsutils + jwhois + keepassx + keepassx-community + keepassx2 + keybase + kpcli + lftp + libarchive + libreoffice + lm_sensors + lsof + lxc + lynx + macchanger + manpages + mc + mcabber + mdp + mediainfo + mkvtoolnix + mmv + monkeysAudio + mono + monodevelop + mosh + mp3gain + mpc_cli + mpv + mtr + ncdu + ncmpcpp + neovim + nethack + nethogs + netkittftp + netrw + netsniff-ng + nitrogen + nix-prefetch-scripts + nix-repl + nixops + nload + nmap + ntfs3g + ntfsprogs + ntopng + numix-icon-theme + obnam + openssl + p7zip + pandoc + paperkey + pass + pasystray + pavucontrol + pciutils + picard + posix_man_pages + powertop + profanity + profile-cleaner + profile-sync-daemon + pv + python + python2 + python3 + python34Packages.hovercraft + pythonPackages.jrnl + pythonPackages.livestreamer + pythonPackages.rainbowstream + qemu + qrencode + recode + reiserfsprogs + rofi + rsync + ruby + safecopy + screen + scrot + shntool + silver-searcher + smartmontools + sox + speedtest-cli + spek + ssdeep + stow + strace + surfraw + taskwarrior + telnet + testdisk + texlive.combined.scheme-small + tftp-hpa + tldr + tmux + toilet + tomahawk + toxic + transcode + transgui + transmission_remote_gtk + tree + tty-clock + udevil + units + unrar + unzip + valgrind + vanilla-dmz + vim_configurable + virt-viewer + virtinst + virtmanager + vit + vivaldi + vlc + vlock + vnstat + vorbisTools + vorbisgain + w3m + wavpack + weechat + wget + which + wipe + wireshark + xfsprogs + xlibs.xev + xmpp-client + xpdf + xpra + xscreensaver + youtube-dl + zathura + zbar + zip + zsync + ]; +} diff --git a/devhell/pkgs/pkgs_eris.nix b/devhell/pkgs/pkgs_eris.nix new file mode 100644 index 00000000..fa834b0e --- /dev/null +++ b/devhell/pkgs/pkgs_eris.nix @@ -0,0 +1,29 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./pkgs_common.nix ]; + + nixpkgs.config.mpv = { + vaapiSupport = true; + }; + + environment.systemPackages = with pkgs; [ + terminator + claws-mail + aircrackng + horst + kismet + minicom + networkmanagerapplet + pamixer + pmtools + pmutils + reaverwps + snort + wavemon + xbindkeys + xorg.xbacklight + thunderbird + iw + ]; +} diff --git a/devhell/pkgs/pkgs_skunkworks.nix b/devhell/pkgs/pkgs_skunkworks.nix new file mode 100644 index 00000000..296dbca1 --- /dev/null +++ b/devhell/pkgs/pkgs_skunkworks.nix @@ -0,0 +1,31 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./pkgs_common.nix ]; + + nixpkgs.config = { + chromium = { + enablePepperFlash = true; + }; + + mpv = { + bs2bSupport = true; + }; + }; + + environment.systemPackages = with pkgs; [ + abook + canto-curses + cli-visualizer + cmus + #ipfs + handbrake + hplip + mutt-with-sidebar + nzbget + #scummvm + slrn + twister + urlview + ]; +} diff --git a/devhell/pkgs/pkgs_titan.nix b/devhell/pkgs/pkgs_titan.nix new file mode 100644 index 00000000..3efab6c1 --- /dev/null +++ b/devhell/pkgs/pkgs_titan.nix @@ -0,0 +1,48 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./pkgs_common.nix ]; + + nixpkgs.config.mpv = { + vaapiSupport = true; + }; + + environment.systemPackages = with pkgs; [ + #cura + #openjdk8 + #skype + aircrackng + calibre + cdrtools + claws-mail + connmanui + dvdplusrwtools + glxinfo + horst + ipmitool + ipmiutil + ipmiview + kismet + libva + libvdpau-va-gl + minicom + msmtp + mutt + networkmanagerapplet + notmuch + offlineimap + pamixer + pmtools + pmutils + pythonPackages.alot + reaverwps + snort + thunderbird + vaapiVdpau + vdpauinfo + wavemon + wirelesstools + xbindkeys + xorg.xbacklight + ]; +} diff --git a/devhell/release.nix b/devhell/release.nix new file mode 100644 index 00000000..10c2a790 --- /dev/null +++ b/devhell/release.nix @@ -0,0 +1,13 @@ +### THIS FILE IS FOR HYDRA BUILD ONLY! YOU CAN IGNORE THIS FILE IF YOU ARE NOT USING A HYDRA! + +let + supportedSystems = [ "x86_64-linux" ]; + system = "x86_64-linux"; + +in + +{ + skunkworks = (import <nixpkgs/nixos> { configuration = ./entry-skunkworks.nix; }).system; + titan = (import <nixpkgs/nixos> { configuration = ./entry-titan.nix; }).system; + eris = (import <nixpkgs/nixos> { configuration = ./entry-eris.nix; }).system; +} diff --git a/devhell/services/services_common.nix b/devhell/services/services_common.nix new file mode 100644 index 00000000..42ba2525 --- /dev/null +++ b/devhell/services/services_common.nix @@ -0,0 +1,79 @@ +{ config, pkgs, lib, ... }: + +{ + virtualisation = { + virtualbox = { + host = { + enable = true; + enableHardening = true; + }; + }; + libvirtd = { + enable = true; + enableKVM = true; + }; + }; + + services = { + gpm.enable = true; + openssh.enable = true; + haveged.enable = true; + thermald.enable = true; + udisks2.enable = true; + redshift = { + enable = true; + latitude = "51.2750"; + longitude = "1.0870"; + }; + }; + + services.xserver = { + displayManager.lightdm.enable = true; + desktopManager.xterm.enable = false; + desktopManager.default = "none"; + }; + + services.xserver.windowManager = { + i3.enable = true; + default = "i3"; + }; + + services.syncthing = { + enable = true; + user = "dev"; + }; + + services.journald.extraConfig = '' + SystemMaxUse = 50M + ''; + + services.psd = { + enable = false; + users = [ "dev" ]; + browsers = [ "chromium" ]; + }; + + services.mpd = { + enable = true; + extraConfig = '' + input { + plugin "curl" + } + + audio_output { + type "fifo" + name "FIFO Output" + path "/tmp/mpd.fifo" + format "44100:16:2" + } + + audio_output { + type "pulse" + name "Pulse Output" + server "127.0.0.1" + } + + replaygain "album" + ''; + }; +} diff --git a/devhell/services/services_eris.nix b/devhell/services/services_eris.nix new file mode 100644 index 00000000..cfec789f --- /dev/null +++ b/devhell/services/services_eris.nix @@ -0,0 +1,138 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./services_common.nix ]; + + services = { + tftpd.enable = true; + gnome3.gnome-keyring.enable = true; + printing.enable = false; + }; + + services.udev = { + extraRules = '' + SUBSYSTEM=="firmware", ACTION=="add", ATTR{loading}="-1" + ''; + }; + + services.acpid = { + enable = true; + lidEventCommands = '' + LID="/proc/acpi/button/lid/LID/state" + state=`cat $LID | ${pkgs.gawk}/bin/awk '{print $2}'` + case "$state" in + *open*) ;; + *close*) systemctl suspend ;; + *) logger -t lid-handler "Failed to detect lid state ($state)" ;; + esac + ''; + }; + + services.xserver = { + enable = true; + layout = "gb"; + videoDrivers = [ "intel" ]; + + synaptics = { + enable = true; + twoFingerScroll = true; + palmDetect = true; + }; + + displayManager.sessionCommands = '' + ${pkgs.xorg.xsetroot}/bin/xsetroot -solid black + ${pkgs.networkmanagerapplet}/bin/nm-applet & + ${pkgs.pasystray}/bin/pasystray & + #${pkgs.compton}/bin/compton -f & + ${pkgs.rofi}/bin/rofi & + ${pkgs.xorg.xrdb}/bin/xrdb "${pkgs.writeText "xrdb.conf" '' + Xft.dpi: 96 + Xft.antialias: true + Xft.hinting: full + Xft.hintstyle: hintslight + Xft.rgba: rgb + Xft.lcdfilter: lcddefault + Xft.autohint: 1 + Xcursor.theme: Vanilla-DMZ-AA + Xcursor.size: 22 + *.charClass:33:48,35:48,37:48,43:48,45-47:48,61:48,63:48,64:48,95:48,126:48,35:48,58:48 + *background: #121212 + *foreground: #babdb6 + ${lib.concatMapStrings (xterm: '' + ${xterm}.termName: xterm-256color + ${xterm}*bellIsUrgent: true + ${xterm}*utf8: 1 + ${xterm}*locale: true + ${xterm}*utf8Title: true + ${xterm}*utf8Fonts: 1 + ${xterm}*utf8Latin1: true + ${xterm}*dynamicColors: true + ${xterm}*eightBitInput: true + ${xterm}*faceName: xft:DejaVu Sans Mono for Powerline:pixelsize=9:antialias=true:hinting=true + ${xterm}*faceNameDoublesize: xft:Unifont:pixelsize=12:antialias=true:hinting=true + ${xterm}*cursorColor: #545f65 + '') [ "UXTerm" "XTerm" ]} + ! ------------------------------------------------------------------------------ + ! ROFI Color theme & Settings + ! ------------------------------------------------------------------------------ + rofi.modi: run + rofi.opacity: 85 + rofi.width: 100 + rofi.lines: 3 + rofi.padding: 300 + rofi.bw: 0 + rofi.eh: 2 + rofi.color-enabled: true + rofi.color-window: #393939, #393939, #268bd2 + rofi.color-normal: #393939, #ffffff, #393939, #268bd2, #ffffff + rofi.color-active: #393939, #268bd2, #393939, #268bd2, #205171 + rofi.color-urgent: #393939, #f3843d, #393939, #268bd2, #ffc39c + ''}" + ''; + }; + + services.tlp = { + enable = true; + extraConfig = '' + TLP_ENABLE = 1 + DISK_IDLE_SECS_ON_BAT=2 + MAX_LOST_WORK_SECS_ON_AC=15 + MAX_LOST_WORK_SECS_ON_BAT=60 + SCHED_POWERSAVE_ON_AC=0 + SCHED_POWERSAVE_ON_BAT=1 + NMI_WATCHDOG=0 + DISK_DEVICES="sda sdb" + DISK_APM_LEVEL_ON_AC="254 254" + DISK_APM_LEVEL_ON_BAT="254 127" + DISK_IOSCHED="noop cfq" + SATA_LINKPWR_ON_AC=max_performance + SATA_LINKPWR_ON_BAT=min_power + PCIE_ASPM_ON_AC=performance + PCIE_ASPM_ON_BAT=powersave + WIFI_PWR_ON_AC=1 + WIFI_PWR_ON_BAT=5 + WOL_DISABLE=Y + SOUND_POWER_SAVE_ON_AC=0 + SOUND_POWER_SAVE_ON_BAT=1 + SOUND_POWER_SAVE_CONTROLLER=Y + RUNTIME_PM_ON_AC=on + RUNTIME_PM_ON_BAT=auto + RUNTIME_PM_ALL=1 + USB_AUTOSUSPEND=1 + USB_BLACKLIST_WWAN=1 + RESTORE_DEVICE_STATE_ON_STARTUP=0 + DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wwan" + DEVICES_TO_ENABLE_ON_STARTUP="wifi" + DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan" + #DEVICES_TO_ENABLE_ON_SHUTDOWN="" + START_CHARGE_THRESH_BAT0=75 + STOP_CHARGE_THRESH_BAT0=80 + #DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan" + #DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan" + #DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi" + #DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan" + #DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT="" + #DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT="" + ''; + }; +} diff --git a/devhell/services/services_skunkworks.nix b/devhell/services/services_skunkworks.nix new file mode 100644 index 00000000..f0fa4243 --- /dev/null +++ b/devhell/services/services_skunkworks.nix @@ -0,0 +1,162 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./services_common.nix ]; + + services = { + printing = { + enable = true; + drivers = [ pkgs.hplipWithPlugin ]; + }; + timesyncd.enable = true; + resolved.enable = true; + canto-daemon.enable = true; + }; + + services.xserver = { + enable = true; + layout = "us"; + xkbVariant = "dvorak"; + videoDrivers = [ "ati" ]; + + serverLayoutSection = '' + Screen "Center/Right" + Screen "Left" LeftOf "Center/Right" + ''; + + config = '' + Section "ServerLayout" + Identifier "Multihead layout" + Screen "Center/Right" + Screen "Left" LeftOf "Center/Right" + EndSection + + Section "Device" + Identifier "Radeon HD 4650 PCIEx8" + Driver "radeon" + BusId "PCI:2:0:0" + + Option "monitor-DVI-1" "Left monitor" + EndSection + + Section "Device" + Identifier "Radeon HD 4650 PCIEx16" + Driver "radeon" + BusID "PCI:1:0:0" + + Option "monitor-DVI-0" "Center monitor" + Option "monitor-HDMI-0" "Right monitor" + EndSection + + Section "Screen" + Identifier "Center/Right" + Monitor "Left monitor" + Device "Radeon HD 4650 PCIEx16" + EndSection + + Section "Screen" + Identifier "Left" + Device "Radeon HD 4650 PCIEx8" + EndSection + + Section "Monitor" + Identifier "Left monitor" + EndSection + + Section "Monitor" + Identifier "Center monitor" + Option "LeftOf" "Right monitor" + Option "Primary" "true" + EndSection + + Section "Monitor" + Identifier "Right monitor" + EndSection + ''; + + displayManager.sessionCommands = '' + ${pkgs.xorg.xsetroot}/bin/xsetroot -solid black + ${pkgs.xscreensaver}/bin/xscreensaver -no-splash & + ${pkgs.rofi}/bin/rofi & + ${pkgs.xorg.xrdb}/bin/xrdb "${pkgs.writeText "xrdb.conf" '' + Xft.dpi: 96 + Xft.antialias: true + Xft.hinting: full + Xft.hintstyle: hintslight + Xft.rgba: rgb + Xft.lcdfilter: lcddefault + Xft.autohint: 1 + XTerm.termName: xterm-256color + XTerm*bellIsUrgent: true + XTerm*utf8: 1 + XTerm*locale: true + XTerm*utf8Title: true + XTerm*utf8Fonts: true + XTerm*utf8Latin1: true + XTerm*dynamicColors: true + XTerm*eightBitInput: true + Xcursor.theme: Vanilla-DMZ-AA + Xcursor.size: 22 + *.charClass:33:48,35:48,37:48,43:48,45-47:48,61:48,63:48,64:48,95:48,126:48,35:48,58:48 + XTerm*faceName: xft:DejaVu Sans Mono for Powerline:pixelsize=12:antialias=true:hinting=true + XTerm*faceNameDoublesize: xft:Unifont:pixelsize=12:antialias=true:hinting=true + XTerm*cursorColor: #545f65 + XTerm*saveLines: 10000 + ! Base16 Twilight + ! Scheme: David Hart (http://hart-dev.com) + #define base00 #1e1e1e + #define base01 #323537 + #define base02 #464b50 + #define base03 #5f5a60 + #define base04 #838184 + #define base05 #a7a7a7 + #define base06 #c3c3c3 + #define base07 #ffffff + #define base08 #cf6a4c + #define base09 #cda869 + #define base0A #f9ee98 + #define base0B #8f9d6a + #define base0C #afc4db + #define base0D #7587a6 + #define base0E #9b859d + #define base0F #9b703f + *.foreground: base05 + *.background: base00 + *.cursorColor: base05 + *.color0: base00 + *.color1: base08 + *.color2: base0B + *.color3: base0A + *.color4: base0D + *.color5: base0E + *.color6: base0C + *.color7: base05 + *.color8: base03 + *.color9: base09 + *.color10: base01 + *.color11: base02 + *.color12: base04 + *.color13: base06 + *.color14: base0F + *.color15: base07 + ! ------------------------------------------------------------------------------ + ! ROFI Color theme & Settings + ! ------------------------------------------------------------------------------ + rofi.modi: run + rofi.opacity: 85 + rofi.width: 100 + rofi.lines: 3 + rofi.padding: 450 + rofi.bw: 0 + rofi.eh: 2 + rofi.color-enabled: true + rofi.color-window: #393939, #393939, #268bd2 + rofi.color-normal: #393939, #ffffff, #393939, #268bd2, #ffffff + rofi.color-active: #393939, #268bd2, #393939, #268bd2, #205171 + rofi.color-urgent: #393939, #f3843d, #393939, #268bd2, #ffc39c + ''}" + + DISPLAY=:0.1 ${pkgs.windowmaker}/bin/wmaker & + ''; + }; +} diff --git a/devhell/services/services_titan.nix b/devhell/services/services_titan.nix new file mode 100644 index 00000000..a4ed892c --- /dev/null +++ b/devhell/services/services_titan.nix @@ -0,0 +1,90 @@ +{ config, pkgs, lib, ... }: + +{ + imports = [ ./services_common.nix ]; + + services = { + tftpd.enable = false; + gnome3.gnome-keyring.enable = true; + printing.enable = false; + }; + + services.acpid = { + enable = true; + lidEventCommands = '' + LID="/proc/acpi/button/lid/LID/state" + state=`cat $LID | ${pkgs.gawk}/bin/awk '{print $2}'` + case "$state" in + *open*) ;; + *close*) systemctl suspend ;; + *) logger -t lid-handler "Failed to detect lid state ($state)" ;; + esac + ''; + }; + + services.xserver = { + enable = true; + layout = "gb"; + videoDrivers = [ "intel" ]; + + synaptics = { + enable = true; + twoFingerScroll = true; + palmDetect = true; + }; + + displayManager.sessionCommands = '' + ${pkgs.xbindkeys}/bin/xbindkeys & + ${pkgs.nitrogen}/bin/nitrogen --restore & + #${pkgs.networkmanagerapplet}/bin/nm-applet & + ${pkgs.connmanui}/bin/connman-ui-gtk & + ${pkgs.xscreensaver}/bin/xscreensaver -no-splash & + ${pkgs.pasystray}/bin/pasystray & + ${pkgs.compton}/bin/compton -f & + ${pkgs.rofi}/bin/rofi & + ${pkgs.xorg.xrdb}/bin/xrdb "${pkgs.writeText "xrdb.conf" '' + Xft.dpi: 96 + Xft.antialias: true + Xft.hinting: full + Xft.hintstyle: hintslight + Xft.rgba: rgb + Xft.lcdfilter: lcddefault + Xft.autohint: 1 + Xcursor.theme: Vanilla-DMZ-AA + Xcursor.size: 22 + *.charClass:33:48,35:48,37:48,43:48,45-47:48,61:48,63:48,64:48,95:48,126:48,35:48,58:48 + *background: #121212 + *foreground: #babdb6 + ${lib.concatMapStrings (xterm: '' + ${xterm}.termName: xterm-256color + ${xterm}*bellIsUrgent: true + ${xterm}*utf8: 1 + ${xterm}*locale: true + ${xterm}*utf8Title: true + ${xterm}*utf8Fonts: 1 + ${xterm}*utf8Latin1: true + ${xterm}*dynamicColors: true + ${xterm}*eightBitInput: true + ${xterm}*faceName: xft:DejaVu Sans Mono for Powerline:pixelsize=9:antialias=true:hinting=true + ${xterm}*faceNameDoublesize: xft:Unifont:pixelsize=12:antialias=true:hinting=true + ${xterm}*cursorColor: #545f65 + '') [ "UXTerm" "XTerm" ]} + ! ------------------------------------------------------------------------------ + ! ROFI Color theme & Settings + ! ------------------------------------------------------------------------------ + rofi.modi: run + rofi.opacity: 85 + rofi.width: 100 + rofi.lines: 3 + rofi.padding: 300 + rofi.bw: 0 + rofi.eh: 2 + rofi.color-enabled: true + rofi.color-window: #393939, #393939, #268bd2 + rofi.color-normal: #393939, #ffffff, #393939, #268bd2, #ffffff + rofi.color-active: #393939, #268bd2, #393939, #268bd2, #205171 + rofi.color-urgent: #393939, #f3843d, #393939, #268bd2, #ffc39c + ''}" + ''; + }; +} diff --git a/devhell/users/users_dev.nix b/devhell/users/users_dev.nix new file mode 100644 index 00000000..41649ae0 --- /dev/null +++ b/devhell/users/users_dev.nix @@ -0,0 +1,10 @@ +{ config, pkgs, lib, ... }: + +{ + users.extraUsers.dev = { + isNormalUser = true; + extraGroups = [ "vboxusers" "wheel" "mpd" "networkmanager" "libvirtd" ]; + uid = 1000; + shell = "${pkgs.zsh}/bin/zsh"; + }; +} |