···33333434, name ? "nixos-disk-image"
35353636-, format ? "raw"
3636+, # Disk image format, one of qcow2, vpc, raw.
3737+ format ? "raw"
3738}:
38393940with lib;
···4546 raw = "img";
4647 };
47484848- nixpkgs = lib.cleanSource pkgs.path;
4949+ nixpkgs = cleanSource pkgs.path;
49505051 channelSources = pkgs.runCommand "nixos-${config.system.nixosVersion}" {} ''
5152 mkdir -p $out
···6465 ${channelSources}
6566 '';
66676767- prepareImageInputs = with pkgs; [ rsync utillinux parted e2fsprogs lkl fakeroot libfaketime config.system.build.nixos-prepare-root ] ++ stdenv.initialPath;
6868+ prepareImageInputs = with pkgs; [ rsync utillinux parted e2fsprogs lkl fakeroot config.system.build.nixos-prepare-root ] ++ stdenv.initialPath;
68696970 # I'm preserving the line below because I'm going to search for it across nixpkgs to consolidate
7071 # image building logic. The comment right below this now appears in 4 different places in nixpkgs :)
···7374 targets = map (x: x.target) contents;
74757576 prepareImage = ''
7676- export PATH=${pkgs.lib.makeSearchPathOutput "bin" "bin" prepareImageInputs}
7777+ export PATH=${makeSearchPathOutput "bin" "bin" prepareImageInputs}
77787879 mkdir $out
7980 diskImage=nixos.raw
···8687 offset=0
8788 ''}
88898989- faketime -f "1970-01-01 00:00:01" mkfs.${fsType} -F -L nixos -E offset=$offset $diskImage
9090-9090+ mkfs.${fsType} -F -L nixos -E offset=$offset $diskImage
9191+9192 root="$PWD/root"
9293 mkdir -p $root
9394···124125 fakeroot nixos-prepare-root $root ${channelSources} ${config.system.build.toplevel} closure
125126126127 echo "copying staging root to image..."
127127- # If we don't faketime, we can end up with timestamps other than 1 on the nix store, which
128128- # will confuse Nix in some situations (e.g., breaking image builds in the target image)
129129- # N.B: I use 0 here, which results in timestamp = 1 in the image. It's weird but see
130130- # https://github.com/lkl/linux/issues/393. Also, running under faketime makes `cptofs` super
131131- # noisy and it prints out that it can't find a bunch of files, and then works anyway. We'll
132132- # shut it up someday but trying to do a stderr filter through grep is running into some nasty
133133- # bug in some eval nonsense we have in runInLinuxVM and I'm sick of trying to fix it.
134134- faketime -f "1970-01-01 00:00:00" \
135135- cptofs ${pkgs.lib.optionalString partitioned "-P 1"} -t ${fsType} -i $diskImage $root/* /
128128+ cptofs ${pkgs.lib.optionalString partitioned "-P 1"} -t ${fsType} -i $diskImage $root/* /
136129 '';
137130in pkgs.vmTools.runInLinuxVM (
138131 pkgs.runCommand name
+32-15
nixos/modules/services/misc/nzbget.nix
···4455let
66 cfg = config.services.nzbget;
77- nzbget = pkgs.nzbget;
88-in
99-{
77+ nzbget = pkgs.nzbget; in {
108 options = {
119 services.nzbget = {
1210 enable = mkEnableOption "NZBGet";
···4240 p7zip
4341 ];
4442 preStart = ''
4545- test -d /var/lib/nzbget || {
4646- echo "Creating nzbget state directoy in /var/lib/"
4747- mkdir -p /var/lib/nzbget
4343+ datadir=/var/lib/nzbget
4444+ cfgtemplate=${cfg.package}/share/nzbget/nzbget.conf
4545+ test -d $datadir || {
4646+ echo "Creating nzbget data directory in $datadir"
4747+ mkdir -p $datadir
4848 }
4949- test -f /var/lib/nzbget/nzbget.conf || {
5050- echo "nzbget.conf not found. Copying default config to /var/lib/nzbget/nzbget.conf"
5151- cp ${cfg.package}/share/nzbget/nzbget.conf /var/lib/nzbget/nzbget.conf
5252- echo "Setting file mode of nzbget.conf to 0700 (needs to be written and contains plaintext credentials)"
5353- chmod 0700 /var/lib/nzbget/nzbget.conf
4949+ test -f $configfile || {
5050+ echo "nzbget.conf not found. Copying default config $cfgtemplate to $configfile"
5151+ cp $cfgtemplate $configfile
5252+ echo "Setting $configfile permissions to 0700 (needs to be written and contains plaintext credentials)"
5353+ chmod 0700 $configfile
5454 echo "Setting temporary \$MAINDIR variable in default config required in order to allow nzbget to complete initial start"
5555 echo "Remember to change this to a proper value once NZBGet startup has been completed"
5656- sed -i -e 's/MainDir=.*/MainDir=\/tmp/g' /var/lib/nzbget/nzbget.conf
5656+ sed -i -e 's/MainDir=.*/MainDir=\/tmp/g' $configfile
5757+ }
5858+ echo "Ensuring proper ownership of $datadir (${cfg.user}:${cfg.group})."
5959+ chown -R ${cfg.user}:${cfg.group} $datadir
6060+ '';
6161+6262+ script = ''
6363+ configfile=/var/lib/nzbget/nzbget.conf
6464+ args="--daemon --configfile $configfile"
6565+ # The script in preStart (above) copies nzbget's config template to datadir on first run, containing paths that point to the nzbget derivation installed at the time.
6666+ # These paths break when nzbget is upgraded & the original derivation is garbage collected. If such broken paths are found in the config file, override them to point to
6767+ # the currently installed nzbget derivation.
6868+ cfgfallback () {
6969+ local hit=`grep -Po "(?<=^$1=).*+" "$configfile" | sed 's/[ \t]*$//'` # Strip trailing whitespace
7070+ ( test $hit && test -e $hit ) || {
7171+ echo "In $configfile, valid $1 not found; falling back to $1=$2"
7272+ args+=" -o $1=$2"
7373+ }
5774 }
5858- echo "Ensuring proper ownership of /var/lib/nzbget (${cfg.user}:${cfg.group})."
5959- chown -R ${cfg.user}:${cfg.group} /var/lib/nzbget
7575+ cfgfallback ConfigTemplate ${cfg.package}/share/nzbget/nzbget.conf
7676+ cfgfallback WebDir ${cfg.package}/share/nzbget/webui
7777+ ${cfg.package}/bin/nzbget $args
6078 '';
61796280 serviceConfig = {
···6482 User = cfg.user;
6583 Group = cfg.group;
6684 PermissionsStartOnly = "true";
6767- ExecStart = "${cfg.package}/bin/nzbget --daemon --configfile /var/lib/nzbget/nzbget.conf";
6885 Restart = "on-failure";
6986 };
7087 };
···4141 on the map, make new tracks and waypoints, see real-time GPS
4242 position, etc.
4343 '';
4444- homepage = http://viking.sourceforge.net/;
4444+ homepage = https://sourceforge.net/projects/viking/;
4545 license = licenses.gpl2Plus;
4646 maintainers = with maintainers; [ pSub ];
4747 platforms = with platforms; linux;
···1717 "0mi3n9kplf82gd0g2m0np957agy53p4g1qh81pbban49r4n0ajcz" else
1818 "1dk400ap5qwdhjvn8lnk602f5akayr391fkljxdkrpn5xac01m97";
1919 };
2020-2020+2121 meta = {
2222 description = "Office program originally named Kingsoft Office";
2323 homepage = http://wps-community.org/;
···4141 ];
42424343 dontPatchELF = true;
4444+4545+ # wpsoffice uses `/build` in its own build system making nix things there
4646+ # references to nix own build directory
4747+ noAuditTmpdir = true;
44484549 installPhase = ''
4650 prefix=$out/opt/kingsoft/wps-office
···11+{ stdenv, fetchFromGitHub, ncurses }:
22+33+stdenv.mkDerivation rec {
44+ name = "braincurses-${version}";
55+ version = "1.1.0";
66+77+ src = fetchFromGitHub {
88+ owner = "bderrly";
99+ repo = "braincurses";
1010+ rev = version;
1111+ sha256 = "0gpny9wrb0zj3lr7iarlgn9j4367awj09v3hhxz9r9a6yhk4anf5";
1212+ };
1313+1414+ buildInputs = [ ncurses ];
1515+1616+ # There is no install target in the Makefile
1717+ installPhase = ''
1818+ install -Dt $out/bin braincurses
1919+ '';
2020+2121+ meta = with stdenv.lib; {
2222+ homepage = https://github.com/bderrly/braincurses;
2323+ description = "A version of the classic game Mastermind";
2424+ license = licenses.gpl2;
2525+ maintainers = with maintainers; [ dotlambda ];
2626+ platforms = platforms.linux;
2727+ };
2828+}
+67
pkgs/games/cataclysm-dda/git.nix
···11+{ fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf,
22+SDL2_mixer, freetype, gettext }:
33+44+stdenv.mkDerivation rec {
55+ version = "2017-07-12";
66+ name = "cataclysm-dda-git-${version}";
77+88+ src = fetchFromGitHub {
99+ owner = "CleverRaven";
1010+ repo = "Cataclysm-DDA";
1111+ rev = "2d7aa8c";
1212+ sha256 = "0xx7si4k5ivyb5gv98fzlcghrg3w0dfblri547x7x4is7fj5ffjd";
1313+ };
1414+1515+ nativeBuildInputs = [ makeWrapper pkgconfig ];
1616+1717+ buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ];
1818+1919+ postPatch = ''
2020+ patchShebangs .
2121+ sed -i Makefile \
2222+ -e 's,-Werror,,g' \
2323+ -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g'
2424+2525+ sed '1i#include <cmath>' \
2626+ -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp
2727+ '';
2828+2929+ makeFlags = "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1";
3030+3131+ postInstall = ''
3232+ wrapProgram $out/bin/cataclysm-tiles \
3333+ --add-flags "--datadir $out/share/cataclysm-dda/"
3434+ '';
3535+3636+ enableParallelBuilding = true;
3737+3838+ meta = with stdenv.lib; {
3939+ description = "A free, post apocalyptic, zombie infested rogue-like";
4040+ longDescription = ''
4141+ Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world.
4242+ Surviving is difficult: you have been thrown, ill-equipped, into a
4343+ landscape now riddled with monstrosities of which flesh eating zombies are
4444+ neither the strangest nor the deadliest.
4545+4646+ Yet with care and a little luck, many things are possible. You may try to
4747+ eke out an existence in the forests silently executing threats and
4848+ providing sustenance with your longbow. You can ride into town in a
4949+ jerry-rigged vehicle, all guns blazing, to settle matters in a fug of
5050+ smoke from your molotovs. You could take a more measured approach and
5151+ construct an impregnable fortress, surrounded by traps to protect you from
5252+ the horrors without. The longer you survive, the more skilled and adapted
5353+ you will get and the better equipped and armed to deal with the threats
5454+ you are presented with.
5555+5656+ In the course of your ordeal there will be opportunities and temptations
5757+ to improve or change your very nature. There are tales of survivors fitted
5858+ with extraordinary cybernetics giving great power and stories too of
5959+ gravely mutated survivors who, warped by their ingestion of exotic
6060+ substances or radiation, now more closely resemble insects, birds or fish
6161+ than their original form.
6262+ '';
6363+ homepage = http://en.cataclysmdda.com/;
6464+ license = licenses.cc-by-sa-30;
6565+ platforms = platforms.linux;
6666+ };
6767+}
···13131414 meta = with stdenv.lib; {
1515 description = "Ncurses disk usage analyzer";
1616- homepage = http://dev.yorhel.nl/ncdu;
1616+ homepage = https://dev.yorhel.nl/ncdu;
1717 license = licenses.mit;
1818 platforms = platforms.all;
1919 maintainers = with maintainers; [ pSub ];
+1-1
pkgs/tools/misc/rrdtool/default.nix
···2929 '';
30303131 meta = with stdenv.lib; {
3232- homepage = http://oss.oetiker.ch/rrdtool/;
3232+ homepage = https://oss.oetiker.ch/rrdtool/;
3333 description = "High performance logging in Round Robin Databases";
3434 license = licenses.gpl2;
3535 platforms = platforms.linux ++ platforms.darwin;
+1-1
pkgs/tools/misc/vorbisgain/default.nix
···1818 '';
19192020 meta = with stdenv.lib; {
2121- homepage = http://sjeng.org/vorbisgain.html;
2121+ homepage = https://sjeng.org/vorbisgain.html;
2222 description = "A utility that corrects the volume of an Ogg Vorbis file to a predefined standardized loudness";
2323 license = licenses.gpl2;
2424 platforms = platforms.linux;
···2233stdenv.mkDerivation rec {
44 name = "lftp-${version}";
55- version = "4.8.2";
55+ version = "4.8.3";
6677 src = fetchurl {
88 urls = [
99- "https://lftp.tech/ftp/${name}.tar.bz2"
1010- "ftp://ftp.st.ryukoku.ac.jp/pub/network/ftp/lftp/${name}.tar.bz2"
1111- "http://lftp.yar.ru/ftp/old/${name}.tar.bz2"
99+ "https://lftp.tech/ftp/${name}.tar.xz"
1010+ "https://ftp.st.ryukoku.ac.jp/pub/network/ftp/lftp/${name}.tar.xz"
1111+ "http://lftp.yar.ru/ftp/${name}.tar.xz"
1212 ];
1313- sha256 = "0a4sp9khqgny1md0b2c9vvg4c7sz0g31w3sfdslxw7dsvijin3mn";
1313+ sha256 = "12y77jlfs4x4zvcah92mw2h2sb4j0bvbaxkh3wwsm8gs392ywyny";
1414 };
15151616 nativeBuildInputs = [ pkgconfig ];
···28282929 meta = with stdenv.lib; {
3030 description = "A file transfer program supporting a number of network protocols";
3131- homepage = http://lftp.tech/;
3131+ homepage = https://lftp.tech/;
3232 license = licenses.gpl3;
3333 platforms = platforms.unix;
3434 maintainers = [ maintainers.bjornfor ];
+2-2
pkgs/tools/security/yara/default.nix
···55}:
6677stdenv.mkDerivation rec {
88- version = "3.6.0";
88+ version = "3.6.3";
99 name = "yara-${version}";
10101111 src = fetchFromGitHub {
1212 owner = "VirusTotal";
1313 repo = "yara";
1414 rev = "v${version}";
1515- sha256 = "05nadqpvihdyxym11mn6n02rzv2ng8ga7j9l0g5gnjx366gcai42";
1515+ sha256 = "13znbdwin9lvql43wpms5hh13h8rk5x5wajgmphz18rxwp8h7j78";
1616 };
17171818 # FIXME: this is probably not the right way to make it work