Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
7654f8f
yarssr: init at git-2017-12-01
xurei Feb 19, 2018
844c468
postman : 5.5.2 -> 5.5.3
xurei Feb 19, 2018
c26bf1c
logkeys: 2017-10-10 -> 2018-01-22
markus1189 Feb 21, 2018
1c3c803
logkeys.service: Add 'device' option
markus1189 Feb 21, 2018
76a1e39
thin-provisioning-tools: 0.6.3 -> 0.7.5
ryantm Feb 28, 2018
8fccc7e
deluge: use mkEnableOption
flokli Jan 10, 2018
fe840cd
deluge: add test
flokli Jan 10, 2018
bf6660c
xpra: 2.2.5 -> 2.2.6
Apr 20, 2018
53bea54
matrix-synapse: 0.27.2 -> 0.27.4
florianjacob Apr 20, 2018
3d97455
canonicaljson: 1.0.0 -> 1.1.3
florianjacob Apr 20, 2018
3e3b589
remarshal: use python3 instead of python2
peterhoeg Apr 21, 2018
6390154
canonicaljson: separating from pythonPackages
florianjacob Apr 21, 2018
ce3961c
python-frozendict: 0.5 -> 1.2
florianjacob Apr 20, 2018
2749531
frozendict: move to separate module
florianjacob Apr 21, 2018
9b57937
motuclient: 1.4.00 -> 1.5.00
lsix Apr 23, 2018
4cd8880
home-assistant: make port configurable so we can use it elsewhere
peterhoeg Apr 21, 2018
b886faa
home-assistant: use remarshal to convert configuration to YAML
peterhoeg Apr 21, 2018
9c194b1
frozendict: disable checks
florianjacob Apr 23, 2018
bec9726
ngx_brotli: -> 0.1.1
dtzWill Apr 24, 2018
2dbde85
pythonPackages.dataclasses: init at 0.5
catern Apr 19, 2018
e4a6e32
home-assistant: simplify definition of configFile
Apr 23, 2018
dad3714
live555: supports darwin
matthewbauer Apr 24, 2018
db6cc56
libmtp: supports darwin
matthewbauer Apr 24, 2018
9c406d2
libdvdnav: supports Darwin
matthewbauer Apr 24, 2018
00bf115
schroedinger: add Darwin patch
matthewbauer Apr 24, 2018
1c3d38c
vim_configurable: replace default ftNix patch with sources from vim-nix
LnL7 Apr 24, 2018
a4ba8c6
clementine: each output should hav a wrapped `GST_PLUGIN_SYSTEM_PATH_…
Ma27 Apr 24, 2018
734b13a
gst-plugins: fix on Darwin
matthewbauer Apr 24, 2018
3e0a443
musl: provide 'iconv' utility occasionally expected as part of libiconv
dtzWill Apr 25, 2018
de00c0d
musl/iconv: use copy from Alpine for minor touchups to error messages
dtzWill Apr 25, 2018
45f1205
Merge pull request #39304 from peterhoeg/f/ha
peterhoeg Apr 25, 2018
b933157
kholidays: Move from kde_applications to kde_frameworks
bkchr Apr 20, 2018
faed183
kde_applications: 17.12.3 -> 18.04.0
bkchr Apr 20, 2018
58f53dc
okteta: Move into own package
bkchr Apr 21, 2018
337e972
kde-applications: Create alias to okteta
adisbladis Apr 24, 2018
a2f617f
qcachegrind: Remove qt 5.10 build fix patch, now applied upstream
adisbladis Apr 24, 2018
7171b60
Merge pull request #39257 from bkchr/kde_applications_18_04
adisbladis Apr 25, 2018
8945e6b
kproperty: 3.0.2 -> 3.1.0
adisbladis Apr 25, 2018
d512153
kreport: 3.0.2 -> 3.1.0
adisbladis Apr 25, 2018
1bde5c5
kexi: 3.0.2 -> 3.1.0
adisbladis Apr 25, 2018
b20a82c
calligra: 3.0.1 -> 3.1.0
adisbladis Apr 25, 2018
04e13de
gn: fix Darwin build
matthewbauer Apr 25, 2018
791b5bb
musl bootstrap: remove libiconv
dtzWill Apr 25, 2018
a276d51
inkscape: fix on Darwin
matthewbauer Apr 25, 2018
7587f98
glibmm: fix High Sierra segfault
matthewbauer Apr 25, 2018
b87cb29
glibmm: 2.54.1 → 2.56.0
matthewbauer Apr 25, 2018
656f69b
buildbot-plugins.wsgi-dashboards: Remove maintainer akazakov
adisbladis Apr 25, 2018
bd1d0e0
flashrom: fix build with gcc7
oxij Apr 25, 2018
fefbc04
Merge pull request #39462 from oxij/pkgs/fix-flashrom
wmertens Apr 25, 2018
ec632b7
qtwebengine: rewrite
matthewbauer Apr 25, 2018
e4e8562
nixos: typofixes/tab deletion in some foundationdb docs/module
thoughtpolice Apr 25, 2018
22fb762
live555: add aarch64-linux entry
matthewbauer Apr 25, 2018
0a8c91a
inkscape: typo
matthewbauer Apr 25, 2018
d71d7c9
Merge pull request #39465 from matthewbauer/work
matthewbauer Apr 25, 2018
fbd169a
Merge pull request #39158 from catern/dataclass
FRidh Apr 25, 2018
304c3eb
Merge pull request #39285 from florianjacob/synapse
FRidh Apr 25, 2018
42c87d4
Merge pull request #39439 from Ma27/fix-free-clementine-plugin-path
matthewbauer Apr 25, 2018
31e9e75
fio: 3.5 -> 3.6, enable on darwin (#39452)
veprbl Apr 25, 2018
ab5e607
Merge pull request #39436 from LnL7/vim-ft-nix
Mic92 Apr 25, 2018
6891bda
nixos/tests/keymap: wait for xdotool to succeed
xeji Apr 24, 2018
2848b5d
nix-zsh-completions: 0.3.8 -> 0.3.9
hedning Apr 25, 2018
25abc29
Merge pull request #39473 from xeji/update-keymap-test
srhb Apr 25, 2018
954e02f
nix-bash-completions: 0.6.5 -> 0.6.6
hedning Apr 25, 2018
c60a874
LTS Haskell 11.6
peti Apr 23, 2018
46cce6e
hackage-packages.nix: automatic Haskell package set update
peti Apr 22, 2018
93b3240
all-cabal-hashes: update to latest version
peti Apr 25, 2018
a49dca6
haskell-monad-logger: drop obsolete override
peti Apr 23, 2018
7724ead
haskell-{hlint,hoogle}: drop obsolete overrides
peti Apr 23, 2018
33e0462
haskell-vector-sized: update override
peti Apr 23, 2018
1d0a718
haskell-brick: update override for ghc 8.4.x
peti Apr 23, 2018
8d58b1a
Merge pull request #39360 from lsix/update_motu
lsix Apr 25, 2018
ca7d983
buildkite-agent3: init at 3.0.1 (#39471)
rvl Apr 25, 2018
ac61ae5
gn: Switch to fetchzip for apple_apsl directory
aszlig Apr 25, 2018
a3502ba
gn: Add libc++ and libc++abi from third_party
aszlig Apr 25, 2018
97698b0
musl-stdenv: don't add special allowance for libiconv
dtzWill Apr 25, 2018
4340a15
pitivi: 0.96 → 0.99
jtojnar Mar 1, 2018
2d54f8f
musl: build iconv using just-built pieces
dtzWill Apr 25, 2018
558f742
musl: make libc -> {ldso,ldd} symlinks relative
dtzWill Mar 12, 2018
c84dad3
lib/generators: print paths without quotes & move function down
Profpatsch Apr 25, 2018
4f16b36
radiotray-ng: 0.2.1 -> 0.2.2
dtzWill Apr 25, 2018
4d40adb
nginx: allow basic auth passwords to be specified in a file
lopsided98 Apr 5, 2018
2236f41
radiotray-ng: disable tests, they now want to download unconditionally
dtzWill Apr 25, 2018
0dec4fa
rarian: merge gnome{2,3}.rarian
jtojnar Apr 25, 2018
e1235e0
Merge pull request #39484 from dtzWill/update/radiotray-ng-0.2.2
dtzWill Apr 25, 2018
542f3db
Merge pull request #39414 from dtzWill/update/ngx_brotli-0.1.1
dtzWill Apr 25, 2018
6c748ae
inkscape: Fix build on NixOS
aszlig Apr 25, 2018
a1349f0
Merge pull request #39486 from dtzWill/fix/musl-provide-iconv-tool
7c6f434c Apr 25, 2018
c4b7bbf
ocamlPackages.findlib: 1.7.3 -> 1.8.0
vbgl Apr 19, 2018
5c4ee2a
ocaml: init at 4.07.0+beta2
vbgl Apr 18, 2018
e609551
vim-nix: 2018-04-15 -> 2018-04-24
LnL7 Apr 25, 2018
43c837b
Merge pull request #39475 from hedning/nix-completions-bump
LnL7 Apr 25, 2018
30357e2
lsof: 4.90 -> 4.91
dtzWill Apr 25, 2018
0009ae3
onboard: fix missing typelibs
jtojnar Apr 25, 2018
d6ca2d3
Merge pull request #39497 from dtzWill/update/lsof-4.91
dtzWill Apr 25, 2018
5eea946
Merge pull request #39492 from LnL7/vim-nix
LnL7 Apr 25, 2018
e40213e
Merge pull request #39183 from r-ryantm/auto-update/xpra
matthewbauer Apr 25, 2018
ba52ae5
treewide: isArm -> isAarch32
Ericson2314 Mar 20, 2018
948c8dc
Merge pull request #37401 from obsidiansystems/aarch32
Ericson2314 Apr 25, 2018
fb83694
Merge pull request #35187 from xurei/app/yarssr
matthewbauer Apr 25, 2018
edf5548
Merge pull request #35201 from xurei/app/postman
matthewbauer Apr 25, 2018
a4a2626
Merge pull request #35280 from markus1189/logkeys
matthewbauer Apr 25, 2018
160d9ed
Merge pull request #36055 from ryantm/auto-update/thin-provisioning-t…
matthewbauer Apr 25, 2018
e4d2d32
Merge pull request #33679 from flokli/deluge-module
matthewbauer Apr 25, 2018
bb9dd2d
top-level: add overrides.nix
matthewbauer Apr 25, 2018
e1f8b22
all-packages: move aliases
matthewbauer Apr 26, 2018
35f3e2d
all-packages.nix: use inherit where possible
matthewbauer Apr 26, 2018
cb0b33d
release: mysql → mariadb
matthewbauer Apr 26, 2018
eeba736
stage.nix: add quickEval options
matthewbauer Apr 26, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 15 additions & 11 deletions lib/generators.nix
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,13 @@ rec {
(This means fn is type Val -> String.) */
allowPrettyValues ? false
}@args: v: with builtins;
if isInt v then toString v
let isPath = v: typeOf v == "path";
in if isInt v then toString v
else if isString v then ''"${libStr.escape [''"''] v}"''
else if true == v then "true"
else if false == v then "false"
else if null == v then "null"
else if isFunction v then
let fna = lib.functionArgs v;
showFnas = concatStringsSep "," (libAttr.mapAttrsToList
(name: hasDefVal: if hasDefVal then "(${name})" else name)
fna);
in if fna == {} then "<λ>"
else "<λ:{${showFnas}}>"
else if null == v then "null"
else if isPath v then toString v
else if isList v then "[ "
+ libStr.concatMapStringsSep " " (toPretty args) v
+ " ]"
Expand All @@ -163,12 +158,21 @@ rec {
if attrNames v == [ "__pretty" "val" ] && allowPrettyValues
then v.__pretty v.val
# TODO: there is probably a better representation?
else if v ? type && v.type == "derivation" then "<δ>"
else if v ? type && v.type == "derivation" then
"<δ:${v.name}>"
# "<δ:${concatStringsSep "," (builtins.attrNames v)}>"
else "{ "
+ libStr.concatStringsSep " " (libAttr.mapAttrsToList
(name: value:
"${toPretty args name} = ${toPretty args value};") v)
+ " }"
else abort "generators.toPretty: should never happen (v = ${v})";
else if isFunction v then
let fna = lib.functionArgs v;
showFnas = concatStringsSep "," (libAttr.mapAttrsToList
(name: hasDefVal: if hasDefVal then "(${name})" else name)
fna);
in if fna == {} then "<λ>"
else "<λ:{${showFnas}}>"
else abort "toPretty: should never happen (v = ${v})";

}
2 changes: 1 addition & 1 deletion lib/systems/doubles.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ in rec {

none = [];

arm = filterDoubles predicates.isArm;
arm = filterDoubles predicates.isAarch32;
aarch64 = filterDoubles predicates.isAarch64;
x86 = filterDoubles predicates.isx86;
i686 = filterDoubles predicates.isi686;
Expand Down
2 changes: 1 addition & 1 deletion lib/systems/for-meta.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in rec {
all = [ {} ]; # `{}` matches anything
none = [];

arm = [ patterns.isArm ];
arm = [ patterns.isAarch32 ];
aarch64 = [ patterns.isAarch64 ];
x86 = [ patterns.isx86 ];
i686 = [ patterns.isi686 ];
Expand Down
7 changes: 5 additions & 2 deletions lib/systems/inspect.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ rec {
isx86_64 = { cpu = cpuTypes.x86_64; };
isPowerPC = { cpu = cpuTypes.powerpc; };
isx86 = { cpu = { family = "x86"; }; };
isArm = { cpu = { family = "arm"; }; };
isAarch64 = { cpu = { family = "aarch64"; }; };
isAarch32 = { cpu = { family = "arm"; bits = 32; }; };
isAarch64 = { cpu = { family = "arm"; bits = 64; }; };
isMips = { cpu = { family = "mips"; }; };
isRiscV = { cpu = { family = "riscv"; }; };
isWasm = { cpu = { family = "wasm"; }; };
Expand Down Expand Up @@ -41,6 +41,9 @@ rec {

isEfi = map (family: { cpu.family = family; })
[ "x86" "arm" "aarch64" ];

# Deprecated
isArm = isAarch32;
};

matchAnyAttrs = patterns:
Expand Down
2 changes: 1 addition & 1 deletion lib/systems/parse.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ rec {
armv6l = { bits = 32; significantByte = littleEndian; family = "arm"; };
armv7a = { bits = 32; significantByte = littleEndian; family = "arm"; };
armv7l = { bits = 32; significantByte = littleEndian; family = "arm"; };
aarch64 = { bits = 64; significantByte = littleEndian; family = "aarch64"; };
aarch64 = { bits = 64; significantByte = littleEndian; family = "arm"; };
i686 = { bits = 32; significantByte = littleEndian; family = "x86"; };
x86_64 = { bits = 64; significantByte = littleEndian; family = "x86"; };
mips = { bits = 32; significantByte = bigEndian; family = "mips"; };
Expand Down
8 changes: 5 additions & 3 deletions lib/tests/misc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,8 @@ runTests {
expr = mapAttrs (const (generators.toPretty {})) rec {
int = 42;
bool = true;
string = "fnord";
string = ''fno"rd'';
path = /. + "/foo"; # toPath returns a string
null_ = null;
function = x: x;
functionArgs = { arg ? 4, foo }: arg;
Expand All @@ -328,13 +329,14 @@ runTests {
expected = rec {
int = "42";
bool = "true";
string = "\"fnord\"";
string = ''"fno\"rd"'';
path = "/foo";
null_ = "null";
function = "<λ>";
functionArgs = "<λ:{(arg),foo}>";
list = "[ 3 4 ${function} [ false ] ]";
attrs = "{ \"foo\" = null; \"foo bar\" = \"baz\"; }";
drv = "<δ>";
drv = "<δ:test>";
};
};

Expand Down
2 changes: 1 addition & 1 deletion nixos/lib/qemu-flags.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
];

qemuSerialDevice = if pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64 then "ttyS0"
else if pkgs.stdenv.isArm || pkgs.stdenv.isAarch64 then "ttyAMA0"
else if pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64 then "ttyAMA0"
else throw "Unknown QEMU serial device for system '${pkgs.stdenv.system}'";

qemuBinary = qemuPkg: {
Expand Down
4 changes: 2 additions & 2 deletions nixos/modules/config/gnu.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ with lib;
nano zile
texinfo # for the stand-alone Info reader
]
++ stdenv.lib.optional (!stdenv.isArm) grub2;
++ stdenv.lib.optional (!stdenv.isAarch32) grub2;


# GNU GRUB, where available.
boot.loader.grub.enable = !pkgs.stdenv.isArm;
boot.loader.grub.enable = !pkgs.stdenv.isAarch32;
boot.loader.grub.version = 2;

# GNU lsh.
Expand Down
8 changes: 4 additions & 4 deletions nixos/modules/services/databases/foundationdb.nix
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ in
default = null;
type = types.nullOr types.str;
description = ''
Machine identifier key. All processes on a machine should share a
Machine identifier key. All processes on a machine should share a
unique id. By default, processes on a machine determine a unique id to share.
This does not generally need to be set.
'';
Expand All @@ -216,7 +216,7 @@ in
default = null;
type = types.nullOr types.str;
description = ''
Zone identifier key. Processes that share a zone id are
Zone identifier key. Processes that share a zone id are
considered non-unique for the purposes of data replication.
If unset, defaults to machine id.
'';
Expand All @@ -226,7 +226,7 @@ in
default = null;
type = types.nullOr types.str;
description = ''
Data center identifier key. All processes physically located in a
Data center identifier key. All processes physically located in a
data center should share the id. If you are depending on data
center based replication this must be set on all processes.
'';
Expand All @@ -236,7 +236,7 @@ in
default = null;
type = types.nullOr types.str;
description = ''
Data hall identifier key. All processes physically located in a
Data hall identifier key. All processes physically located in a
data hall should share the id. If you are depending on data
hall based replication this must be set on all processes.
'';
Expand Down
9 changes: 5 additions & 4 deletions nixos/modules/services/databases/foundationdb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

<para>FoundationDB (or "FDB") is a distributed, open source, high performance,
transactional key-value store. It can store petabytes of data and deliver
exceptional performance while maintaining consistency and ACID semantics over a
large cluster.</para>
exceptional performance while maintaining consistency and ACID semantics
(serializable transactions) over a large cluster.</para>

<section><title>Configuring and basic setup</title>

Expand Down Expand Up @@ -101,7 +101,7 @@ FoundationDB worker processes that should be started on the machine.</para>

<para>FoundationDB worker processes typically require 4GB of RAM per-process at
minimum for good performance, so this option is set to 1 by default since the
maximum aount of RAM is unknown. You're advised to abide by this restriction,
maximum amount of RAM is unknown. You're advised to abide by this restriction,
so pick a number of processes so that each has 4GB or more.</para>

<para>A similar option exists in order to scale backup agent processes,
Expand Down Expand Up @@ -129,7 +129,8 @@ client applications will use to find and join coordinators. Note that this file
<emphasis>can not</emphasis> be managed by NixOS so easily: FoundationDB is
designed so that it will rewrite the file at runtime for all clients and nodes
when cluster coordinators change, with clients transparently handling this
without intervention.</para>
without intervention. It is fundamentally a mutable file, and you should not
try to manage it in any way in NixOS.</para>

<para>When dealing with a cluster, there are two main things you want to
do:</para>
Expand Down
42 changes: 36 additions & 6 deletions nixos/modules/services/misc/home-assistant.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ with lib;
let
cfg = config.services.home-assistant;

configFile = pkgs.writeText "configuration.yaml" (builtins.toJSON cfg.config);
# cfg.config != null can be assumed here
configFile = pkgs.writeText "configuration.json"
(builtins.toJSON (if cfg.applyDefaultConfig then
(lib.recursiveUpdate defaultConfig cfg.config) else cfg.config));

availableComponents = pkgs.home-assistant.availableComponents;

Expand Down Expand Up @@ -38,6 +41,12 @@ let
then (cfg.package.override { inherit extraComponents; })
else cfg.package;

# If you are changing this, please update the description in applyDefaultConfig
defaultConfig = {
homeassistant.time_zone = config.time.timeZone;
http.server_port = (toString cfg.port);
};

in {
meta.maintainers = with maintainers; [ dotlambda ];

Expand All @@ -50,6 +59,26 @@ in {
description = "The config directory, where your <filename>configuration.yaml</filename> is located.";
};

port = mkOption {
default = 8123;
type = types.int;
description = "The port on which to listen.";
};

applyDefaultConfig = mkOption {
default = true;
type = types.bool;
description = ''
Setting this option enables a few configuration options for HA based on NixOS configuration (such as time zone) to avoid having to manually specify configuration we already have.
</para>
<para>
Currently one side effect of enabling this is that the <literal>http</literal> component will be enabled.
</para>
<para>
This only takes effect if <literal>config != null</literal> in order to ensure that a manually managed <filename>configuration.yaml</filename> is not overwritten.
'';
};

config = mkOption {
default = null;
type = with types; nullOr attrs;
Expand Down Expand Up @@ -106,19 +135,20 @@ in {
description = "Home Assistant";
after = [ "network.target" ];
preStart = lib.optionalString (cfg.config != null) ''
rm -f ${cfg.configDir}/configuration.yaml
ln -s ${configFile} ${cfg.configDir}/configuration.yaml
config=${cfg.configDir}/configuration.yaml
rm -f $config
${pkgs.remarshal}/bin/json2yaml -i ${configFile} -o $config
chmod 444 $config
'';
serviceConfig = {
ExecStart = ''
${package}/bin/hass --config "${cfg.configDir}"
'';
ExecStart = "${package}/bin/hass --config '${cfg.configDir}'";
User = "hass";
Group = "hass";
Restart = "on-failure";
ProtectSystem = "strict";
ReadWritePaths = "${cfg.configDir}";
PrivateTmp = true;
RemoveIPC = true;
};
path = [
"/run/wrappers" # needed for ping
Expand Down
9 changes: 8 additions & 1 deletion nixos/modules/services/misc/logkeys.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,21 @@ let
in {
options.services.logkeys = {
enable = mkEnableOption "logkeys service";

device = mkOption {
description = "Use the given device as keyboard input event device instead of /dev/input/eventX default.";
default = null;
type = types.nullOr types.string;
example = "/dev/input/event15";
};
};

config = mkIf cfg.enable {
systemd.services.logkeys = {
description = "LogKeys Keylogger Daemon";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${pkgs.logkeys}/bin/logkeys -s";
ExecStart = "${pkgs.logkeys}/bin/logkeys -s${lib.optionalString (cfg.device != null) " -d ${cfg.device}"}";
ExecStop = "${pkgs.logkeys}/bin/logkeys -k";
Type = "forking";
};
Expand Down
14 changes: 2 additions & 12 deletions nixos/modules/services/torrent/deluge.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ in {
options = {
services = {
deluge = {
enable = mkOption {
default = false;
description = "Start the Deluge daemon";
};
enable = mkEnableOption "Deluge daemon";

openFilesLimit = mkOption {
default = openFilesLimit;
Expand All @@ -25,14 +22,7 @@ in {
};
};

deluge.web = {
enable = mkOption {
default = false;
description = ''
Start Deluge Web daemon.
'';
};
};
deluge.web.enable = mkEnableOption "Deluge Web daemon";
};
};

Expand Down
20 changes: 9 additions & 11 deletions nixos/modules/services/web-servers/nginx/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ let
ssl_certificate_key ${vhost.sslCertificateKey};
''}

${optionalString (vhost.basicAuth != {}) (mkBasicAuth vhostName vhost.basicAuth)}
${optionalString (vhost.basicAuthFile != null || vhost.basicAuth != {}) ''
auth_basic secured;
auth_basic_user_file ${if vhost.basicAuthFile != null then vhost.basicAuthFile else mkHtpasswd vhostName vhost.basicAuth};
''}

${mkLocations vhost.locations}

Expand Down Expand Up @@ -248,16 +251,11 @@ let
${optionalString (config.proxyPass != null && cfg.recommendedProxySettings) "include ${recommendedProxyConfig};"}
}
'') locations);
mkBasicAuth = vhostName: authDef: let
htpasswdFile = pkgs.writeText "${vhostName}.htpasswd" (
concatStringsSep "\n" (mapAttrsToList (user: password: ''
${user}:{PLAIN}${password}
'') authDef)
);
in ''
auth_basic secured;
auth_basic_user_file ${htpasswdFile};
'';
mkHtpasswd = vhostName: authDef: pkgs.writeText "${vhostName}.htpasswd" (
concatStringsSep "\n" (mapAttrsToList (user: password: ''
${user}:{PLAIN}${password}
'') authDef)
);
in

{
Expand Down
8 changes: 8 additions & 0 deletions nixos/modules/services/web-servers/nginx/vhost-options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@ with lib;
'';
};

basicAuthFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
Basic Auth password file for a vhost.
'';
};

locations = mkOption {
type = types.attrsOf (types.submodule (import ./location-options.nix {
inherit lib;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/qemu-vm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ in
# FIXME: Consolidate this one day.
virtualisation.qemu.options = mkMerge [
(mkIf (pkgs.stdenv.isi686 || pkgs.stdenv.isx86_64) [ "-vga std" "-usb" "-device usb-tablet,bus=usb-bus.0" ])
(mkIf (pkgs.stdenv.isArm || pkgs.stdenv.isAarch64) [ "-device virtio-gpu-pci" "-device usb-ehci,id=usb0" "-device usb-kbd" "-device usb-tablet" ])
(mkIf (pkgs.stdenv.isAarch32 || pkgs.stdenv.isAarch64) [ "-device virtio-gpu-pci" "-device usb-ehci,id=usb0" "-device usb-kbd" "-device usb-tablet" ])
];

# Mount the host filesystem via 9P, and bind-mount the Nix store
Expand Down
Loading