diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 3755776..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "nixpkgs-master"] - path = nixpkgs-master - url = https://github.com/NixOS/nixpkgs.git diff --git a/lib/packages.nix b/lib/packages.nix index 9948bb2..d3a707f 100644 --- a/lib/packages.nix +++ b/lib/packages.nix @@ -1,5 +1,12 @@ -options: { - master = (import ../nixpkgs-master) options; - nixpkgs = (import ) options; - myNixpkgs = {}; +options: let + combinedOptions = options // { + overlays = [ + (import ../nixpkgs-mozilla/rust-overlay.nix) + ]; + }; +in { + master = (import (fetchTarball https://github.com/NixOS/nixpkgs/archive/master.tar.gz) combinedOptions); + unstable = (import (fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz) combinedOptions); + nixpkgs = (import ) combinedOptions; + myNixpkgs = (import ../packages) {}; } diff --git a/nixpkgs-master b/nixpkgs-master deleted file mode 160000 index f928160..0000000 --- a/nixpkgs-master +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f9281609aef096cac905cd1081aacc9193ad273f diff --git a/nixpkgs-mozilla b/nixpkgs-mozilla new file mode 160000 index 0000000..086d3be --- /dev/null +++ b/nixpkgs-mozilla @@ -0,0 +1 @@ +Subproject commit 086d3beecab64c7fda215788eb1379fb665b462b diff --git a/packages/default.nix b/packages/default.nix new file mode 100644 index 0000000..1805c75 --- /dev/null +++ b/packages/default.nix @@ -0,0 +1,17 @@ +{ system ? builtins.currentSystem }: + +let + pkgs = import { inherit system; } // {config.allowUnfree = true;}; + + callPackage = packageName: options: + pkgs.lib.callPackageWith (pkgs // pkgs.xorg // self) packageName (options); + + self = rec { + xonotic = callPackage ./xonotic {}; + stardew-valley = callPackage ./stardew-valley {}; + starbound = callPackage ./starbound {}; + technic-launcher = callPackage ./technic-launcher {}; + ftb-launcher = callPackage ./ftb-launcher {}; + }; +in + self diff --git a/packages/ftb-launcher/FTB_Launcher.jar b/packages/ftb-launcher/FTB_Launcher.jar new file mode 100644 index 0000000..7017ad1 Binary files /dev/null and b/packages/ftb-launcher/FTB_Launcher.jar differ diff --git a/packages/ftb-launcher/default.nix b/packages/ftb-launcher/default.nix new file mode 100644 index 0000000..bf475ad --- /dev/null +++ b/packages/ftb-launcher/default.nix @@ -0,0 +1,25 @@ +{ stdenv, xorg, openjdk, mesa, openal, jre, ... }: + +stdenv.mkDerivation { + name = "ftb"; + src = ./FTB_Launcher.jar; + buildInputs = with xorg; [ libX11 libXext libXcursor libXrandr libXxf86vm openjdk mesa openal ]; + buildCommand = '' + mkdir -pv $out/libexec/ $out/bin/ + cp -v $src $out/libexec/FTB_Launcher.jar + + RESULT= + for x in $nativeBuildInputs; do + RESULT=$x/lib/:$RESULT + done + + cat < $out/bin/ftb + #!${stdenv.shell} + export LD_LIBRARY_PATH=$RESULT + export GAME_LIBRARY_PATH=$RESULT + exec ${jre}/bin/java -jar $out/libexec/FTB_Launcher.jar + EOF + + chmod +x $out/bin/ftb + ''; +} diff --git a/packages/starbound/default.nix b/packages/starbound/default.nix new file mode 100644 index 0000000..1ae397f --- /dev/null +++ b/packages/starbound/default.nix @@ -0,0 +1,64 @@ +{ stdenv, requireFile, SDL2, makeWrapper, + mesa_glu, + unzip, ... }: + +let + originalArchive = "gog_starbound_2.13.0.14.sh"; +in + stdenv.mkDerivation rec { + name = "starbound-${version}"; + version = "2.13.0.14"; + + src = ../../../nixrc-src-games/gog_starbound_2.13.0.14.sh; + + phases = "unpackPhase installPhase"; + + unpackCmd = "${unzip}/bin/unzip -qq $src || true"; + + sourceRoot = "data"; + + libPath = stdenv.lib.makeLibraryPath [ + mesa_glu + stdenv.cc.cc.lib + SDL2 + ]; + + buildInputs = [ + makeWrapper + ]; + + installPhase = '' + mkdir -p $out + mv noarch/game/* $out/ + mkdir -p $out/bin + + chmod +x $out/linux/starbound + + cat > $out/linux/sbinit.config << EOF + { + "assetDirectories" : [ + "../assets/", + "../mods/" + ], + + "storageDirectory" : "/home/sven/.starbound-storage/" + } + EOF + + patchelf \ + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ + $out/linux/starbound + + for lib in linux/*.so{,.*}; do + patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $lib + done + + makeWrapper strace $out/bin/starbound-strace \ + --add-flags -f \ + --add-flags $out/linux/starbound \ + --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$libPath:$out/linux + + makeWrapper $out/linux/starbound $out/bin/starbound \ + --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$libPath:$out/linux + ''; + } diff --git a/packages/stardew-valley/default.nix b/packages/stardew-valley/default.nix new file mode 100644 index 0000000..bb417a9 --- /dev/null +++ b/packages/stardew-valley/default.nix @@ -0,0 +1,95 @@ +{ stdenv, requireFile, SDL2, makeWrapper, mono44, + libX11, libXext, libXcursor, libXxf86vm, libXi, libXinerama, libXrandr, + libgcrypt, libgpgerror, + alsaLib, libpulseaudio, libogg, libvorbis, + mesa_glu, libudev, lzma, dbus, + unzip, ... }: + +let + originalArchive = "gog_stardew_valley_2.6.0.7.sh"; +in + stdenv.mkDerivation rec { + name = "stardew-valley-${version}"; + version = "2.6.0.7"; + + src = ../../../nixrc-src-games/gog_stardew_valley_2.6.0.7.sh; + + phases = "unpackPhase installPhase"; + + unpackCmd = "${unzip}/bin/unzip -qq $src || true"; + + sourceRoot = "data"; + + libPath = stdenv.lib.makeLibraryPath [ + alsaLib + libpulseaudio + mesa_glu + libX11 + libXext + libXcursor + libXxf86vm + libXi + libXinerama + libXrandr + libgcrypt + libgpgerror + libudev + libogg + libvorbis + lzma + dbus + mono44 + stdenv.cc.cc.lib + SDL2 + ]; + + buildInputs = [ + makeWrapper + ]; + + installPhase = '' + mkdir -p $out + mv noarch/game/* $out/ + mkdir -p $out/bin + + chmod +x $out/StardewValley.bin.x86 + chmod +x $out/StardewValley.bin.x86_64 + + ln -sf ${mono44}/bin/mcs $out/mcs + + patchelf \ + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ + $out/StardewValley.bin.x86_64 + + patchelf \ + --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ + $out/StardewValley.bin.x86 + + for lib in lib{,64}/*.so.*; do + patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $lib + done + + makeWrapper strace $out/stardew-valley-strace \ + --run 'cd "`dirname "$0"`"' \ + --add-flags -f \ + --add-flags $out/StardewValley.bin.x86_64 \ + --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$libPath + + makeWrapper $out/StardewValley.bin.x86_64 $out/stardew-valley \ + --run 'cd "`dirname "$0"`"' \ + --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$libPath + + makeWrapper $out/StardewValley.bin.x86 $out/stardew-valley-32 \ + --run 'cd "`dirname "$0"`"' \ + --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:$libPath + + echo "cd $out; pwd; ./stardew-valley" > $out/bin/stardew-valley + chmod +x $out/bin/stardew-valley + + echo "cd $out; pwd; ./stardew-valley-32" > $out/bin/stardew-valley-32 + chmod +x $out/bin/stardew-valley-32 + + echo "cd $out; pwd; ./stardew-valley-strace" > $out/bin/stardew-valley-strace + chmod +x $out/bin/stardew-valley-strace + ''; + } diff --git a/packages/technic-launcher/TechnicLauncher.jar b/packages/technic-launcher/TechnicLauncher.jar new file mode 100644 index 0000000..4ce6976 Binary files /dev/null and b/packages/technic-launcher/TechnicLauncher.jar differ diff --git a/packages/technic-launcher/default.nix b/packages/technic-launcher/default.nix new file mode 100644 index 0000000..e137a88 --- /dev/null +++ b/packages/technic-launcher/default.nix @@ -0,0 +1,25 @@ +{ stdenv, xorg, jdk, mesa, openal, ... }: + +stdenv.mkDerivation { + name = "technic"; + src = ./TechnicLauncher.jar; + buildInputs = with xorg; [ libX11 libXext libXcursor libXrandr libXxf86vm jdk mesa openal ]; + buildCommand = '' + mkdir -pv $out/libexec/ $out/bin/ + cp -v $src $out/libexec/TechnicLauncher.jar + + RESULT= + for x in $nativeBuildInputs; do + RESULT=$x/lib/:$RESULT + done + + cat < $out/bin/technic + #!${stdenv.shell} + export LD_LIBRARY_PATH=$RESULT + export GAME_LIBRARY_PATH=$RESULT + exec ${jdk}/bin/java -jar $out/libexec/TechnicLauncher.jar + EOF + + chmod +x $out/bin/technic + ''; +} diff --git a/packages/xonotic/default.nix b/packages/xonotic/default.nix new file mode 100644 index 0000000..ce3e368 --- /dev/null +++ b/packages/xonotic/default.nix @@ -0,0 +1,68 @@ +{ stdenv, fetchurl +, # required for both + unzip, libjpeg, zlib, libvorbis, curl +, # glx + libX11, mesa, libXpm, libXext, libXxf86vm, alsaLib +, # sdl + SDL2, ... +}: + +stdenv.mkDerivation rec { + name = "xonotic-0.8.2"; + + src = fetchurl { + url = "http://dl.xonotic.org/${name}.zip"; + sha256 = "1mcs6l4clvn7ibfq3q69k2p0z6ww75rxvnngamdq5ic6yhq74bx2"; + }; + + buildInputs = [ + # required for both + unzip libjpeg + # glx + libX11 mesa libXpm libXext libXxf86vm alsaLib + # sdl + SDL2 + zlib libvorbis curl + ]; + + sourceRoot = "Xonotic/source/darkplaces"; + + buildPhase = '' + DP_FS_BASEDIR="$out/share/xonotic" + make DP_FS_BASEDIR=$DP_FS_BASEDIR cl-release + make DP_FS_BASEDIR=$DP_FS_BASEDIR sdl-release + make DP_FS_BASEDIR=$DP_FS_BASEDIR sv-release + ''; + enableParallelBuilding = true; + + installPhase = '' + mkdir -p "$out/bin" + cp darkplaces-dedicated "$out/bin/xonotic-dedicated" + cp darkplaces-sdl "$out/bin/xonotic-sdl" + cp darkplaces-glx "$out/bin/xonotic-glx" + cd ../.. + mkdir -p "$out/share/xonotic" + mv data "$out/share/xonotic" + # default to sdl + ln -s "$out/bin/xonotic-sdl" "$out/bin/xonotic" + ''; + + dontPatchELF = true; + + meta = { + description = "A free fast-paced first-person shooter"; + longDescription = '' + Xonotic is a free, fast-paced first-person shooter that works on + Windows, OS X and Linux. The project is geared towards providing + addictive arena shooter gameplay which is all spawned and driven + by the community itself. Xonotic is a direct successor of the + Nexuiz project with years of development between them, and it + aims to become the best possible open-source FPS of its kind. + ''; + homepage = http://www.xonotic.org; + license = stdenv.lib.licenses.gpl2Plus; + maintainers = with stdenv.lib.maintainers; [ astsmtl ]; + platforms = stdenv.lib.platforms.linux; + hydraPlatforms = []; + }; +} diff --git a/profiles/environment/common-software.nix b/profiles/environment/common-software.nix new file mode 100644 index 0000000..6db1048 --- /dev/null +++ b/profiles/environment/common-software.nix @@ -0,0 +1,162 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + # Cryptocurrency + nixpkgs.electrum + + # Browsers + nixpkgs.chromium + nixpkgs.firefox + nixpkgs.w3m + + # Filesystems + nixpkgs.ntfs3g + nixpkgs.davfs2 + nixpkgs.exfat + + # Build tools + nixpkgs.gcc + nixpkgs.gnumake + nixpkgs.automake + nixpkgs.autoconf + + # Development tools + unstable.atom + nixpkgs.geany + nixpkgs.sqlitebrowser + nixpkgs.gitAndTools.gitFull + nixpkgs.meld + nixpkgs.radare2 + nixpkgs.wxhexeditor + nixpkgs.gdb + + # Node.js + nixpkgs.nodejs-6_x + unstable.electron + nixpkgs.nodePackages_6_x.node2nix + + # Rust + nixpkgs.rustChannels.nightly.rust + nixpkgs.rustChannels.nightly.rust-src + + # Downloaders and filesharing + (unstable.python35Packages.youtube-dl.override { + ffmpeg = unstable.ffmpeg-full; + }) + unstable.megatools + nixpkgs.aria2 + nixpkgs.qbittorrent + nixpkgs.filezilla + + # Emulation + nixpkgs.wineUnstable + nixpkgs.dosbox + nixpkgs.playonlinux + + # Light-weight games + nixpkgs.simutrans + unstable.openttd + unstable.voxelands + + # File and archive management + nixpkgs.p7zip + nixpkgs.pcmanfm + + # Password management + nixpkgs.keepassx2 + + # Chat and communication + nixpkgs.pidgin + nixpkgs.konversation + + # Productivity + nixpkgs.libreoffice + nixpkgs.gimp + nixpkgs.inkscape + nixpkgs.audacity + nixpkgs.shutter + nixpkgs.jekyll + + # Multimedia + # Video + nixpkgs.mplayer + nixpkgs.mpv + nixpkgs.vlc + nixpkgs.kodi + + # Audio + nixpkgs.tomahawk + nixpkgs.audacious + nixpkgs.mpg321 + nixpkgs.xmp + + # Documents + nixpkgs.evince + nixpkgs.djvulibre + + # Images + nixpkgs.gqview + + # Utilities + nixpkgs.mediainfo + + # Diagnostics + # 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 + nixpkgs.cv # == `progress` + + # Peripherals + nixpkgs.pciutils + nixpkgs.usbutils + + # Graphics + nixpkgs.glxinfo + ]; + + nixpkgs.config = { + firefox = { + enableGoogleTalkPlugin = true; + enableAdobeFlash = true; + jre = true; + }; + + chromium = { + enablePepperFlash = true; + enablePepperPDF = true; + jre = true; + }; + }; + + services = { + postgresql = { + enable = true; + package = packages.nixpkgs.postgresql95; + authentication = '' + local all all ident + host all all 127.0.0.1/32 md5 + ''; + }; + }; + + networking.firewall.allowedTCPPorts = [ + 8999 # qBittorrent + ]; +} diff --git a/profiles/environment/graphical-environment.nix b/profiles/environment/graphical-environment.nix index 41824f7..02c2022 100644 --- a/profiles/environment/graphical-environment.nix +++ b/profiles/environment/graphical-environment.nix @@ -27,6 +27,10 @@ packages: {config, ...}: { ]; }; + hardware = { + opengl.driSupport32Bit = true; + }; + services = { xserver = { enable = true; diff --git a/profiles/environment/plasma5.nix b/profiles/environment/plasma5.nix new file mode 100644 index 0000000..eafafbd --- /dev/null +++ b/profiles/environment/plasma5.nix @@ -0,0 +1,17 @@ +packages: {config, ...}: { + environment.systemPackages = with packages; [ + nixpkgs.kdeApplications.kmix + ]; + + services = { + xserver = { + displayManager.ssdm = { + enable = true; + }; + + desktopManager.plasma5 = { + enable = true; + }; + }; + }; +} diff --git a/profiles/environment/xfce4.nix b/profiles/environment/xfce4.nix index 1d4deaa..ad15fb7 100644 --- a/profiles/environment/xfce4.nix +++ b/profiles/environment/xfce4.nix @@ -18,9 +18,12 @@ packages: {config, ...}: { nixpkgs.gnome3.file-roller # GTK themes - master.blackbird - master.greybird - nixpkgs.arc-gtk-theme + nixpkgs.blackbird + nixpkgs.greybird + nixpkgs.arc-theme + nixpkgs.arc-icon-theme + nixpkgs.gtk-engine-murrine + #nixpkgs.arc-gtk-theme # GNOME/GTK internals nixpkgs.gnome3.dconf diff --git a/profiles/software/bitcoin.nix b/profiles/software/bitcoin.nix deleted file mode 100644 index 8918173..0000000 --- a/profiles/software/bitcoin.nix +++ /dev/null @@ -1,5 +0,0 @@ -packages: {config, ...}: { - environment.systemPackages = with packages; [ - nixpkgs.electrum - ]; -} diff --git a/profiles/software/browsers.nix b/profiles/software/browsers.nix deleted file mode 100644 index d1d8680..0000000 --- a/profiles/software/browsers.nix +++ /dev/null @@ -1,21 +0,0 @@ -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 deleted file mode 100644 index d660d0a..0000000 --- a/profiles/software/build-tools.nix +++ /dev/null @@ -1,8 +0,0 @@ -packages: {config, ...}: { - environment.systemPackages = with packages; [ - gcc - gnumake - automake - autoconf - ]; -} diff --git a/profiles/software/couchdb.nix b/profiles/software/couchdb.nix index b81c4e5..161e956 100644 --- a/profiles/software/couchdb.nix +++ b/profiles/software/couchdb.nix @@ -1,6 +1,6 @@ packages: {config, ...}: { environment.systemPackages = with packages; [ - master.couchdb + unstable.couchdb ]; # FIXME: CouchDB service? diff --git a/profiles/software/development.nix b/profiles/software/development.nix deleted file mode 100644 index ff82ddd..0000000 --- a/profiles/software/development.nix +++ /dev/null @@ -1,11 +0,0 @@ -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 deleted file mode 100644 index b83b9b8..0000000 --- a/profiles/software/diagnostics.nix +++ /dev/null @@ -1,32 +0,0 @@ -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 deleted file mode 100644 index 7ba8b4b..0000000 --- a/profiles/software/downloaders.nix +++ /dev/null @@ -1,8 +0,0 @@ -packages: {config, ...}: { - environment.systemPackages = with packages; [ - (master.python35Packages.youtube-dl.override { - ffmpeg = master.ffmpeg-full; - }) - master.megatools - ]; -} diff --git a/profiles/software/elasticsearch.nix b/profiles/software/elasticsearch.nix new file mode 100644 index 0000000..c05b283 --- /dev/null +++ b/profiles/software/elasticsearch.nix @@ -0,0 +1,8 @@ +packages: {config, ...}: { + services = { + elasticsearch = { + enable = true; + package = packages.nixpkgs.elasticsearch2; + }; + }; +} diff --git a/profiles/software/emulators.nix b/profiles/software/emulators.nix deleted file mode 100644 index 0e1f812..0000000 --- a/profiles/software/emulators.nix +++ /dev/null @@ -1,7 +0,0 @@ -packages: {config, ...}: { - environment.systemPackages = with packages; [ - nixpkgs.wineUnstable - nixpkgs.dosbox - nixpkgs.playonlinux - ]; -} diff --git a/profiles/software/filesharing.nix b/profiles/software/filesharing.nix deleted file mode 100644 index 826aea1..0000000 --- a/profiles/software/filesharing.nix +++ /dev/null @@ -1,5 +0,0 @@ -packages: {config, ...}: { - environment.systemPackages = with packages; [ - nixpkgs.qbittorrent - ]; -} diff --git a/profiles/software/games.nix b/profiles/software/games.nix index f3e992a..a9b2f33 100644 --- a/profiles/software/games.nix +++ b/profiles/software/games.nix @@ -1,6 +1,17 @@ packages: {config, ...}: { environment.systemPackages = with packages; [ nixpkgs.multimc - master.xonotic + myNixpkgs.xonotic + myNixpkgs.stardew-valley + myNixpkgs.starbound + #(unstable.stdenv.lib.overrideDerivation unstable.factorio (oldAttrs: { + # version = "0.4.2.1"; + # name = "factorio-alpha-0.4.2.1"; + # src = { + # url = "https://www.factorio.com/get-download/0.14.21/alpha/linux64"; + # name = "factorio_alpha_linux64-0.4.2.1.tar.gz"; + # sha256 = "0nf1sxcgnbx52iwx7jgkjxass10lzz1iyskvgk0gq3ky9cg4ixfb"; + # }; + #})) ]; } diff --git a/profiles/software/graphical-base.nix b/profiles/software/graphical-base.nix deleted file mode 100644 index c9cc9d9..0000000 --- a/profiles/software/graphical-base.nix +++ /dev/null @@ -1,7 +0,0 @@ -packages: {config, ...}: { - environment.systemPackages = with packages; [ - nixpkgs.p7zip - nixpkgs.keepassx2 - nixpkgs.pcmanfm - ]; -} diff --git a/profiles/software/guake.nix b/profiles/software/guake.nix index 210321b..51a6b76 100644 --- a/profiles/software/guake.nix +++ b/profiles/software/guake.nix @@ -1,14 +1,14 @@ packages: {config, ...}: { environment.systemPackages = with packages; [ nixpkgs.guake - nixpkgs.gnome.GConf + nixpkgs.gnome2.GConf ]; environment.pathsToLink = [ "/etc/gconf" ]; services = { dbus = with packages; { - packages = [ nixpkgs.gnome.GConf ]; + packages = [ nixpkgs.gnome2.GConf ]; }; }; } diff --git a/profiles/software/light-games.nix b/profiles/software/light-games.nix deleted file mode 100644 index 00b91e6..0000000 --- a/profiles/software/light-games.nix +++ /dev/null @@ -1,6 +0,0 @@ -packages: {config, ...}: { - environment.systemPackages = with packages; [ - nixpkgs.simutrans - master.openttd - ]; -} diff --git a/profiles/software/messaging.nix b/profiles/software/messaging.nix deleted file mode 100644 index 7729aab..0000000 --- a/profiles/software/messaging.nix +++ /dev/null @@ -1,5 +0,0 @@ -packages: {config, ...}: { - environment.systemPackages = with packages; [ - nixpkgs.pidgin - ]; -} diff --git a/profiles/software/multimedia.nix b/profiles/software/multimedia.nix deleted file mode 100644 index a012c79..0000000 --- a/profiles/software/multimedia.nix +++ /dev/null @@ -1,24 +0,0 @@ -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 deleted file mode 100644 index df8d932..0000000 --- a/profiles/software/node.nix +++ /dev/null @@ -1,5 +0,0 @@ -packages: {config, ...}: { - environment.systemPackages = with packages; [ - master.nodejs-6_x - ]; -} diff --git a/profiles/software/postgresql.nix b/profiles/software/postgresql.nix deleted file mode 100644 index a7a2125..0000000 --- a/profiles/software/postgresql.nix +++ /dev/null @@ -1,16 +0,0 @@ -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 deleted file mode 100644 index 3f78fc4..0000000 --- a/profiles/software/productivity.nix +++ /dev/null @@ -1,10 +0,0 @@ -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 index f244f0e..c2656e1 100644 --- a/profiles/software/synergy.nix +++ b/profiles/software/synergy.nix @@ -3,4 +3,8 @@ packages: {config, ...}: { nixpkgs.quicksynergy nixpkgs.synergy ]; + + networking.firewall.allowedTCPPorts = [ + 24800 + ]; } diff --git a/profiles/system/networked.nix b/profiles/system/networked.nix index 3089940..b7bb132 100644 --- a/profiles/system/networked.nix +++ b/profiles/system/networked.nix @@ -13,10 +13,10 @@ packages: {config, ...}: { }; services = { - ntp = { - enable = true; - servers = [ "server.local" "0.pool.ntp.org" "1.pool.ntp.org" "2.pool.ntp.org" ]; - }; + #ntp = { + # enable = true; + # servers = [ "server.local" "0.pool.ntp.org" "1.pool.ntp.org" "2.pool.ntp.org" ]; + #}; avahi = { enable = true; diff --git a/profiles/system/printing.nix b/profiles/system/printing.nix index 0acb633..404644e 100644 --- a/profiles/system/printing.nix +++ b/profiles/system/printing.nix @@ -1,5 +1,8 @@ packages: {config, ...}: { - environment.systemPackages = with packages; [ - master.xsane - ]; + services = { + printing = with packages; { + enable = true; + drivers = [ nixpkgs.gutenprint ]; + }; + }; } diff --git a/profiles/system/pulseaudio.nix b/profiles/system/pulseaudio.nix index dfa4d44..0dfc095 100644 --- a/profiles/system/pulseaudio.nix +++ b/profiles/system/pulseaudio.nix @@ -7,6 +7,6 @@ packages: {config, ...}: { hardware.pulseaudio = with packages; { enable = true; support32Bit = true; - package = nixpkgs.pulseaudioFull; + package = nixpkgs.pulseaudioLight; }; } diff --git a/profiles/system/scanning.nix b/profiles/system/scanning.nix index 404644e..541c35f 100644 --- a/profiles/system/scanning.nix +++ b/profiles/system/scanning.nix @@ -1,8 +1,5 @@ packages: {config, ...}: { - services = { - printing = with packages; { - enable = true; - drivers = [ nixpkgs.gutenprint ]; - }; - }; + environment.systemPackages = with packages; [ + unstable.xsane + ]; } diff --git a/systems/desktop.nix b/systems/desktop.nix index caaa2d3..f437624 100644 --- a/systems/desktop.nix +++ b/systems/desktop.nix @@ -7,6 +7,7 @@ in { (callPackageFile ../profiles/environment/graphical-environment.nix) (callPackageFile ../profiles/environment/xfce4.nix) + (callPackageFile ../profiles/environment/common-software.nix) (callPackageFile ../profiles/system/efi-boot.nix) (callPackageFile ../profiles/system/networked.nix) @@ -16,26 +17,13 @@ in { (callPackageFile ../profiles/system/pulseaudio.nix) (callPackageFile ../profiles/system/virtualization.nix) - (callPackageFile ../profiles/software/postgresql.nix) + (callPackageFile ../profiles/software/elasticsearch.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 = { @@ -50,9 +38,11 @@ in { firewall = { # FIXME: abstract this out... allowedTCPPorts = [ - 24800 # Synergy - 8999 # qBittorrent - 27273 # Workrave + 25565 # Minecraft + ]; + + allowedUDPPorts = [ + 34197 # Factorio ]; }; }; @@ -63,8 +53,17 @@ in { extraGroups = ["libvirtd"]; }; + users.groups = { + davfs2 = {}; + }; + + users.extraUsers.davfs2 = { + isNormalUser = true; + }; + boot = { kernelModules = [ "tun" "virtio" "nbd" ]; + kernelPackages = pkgs.linuxPackages_4_4; }; fileSystems = [ @@ -87,6 +86,14 @@ in { ]; environment = { + systemPackages = with packages; [ + nixpkgs.blueman + nixpkgs.nixops + nixpkgs.oraclejre8 + myNixpkgs.technic-launcher + myNixpkgs.ftb-launcher + ]; + etc = { "synergy-server.conf" = { text = '' @@ -115,5 +122,33 @@ in { ''; }; }; + + pathsToLink = [ + "/lib/rustlib/src" + ]; }; + + hardware.bluetooth.enable = true; + hardware.pulseaudio.extraConfig = '' + load-module module-loopback + load-module module-combine-sink sink_name=all + ''; + + networking.extraHosts = '' + 127.0.0.1 im-project.im + ''; + + /*networking.wireguard = { + wg0 = { + ips = [ "192.168.20.4/24" ]; + privateKey = "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk="; + peers = [ + { allowedIPs = [ "192.168.20.1/32" ]; + publicKey = "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg="; + endpoint = "demo.wireguard.io:12913"; } + ]; + }; + };*/ + + nix.useSandbox = true; } diff --git a/systems/laptop.nix b/systems/laptop.nix new file mode 100644 index 0000000..2bb8cf1 --- /dev/null +++ b/systems/laptop.nix @@ -0,0 +1,71 @@ +{ 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/plasma5.nix) + (callPackageFile ../profiles/environment/common-software.nix) + + (callPackageFile ../profiles/system/networked.nix) + (callPackageFile ../profiles/system/printing.nix) + (callPackageFile ../profiles/system/scanning.nix) + (callPackageFile ../profiles/system/pulseaudio.nix) + (callPackageFile ../profiles/system/virtualization.nix) + + (callPackageFile ../profiles/software/games.nix) + (callPackageFile ../profiles/software/guake.nix) + (callPackageFile ../profiles/software/synergy.nix) + (callPackageFile ../profiles/software/workrave.nix) + ]; + + networking = { + hostName = "laptop"; + }; + + users.extraUsers.sven = { + isNormalUser = true; + uid = 1000; + extraGroups = ["libvirtd"]; + }; + + users.groups = { + davfs2 = {}; + }; + + users.extraUsers.davfs2 = { + isNormalUser = true; + }; + + boot = { + kernelModules = [ "tun" "virtio" "nbd" ]; + }; + + environment = { + pathsToLink = [ + "/lib/rustlib/src" + ]; + }; + + hardware.bluetooth.enable = true; + hardware.pulseaudio.extraConfig = '' + load-module module-loopback + load-module module-combine-sink sink_name=all + ''; + + /*networking.wireguard = { + wg0 = { + ips = [ "192.168.20.4/24" ]; + privateKey = "yAnz5TF+lXXJte14tji3zlMNq+hd2rYUIgJBgB3fBmk="; + peers = [ + { allowedIPs = [ "192.168.20.1/32" ]; + publicKey = "xTIBA5rboUvnH4htodjb6e697QjLERt1NAB4mZqp8Dg="; + endpoint = "demo.wireguard.io:12913"; } + ]; + }; + };*/ + + nix.useSandbox = true; +}