···3334, name ? "nixos-disk-image"
3536-, format ? "raw"
037}:
3839with lib;
···45 raw = "img";
46 };
4748- nixpkgs = lib.cleanSource pkgs.path;
4950 channelSources = pkgs.runCommand "nixos-${config.system.nixosVersion}" {} ''
51 mkdir -p $out
···64 ${channelSources}
65 '';
6667- prepareImageInputs = with pkgs; [ rsync utillinux parted e2fsprogs lkl fakeroot libfaketime config.system.build.nixos-prepare-root ] ++ stdenv.initialPath;
6869 # I'm preserving the line below because I'm going to search for it across nixpkgs to consolidate
70 # image building logic. The comment right below this now appears in 4 different places in nixpkgs :)
···73 targets = map (x: x.target) contents;
7475 prepareImage = ''
76- export PATH=${pkgs.lib.makeSearchPathOutput "bin" "bin" prepareImageInputs}
7778 mkdir $out
79 diskImage=nixos.raw
···86 offset=0
87 ''}
8889- faketime -f "1970-01-01 00:00:01" mkfs.${fsType} -F -L nixos -E offset=$offset $diskImage
90-91 root="$PWD/root"
92 mkdir -p $root
93···124 fakeroot nixos-prepare-root $root ${channelSources} ${config.system.build.toplevel} closure
125126 echo "copying staging root to image..."
127- # If we don't faketime, we can end up with timestamps other than 1 on the nix store, which
128- # will confuse Nix in some situations (e.g., breaking image builds in the target image)
129- # N.B: I use 0 here, which results in timestamp = 1 in the image. It's weird but see
130- # https://github.com/lkl/linux/issues/393. Also, running under faketime makes `cptofs` super
131- # noisy and it prints out that it can't find a bunch of files, and then works anyway. We'll
132- # shut it up someday but trying to do a stderr filter through grep is running into some nasty
133- # bug in some eval nonsense we have in runInLinuxVM and I'm sick of trying to fix it.
134- faketime -f "1970-01-01 00:00:00" \
135- cptofs ${pkgs.lib.optionalString partitioned "-P 1"} -t ${fsType} -i $diskImage $root/* /
136 '';
137in pkgs.vmTools.runInLinuxVM (
138 pkgs.runCommand name
···3334, name ? "nixos-disk-image"
3536+, # Disk image format, one of qcow2, vpc, raw.
37+ format ? "raw"
38}:
3940with lib;
···46 raw = "img";
47 };
4849+ nixpkgs = cleanSource pkgs.path;
5051 channelSources = pkgs.runCommand "nixos-${config.system.nixosVersion}" {} ''
52 mkdir -p $out
···65 ${channelSources}
66 '';
6768+ prepareImageInputs = with pkgs; [ rsync utillinux parted e2fsprogs lkl fakeroot config.system.build.nixos-prepare-root ] ++ stdenv.initialPath;
6970 # I'm preserving the line below because I'm going to search for it across nixpkgs to consolidate
71 # image building logic. The comment right below this now appears in 4 different places in nixpkgs :)
···74 targets = map (x: x.target) contents;
7576 prepareImage = ''
77+ export PATH=${makeSearchPathOutput "bin" "bin" prepareImageInputs}
7879 mkdir $out
80 diskImage=nixos.raw
···87 offset=0
88 ''}
8990+ mkfs.${fsType} -F -L nixos -E offset=$offset $diskImage
91+92 root="$PWD/root"
93 mkdir -p $root
94···125 fakeroot nixos-prepare-root $root ${channelSources} ${config.system.build.toplevel} closure
126127 echo "copying staging root to image..."
128+ cptofs ${pkgs.lib.optionalString partitioned "-P 1"} -t ${fsType} -i $diskImage $root/* /
00000000129 '';
130in pkgs.vmTools.runInLinuxVM (
131 pkgs.runCommand name
+32-15
nixos/modules/services/misc/nzbget.nix
···45let
6 cfg = config.services.nzbget;
7- nzbget = pkgs.nzbget;
8-in
9-{
10 options = {
11 services.nzbget = {
12 enable = mkEnableOption "NZBGet";
···42 p7zip
43 ];
44 preStart = ''
45- test -d /var/lib/nzbget || {
46- echo "Creating nzbget state directoy in /var/lib/"
47- mkdir -p /var/lib/nzbget
0048 }
49- test -f /var/lib/nzbget/nzbget.conf || {
50- echo "nzbget.conf not found. Copying default config to /var/lib/nzbget/nzbget.conf"
51- cp ${cfg.package}/share/nzbget/nzbget.conf /var/lib/nzbget/nzbget.conf
52- echo "Setting file mode of nzbget.conf to 0700 (needs to be written and contains plaintext credentials)"
53- chmod 0700 /var/lib/nzbget/nzbget.conf
54 echo "Setting temporary \$MAINDIR variable in default config required in order to allow nzbget to complete initial start"
55 echo "Remember to change this to a proper value once NZBGet startup has been completed"
56- sed -i -e 's/MainDir=.*/MainDir=\/tmp/g' /var/lib/nzbget/nzbget.conf
0000000000000000057 }
58- echo "Ensuring proper ownership of /var/lib/nzbget (${cfg.user}:${cfg.group})."
59- chown -R ${cfg.user}:${cfg.group} /var/lib/nzbget
060 '';
6162 serviceConfig = {
···64 User = cfg.user;
65 Group = cfg.group;
66 PermissionsStartOnly = "true";
67- ExecStart = "${cfg.package}/bin/nzbget --daemon --configfile /var/lib/nzbget/nzbget.conf";
68 Restart = "on-failure";
69 };
70 };
···45let
6 cfg = config.services.nzbget;
7+ nzbget = pkgs.nzbget; in {
008 options = {
9 services.nzbget = {
10 enable = mkEnableOption "NZBGet";
···40 p7zip
41 ];
42 preStart = ''
43+ datadir=/var/lib/nzbget
44+ cfgtemplate=${cfg.package}/share/nzbget/nzbget.conf
45+ test -d $datadir || {
46+ echo "Creating nzbget data directory in $datadir"
47+ mkdir -p $datadir
48 }
49+ test -f $configfile || {
50+ echo "nzbget.conf not found. Copying default config $cfgtemplate to $configfile"
51+ cp $cfgtemplate $configfile
52+ echo "Setting $configfile permissions to 0700 (needs to be written and contains plaintext credentials)"
53+ chmod 0700 $configfile
54 echo "Setting temporary \$MAINDIR variable in default config required in order to allow nzbget to complete initial start"
55 echo "Remember to change this to a proper value once NZBGet startup has been completed"
56+ sed -i -e 's/MainDir=.*/MainDir=\/tmp/g' $configfile
57+ }
58+ echo "Ensuring proper ownership of $datadir (${cfg.user}:${cfg.group})."
59+ chown -R ${cfg.user}:${cfg.group} $datadir
60+ '';
61+62+ script = ''
63+ configfile=/var/lib/nzbget/nzbget.conf
64+ args="--daemon --configfile $configfile"
65+ # 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.
66+ # 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
67+ # the currently installed nzbget derivation.
68+ cfgfallback () {
69+ local hit=`grep -Po "(?<=^$1=).*+" "$configfile" | sed 's/[ \t]*$//'` # Strip trailing whitespace
70+ ( test $hit && test -e $hit ) || {
71+ echo "In $configfile, valid $1 not found; falling back to $1=$2"
72+ args+=" -o $1=$2"
73+ }
74 }
75+ cfgfallback ConfigTemplate ${cfg.package}/share/nzbget/nzbget.conf
76+ cfgfallback WebDir ${cfg.package}/share/nzbget/webui
77+ ${cfg.package}/bin/nzbget $args
78 '';
7980 serviceConfig = {
···82 User = cfg.user;
83 Group = cfg.group;
84 PermissionsStartOnly = "true";
085 Restart = "on-failure";
86 };
87 };
···41 on the map, make new tracks and waypoints, see real-time GPS
42 position, etc.
43 '';
44- homepage = http://viking.sourceforge.net/;
45 license = licenses.gpl2Plus;
46 maintainers = with maintainers; [ pSub ];
47 platforms = with platforms; linux;
···41 on the map, make new tracks and waypoints, see real-time GPS
42 position, etc.
43 '';
44+ homepage = https://sourceforge.net/projects/viking/;
45 license = licenses.gpl2Plus;
46 maintainers = with maintainers; [ pSub ];
47 platforms = with platforms; linux;
···17 "0mi3n9kplf82gd0g2m0np957agy53p4g1qh81pbban49r4n0ajcz" else
18 "1dk400ap5qwdhjvn8lnk602f5akayr391fkljxdkrpn5xac01m97";
19 };
20-21 meta = {
22 description = "Office program originally named Kingsoft Office";
23 homepage = http://wps-community.org/;
···41 ];
4243 dontPatchELF = true;
00004445 installPhase = ''
46 prefix=$out/opt/kingsoft/wps-office
···17 "0mi3n9kplf82gd0g2m0np957agy53p4g1qh81pbban49r4n0ajcz" else
18 "1dk400ap5qwdhjvn8lnk602f5akayr391fkljxdkrpn5xac01m97";
19 };
20+21 meta = {
22 description = "Office program originally named Kingsoft Office";
23 homepage = http://wps-community.org/;
···41 ];
4243 dontPatchELF = true;
44+45+ # wpsoffice uses `/build` in its own build system making nix things there
46+ # references to nix own build directory
47+ noAuditTmpdir = true;
4849 installPhase = ''
50 prefix=$out/opt/kingsoft/wps-office
···1+{ fetchFromGitHub, stdenv, makeWrapper, pkgconfig, ncurses, lua, SDL2, SDL2_image, SDL2_ttf,
2+SDL2_mixer, freetype, gettext }:
3+4+stdenv.mkDerivation rec {
5+ version = "2017-07-12";
6+ name = "cataclysm-dda-git-${version}";
7+8+ src = fetchFromGitHub {
9+ owner = "CleverRaven";
10+ repo = "Cataclysm-DDA";
11+ rev = "2d7aa8c";
12+ sha256 = "0xx7si4k5ivyb5gv98fzlcghrg3w0dfblri547x7x4is7fj5ffjd";
13+ };
14+15+ nativeBuildInputs = [ makeWrapper pkgconfig ];
16+17+ buildInputs = [ ncurses lua SDL2 SDL2_image SDL2_ttf SDL2_mixer freetype gettext ];
18+19+ postPatch = ''
20+ patchShebangs .
21+ sed -i Makefile \
22+ -e 's,-Werror,,g' \
23+ -e 's,\(DATA_PREFIX=$(PREFIX)/share/\)cataclysm-dda/,\1,g'
24+25+ sed '1i#include <cmath>' \
26+ -i src/{crafting,skill,weather_data,melee,vehicle,overmap,iuse_actor}.cpp
27+ '';
28+29+ makeFlags = "PREFIX=$(out) LUA=1 TILES=1 SOUND=1 RELEASE=1 USE_HOME_DIR=1";
30+31+ postInstall = ''
32+ wrapProgram $out/bin/cataclysm-tiles \
33+ --add-flags "--datadir $out/share/cataclysm-dda/"
34+ '';
35+36+ enableParallelBuilding = true;
37+38+ meta = with stdenv.lib; {
39+ description = "A free, post apocalyptic, zombie infested rogue-like";
40+ longDescription = ''
41+ Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world.
42+ Surviving is difficult: you have been thrown, ill-equipped, into a
43+ landscape now riddled with monstrosities of which flesh eating zombies are
44+ neither the strangest nor the deadliest.
45+46+ Yet with care and a little luck, many things are possible. You may try to
47+ eke out an existence in the forests silently executing threats and
48+ providing sustenance with your longbow. You can ride into town in a
49+ jerry-rigged vehicle, all guns blazing, to settle matters in a fug of
50+ smoke from your molotovs. You could take a more measured approach and
51+ construct an impregnable fortress, surrounded by traps to protect you from
52+ the horrors without. The longer you survive, the more skilled and adapted
53+ you will get and the better equipped and armed to deal with the threats
54+ you are presented with.
55+56+ In the course of your ordeal there will be opportunities and temptations
57+ to improve or change your very nature. There are tales of survivors fitted
58+ with extraordinary cybernetics giving great power and stories too of
59+ gravely mutated survivors who, warped by their ingestion of exotic
60+ substances or radiation, now more closely resemble insects, birds or fish
61+ than their original form.
62+ '';
63+ homepage = http://en.cataclysmdda.com/;
64+ license = licenses.cc-by-sa-30;
65+ platforms = platforms.linux;
66+ };
67+}
···1314 meta = with stdenv.lib; {
15 description = "Ncurses disk usage analyzer";
16- homepage = http://dev.yorhel.nl/ncdu;
17 license = licenses.mit;
18 platforms = platforms.all;
19 maintainers = with maintainers; [ pSub ];
···1314 meta = with stdenv.lib; {
15 description = "Ncurses disk usage analyzer";
16+ homepage = https://dev.yorhel.nl/ncdu;
17 license = licenses.mit;
18 platforms = platforms.all;
19 maintainers = with maintainers; [ pSub ];
+1-1
pkgs/tools/misc/rrdtool/default.nix
···29 '';
3031 meta = with stdenv.lib; {
32- homepage = http://oss.oetiker.ch/rrdtool/;
33 description = "High performance logging in Round Robin Databases";
34 license = licenses.gpl2;
35 platforms = platforms.linux ++ platforms.darwin;
···29 '';
3031 meta = with stdenv.lib; {
32+ homepage = https://oss.oetiker.ch/rrdtool/;
33 description = "High performance logging in Round Robin Databases";
34 license = licenses.gpl2;
35 platforms = platforms.linux ++ platforms.darwin;
+1-1
pkgs/tools/misc/vorbisgain/default.nix
···18 '';
1920 meta = with stdenv.lib; {
21- homepage = http://sjeng.org/vorbisgain.html;
22 description = "A utility that corrects the volume of an Ogg Vorbis file to a predefined standardized loudness";
23 license = licenses.gpl2;
24 platforms = platforms.linux;
···18 '';
1920 meta = with stdenv.lib; {
21+ homepage = https://sjeng.org/vorbisgain.html;
22 description = "A utility that corrects the volume of an Ogg Vorbis file to a predefined standardized loudness";
23 license = licenses.gpl2;
24 platforms = platforms.linux;
···23stdenv.mkDerivation rec {
4 name = "lftp-${version}";
5- version = "4.8.2";
67 src = fetchurl {
8 urls = [
9- "https://lftp.tech/ftp/${name}.tar.bz2"
10- "ftp://ftp.st.ryukoku.ac.jp/pub/network/ftp/lftp/${name}.tar.bz2"
11- "http://lftp.yar.ru/ftp/old/${name}.tar.bz2"
12 ];
13- sha256 = "0a4sp9khqgny1md0b2c9vvg4c7sz0g31w3sfdslxw7dsvijin3mn";
14 };
1516 nativeBuildInputs = [ pkgconfig ];
···2829 meta = with stdenv.lib; {
30 description = "A file transfer program supporting a number of network protocols";
31- homepage = http://lftp.tech/;
32 license = licenses.gpl3;
33 platforms = platforms.unix;
34 maintainers = [ maintainers.bjornfor ];
···23stdenv.mkDerivation rec {
4 name = "lftp-${version}";
5+ version = "4.8.3";
67 src = fetchurl {
8 urls = [
9+ "https://lftp.tech/ftp/${name}.tar.xz"
10+ "https://ftp.st.ryukoku.ac.jp/pub/network/ftp/lftp/${name}.tar.xz"
11+ "http://lftp.yar.ru/ftp/${name}.tar.xz"
12 ];
13+ sha256 = "12y77jlfs4x4zvcah92mw2h2sb4j0bvbaxkh3wwsm8gs392ywyny";
14 };
1516 nativeBuildInputs = [ pkgconfig ];
···2829 meta = with stdenv.lib; {
30 description = "A file transfer program supporting a number of network protocols";
31+ homepage = https://lftp.tech/;
32 license = licenses.gpl3;
33 platforms = platforms.unix;
34 maintainers = [ maintainers.bjornfor ];
+2-2
pkgs/tools/security/yara/default.nix
···5}:
67stdenv.mkDerivation rec {
8- version = "3.6.0";
9 name = "yara-${version}";
1011 src = fetchFromGitHub {
12 owner = "VirusTotal";
13 repo = "yara";
14 rev = "v${version}";
15- sha256 = "05nadqpvihdyxym11mn6n02rzv2ng8ga7j9l0g5gnjx366gcai42";
16 };
1718 # FIXME: this is probably not the right way to make it work
···5}:
67stdenv.mkDerivation rec {
8+ version = "3.6.3";
9 name = "yara-${version}";
1011 src = fetchFromGitHub {
12 owner = "VirusTotal";
13 repo = "yara";
14 rev = "v${version}";
15+ sha256 = "13znbdwin9lvql43wpms5hh13h8rk5x5wajgmphz18rxwp8h7j78";
16 };
1718 # FIXME: this is probably not the right way to make it work