commit c0062bbc5c7ae0b3d7d155ad1105ea434d44c10d Author: Sven Slootweg Date: Sun Dec 11 09:44:28 2016 +0100 Initial commit diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..3755776 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "nixpkgs-master"] + path = nixpkgs-master + url = https://github.com/NixOS/nixpkgs.git diff --git a/lib/packages.nix b/lib/packages.nix new file mode 100644 index 0000000..9948bb2 --- /dev/null +++ b/lib/packages.nix @@ -0,0 +1,5 @@ +options: { + master = (import ../nixpkgs-master) options; + nixpkgs = (import ) options; + myNixpkgs = {}; +} diff --git a/nixpkgs-master b/nixpkgs-master new file mode 160000 index 0000000..f928160 --- /dev/null +++ b/nixpkgs-master @@ -0,0 +1 @@ +Subproject commit f9281609aef096cac905cd1081aacc9193ad273f diff --git a/profiles/environment/graphical-environment.nix b/profiles/environment/graphical-environment.nix new file mode 100644 index 0000000..41824f7 --- /dev/null +++ b/profiles/environment/graphical-environment.nix @@ -0,0 +1,48 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.gksu + nixpkgs.xfontsel + ]; + + fonts = { + fontconfig = { + enable = true; + }; + + enableFontDir = true; + enableCoreFonts = true; + enableGhostscriptFonts = true; + + fonts = with packages ; [ + nixpkgs.liberation_ttf + nixpkgs.ttf_bitstream_vera + nixpkgs.dejavu_fonts + nixpkgs.terminus_font + nixpkgs.bakoma_ttf + nixpkgs.bakoma_ttf + nixpkgs.ubuntu_font_family + nixpkgs.vistafonts + nixpkgs.unifont + nixpkgs.freefont_ttf + ]; + }; + + services = { + xserver = { + enable = true; + layout = "us"; + xkbOptions = "eurosign:e, caps:backspace"; + + displayManager = { + lightdm = { + enable = true; + }; + }; + }; + + # We need accounts-daemon for lightdm to work correctly. + accounts-daemon = { + enable = true; + }; + }; +} diff --git a/profiles/environment/xfce4.nix b/profiles/environment/xfce4.nix new file mode 100644 index 0000000..1d4deaa --- /dev/null +++ b/profiles/environment/xfce4.nix @@ -0,0 +1,44 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + # XFCE tools + nixpkgs.xfce.xfce4taskmanager + nixpkgs.xfce.gigolo + nixpkgs.xfce.xfce4_systemload_plugin + nixpkgs.xfce.xfce4_cpufreq_plugin + nixpkgs.xfce.xfce4_whiskermenu_plugin + nixpkgs.xfce.xfce4_cpugraph_plugin + nixpkgs.xfce.xfce4_fsguard_plugin + nixpkgs.xfce.xfce4_datetime_plugin + nixpkgs.xfce.xfce4_netload_plugin + nixpkgs.xfce.xfce4_systemload_plugin + nixpkgs.xfce.xfce4_verve_plugin + nixpkgs.xfce.xfce4_xkb_plugin + + # GNOME applications + nixpkgs.gnome3.file-roller + + # GTK themes + master.blackbird + master.greybird + nixpkgs.arc-gtk-theme + + # GNOME/GTK internals + nixpkgs.gnome3.dconf + nixpkgs.gnome3.dconf-editor + nixpkgs.polkit_gnome + ]; + + services = { + xserver.desktopManager.xfce = { + enable = true; + thunarPlugins = with packages; [ + nixpkgs.xfce.thunar-archive-plugin + nixpkgs.xfce.thunar_volman + ]; + }; + + udisks2 = { + enable = true; + }; + }; +} diff --git a/profiles/software/bitcoin.nix b/profiles/software/bitcoin.nix new file mode 100644 index 0000000..8918173 --- /dev/null +++ b/profiles/software/bitcoin.nix @@ -0,0 +1,5 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.electrum + ]; +} diff --git a/profiles/software/browsers.nix b/profiles/software/browsers.nix new file mode 100644 index 0000000..d1d8680 --- /dev/null +++ b/profiles/software/browsers.nix @@ -0,0 +1,21 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.chromium + nixpkgs.firefox + nixpkgs.w3m + ]; + + nixpkgs.config = { + firefox = { + enableGoogleTalkPlugin = true; + enableAdobeFlash = true; + jre = true; + }; + + chromium = { + enablePepperFlash = true; + enablePepperPDF = true; + jre = true; + }; + }; +} diff --git a/profiles/software/build-tools.nix b/profiles/software/build-tools.nix new file mode 100644 index 0000000..d660d0a --- /dev/null +++ b/profiles/software/build-tools.nix @@ -0,0 +1,8 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + gcc + gnumake + automake + autoconf + ]; +} diff --git a/profiles/software/couchdb.nix b/profiles/software/couchdb.nix new file mode 100644 index 0000000..b81c4e5 --- /dev/null +++ b/profiles/software/couchdb.nix @@ -0,0 +1,7 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + master.couchdb + ]; + + # FIXME: CouchDB service? +} diff --git a/profiles/software/development.nix b/profiles/software/development.nix new file mode 100644 index 0000000..ff82ddd --- /dev/null +++ b/profiles/software/development.nix @@ -0,0 +1,11 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + master.atom + nixpkgs.geany + nixpkgs.sqlitebrowser + nixpkgs.gitAndTools.gitFull + nixpkgs.meld + nixpkgs.radare2 + nixpkgs.wxhexeditor + ]; +} diff --git a/profiles/software/diagnostics.nix b/profiles/software/diagnostics.nix new file mode 100644 index 0000000..b83b9b8 --- /dev/null +++ b/profiles/software/diagnostics.nix @@ -0,0 +1,32 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + # General + nixpkgs.lsof + + # Processes + nixpkgs.htop + nixpkgs.psmisc + + # Network + nixpkgs.iftop + nixpkgs.nload + nixpkgs.tcpdump + nixpkgs.nmap + nixpkgs.mtr + nixpkgs.vnstat + nixpkgs.telnet + + # Disk and filesystem + nixpkgs.smartmontools + nixpkgs.iotop + nixpkgs.ncdu + nixpkgs.gparted + + # Peripherals + nixpkgs.pciutils + nixpkgs.usbutils + + # Graphics + nixpkgs.glxinfo + ]; +} diff --git a/profiles/software/downloaders.nix b/profiles/software/downloaders.nix new file mode 100644 index 0000000..7ba8b4b --- /dev/null +++ b/profiles/software/downloaders.nix @@ -0,0 +1,8 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + (master.python35Packages.youtube-dl.override { + ffmpeg = master.ffmpeg-full; + }) + master.megatools + ]; +} diff --git a/profiles/software/emulators.nix b/profiles/software/emulators.nix new file mode 100644 index 0000000..0e1f812 --- /dev/null +++ b/profiles/software/emulators.nix @@ -0,0 +1,7 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.wineUnstable + nixpkgs.dosbox + nixpkgs.playonlinux + ]; +} diff --git a/profiles/software/filesharing.nix b/profiles/software/filesharing.nix new file mode 100644 index 0000000..826aea1 --- /dev/null +++ b/profiles/software/filesharing.nix @@ -0,0 +1,5 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.qbittorrent + ]; +} diff --git a/profiles/software/games.nix b/profiles/software/games.nix new file mode 100644 index 0000000..f3e992a --- /dev/null +++ b/profiles/software/games.nix @@ -0,0 +1,6 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.multimc + master.xonotic + ]; +} diff --git a/profiles/software/graphical-base.nix b/profiles/software/graphical-base.nix new file mode 100644 index 0000000..c9cc9d9 --- /dev/null +++ b/profiles/software/graphical-base.nix @@ -0,0 +1,7 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.p7zip + nixpkgs.keepassx2 + nixpkgs.pcmanfm + ]; +} diff --git a/profiles/software/guake.nix b/profiles/software/guake.nix new file mode 100644 index 0000000..210321b --- /dev/null +++ b/profiles/software/guake.nix @@ -0,0 +1,14 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.guake + nixpkgs.gnome.GConf + ]; + + environment.pathsToLink = [ "/etc/gconf" ]; + + services = { + dbus = with packages; { + packages = [ nixpkgs.gnome.GConf ]; + }; + }; +} diff --git a/profiles/software/light-games.nix b/profiles/software/light-games.nix new file mode 100644 index 0000000..00b91e6 --- /dev/null +++ b/profiles/software/light-games.nix @@ -0,0 +1,6 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.simutrans + master.openttd + ]; +} diff --git a/profiles/software/messaging.nix b/profiles/software/messaging.nix new file mode 100644 index 0000000..7729aab --- /dev/null +++ b/profiles/software/messaging.nix @@ -0,0 +1,5 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.pidgin + ]; +} diff --git a/profiles/software/multimedia.nix b/profiles/software/multimedia.nix new file mode 100644 index 0000000..a012c79 --- /dev/null +++ b/profiles/software/multimedia.nix @@ -0,0 +1,24 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + # Video + nixpkgs.mplayer + nixpkgs.mpv + nixpkgs.vlc + nixpkgs.kodi + + # Audio + nixpkgs.tomahawk + nixpkgs.audacious + nixpkgs.mpg321 + + # Documents + nixpkgs.evince + nixpkgs.djvulibre + + # Images + nixpkgs.gqview + + # Utilities + nixpkgs.mediainfo + ]; +} diff --git a/profiles/software/node.nix b/profiles/software/node.nix new file mode 100644 index 0000000..df8d932 --- /dev/null +++ b/profiles/software/node.nix @@ -0,0 +1,5 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + master.nodejs-6_x + ]; +} diff --git a/profiles/software/postgresql.nix b/profiles/software/postgresql.nix new file mode 100644 index 0000000..a7a2125 --- /dev/null +++ b/profiles/software/postgresql.nix @@ -0,0 +1,16 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + master.pgadmin + ]; + + services = { + postgresql = { + enable = true; + package = packages.nixpkgs.postgresql95; + authentication = '' + local all all ident + host all all 127.0.0.1/32 md5 + ''; + }; + }; +} diff --git a/profiles/software/productivity.nix b/profiles/software/productivity.nix new file mode 100644 index 0000000..3f78fc4 --- /dev/null +++ b/profiles/software/productivity.nix @@ -0,0 +1,10 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.libreoffice + nixpkgs.gimp + nixpkgs.inkscape + nixpkgs.audacity + nixpkgs.shutter + nixpkgs.jekyll + ]; +} diff --git a/profiles/software/synergy.nix b/profiles/software/synergy.nix new file mode 100644 index 0000000..f244f0e --- /dev/null +++ b/profiles/software/synergy.nix @@ -0,0 +1,6 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.quicksynergy + nixpkgs.synergy + ]; +} diff --git a/profiles/software/workrave.nix b/profiles/software/workrave.nix new file mode 100644 index 0000000..3b348b2 --- /dev/null +++ b/profiles/software/workrave.nix @@ -0,0 +1,9 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.workrave + ]; + + networking.firewall.allowedTCPPorts = [ + 27273 + ]; +} diff --git a/profiles/system/amd.nix b/profiles/system/amd.nix new file mode 100644 index 0000000..cc7e506 --- /dev/null +++ b/profiles/system/amd.nix @@ -0,0 +1,9 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.amdappsdk # For OpenCL support, at least theoretically... + ]; + + services.xserver = { + videoDrivers = ["ati_unfree"]; + }; +} diff --git a/profiles/system/base.nix b/profiles/system/base.nix new file mode 100644 index 0000000..9757649 --- /dev/null +++ b/profiles/system/base.nix @@ -0,0 +1,59 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.openssl + nixpkgs.cacert + nixpkgs.fuse + nixpkgs.bashCompletion + + nixpkgs.nix-repl + nixpkgs.xorg.xmodmap + + nixpkgs.python + + nixpkgs.file + nixpkgs.tree + + nixpkgs.zip + nixpkgs.unzip + nixpkgs.unrar + + nixpkgs.ag + nixpkgs.jq + nixpkgs.nano + + nixpkgs.screen + nixpkgs.tmux + ]; + + nixpkgs.config = { + allowUnfree = true; + }; + + nix = { + gc = { + automatic = true; + dates = "00:00"; + }; + }; + + system.autoUpgrade.enable = true; + + security = { + sudo.configFile = '' + Defaults targetpw + ALL ALL=(ALL) ALL + ''; + }; + + i18n = { + consoleFont = "Lat2-Terminus16"; + consoleKeyMap = "us"; + defaultLocale = "en_US.UTF-8"; + }; + + time.timeZone = "Europe/Amsterdam"; + + boot = { + plymouth.enable = true; + }; +} diff --git a/profiles/system/efi-boot.nix b/profiles/system/efi-boot.nix new file mode 100644 index 0000000..2ce316d --- /dev/null +++ b/profiles/system/efi-boot.nix @@ -0,0 +1,19 @@ +packages: {config, ...}: { + boot = { + loader = { + systemd-boot.enable = false; + + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + + grub = { + enable = true; + device = "nodev"; + version = 2; + efiSupport = true; + }; + }; + }; +} diff --git a/profiles/system/networked.nix b/profiles/system/networked.nix new file mode 100644 index 0000000..3089940 --- /dev/null +++ b/profiles/system/networked.nix @@ -0,0 +1,26 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.iptables + + nixpkgs.wget + nixpkgs.curl + nixpkgs.httpie + nixpkgs.whois + ]; + + networking = { + networkmanager.enable = true; + }; + + services = { + ntp = { + enable = true; + servers = [ "server.local" "0.pool.ntp.org" "1.pool.ntp.org" "2.pool.ntp.org" ]; + }; + + avahi = { + enable = true; + nssmdns = true; + }; + }; +} diff --git a/profiles/system/printing.nix b/profiles/system/printing.nix new file mode 100644 index 0000000..0acb633 --- /dev/null +++ b/profiles/system/printing.nix @@ -0,0 +1,5 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + master.xsane + ]; +} diff --git a/profiles/system/pulseaudio.nix b/profiles/system/pulseaudio.nix new file mode 100644 index 0000000..dfa4d44 --- /dev/null +++ b/profiles/system/pulseaudio.nix @@ -0,0 +1,12 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.pavucontrol + nixpkgs.xfce.xfce4_pulseaudio_plugin # FIXME: Only enable when running XFCE + ]; + + hardware.pulseaudio = with packages; { + enable = true; + support32Bit = true; + package = nixpkgs.pulseaudioFull; + }; +} diff --git a/profiles/system/scanning.nix b/profiles/system/scanning.nix new file mode 100644 index 0000000..404644e --- /dev/null +++ b/profiles/system/scanning.nix @@ -0,0 +1,8 @@ +packages: {config, ...}: { + services = { + printing = with packages; { + enable = true; + drivers = [ nixpkgs.gutenprint ]; + }; + }; +} diff --git a/profiles/system/virtualization.nix b/profiles/system/virtualization.nix new file mode 100644 index 0000000..e33684c --- /dev/null +++ b/profiles/system/virtualization.nix @@ -0,0 +1,11 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.virtmanager + ]; + + boot.kernelModules = [ + "tun" # For full network capabilities in QEMU/KVM + "virtio" # Faster I/O drivers for QEMU/KVM on Linux + "nbd" # For mounting QEMU images (optionally over the network) + ]; +} diff --git a/systems/desktop.nix b/systems/desktop.nix new file mode 100644 index 0000000..089ab6d --- /dev/null +++ b/systems/desktop.nix @@ -0,0 +1,119 @@ +{ config, pkgs, ... }: let + packages = (import ../lib/packages.nix) { config = config.nixpkgs.config; }; + callPackageFile = path: (import path) packages; +in { + imports = [ + (callPackageFile ../profiles/system/base.nix) + + (callPackageFile ../profiles/environment/graphical-environment.nix) + (callPackageFile ../profiles/environment/xfce4.nix) + + (callPackageFile ../profiles/system/efi-boot.nix) + (callPackageFile ../profiles/system/networked.nix) + (callPackageFile ../profiles/system/printing.nix) + (callPackageFile ../profiles/system/scanning.nix) + (callPackageFile ../profiles/system/amd.nix) + (callPackageFile ../profiles/system/pulseaudio.nix) + (callPackageFile ../profiles/system/virtualization.nix) + + (callPackageFile ../profiles/software/postgresql.nix) + (callPackageFile ../profiles/software/couchdb.nix) + + (callPackageFile ../profiles/software/light-games.nix) + (callPackageFile ../profiles/software/games.nix) + (callPackageFile ../profiles/software/bitcoin.nix) + (callPackageFile ../profiles/software/browsers.nix) + (callPackageFile ../profiles/software/development.nix) + (callPackageFile ../profiles/software/diagnostics.nix) + (callPackageFile ../profiles/software/downloaders.nix) + (callPackageFile ../profiles/software/emulators.nix) + (callPackageFile ../profiles/software/filesharing.nix) + (callPackageFile ../profiles/software/guake.nix) + (callPackageFile ../profiles/software/messaging.nix) + (callPackageFile ../profiles/software/multimedia.nix) + (callPackageFile ../profiles/software/node.nix) + (callPackageFile ../profiles/software/productivity.nix) + (callPackageFile ../profiles/software/synergy.nix) + (callPackageFile ../profiles/software/workrave.nix) + (callPackageFile ../profiles/software/graphical-base.nix) + ]; + + services.xserver = { + xrandrHeads = [ + "DFP6" + "CRT1" + ]; + }; + + networking = { + hostName = "desktop-home"; + + firewall = { # FIXME: abstract this out... + allowedTCPPorts = [ + 24800 # Synergy + 8999 # qBittorrent + 27273 # Workrave + ]; + }; + }; + + users.extraUsers.sven = { + isNormalUser = true; + uid = 1000; + extraGroups = ["libvirtd"]; + }; + + boot = { + kernelModules = [ "tun" "virtio" "nbd" ]; + }; + + fileSystems = [ + { + mountPoint = "/mnt/storage1"; + device = "/dev/disk/by-uuid/f7b13747-f465-4600-9928-d7bf0720df1a"; + } + { + mountPoint = "/mnt/storage2"; + device = "/dev/disk/by-uuid/71cc55ca-7fc7-40c2-9dee-9e6216959d15"; + } + { + mountPoint = "/mnt/temp"; + device = "/dev/disk/by-uuid/6251105f-2b32-40de-859b-1654d6d1037e"; + } + { + mountPoint = "/mnt/opensuse"; + device = "/dev/disk/by-uuid/02a65154-3d26-4077-8942-c48337a3f9a2"; + } + ]; + + environment = { + etc = { + "synergy-server.conf" = { + text = '' + section: screens + desktop: + + laptop: + + end + + section: links + desktop: + left = laptop + laptop: + right = desktop + end sven  desktop-home  ~  $  ls -al /lib +ls: cannot access '/lib': No such file or directory +aliases + desktop: + 192.168.178.60 + desktop-home + laptop: + 192.168.178.41 + linux-o82e.site + end + ''; + }; + }; + }; +}