Merge branch 'master' into fix-linux-perf

This commit is contained in:
Jörg Thalheim 2021-07-03 18:56:44 +01:00 committed by GitHub
commit e587a7fcf1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
630 changed files with 11585 additions and 7344 deletions

View file

@ -1,41 +0,0 @@
name: "merge staging(-next)"
on:
schedule:
# * is a special character in YAML so you have to quote this string
# Merge every 6 hours
- cron: '0 */6 * * *'
jobs:
sync-branch:
if: github.repository_owner == 'NixOS'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Merge master into staging-next
id: staging_next
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: master
target_branch: staging-next
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Merge staging-next into staging
id: staging
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: staging-next
target_branch: staging
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on failure
uses: peter-evans/create-or-update-comment@v1
if: ${{ failure() }}
with:
issue-number: 105153
body: |
An automatic merge${{ (steps.staging_next.outcome == 'failure' && ' from master to staging-next') || ((steps.staging.outcome == 'failure' && ' from staging-next to staging') || '') }} [failed](https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}).

View file

@ -0,0 +1,49 @@
# This action periodically merges base branches into staging branches.
# This is done to
# * prevent conflicts or rather resolve them early
# * make all potential breakage happen on the staging branch
# * and make sure that all major rebuilds happen before the staging
# branch gets merged back into its base branch.
name: "Periodic Merges (24h)"
on:
schedule:
# * is a special character in YAML so you have to quote this string
# Merge every 24 hours
- cron: '0 0 * * *'
jobs:
periodic-merge:
if: github.repository_owner == 'NixOS'
runs-on: ubuntu-latest
strategy:
# don't fail fast, so that all pairs are tried
fail-fast: false
# certain branches need to be merged in order, like master->staging-next->staging
# and disabling parallelism ensures the order of the pairs below.
max-parallel: 1
matrix:
pairs:
- from: master
into: haskell-updates
name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
steps:
- uses: actions/checkout@v2
- name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: ${{ matrix.pairs.from }}
target_branch: ${{ matrix.pairs.into }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on failure
uses: peter-evans/create-or-update-comment@v1
if: ${{ failure() }}
with:
issue-number: 105153
body: |
Periodic merge from `${{ matrix.pairs.from }}` into `${{ matrix.pairs.into }}` has [failed](https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}).

55
.github/workflows/periodic-merge-6h.yml vendored Normal file
View file

@ -0,0 +1,55 @@
# This action periodically merges base branches into staging branches.
# This is done to
# * prevent conflicts or rather resolve them early
# * make all potential breakage happen on the staging branch
# * and make sure that all major rebuilds happen before the staging
# branch gets merged back into its base branch.
name: "Periodic Merges (6h)"
on:
schedule:
# * is a special character in YAML so you have to quote this string
# Merge every 6 hours
- cron: '0 */6 * * *'
jobs:
periodic-merge:
if: github.repository_owner == 'NixOS'
runs-on: ubuntu-latest
strategy:
# don't fail fast, so that all pairs are tried
fail-fast: false
# certain branches need to be merged in order, like master->staging-next->staging
# and disabling parallelism ensures the order of the pairs below.
max-parallel: 1
matrix:
pairs:
- from: master
into: staging-next
- from: staging-next
into: staging
- from: release-21.05
into: staging-next-21.05
- from: staging-next-21.05
into: staging-21.05
name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
steps:
- uses: actions/checkout@v2
- name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: ${{ matrix.pairs.from }}
target_branch: ${{ matrix.pairs.into }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on failure
uses: peter-evans/create-or-update-comment@v1
if: ${{ failure() }}
with:
issue-number: 105153
body: |
Periodic merge from `${{ matrix.pairs.from }}` into `${{ matrix.pairs.into }}` has [failed](https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}).

View file

@ -56,16 +56,7 @@ Use `programs.steam.enable = true;` if you want to add steam to systemPackages a
## steam-run {#sec-steam-run}
The FHS-compatible chroot used for steam can also be used to run other linux games that expect a FHS environment. To do it, add
```nix
pkgs.steam.override ({
nativeOnly = true;
newStdcpp = true;
}).run
```
to your configuration, rebuild, and run the game with
The FHS-compatible chroot used for Steam can also be used to run other Linux games that expect a FHS environment. To use it, install the `steam-run-native` package and run the game with
```
steam-run ./foo

View file

@ -241,7 +241,7 @@ let
git
# replace with beam.packages.erlang.elixir_1_11 if you need
beam.packages.erlang.elixir
nodejs-15_x
nodejs
postgresql_13
# only used for frontend dependencies
# you are free to use yarn2nix as well

View file

@ -0,0 +1,31 @@
# Hy {#sec-language-hy}
## Installation {#ssec-hy-installation}
### Installation without packages {#installation-without-packages}
You can install `hy` via nix-env or by adding it to `configuration.nix` by reffering to it as a `hy` attribute. This kind of installation adds `hy` to your environment and it succesfully works with `python3`.
::: {.caution}
Packages that are installed with your python derivation, are not accesible by `hy` this way.
:::
### Installation with packages {#installation-with-packages}
Creating `hy` derivation with custom `python` packages is really simple and similar to the way that python does it. Attribute `hy` provides function `withPackages` that creates custom `hy` derivation with specified packages.
For example if you want to create shell with `matplotlib` and `numpy`, you can do it like so:
```ShellSession
$ nix-shell -p "hy.withPackages (ps: with ps; [ numpy matplotlib ])"
```
Or if you want to extend your `configuration.nix`:
```nix
{ # ...
environment.systemPackages = with pkgs; [
(hy.withPackages (py-packages: with py-packages; [ numpy matplotlib ]))
];
}
```

View file

@ -16,6 +16,7 @@
<xi:include href="gnome.section.xml" />
<xi:include href="go.section.xml" />
<xi:include href="haskell.section.xml" />
<xi:include href="hy.section.xml" />
<xi:include href="idris.section.xml" />
<xi:include href="ios.section.xml" />
<xi:include href="java.section.xml" />

View file

@ -1701,6 +1701,18 @@
githubId = 3471749;
name = "Claudio Bley";
};
cburstedde = {
email = "burstedde@ins.uni-bonn.de";
github = "cburstedde";
githubId = 109908;
name = "Carsten Burstedde";
keys = [
{
longkeyid = "rsa2048/0x0704CD9E550A6BCD";
fingerprint = "1127 A432 6524 BF02 737B 544E 0704 CD9E 550A 6BCD";
}
];
};
cdepillabout = {
email = "cdep.illabout@gmail.com";
github = "cdepillabout";
@ -2562,7 +2574,7 @@
name = "Diego Lelis";
};
diffumist = {
email = "diffumist@gmail.com";
email = "git@diffumist.me";
github = "diffumist";
githubId = 32810399;
name = "Diffumist";
@ -4049,6 +4061,12 @@
github = "gytis-ivaskevicius";
githubId = 23264966;
};
hagl = {
email = "harald@glie.be";
github = "hagl";
githubId = 1162118;
name = "Harald Gliebe";
};
hakuch = {
email = "hakuch@gmail.com";
github = "hakuch";
@ -7228,10 +7246,10 @@
name = "Marko Poikonen";
};
mtreca = {
email = "maxime@treca.dev";
name = "Maxime Tréca";
email = "maxime.treca@gmail.com";
github = "mtreca";
githubId = 16440823;
name = "Maxime Tréca";
};
mtreskin = {
email = "zerthurd@gmail.com";
@ -10776,6 +10794,12 @@
githubId = 347983;
name = "Udo Spallek";
};
ulrikstrid = {
email = "ulrik.strid@outlook.com";
github = "ulrikstrid";
githubId = 1607770;
name = "Ulrik Strid";
};
unode = {
email = "alves.rjc@gmail.com";
github = "unode";
@ -10872,6 +10896,12 @@
githubId = 608417;
name = "Jos van den Oever";
};
vanilla = {
email = "neko@hydev.org";
github = "VergeDX";
githubId = 25173827;
name = "Vanilla";
};
vanschelven = {
email = "klaas@vanschelven.com";
github = "vanschelven";

View file

@ -17,9 +17,9 @@ trap "rm ${tmpfile}" 0
echo "Remember that you need to manually run 'maintainers/scripts/haskell/hydra-report.hs get-report' sometime before running this script."
echo "Generating a list of broken builds and displaying for manual confirmation ..."
maintainers/scripts/haskell/hydra-report.hs mark-broken-list | sort -i > $tmpfile
maintainers/scripts/haskell/hydra-report.hs mark-broken-list | sort -i > "$tmpfile"
$EDITOR $tmpfile
$EDITOR "$tmpfile"
tail -n +3 "$broken_config" >> "$tmpfile"
@ -28,10 +28,11 @@ broken-packages:
# These packages don't compile.
EOF
# clear environment here to avoid things like allowing broken builds in
sort -iu "$tmpfile" >> "$broken_config"
maintainers/scripts/haskell/regenerate-hackage-packages.sh
maintainers/scripts/haskell/regenerate-transitive-broken-packages.sh
maintainers/scripts/haskell/regenerate-hackage-packages.sh
env -i maintainers/scripts/haskell/regenerate-hackage-packages.sh
env -i maintainers/scripts/haskell/regenerate-transitive-broken-packages.sh
env -i maintainers/scripts/haskell/regenerate-hackage-packages.sh
if [[ "${1:-}" == "--do-commit" ]]; then
git add $broken_config

View file

@ -30,6 +30,12 @@ If NixOS fails to boot, there are a number of kernel command line parameters tha
: Make systemd very verbose and send log messages to the console instead of the journal. For more parameters recognised by systemd, see systemd(1).
In addition, these arguments are recognised by the live image only:
`live.nixos.passwd=password`
: Set the password for the `nixos` live user. This can be used for SSH access if there are issues using the terminal.
Notice that for `boot.shell_on_fail`, `boot.debug1`, `boot.debug1devices`, and `boot.debug1mounts`, if you did **not** select "start the new shell as pid 1", and you `exit` from the new shell, boot will proceed normally from the point where it failed, as if you'd chosen "ignore the error and continue".
If no login prompts or X11 login screens appear (e.g. due to hanging dependencies), you can press Alt+ArrowUp. If youre lucky, this will start rescue mode (described above). (Also note that since most units have a 90-second timeout before systemd gives up on them, the `agetty` login prompts should appear eventually unless something is very wrong.)

View file

@ -13,7 +13,7 @@ xlink:href="https://github.com/NixOS/nixpkgs/tree/master/nixos/tests">nixos/test
one or more virtual machines containing the NixOS system(s) required for the
test.
</para>
<xi:include href="writing-nixos-tests.xml" />
<xi:include href="running-nixos-tests.xml" />
<xi:include href="running-nixos-tests-interactively.xml" />
<xi:include href="../from_md/development/writing-nixos-tests.section.xml" />
<xi:include href="../from_md/development/running-nixos-tests.section.xml" />
<xi:include href="../from_md/development/running-nixos-tests-interactively.section.xml" />
</chapter>

View file

@ -0,0 +1,44 @@
# Running Tests interactively {#sec-running-nixos-tests-interactively}
The test itself can be run interactively. This is particularly useful
when developing or debugging a test:
```ShellSession
$ nix-build nixos/tests/login.nix -A driverInteractive
$ ./result/bin/nixos-test-driver
starting VDE switch for network 1
>
```
You can then take any Python statement, e.g.
```py
> start_all()
> test_script()
> machine.succeed("touch /tmp/foo")
> print(machine.succeed("pwd")) # Show stdout of command
```
The function `test_script` executes the entire test script and drops you
back into the test driver command line upon its completion. This allows
you to inspect the state of the VMs after the test (e.g. to debug the
test script).
To just start and experiment with the VMs, run:
```ShellSession
$ nix-build nixos/tests/login.nix -A driverInteractive
$ ./result/bin/nixos-run-vms
```
The script `nixos-run-vms` starts the virtual machines defined by test.
You can re-use the VM states coming from a previous run by setting the
`--keep-vm-state` flag.
```ShellSession
$ ./result/bin/nixos-run-vms --keep-vm-state
```
The machine state is stored in the `$TMPDIR/vm-state-machinename`
directory.

View file

@ -1,49 +0,0 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="sec-running-nixos-tests-interactively">
<title>Running Tests interactively</title>
<para>
The test itself can be run interactively. This is particularly useful when
developing or debugging a test:
<screen>
<prompt>$ </prompt>nix-build nixos/tests/login.nix -A driverInteractive
<prompt>$ </prompt>./result/bin/nixos-test-driver
starting VDE switch for network 1
<prompt>&gt;</prompt>
</screen>
You can then take any Python statement, e.g.
<screen>
<prompt>&gt;</prompt> start_all()
<prompt>&gt;</prompt> test_script()
<prompt>&gt;</prompt> machine.succeed("touch /tmp/foo")
<prompt>&gt;</prompt> print(machine.succeed("pwd")) # Show stdout of command
</screen>
The function <command>test_script</command> executes the entire test script
and drops you back into the test driver command line upon its completion.
This allows you to inspect the state of the VMs after the test (e.g. to debug
the test script).
</para>
<para>
To just start and experiment with the VMs, run:
<screen>
<prompt>$ </prompt>nix-build nixos/tests/login.nix -A driverInteractive
<prompt>$ </prompt>./result/bin/nixos-run-vms
</screen>
The script <command>nixos-run-vms</command> starts the virtual machines
defined by test.
</para>
<para>
You can re-use the VM states coming from a previous run
by setting the <command>--keep-vm-state</command> flag.
<screen>
<prompt>$ </prompt>./result/bin/nixos-run-vms --keep-vm-state
</screen>
The machine state is stored in the
<filename>$TMPDIR/vm-state-</filename><varname>machinename</varname> directory.
</para>
</section>

View file

@ -0,0 +1,31 @@
# Running Tests {#sec-running-nixos-tests}
You can run tests using `nix-build`. For example, to run the test
[`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix),
you just do:
```ShellSession
$ nix-build '<nixpkgs/nixos/tests/login.nix>'
```
or, if you don't want to rely on `NIX_PATH`:
```ShellSession
$ cd /my/nixpkgs/nixos/tests
$ nix-build login.nix
running the VM test script
machine: QEMU running (pid 8841)
6 out of 6 tests succeeded
```
After building/downloading all required dependencies, this will perform
a build that starts a QEMU/KVM virtual machine containing a NixOS
system. The virtual machine mounts the Nix store of the host; this makes
VM creation very fast, as no disk image needs to be created. Afterwards,
you can view a pretty-printed log of the test:
```ShellSession
$ firefox result/log.html
```

View file

@ -1,36 +0,0 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="sec-running-nixos-tests">
<title>Running Tests</title>
<para>
You can run tests using <command>nix-build</command>. For example, to run the
test
<filename
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix">login.nix</filename>,
you just do:
<screen>
<prompt>$ </prompt>nix-build '&lt;nixpkgs/nixos/tests/login.nix>'
</screen>
or, if you dont want to rely on <envar>NIX_PATH</envar>:
<screen>
<prompt>$ </prompt>cd /my/nixpkgs/nixos/tests
<prompt>$ </prompt>nix-build login.nix
running the VM test script
machine: QEMU running (pid 8841)
6 out of 6 tests succeeded
</screen>
After building/downloading all required dependencies, this will perform a
build that starts a QEMU/KVM virtual machine containing a NixOS system. The
virtual machine mounts the Nix store of the host; this makes VM creation very
fast, as no disk image needs to be created. Afterwards, you can view a
pretty-printed log of the test:
<screen>
<prompt>$ </prompt>firefox result/log.html
</screen>
</para>
</section>

View file

@ -0,0 +1,301 @@
# Writing Tests {#sec-writing-nixos-tests}
A NixOS test is a Nix expression that has the following structure:
```nix
import ./make-test-python.nix {
# Either the configuration of a single machine:
machine =
{ config, pkgs, ... }:
{ configuration…
};
# Or a set of machines:
nodes =
{ machine1 =
{ config, pkgs, ... }: { … };
machine2 =
{ config, pkgs, ... }: { … };
};
testScript =
''
Python code…
'';
}
```
The attribute `testScript` is a bit of Python code that executes the
test (described below). During the test, it will start one or more
virtual machines, the configuration of which is described by the
attribute `machine` (if you need only one machine in your test) or by
the attribute `nodes` (if you need multiple machines). For instance,
[`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix)
only needs a single machine to test whether users can log in
on the virtual console, whether device ownership is correctly maintained
when switching between consoles, and so on. On the other hand,
[`nfs/simple.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs/simple.nix),
which tests NFS client and server functionality in the
Linux kernel (including whether locks are maintained across server
crashes), requires three machines: a server and two clients.
There are a few special NixOS configuration options for test VMs:
`virtualisation.memorySize`
: The memory of the VM in megabytes.
`virtualisation.vlans`
: The virtual networks to which the VM is connected. See
[`nat.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nat.nix)
for an example.
`virtualisation.writableStore`
: By default, the Nix store in the VM is not writable. If you enable
this option, a writable union file system is mounted on top of the
Nix store to make it appear writable. This is necessary for tests
that run Nix operations that modify the store.
For more options, see the module
[`qemu-vm.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/qemu-vm.nix).
The test script is a sequence of Python statements that perform various
actions, such as starting VMs, executing commands in the VMs, and so on.
Each virtual machine is represented as an object stored in the variable
`name` if this is also the identifier of the machine in the declarative
config. If you didn\'t specify multiple machines using the `nodes`
attribute, it is just `machine`. The following example starts the
machine, waits until it has finished booting, then executes a command
and checks that the output is more-or-less correct:
```py
machine.start()
machine.wait_for_unit("default.target")
if not "Linux" in machine.succeed("uname"):
raise Exception("Wrong OS")
```
The first line is actually unnecessary; machines are implicitly started
when you first execute an action on them (such as `wait_for_unit` or
`succeed`). If you have multiple machines, you can speed up the test by
starting them in parallel:
```py
start_all()
```
The following methods are available on machine objects:
`start`
: Start the virtual machine. This method is asynchronous --- it does
not wait for the machine to finish booting.
`shutdown`
: Shut down the machine, waiting for the VM to exit.
`crash`
: Simulate a sudden power failure, by telling the VM to exit
immediately.
`block`
: Simulate unplugging the Ethernet cable that connects the machine to
the other machines.
`unblock`
: Undo the effect of `block`.
`screenshot`
: Take a picture of the display of the virtual machine, in PNG format.
The screenshot is linked from the HTML log.
`get_screen_text_variants`
: Return a list of different interpretations of what is currently
visible on the machine\'s screen using optical character
recognition. The number and order of the interpretations is not
specified and is subject to change, but if no exception is raised at
least one will be returned.
::: {.note}
This requires passing `enableOCR` to the test attribute set.
:::
`get_screen_text`
: Return a textual representation of what is currently visible on the
machine\'s screen using optical character recognition.
::: {.note}
This requires passing `enableOCR` to the test attribute set.
:::
`send_monitor_command`
: Send a command to the QEMU monitor. This is rarely used, but allows
doing stuff such as attaching virtual USB disks to a running
machine.
`send_key`
: Simulate pressing keys on the virtual keyboard, e.g.,
`send_key("ctrl-alt-delete")`.
`send_chars`
: Simulate typing a sequence of characters on the virtual keyboard,
e.g., `send_chars("foobar\n")` will type the string `foobar`
followed by the Enter key.
`execute`
: Execute a shell command, returning a list `(status, stdout)`.
`succeed`
: Execute a shell command, raising an exception if the exit status is
not zero, otherwise returning the standard output. Commands are run
with `set -euo pipefail` set:
- If several commands are separated by `;` and one fails, the
command as a whole will fail.
- For pipelines, the last non-zero exit status will be returned
(if there is one, zero will be returned otherwise).
- Dereferencing unset variables fail the command.
`fail`
: Like `succeed`, but raising an exception if the command returns a zero
status.
`wait_until_succeeds`
: Repeat a shell command with 1-second intervals until it succeeds.
`wait_until_fails`
: Repeat a shell command with 1-second intervals until it fails.
`wait_for_unit`
: Wait until the specified systemd unit has reached the "active"
state.
`wait_for_file`
: Wait until the specified file exists.
`wait_for_open_port`
: Wait until a process is listening on the given TCP port (on
`localhost`, at least).
`wait_for_closed_port`
: Wait until nobody is listening on the given TCP port.
`wait_for_x`
: Wait until the X11 server is accepting connections.
`wait_for_text`
: Wait until the supplied regular expressions matches the textual
contents of the screen by using optical character recognition (see
`get_screen_text` and `get_screen_text_variants`).
::: {.note}
This requires passing `enableOCR` to the test attribute set.
:::
`wait_for_console_text`
: Wait until the supplied regular expressions match a line of the
serial console output. This method is useful when OCR is not
possibile or accurate enough.
`wait_for_window`
: Wait until an X11 window has appeared whose name matches the given
regular expression, e.g., `wait_for_window("Terminal")`.
`copy_from_host`
: Copies a file from host to machine, e.g.,
`copy_from_host("myfile", "/etc/my/important/file")`.
The first argument is the file on the host. The file needs to be
accessible while building the nix derivation. The second argument is
the location of the file on the machine.
`systemctl`
: Runs `systemctl` commands with optional support for
`systemctl --user`
```py
machine.systemctl("list-jobs --no-pager") # runs `systemctl list-jobs --no-pager`
machine.systemctl("list-jobs --no-pager", "any-user") # spawns a shell for `any-user` and runs `systemctl --user list-jobs --no-pager`
```
`shell_interact`
: Allows you to directly interact with the guest shell. This should
only be used during test development, not in production tests.
Killing the interactive session with `Ctrl-d` or `Ctrl-c` also ends
the guest session.
To test user units declared by `systemd.user.services` the optional
`user` argument can be used:
```py
machine.start()
machine.wait_for_x()
machine.wait_for_unit("xautolock.service", "x-session-user")
```
This applies to `systemctl`, `get_unit_info`, `wait_for_unit`,
`start_job` and `stop_job`.
For faster dev cycles it\'s also possible to disable the code-linters
(this shouldn\'t be commited though):
```nix
import ./make-test-python.nix {
skipLint = true;
machine =
{ config, pkgs, ... }:
{ configuration…
};
testScript =
''
Python code…
'';
}
```
This will produce a Nix warning at evaluation time. To fully disable the
linter, wrap the test script in comment directives to disable the Black
linter directly (again, don\'t commit this within the Nixpkgs
repository):
```nix
testScript =
''
# fmt: off
Python code…
# fmt: on
'';
```

View file

@ -1,517 +0,0 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="sec-writing-nixos-tests">
<title>Writing Tests</title>
<para>
A NixOS test is a Nix expression that has the following structure:
<programlisting>
import ./make-test-python.nix {
# Either the configuration of a single machine:
machine =
{ config, pkgs, ... }:
{ <replaceable>configuration…</replaceable>
};
# Or a set of machines:
nodes =
{ <replaceable>machine1</replaceable> =
{ config, pkgs, ... }: { <replaceable></replaceable> };
<replaceable>machine2</replaceable> =
{ config, pkgs, ... }: { <replaceable></replaceable> };
};
testScript =
''
<replaceable>Python code…</replaceable>
'';
}
</programlisting>
The attribute <literal>testScript</literal> is a bit of Python code that
executes the test (described below). During the test, it will start one or
more virtual machines, the configuration of which is described by the
attribute <literal>machine</literal> (if you need only one machine in your
test) or by the attribute <literal>nodes</literal> (if you need multiple
machines). For instance,
<filename
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix">login.nix</filename>
only needs a single machine to test whether users can log in on the virtual
console, whether device ownership is correctly maintained when switching
between consoles, and so on. On the other hand,
<filename
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs/simple.nix">nfs/simple.nix</filename>,
which tests NFS client and server functionality in the Linux kernel
(including whether locks are maintained across server crashes), requires
three machines: a server and two clients.
</para>
<para>
There are a few special NixOS configuration options for test VMs:
<!-- FIXME: would be nice to generate this automatically. -->
<variablelist>
<varlistentry>
<term>
<option>virtualisation.memorySize</option>
</term>
<listitem>
<para>
The memory of the VM in megabytes.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>virtualisation.vlans</option>
</term>
<listitem>
<para>
The virtual networks to which the VM is connected. See
<filename
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nat.nix">nat.nix</filename>
for an example.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>virtualisation.writableStore</option>
</term>
<listitem>
<para>
By default, the Nix store in the VM is not writable. If you enable this
option, a writable union file system is mounted on top of the Nix store
to make it appear writable. This is necessary for tests that run Nix
operations that modify the store.
</para>
</listitem>
</varlistentry>
</variablelist>
For more options, see the module
<filename
xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/qemu-vm.nix">qemu-vm.nix</filename>.
</para>
<para>
The test script is a sequence of Python statements that perform various
actions, such as starting VMs, executing commands in the VMs, and so on. Each
virtual machine is represented as an object stored in the variable
<literal><replaceable>name</replaceable></literal> if this is also the
identifier of the machine in the declarative config.
If you didn't specify multiple machines using the <literal>nodes</literal>
attribute, it is just <literal>machine</literal>.
The following example starts the machine, waits until it has finished booting,
then executes a command and checks that the output is more-or-less correct:
<programlisting>
machine.start()
machine.wait_for_unit("default.target")
if not "Linux" in machine.succeed("uname"):
raise Exception("Wrong OS")
</programlisting>
The first line is actually unnecessary; machines are implicitly started when
you first execute an action on them (such as <literal>wait_for_unit</literal>
or <literal>succeed</literal>). If you have multiple machines, you can speed
up the test by starting them in parallel:
<programlisting>
start_all()
</programlisting>
</para>
<para>
The following methods are available on machine objects:
<variablelist>
<varlistentry>
<term>
<methodname>start</methodname>
</term>
<listitem>
<para>
Start the virtual machine. This method is asynchronous — it does not
wait for the machine to finish booting.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>shutdown</methodname>
</term>
<listitem>
<para>
Shut down the machine, waiting for the VM to exit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>crash</methodname>
</term>
<listitem>
<para>
Simulate a sudden power failure, by telling the VM to exit immediately.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>block</methodname>
</term>
<listitem>
<para>
Simulate unplugging the Ethernet cable that connects the machine to the
other machines.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>unblock</methodname>
</term>
<listitem>
<para>
Undo the effect of <methodname>block</methodname>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>screenshot</methodname>
</term>
<listitem>
<para>
Take a picture of the display of the virtual machine, in PNG format. The
screenshot is linked from the HTML log.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>get_screen_text_variants</methodname>
</term>
<listitem>
<para>
Return a list of different interpretations of what is currently visible
on the machine's screen using optical character recognition. The number
and order of the interpretations is not specified and is subject to
change, but if no exception is raised at least one will be returned.
</para>
<note>
<para>
This requires passing <option>enableOCR</option> to the test attribute
set.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>get_screen_text</methodname>
</term>
<listitem>
<para>
Return a textual representation of what is currently visible on the
machine's screen using optical character recognition.
</para>
<note>
<para>
This requires passing <option>enableOCR</option> to the test attribute
set.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>send_monitor_command</methodname>
</term>
<listitem>
<para>
Send a command to the QEMU monitor. This is rarely used, but allows doing
stuff such as attaching virtual USB disks to a running machine.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>send_key</methodname>
</term>
<listitem>
<para>
Simulate pressing keys on the virtual keyboard, e.g.,
<literal>send_key("ctrl-alt-delete")</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>send_chars</methodname>
</term>
<listitem>
<para>
Simulate typing a sequence of characters on the virtual keyboard, e.g.,
<literal>send_chars("foobar\n")</literal> will type the string
<literal>foobar</literal> followed by the Enter key.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>execute</methodname>
</term>
<listitem>
<para>
Execute a shell command, returning a list
<literal>(<replaceable>status</replaceable>,
<replaceable>stdout</replaceable>)</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>succeed</methodname>
</term>
<listitem>
<para>
Execute a shell command, raising an exception if the exit status
is not zero, otherwise returning the standard output. Commands
are run with <literal>set -euo pipefail</literal> set:
<itemizedlist>
<listitem>
<para>
If several commands are separated by <literal>;</literal>
and one fails, the command as a whole will fail.
</para>
</listitem>
<listitem>
<para>
For pipelines, the last non-zero exit status will be
returned (if there is one, zero will be returned
otherwise).
</para>
</listitem>
<listitem>
<para>
Dereferencing unset variables fail the command.
</para>
</listitem>
</itemizedlist>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>fail</methodname>
</term>
<listitem>
<para>
Like <methodname>succeed</methodname>, but raising an exception if the
command returns a zero status.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>wait_until_succeeds</methodname>
</term>
<listitem>
<para>
Repeat a shell command with 1-second intervals until it succeeds.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>wait_until_fails</methodname>
</term>
<listitem>
<para>
Repeat a shell command with 1-second intervals until it fails.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>wait_for_unit</methodname>
</term>
<listitem>
<para>
Wait until the specified systemd unit has reached the “active” state.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>wait_for_file</methodname>
</term>
<listitem>
<para>
Wait until the specified file exists.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>wait_for_open_port</methodname>
</term>
<listitem>
<para>
Wait until a process is listening on the given TCP port (on
<literal>localhost</literal>, at least).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>wait_for_closed_port</methodname>
</term>
<listitem>
<para>
Wait until nobody is listening on the given TCP port.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>wait_for_x</methodname>
</term>
<listitem>
<para>
Wait until the X11 server is accepting connections.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>wait_for_text</methodname>
</term>
<listitem>
<para>
Wait until the supplied regular expressions matches the textual contents
of the screen by using optical character recognition (see
<methodname>get_screen_text</methodname> and
<methodname>get_screen_text_variants</methodname>).
</para>
<note>
<para>
This requires passing <option>enableOCR</option> to the test attribute
set.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>wait_for_console_text</methodname>
</term>
<listitem>
<para>
Wait until the supplied regular expressions match a line of the serial
console output. This method is useful when OCR is not possibile or
accurate enough.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>wait_for_window</methodname>
</term>
<listitem>
<para>
Wait until an X11 window has appeared whose name matches the given
regular expression, e.g., <literal>wait_for_window("Terminal")</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>copy_from_host</methodname>
</term>
<listitem>
<para>
Copies a file from host to machine, e.g.,
<literal>copy_from_host("myfile", "/etc/my/important/file")</literal>.
</para>
<para>
The first argument is the file on the host. The file needs to be
accessible while building the nix derivation. The second argument is the
location of the file on the machine.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>systemctl</methodname>
</term>
<listitem>
<para>
Runs <literal>systemctl</literal> commands with optional support for
<literal>systemctl --user</literal>
</para>
<para>
<programlisting>
machine.systemctl("list-jobs --no-pager") # runs `systemctl list-jobs --no-pager`
machine.systemctl("list-jobs --no-pager", "any-user") # spawns a shell for `any-user` and runs `systemctl --user list-jobs --no-pager`
</programlisting>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<methodname>shell_interact</methodname>
</term>
<listitem>
<para>
Allows you to directly interact with the guest shell.
This should only be used during test development, not in production tests.
Killing the interactive session with <literal>Ctrl-d</literal> or <literal>Ctrl-c</literal> also ends the guest session.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
<para>
To test user units declared by <literal>systemd.user.services</literal> the
optional <literal>user</literal> argument can be used:
<programlisting>
machine.start()
machine.wait_for_x()
machine.wait_for_unit("xautolock.service", "x-session-user")
</programlisting>
This applies to <literal>systemctl</literal>, <literal>get_unit_info</literal>,
<literal>wait_for_unit</literal>, <literal>start_job</literal> and
<literal>stop_job</literal>.
</para>
<para>
For faster dev cycles it's also possible to disable the code-linters (this shouldn't
be commited though):
<programlisting>
import ./make-test-python.nix {
skipLint = true;
machine =
{ config, pkgs, ... }:
{ <replaceable>configuration…</replaceable>
};
testScript =
''
<replaceable>Python code…</replaceable>
'';
}
</programlisting>
This will produce a Nix warning at evaluation time. To fully disable the
linter, wrap the test script in comment directives to disable the Black linter
directly (again, don't commit this within the Nixpkgs repository):
<programlisting>
testScript =
''
# fmt: off
<replaceable>Python code…</replaceable>
# fmt: on
'';
</programlisting>
</para>
</section>

View file

@ -106,6 +106,23 @@
</listitem>
</varlistentry>
</variablelist>
<para>
In addition, these arguments are recognised by the live image only:
</para>
<variablelist>
<varlistentry>
<term>
<literal>live.nixos.passwd=password</literal>
</term>
<listitem>
<para>
Set the password for the <literal>nixos</literal> live user.
This can be used for SSH access if there are issues using the
terminal.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
Notice that for <literal>boot.shell_on_fail</literal>,
<literal>boot.debug1</literal>,

View file

@ -0,0 +1,50 @@
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-running-nixos-tests-interactively">
<title>Running Tests interactively</title>
<para>
The test itself can be run interactively. This is particularly
useful when developing or debugging a test:
</para>
<programlisting>
$ nix-build nixos/tests/login.nix -A driverInteractive
$ ./result/bin/nixos-test-driver
starting VDE switch for network 1
&gt;
</programlisting>
<para>
You can then take any Python statement, e.g.
</para>
<programlisting language="python">
&gt; start_all()
&gt; test_script()
&gt; machine.succeed(&quot;touch /tmp/foo&quot;)
&gt; print(machine.succeed(&quot;pwd&quot;)) # Show stdout of command
</programlisting>
<para>
The function <literal>test_script</literal> executes the entire test
script and drops you back into the test driver command line upon its
completion. This allows you to inspect the state of the VMs after
the test (e.g. to debug the test script).
</para>
<para>
To just start and experiment with the VMs, run:
</para>
<programlisting>
$ nix-build nixos/tests/login.nix -A driverInteractive
$ ./result/bin/nixos-run-vms
</programlisting>
<para>
The script <literal>nixos-run-vms</literal> starts the virtual
machines defined by test.
</para>
<para>
You can re-use the VM states coming from a previous run by setting
the <literal>--keep-vm-state</literal> flag.
</para>
<programlisting>
$ ./result/bin/nixos-run-vms --keep-vm-state
</programlisting>
<para>
The machine state is stored in the
<literal>$TMPDIR/vm-state-machinename</literal> directory.
</para>
</section>

View file

@ -0,0 +1,34 @@
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-running-nixos-tests">
<title>Running Tests</title>
<para>
You can run tests using <literal>nix-build</literal>. For example,
to run the test
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix"><literal>login.nix</literal></link>,
you just do:
</para>
<programlisting>
$ nix-build '&lt;nixpkgs/nixos/tests/login.nix&gt;'
</programlisting>
<para>
or, if you dont want to rely on <literal>NIX_PATH</literal>:
</para>
<programlisting>
$ cd /my/nixpkgs/nixos/tests
$ nix-build login.nix
running the VM test script
machine: QEMU running (pid 8841)
6 out of 6 tests succeeded
</programlisting>
<para>
After building/downloading all required dependencies, this will
perform a build that starts a QEMU/KVM virtual machine containing a
NixOS system. The virtual machine mounts the Nix store of the host;
this makes VM creation very fast, as no disk image needs to be
created. Afterwards, you can view a pretty-printed log of the test:
</para>
<programlisting>
$ firefox result/log.html
</programlisting>
</section>

View file

@ -0,0 +1,526 @@
<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-writing-nixos-tests">
<title>Writing Tests</title>
<para>
A NixOS test is a Nix expression that has the following structure:
</para>
<programlisting language="bash">
import ./make-test-python.nix {
# Either the configuration of a single machine:
machine =
{ config, pkgs, ... }:
{ configuration…
};
# Or a set of machines:
nodes =
{ machine1 =
{ config, pkgs, ... }: { … };
machine2 =
{ config, pkgs, ... }: { … };
};
testScript =
''
Python code…
'';
}
</programlisting>
<para>
The attribute <literal>testScript</literal> is a bit of Python code
that executes the test (described below). During the test, it will
start one or more virtual machines, the configuration of which is
described by the attribute <literal>machine</literal> (if you need
only one machine in your test) or by the attribute
<literal>nodes</literal> (if you need multiple machines). For
instance,
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix"><literal>login.nix</literal></link>
only needs a single machine to test whether users can log in on the
virtual console, whether device ownership is correctly maintained
when switching between consoles, and so on. On the other hand,
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nfs/simple.nix"><literal>nfs/simple.nix</literal></link>,
which tests NFS client and server functionality in the Linux kernel
(including whether locks are maintained across server crashes),
requires three machines: a server and two clients.
</para>
<para>
There are a few special NixOS configuration options for test VMs:
</para>
<variablelist>
<varlistentry>
<term>
<literal>virtualisation.memorySize</literal>
</term>
<listitem>
<para>
The memory of the VM in megabytes.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>virtualisation.vlans</literal>
</term>
<listitem>
<para>
The virtual networks to which the VM is connected. See
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/nat.nix"><literal>nat.nix</literal></link>
for an example.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>virtualisation.writableStore</literal>
</term>
<listitem>
<para>
By default, the Nix store in the VM is not writable. If you
enable this option, a writable union file system is mounted on
top of the Nix store to make it appear writable. This is
necessary for tests that run Nix operations that modify the
store.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
For more options, see the module
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/qemu-vm.nix"><literal>qemu-vm.nix</literal></link>.
</para>
<para>
The test script is a sequence of Python statements that perform
various actions, such as starting VMs, executing commands in the
VMs, and so on. Each virtual machine is represented as an object
stored in the variable <literal>name</literal> if this is also the
identifier of the machine in the declarative config. If you didn't
specify multiple machines using the <literal>nodes</literal>
attribute, it is just <literal>machine</literal>. The following
example starts the machine, waits until it has finished booting,
then executes a command and checks that the output is more-or-less
correct:
</para>
<programlisting language="python">
machine.start()
machine.wait_for_unit(&quot;default.target&quot;)
if not &quot;Linux&quot; in machine.succeed(&quot;uname&quot;):
raise Exception(&quot;Wrong OS&quot;)
</programlisting>
<para>
The first line is actually unnecessary; machines are implicitly
started when you first execute an action on them (such as
<literal>wait_for_unit</literal> or <literal>succeed</literal>). If
you have multiple machines, you can speed up the test by starting
them in parallel:
</para>
<programlisting language="python">
start_all()
</programlisting>
<para>
The following methods are available on machine objects:
</para>
<variablelist>
<varlistentry>
<term>
<literal>start</literal>
</term>
<listitem>
<para>
Start the virtual machine. This method is asynchronous — it
does not wait for the machine to finish booting.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>shutdown</literal>
</term>
<listitem>
<para>
Shut down the machine, waiting for the VM to exit.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>crash</literal>
</term>
<listitem>
<para>
Simulate a sudden power failure, by telling the VM to exit
immediately.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>block</literal>
</term>
<listitem>
<para>
Simulate unplugging the Ethernet cable that connects the
machine to the other machines.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>unblock</literal>
</term>
<listitem>
<para>
Undo the effect of <literal>block</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>screenshot</literal>
</term>
<listitem>
<para>
Take a picture of the display of the virtual machine, in PNG
format. The screenshot is linked from the HTML log.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>get_screen_text_variants</literal>
</term>
<listitem>
<para>
Return a list of different interpretations of what is
currently visible on the machine's screen using optical
character recognition. The number and order of the
interpretations is not specified and is subject to change, but
if no exception is raised at least one will be returned.
</para>
<note>
<para>
This requires passing <literal>enableOCR</literal> to the
test attribute set.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>get_screen_text</literal>
</term>
<listitem>
<para>
Return a textual representation of what is currently visible
on the machine's screen using optical character recognition.
</para>
<note>
<para>
This requires passing <literal>enableOCR</literal> to the
test attribute set.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>send_monitor_command</literal>
</term>
<listitem>
<para>
Send a command to the QEMU monitor. This is rarely used, but
allows doing stuff such as attaching virtual USB disks to a
running machine.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>send_key</literal>
</term>
<listitem>
<para>
Simulate pressing keys on the virtual keyboard, e.g.,
<literal>send_key(&quot;ctrl-alt-delete&quot;)</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>send_chars</literal>
</term>
<listitem>
<para>
Simulate typing a sequence of characters on the virtual
keyboard, e.g.,
<literal>send_chars(&quot;foobar\n&quot;)</literal> will type
the string <literal>foobar</literal> followed by the Enter
key.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>execute</literal>
</term>
<listitem>
<para>
Execute a shell command, returning a list
<literal>(status, stdout)</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>succeed</literal>
</term>
<listitem>
<para>
Execute a shell command, raising an exception if the exit
status is not zero, otherwise returning the standard output.
Commands are run with <literal>set -euo pipefail</literal>
set:
</para>
<itemizedlist>
<listitem>
<para>
If several commands are separated by <literal>;</literal>
and one fails, the command as a whole will fail.
</para>
</listitem>
<listitem>
<para>
For pipelines, the last non-zero exit status will be
returned (if there is one, zero will be returned
otherwise).
</para>
</listitem>
<listitem>
<para>
Dereferencing unset variables fail the command.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>fail</literal>
</term>
<listitem>
<para>
Like <literal>succeed</literal>, but raising an exception if
the command returns a zero status.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>wait_until_succeeds</literal>
</term>
<listitem>
<para>
Repeat a shell command with 1-second intervals until it
succeeds.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>wait_until_fails</literal>
</term>
<listitem>
<para>
Repeat a shell command with 1-second intervals until it fails.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>wait_for_unit</literal>
</term>
<listitem>
<para>
Wait until the specified systemd unit has reached the
<quote>active</quote> state.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>wait_for_file</literal>
</term>
<listitem>
<para>
Wait until the specified file exists.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>wait_for_open_port</literal>
</term>
<listitem>
<para>
Wait until a process is listening on the given TCP port (on
<literal>localhost</literal>, at least).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>wait_for_closed_port</literal>
</term>
<listitem>
<para>
Wait until nobody is listening on the given TCP port.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>wait_for_x</literal>
</term>
<listitem>
<para>
Wait until the X11 server is accepting connections.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>wait_for_text</literal>
</term>
<listitem>
<para>
Wait until the supplied regular expressions matches the
textual contents of the screen by using optical character
recognition (see <literal>get_screen_text</literal> and
<literal>get_screen_text_variants</literal>).
</para>
<note>
<para>
This requires passing <literal>enableOCR</literal> to the
test attribute set.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>wait_for_console_text</literal>
</term>
<listitem>
<para>
Wait until the supplied regular expressions match a line of
the serial console output. This method is useful when OCR is
not possibile or accurate enough.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>wait_for_window</literal>
</term>
<listitem>
<para>
Wait until an X11 window has appeared whose name matches the
given regular expression, e.g.,
<literal>wait_for_window(&quot;Terminal&quot;)</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>copy_from_host</literal>
</term>
<listitem>
<para>
Copies a file from host to machine, e.g.,
<literal>copy_from_host(&quot;myfile&quot;, &quot;/etc/my/important/file&quot;)</literal>.
</para>
<para>
The first argument is the file on the host. The file needs to
be accessible while building the nix derivation. The second
argument is the location of the file on the machine.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>systemctl</literal>
</term>
<listitem>
<para>
Runs <literal>systemctl</literal> commands with optional
support for <literal>systemctl --user</literal>
</para>
<programlisting language="python">
machine.systemctl(&quot;list-jobs --no-pager&quot;) # runs `systemctl list-jobs --no-pager`
machine.systemctl(&quot;list-jobs --no-pager&quot;, &quot;any-user&quot;) # spawns a shell for `any-user` and runs `systemctl --user list-jobs --no-pager`
</programlisting>
</listitem>
</varlistentry>
<varlistentry>
<term>
<literal>shell_interact</literal>
</term>
<listitem>
<para>
Allows you to directly interact with the guest shell. This
should only be used during test development, not in production
tests. Killing the interactive session with
<literal>Ctrl-d</literal> or <literal>Ctrl-c</literal> also
ends the guest session.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
To test user units declared by
<literal>systemd.user.services</literal> the optional
<literal>user</literal> argument can be used:
</para>
<programlisting language="python">
machine.start()
machine.wait_for_x()
machine.wait_for_unit(&quot;xautolock.service&quot;, &quot;x-session-user&quot;)
</programlisting>
<para>
This applies to <literal>systemctl</literal>,
<literal>get_unit_info</literal>, <literal>wait_for_unit</literal>,
<literal>start_job</literal> and <literal>stop_job</literal>.
</para>
<para>
For faster dev cycles it's also possible to disable the code-linters
(this shouldn't be commited though):
</para>
<programlisting language="bash">
import ./make-test-python.nix {
skipLint = true;
machine =
{ config, pkgs, ... }:
{ configuration…
};
testScript =
''
Python code…
'';
}
</programlisting>
<para>
This will produce a Nix warning at evaluation time. To fully disable
the linter, wrap the test script in comment directives to disable
the Black linter directly (again, don't commit this within the
Nixpkgs repository):
</para>
<programlisting language="bash">
testScript =
''
# fmt: off
Python code…
# fmt: on
'';
</programlisting>
</section>

View file

@ -101,16 +101,18 @@
<listitem>
<para>
<link xlink:href="https://www.gnuradio.org/">GNURadio</link>
3.8 was
3.8 and 3.9 were
<link xlink:href="https://github.com/NixOS/nixpkgs/issues/82263">finally</link>
packaged, along with a rewrite to the Nix expressions,
allowing users to override the features upstream supports
selecting to compile or not to. Additionally, the attribute
<literal>gnuradio</literal> and <literal>gnuradio3_7</literal>
now point to an externally wrapped by default derivations,
that allow you to also add `extraPythonPackages` to the Python
interpreter used by GNURadio. Missing environmental variables
needed for operational GUI were also added
<literal>gnuradio</literal> (3.9),
<literal>gnuradio3_8</literal> and
<literal>gnuradio3_7</literal> now point to an externally
wrapped by default derivations, that allow you to also add
`extraPythonPackages` to the Python interpreter used by
GNURadio. Missing environmental variables needed for
operational GUI were also added
(<link xlink:href="https://github.com/NixOS/nixpkgs/issues/75478">#75478</link>).
</para>
</listitem>
@ -1026,7 +1028,7 @@ self: super:
<para>
<link xlink:href="https://kodi.tv/">Kodi</link> has been
updated to version 19.1 &quot;Matrix&quot;. See the
<link xlink:href="https://kodi.tv/article/kodi-190-matrix-release">announcement</link>
<link xlink:href="https://kodi.tv/article/kodi-19-0-matrix-release">announcement</link>
for further details.
</para>
</listitem>

View file

@ -48,6 +48,14 @@
<link xlink:href="options.html#opt-networking.ucarp.enable">networking.ucarp</link>.
</para>
</listitem>
<listitem>
<para>
Users of flashrom should migrate to
<link xlink:href="options.html#opt-programs.flashrom.enable">programs.flashrom.enable</link>
and add themselves to the <literal>flashrom</literal> group to
be able to access programmers supported by flashrom.
</para>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec-release-21.11-incompatibilities">
@ -331,6 +339,116 @@
release instead of the old 2.31.0 version.
</para>
</listitem>
<listitem>
<para>
The <literal>bitwarden_rs</literal> packages and modules were
renamed to <literal>vaultwarden</literal>
<link xlink:href="https://github.com/dani-garcia/vaultwarden/discussions/1642">following
upstream</link>. More specifically,
</para>
<itemizedlist>
<listitem>
<para>
<literal>pkgs.bitwarden_rs</literal>,
<literal>pkgs.bitwarden_rs-sqlite</literal>,
<literal>pkgs.bitwarden_rs-mysql</literal> and
<literal>pkgs.bitwarden_rs-postgresql</literal> were
renamed to <literal>pkgs.vaultwarden</literal>,
<literal>pkgs.vaultwarden-sqlite</literal>,
<literal>pkgs.vaultwarden-mysql</literal> and
<literal>pkgs.vaultwarden-postgresql</literal>,
respectively.
</para>
<itemizedlist spacing="compact">
<listitem>
<para>
Old names are preserved as aliases for backwards
compatibility, but may be removed in the future.
</para>
</listitem>
<listitem>
<para>
The <literal>bitwarden_rs</literal> executable was
also renamed to <literal>vaultwarden</literal> in all
packages.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
<literal>pkgs.bitwarden_rs-vault</literal> was renamed to
<literal>pkgs.vaultwarden-vault</literal>.
</para>
<itemizedlist spacing="compact">
<listitem>
<para>
<literal>pkgs.bitwarden_rs-vault</literal> is
preserved as an alias for backwards compatibility, but
may be removed in the future.
</para>
</listitem>
<listitem>
<para>
The static files were moved from
<literal>/usr/share/bitwarden_rs</literal> to
<literal>/usr/share/vaultwarden</literal>.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
The <literal>services.bitwarden_rs</literal> config module
was renamed to <literal>services.vaultwarden</literal>.
</para>
<itemizedlist spacing="compact">
<listitem>
<para>
<literal>services.bitwarden_rs</literal> is preserved
as an alias for backwards compatibility, but may be
removed in the future.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
<literal>systemd.services.bitwarden_rs</literal>,
<literal>systemd.services.backup-bitwarden_rs</literal>
and <literal>systemd.timers.backup-bitwarden_rs</literal>
were renamed to
<literal>systemd.services.vaultwarden</literal>,
<literal>systemd.services.backup-vaultwarden</literal> and
<literal>systemd.timers.backup-vaultwarden</literal>,
respectively.
</para>
<itemizedlist spacing="compact">
<listitem>
<para>
Old names are preserved as aliases for backwards
compatibility, but may be removed in the future.
</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
<literal>users.users.bitwarden_rs</literal> and
<literal>users.groups.bitwarden_rs</literal> were renamed
to <literal>users.users.vaultwarden</literal> and
<literal>users.groups.vaultwarden</literal>, respectively.
</para>
</listitem>
<listitem>
<para>
The data directory remains located at
<literal>/var/lib/bitwarden_rs</literal>, for backwards
compatibility.
</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</section>
<section xml:id="sec-release-21.11-notable-changes">

View file

@ -36,7 +36,7 @@ In addition to numerous new and upgraded packages, this release has the followin
The following new services were added since the last release:
- [GNURadio](https://www.gnuradio.org/) 3.8 was [finally](https://github.com/NixOS/nixpkgs/issues/82263) packaged, along with a rewrite to the Nix expressions, allowing users to override the features upstream supports selecting to compile or not to. Additionally, the attribute `gnuradio` and `gnuradio3_7` now point to an externally wrapped by default derivations, that allow you to also add \`extraPythonPackages\` to the Python interpreter used by GNURadio. Missing environmental variables needed for operational GUI were also added ([\#75478](https://github.com/NixOS/nixpkgs/issues/75478)).
- [GNURadio](https://www.gnuradio.org/) 3.8 and 3.9 were [finally](https://github.com/NixOS/nixpkgs/issues/82263) packaged, along with a rewrite to the Nix expressions, allowing users to override the features upstream supports selecting to compile or not to. Additionally, the attribute `gnuradio` (3.9), `gnuradio3_8` and `gnuradio3_7` now point to an externally wrapped by default derivations, that allow you to also add \`extraPythonPackages\` to the Python interpreter used by GNURadio. Missing environmental variables needed for operational GUI were also added ([\#75478](https://github.com/NixOS/nixpkgs/issues/75478)).
- [Keycloak](https://www.keycloak.org/), an open source identity and access management server with support for [OpenID Connect](https://openid.net/connect/), [OAUTH 2.0](https://oauth.net/2/) and [SAML 2.0](https://en.wikipedia.org/wiki/SAML_2.0).
@ -300,7 +300,7 @@ When upgrading from a previous release, please be aware of the following incompa
Regarding the NixOS module, new options for HTTPS inspection have been added and `services.privoxy.extraConfig` has been replaced by the new [services.privoxy.settings](options.html#opt-services.privoxy.settings) (See [RFC 0042](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md) for the motivation).
- [Kodi](https://kodi.tv/) has been updated to version 19.1 \"Matrix\". See the [announcement](https://kodi.tv/article/kodi-190-matrix-release) for further details.
- [Kodi](https://kodi.tv/) has been updated to version 19.1 \"Matrix\". See the [announcement](https://kodi.tv/article/kodi-19-0-matrix-release) for further details.
- The `services.packagekit.backend` option has been removed as it only supported a single setting which would always be the default. Instead new [RFC 0042](https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md) compliant [services.packagekit.settings](options.html#opt-services.packagekit.settings) and [services.packagekit.vendorSettings](options.html#opt-services.packagekit.vendorSettings) options have been introduced.

View file

@ -16,6 +16,8 @@ In addition to numerous new and upgraded packages, this release has the followin
- [ucarp](https://download.pureftpd.org/pub/ucarp/README), an userspace implementation of the Common Address Redundancy Protocol (CARP). Available as [networking.ucarp](options.html#opt-networking.ucarp.enable).
- Users of flashrom should migrate to [programs.flashrom.enable](options.html#opt-programs.flashrom.enable) and add themselves to the `flashrom` group to be able to access programmers supported by flashrom.
## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
- The `staticjinja` package has been upgraded from 1.0.4 to 2.0.0
@ -83,6 +85,32 @@ In addition to numerous new and upgraded packages, this release has the followin
* The `libwnck` package now defaults to the 3.x release instead of the
old 2.31.0 version.
* The `bitwarden_rs` packages and modules were renamed to `vaultwarden`
[following upstream](https://github.com/dani-garcia/vaultwarden/discussions/1642). More specifically,
* `pkgs.bitwarden_rs`, `pkgs.bitwarden_rs-sqlite`, `pkgs.bitwarden_rs-mysql` and
`pkgs.bitwarden_rs-postgresql` were renamed to `pkgs.vaultwarden`, `pkgs.vaultwarden-sqlite`,
`pkgs.vaultwarden-mysql` and `pkgs.vaultwarden-postgresql`, respectively.
* Old names are preserved as aliases for backwards compatibility, but may be removed in the future.
* The `bitwarden_rs` executable was also renamed to `vaultwarden` in all packages.
* `pkgs.bitwarden_rs-vault` was renamed to `pkgs.vaultwarden-vault`.
* `pkgs.bitwarden_rs-vault` is preserved as an alias for backwards compatibility, but may be removed in the future.
* The static files were moved from `/usr/share/bitwarden_rs` to `/usr/share/vaultwarden`.
* The `services.bitwarden_rs` config module was renamed to `services.vaultwarden`.
* `services.bitwarden_rs` is preserved as an alias for backwards compatibility, but may be removed in the future.
* `systemd.services.bitwarden_rs`, `systemd.services.backup-bitwarden_rs` and `systemd.timers.backup-bitwarden_rs`
were renamed to `systemd.services.vaultwarden`, `systemd.services.backup-vaultwarden` and
`systemd.timers.backup-vaultwarden`, respectively.
* Old names are preserved as aliases for backwards compatibility, but may be removed in the future.
* `users.users.bitwarden_rs` and `users.groups.bitwarden_rs` were renamed to `users.users.vaultwarden` and
`users.groups.vaultwarden`, respectively.
* The data directory remains located at `/var/lib/bitwarden_rs`, for backwards compatibility.
## Other Notable Changes {#sec-release-21.11-notable-changes}
- The setting [`services.openssh.logLevel`](options.html#opt-services.openssh.logLevel) `"VERBOSE"` `"INFO"`. This brings NixOS in line with upstream and other Linux distributions, and reduces log spam on servers due to bruteforcing botnets.

View file

@ -126,6 +126,14 @@ in
type = types.bool;
};
environment.localBinInPath = mkOption {
description = ''
Add ~/.local/bin/ to $PATH
'';
default = false;
type = types.bool;
};
environment.binsh = mkOption {
default = "${config.system.build.binsh}/bin/sh";
defaultText = "\${config.system.build.binsh}/bin/sh";
@ -198,6 +206,10 @@ in
# ~/bin if it exists overrides other bin directories.
export PATH="$HOME/bin:$PATH"
''}
${optionalString cfg.localBinInPath ''
export PATH="$HOME/.local/bin:$PATH"
''}
'';
system.activationScripts.binsh = stringAfter [ "stdio" ]

View file

@ -30,5 +30,16 @@ with lib;
# Add Memtest86+ to the CD.
boot.loader.grub.memtest86.enable = true;
boot.postBootCommands = ''
for o in $(</proc/cmdline); do
case "$o" in
live.nixos.passwd=*)
set -- $(IFS==; echo $o)
echo "nixos:$2" | ${pkgs.shadow}/bin/chpasswd
;;
esac
done
'';
system.stateVersion = mkDefault "18.03";
}

View file

@ -40,7 +40,7 @@ let
};
nixos-option =
if lib.versionAtLeast (lib.getVersion pkgs.nix) "2.4pre"
if lib.versionAtLeast (lib.getVersion config.nix.package) "2.4pre"
then null
else pkgs.callPackage ./nixos-option { };

View file

@ -138,6 +138,7 @@
./programs/file-roller.nix
./programs/firejail.nix
./programs/fish.nix
./programs/flashrom.nix
./programs/flexoptix-app.nix
./programs/freetds.nix
./programs/fuse.nix
@ -873,7 +874,6 @@
./services/search/hound.nix
./services/search/kibana.nix
./services/search/solr.nix
./services/security/bitwarden_rs/default.nix
./services/security/certmgr.nix
./services/security/cfssl.nix
./services/security/clamav.nix
@ -899,6 +899,7 @@
./services/security/torsocks.nix
./services/security/usbguard.nix
./services/security/vault.nix
./services/security/vaultwarden/default.nix
./services/security/yubikey-agent.nix
./services/system/cloud-init.nix
./services/system/dbus.nix

View file

@ -0,0 +1,26 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.flashrom;
in
{
options.programs.flashrom = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Installs flashrom and configures udev rules for programmers
used by flashrom. Grants access to users in the "flashrom"
group.
'';
};
};
config = mkIf cfg.enable {
services.udev.packages = [ pkgs.flashrom ];
environment.systemPackages = [ pkgs.flashrom ];
users.groups.flashrom = { };
};
}

View file

@ -91,7 +91,7 @@ in
# before setting your PS1 and etc. Otherwise this will likely to interact with
# your ~/.zshrc configuration in unexpected ways as the default prompt sets
# a lot of different prompt variables.
autoload -U promptinit && promptinit && prompt walters && setopt prompt_sp
autoload -U promptinit && promptinit && prompt suse && setopt prompt_sp
'';
description = ''
Shell script code used to initialise the zsh prompt.

View file

@ -105,7 +105,7 @@ in {
wantsAPIVFS = lib.mkDefault (config.confinement.mode == "full-apivfs");
in lib.mkIf config.confinement.enable {
serviceConfig = {
RootDirectory = pkgs.runCommand rootName {} "mkdir \"$out\"";
RootDirectory = "/var/empty";
TemporaryFileSystem = "/";
PrivateMounts = lib.mkDefault true;

View file

@ -63,6 +63,7 @@ in {
description = "Slimserver daemon user";
home = cfg.dataDir;
group = "slimserver";
isSystemUser = true;
};
groups.slimserver = {};
};

View file

@ -10,74 +10,51 @@ let
description = "dataset/template options";
};
# Default values from https://github.com/jimsalterjrs/sanoid/blob/master/sanoid.defaults.conf
commonOptions = {
hourly = mkOption {
description = "Number of hourly snapshots.";
type = types.ints.unsigned;
default = 48;
type = with types; nullOr ints.unsigned;
default = null;
};
daily = mkOption {
description = "Number of daily snapshots.";
type = types.ints.unsigned;
default = 90;
type = with types; nullOr ints.unsigned;
default = null;
};
monthly = mkOption {
description = "Number of monthly snapshots.";
type = types.ints.unsigned;
default = 6;
type = with types; nullOr ints.unsigned;
default = null;
};
yearly = mkOption {
description = "Number of yearly snapshots.";
type = types.ints.unsigned;
default = 0;
type = with types; nullOr ints.unsigned;
default = null;
};
autoprune = mkOption {
description = "Whether to automatically prune old snapshots.";
type = types.bool;
default = true;
type = with types; nullOr bool;
default = null;
};
autosnap = mkOption {
description = "Whether to automatically take snapshots.";
type = types.bool;
default = true;
};
settings = mkOption {
description = ''
Free-form settings for this template/dataset. See
<link xlink:href="https://github.com/jimsalterjrs/sanoid/blob/master/sanoid.defaults.conf"/>
for allowed values.
'';
type = datasetSettingsType;
type = with types; nullOr bool;
default = null;
};
};
commonConfig = config: {
settings = {
hourly = mkDefault config.hourly;
daily = mkDefault config.daily;
monthly = mkDefault config.monthly;
yearly = mkDefault config.yearly;
autoprune = mkDefault config.autoprune;
autosnap = mkDefault config.autosnap;
};
};
datasetOptions = {
useTemplate = mkOption {
datasetOptions = rec {
use_template = mkOption {
description = "Names of the templates to use for this dataset.";
type = (types.listOf (types.enum (attrNames cfg.templates))) // {
description = "list of template names";
};
type = types.listOf (types.enum (attrNames cfg.templates));
default = [];
};
useTemplate = use_template;
recursive = mkOption {
description = "Whether to recursively snapshot dataset children.";
@ -85,19 +62,12 @@ let
default = false;
};
processChildrenOnly = mkOption {
process_children_only = mkOption {
description = "Whether to only snapshot child datasets if recursing.";
type = types.bool;
default = false;
};
};
datasetConfig = config: {
settings = {
use_template = mkDefault config.useTemplate;
recursive = mkDefault config.recursive;
process_children_only = mkDefault config.processChildrenOnly;
};
processChildrenOnly = process_children_only;
};
# Extract pool names from configured datasets
@ -109,11 +79,11 @@ let
else generators.mkValueStringDefault {} v;
mkKeyValue = k: v: if v == null then ""
else if k == "processChildrenOnly" then ""
else if k == "useTemplate" then ""
else generators.mkKeyValueDefault { inherit mkValueString; } "=" k v;
in generators.toINI { inherit mkKeyValue; } cfg.settings;
configDir = pkgs.writeTextDir "sanoid.conf" configFile;
in {
# Interface
@ -135,19 +105,21 @@ in {
};
datasets = mkOption {
type = types.attrsOf (types.submodule ({ config, ... }: {
type = types.attrsOf (types.submodule ({config, options, ...}: {
freeformType = datasetSettingsType;
options = commonOptions // datasetOptions;
config = mkMerge [ (commonConfig config) (datasetConfig config) ];
config.use_template = mkAliasDefinitions (options.useTemplate or {});
config.process_children_only = mkAliasDefinitions (options.processChildrenOnly or {});
}));
default = {};
description = "Datasets to snapshot.";
};
templates = mkOption {
type = types.attrsOf (types.submodule ({ config, ... }: {
type = types.attrsOf (types.submodule {
freeformType = datasetSettingsType;
options = commonOptions;
config = commonConfig config;
}));
});
default = {};
description = "Templates for datasets.";
};
@ -177,8 +149,8 @@ in {
config = mkIf cfg.enable {
services.sanoid.settings = mkMerge [
(mapAttrs' (d: v: nameValuePair ("template_" + d) v.settings) cfg.templates)
(mapAttrs (d: v: v.settings) cfg.datasets)
(mapAttrs' (d: v: nameValuePair ("template_" + d) v) cfg.templates)
(mapAttrs (d: v: v) cfg.datasets)
];
systemd.services.sanoid = {
@ -191,7 +163,7 @@ in {
ExecStart = lib.escapeShellArgs ([
"${pkgs.sanoid}/bin/sanoid"
"--cron"
"--configdir" configDir
"--configdir" (pkgs.writeTextDir "sanoid.conf" configFile)
] ++ cfg.extraArgs);
ExecStopPost = map (pool: lib.escapeShellArgs [
"+/run/booted-system/sw/bin/zfs" "unallow" "sanoid" pool

View file

@ -189,6 +189,7 @@ in
# manually paste it in place. Just symlink.
# otherwise, create the target file, ready for users to insert the token
mkdir -p $(dirname ${certmgrAPITokenPath})
if [ -f "${cfsslAPITokenPath}" ]; then
ln -fs "${cfsslAPITokenPath}" "${certmgrAPITokenPath}"
else

View file

@ -59,7 +59,7 @@ in
description = "Kubernetes Proxy Service";
wantedBy = [ "kubernetes.target" ];
after = [ "kube-apiserver.service" ];
path = with pkgs; [ iptables conntrack_tools ];
path = with pkgs; [ iptables conntrack-tools ];
serviceConfig = {
Slice = "kubernetes.slice";
ExecStart = ''${top.package}/bin/kube-proxy \

View file

@ -99,9 +99,22 @@ in
LockFile = "/run/geoipupdate/.lock";
};
systemd.services.geoipupdate-create-db-dir = {
serviceConfig.Type = "oneshot";
script = ''
mkdir -p ${cfg.settings.DatabaseDirectory}
chmod 0755 ${cfg.settings.DatabaseDirectory}
'';
};
systemd.services.geoipupdate = {
description = "GeoIP Updater";
after = [ "network-online.target" "nss-lookup.target" ];
requires = [ "geoipupdate-create-db-dir.service" ];
after = [
"geoipupdate-create-db-dir.service"
"network-online.target"
"nss-lookup.target"
];
wants = [ "network-online.target" ];
startAt = cfg.interval;
serviceConfig = {
@ -119,11 +132,9 @@ in
};
};
geoipupdateConf = pkgs.writeText "discourse.conf" (geoipupdateKeyValue cfg.settings);
geoipupdateConf = pkgs.writeText "geoipupdate.conf" (geoipupdateKeyValue cfg.settings);
script = ''
mkdir -p "${cfg.settings.DatabaseDirectory}"
chmod 755 "${cfg.settings.DatabaseDirectory}"
chown geoip "${cfg.settings.DatabaseDirectory}"
cp ${geoipupdateConf} /run/geoipupdate/GeoIP.conf
@ -139,7 +150,38 @@ in
ReadWritePaths = cfg.settings.DatabaseDirectory;
RuntimeDirectory = "geoipupdate";
RuntimeDirectoryMode = 0700;
CapabilityBoundingSet = "";
PrivateDevices = true;
PrivateMounts = true;
PrivateUsers = true;
ProtectClock = true;
ProtectControlGroups = true;
ProtectHome = true;
ProtectHostname = true;
ProtectKernelLogs = true;
ProtectKernelModules = true;
ProtectKernelTunables = true;
ProtectProc = "invisible";
ProcSubset = "pid";
SystemCallFilter = [ "@system-service" "~@privileged" "~@resources" ];
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" ];
RestrictRealtime = true;
RestrictNamespaces = true;
MemoryDenyWriteExecute = true;
LockPersonality = true;
SystemCallArchitectures = "native";
};
};
systemd.timers.geoipupdate-initial-run = {
wantedBy = [ "timers.target" ];
unitConfig.ConditionPathExists = "!${cfg.settings.DatabaseDirectory}";
timerConfig = {
Unit = "geoipupdate.service";
OnActiveSec = 0;
};
};
};
meta.maintainers = [ lib.maintainers.talyz ];
}

View file

@ -231,9 +231,9 @@ in {
}
fi
'' + optionalString cfg.autoMount ''
ipfs --local config Mounts.FuseAllowOther --json true
ipfs --local config Mounts.IPFS ${cfg.ipfsMountDir}
ipfs --local config Mounts.IPNS ${cfg.ipnsMountDir}
ipfs --offline config Mounts.FuseAllowOther --json true
ipfs --offline config Mounts.IPFS ${cfg.ipfsMountDir}
ipfs --offline config Mounts.IPNS ${cfg.ipnsMountDir}
'' + concatStringsSep "\n" (collect
isString
(mapAttrsRecursive
@ -243,7 +243,7 @@ in {
read value <<EOF
${builtins.toJSON value}
EOF
ipfs --local config --json "${concatStringsSep "." path}" "$value"
ipfs --offline config --json "${concatStringsSep "." path}" "$value"
'')
({ Addresses.API = cfg.apiAddress;
Addresses.Gateway = cfg.gatewayAddress;

View file

@ -16,6 +16,7 @@ ${lib.optionalString cfg.lt-cred-mech "lt-cred-mech"}
${lib.optionalString cfg.no-auth "no-auth"}
${lib.optionalString cfg.use-auth-secret "use-auth-secret"}
${lib.optionalString (cfg.static-auth-secret != null) ("static-auth-secret=${cfg.static-auth-secret}")}
${lib.optionalString (cfg.static-auth-secret-file != null) ("static-auth-secret=#static-auth-secret#")}
realm=${cfg.realm}
${lib.optionalString cfg.no-udp "no-udp"}
${lib.optionalString cfg.no-tcp "no-tcp"}
@ -182,6 +183,13 @@ in {
by a separate program, so this is why that other mode is 'dynamic'.
'';
};
static-auth-secret-file = mkOption {
type = types.nullOr types.str;
default = null;
description = ''
Path to the file containing the static authentication secret.
'';
};
realm = mkOption {
type = types.str;
default = config.networking.hostName;
@ -293,42 +301,63 @@ in {
};
};
config = mkIf cfg.enable {
users.users.turnserver =
{ uid = config.ids.uids.turnserver;
description = "coturn TURN server user";
};
users.groups.turnserver =
{ gid = config.ids.gids.turnserver;
members = [ "turnserver" ];
};
config = mkIf cfg.enable (mkMerge ([
{ assertions = [
{ assertion = cfg.static-auth-secret != null -> cfg.static-auth-secret-file == null ;
message = "static-auth-secret and static-auth-secret-file cannot be set at the same time";
}
];}
systemd.services.coturn = {
description = "coturn TURN server";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
{
users.users.turnserver =
{ uid = config.ids.uids.turnserver;
description = "coturn TURN server user";
};
users.groups.turnserver =
{ gid = config.ids.gids.turnserver;
members = [ "turnserver" ];
};
unitConfig = {
Documentation = "man:coturn(1) man:turnadmin(1) man:turnserver(1)";
};
systemd.services.coturn = let
runConfig = "/run/coturn/turnserver.cfg";
in {
description = "coturn TURN server";
after = [ "network-online.target" ];
wants = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.coturn}/bin/turnserver -c ${configFile}";
RuntimeDirectory = "turnserver";
User = "turnserver";
Group = "turnserver";
AmbientCapabilities =
mkIf (
cfg.listening-port < 1024 ||
cfg.alt-listening-port < 1024 ||
cfg.tls-listening-port < 1024 ||
cfg.alt-tls-listening-port < 1024 ||
cfg.min-port < 1024
) "cap_net_bind_service";
Restart = "on-abort";
unitConfig = {
Documentation = "man:coturn(1) man:turnadmin(1) man:turnserver(1)";
};
preStart = ''
cat ${configFile} > ${runConfig}
${optionalString (cfg.static-auth-secret-file != null) ''
STATIC_AUTH_SECRET="$(head -n1 ${cfg.static-auth-secret-file} || :)"
sed -e "s,#static-auth-secret#,$STATIC_AUTH_SECRET,g" \
-i ${runConfig}
'' }
chmod 640 ${runConfig}
'';
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.coturn}/bin/turnserver -c ${runConfig}";
RuntimeDirectory = "turnserver";
User = "turnserver";
Group = "turnserver";
AmbientCapabilities =
mkIf (
cfg.listening-port < 1024 ||
cfg.alt-listening-port < 1024 ||
cfg.tls-listening-port < 1024 ||
cfg.alt-tls-listening-port < 1024 ||
cfg.min-port < 1024
) "cap_net_bind_service";
Restart = "on-abort";
};
};
};
};
systemd.tmpfiles.rules = [
"d /run/coturn 0700 turnserver turnserver - -"
];
}]));
}

View file

@ -453,6 +453,7 @@ in
{ ExecStart =
(optionalString cfg.startWhenNeeded "-") +
"${cfgc.package}/bin/sshd " + (optionalString cfg.startWhenNeeded "-i ") +
"-D " + # don't detach into a daemon process
"-f /etc/ssh/sshd_config";
KillMode = "process";
} // (if cfg.startWhenNeeded then {

View file

@ -34,7 +34,7 @@ in {
systemd.packages = [ cfg.package ];
systemd.services.tailscaled = {
wantedBy = [ "multi-user.target" ];
path = [ pkgs.openresolv ];
path = [ pkgs.openresolv pkgs.procps ];
serviceConfig.Environment = [
"PORT=${toString cfg.port}"
''"FLAGS=--tun ${lib.escapeShellArg cfg.interfaceName}"''

View file

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Based on: https://github.com/dani-garcia/bitwarden_rs/wiki/Backing-up-your-vault
# Based on: https://github.com/dani-garcia/vaultwarden/wiki/Backing-up-your-vault
if ! mkdir -p "$BACKUP_FOLDER"; then
echo "Could not create backup folder '$BACKUP_FOLDER'" >&2
exit 1

View file

@ -3,9 +3,9 @@
with lib;
let
cfg = config.services.bitwarden_rs;
user = config.users.users.bitwarden_rs.name;
group = config.users.groups.bitwarden_rs.name;
cfg = config.services.vaultwarden;
user = config.users.users.vaultwarden.name;
group = config.users.groups.vaultwarden.name;
# Convert name from camel case (e.g. disable2FARemember) to upper case snake case (e.g. DISABLE_2FA_REMEMBER).
nameToEnvVar = name:
@ -26,22 +26,26 @@ let
if value != null then [ (nameValuePair (nameToEnvVar name) (if isBool value then boolToString value else toString value)) ] else []
) cfg.config));
in { DATA_FOLDER = "/var/lib/bitwarden_rs"; } // optionalAttrs (!(configEnv ? WEB_VAULT_ENABLED) || configEnv.WEB_VAULT_ENABLED == "true") {
WEB_VAULT_FOLDER = "${pkgs.bitwarden_rs-vault}/share/bitwarden_rs/vault";
WEB_VAULT_FOLDER = "${pkgs.vaultwarden-vault}/share/vaultwarden/vault";
} // configEnv;
configFile = pkgs.writeText "bitwarden_rs.env" (concatStrings (mapAttrsToList (name: value: "${name}=${value}\n") configEnv));
configFile = pkgs.writeText "vaultwarden.env" (concatStrings (mapAttrsToList (name: value: "${name}=${value}\n") configEnv));
bitwarden_rs = pkgs.bitwarden_rs.override { inherit (cfg) dbBackend; };
vaultwarden = pkgs.vaultwarden.override { inherit (cfg) dbBackend; };
in {
options.services.bitwarden_rs = with types; {
enable = mkEnableOption "bitwarden_rs";
imports = [
(mkRenamedOptionModule [ "services" "bitwarden_rs" ] [ "services" "vaultwarden" ])
];
options.services.vaultwarden = with types; {
enable = mkEnableOption "vaultwarden";
dbBackend = mkOption {
type = enum [ "sqlite" "mysql" "postgresql" ];
default = "sqlite";
description = ''
Which database backend bitwarden_rs will be using.
Which database backend vaultwarden will be using.
'';
};
@ -49,7 +53,7 @@ in {
type = nullOr str;
default = null;
description = ''
The directory under which bitwarden_rs will backup its persistent data.
The directory under which vaultwarden will backup its persistent data.
'';
};
@ -65,7 +69,7 @@ in {
}
'';
description = ''
The configuration of bitwarden_rs is done through environment variables,
The configuration of vaultwarden is done through environment variables,
therefore the names are converted from camel case (e.g. disable2FARemember)
to upper case snake case (e.g. DISABLE_2FA_REMEMBER).
In this conversion digits (0-9) are handled just like upper case characters,
@ -75,17 +79,17 @@ in {
This allows working around any potential future conflicting naming conventions.
Based on the attributes passed to this config option an environment file will be generated
that is passed to bitwarden_rs's systemd service.
that is passed to vaultwarden's systemd service.
The available configuration options can be found in
<link xlink:href="https://github.com/dani-garcia/bitwarden_rs/blob/${bitwarden_rs.version}/.env.template">the environment template file</link>.
<link xlink:href="https://github.com/dani-garcia/vaultwarden/blob/${vaultwarden.version}/.env.template">the environment template file</link>.
'';
};
environmentFile = mkOption {
type = with types; nullOr path;
default = null;
example = "/root/bitwarden_rs.env";
example = "/root/vaultwarden.env";
description = ''
Additional environment file as defined in <citerefentry>
<refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum>
@ -95,7 +99,7 @@ in {
may be passed to the service without adding them to the world-readable Nix store.
Note that this file needs to be available on the host on which
<literal>bitwarden_rs</literal> is running.
<literal>vaultwarden</literal> is running.
'';
};
};
@ -106,20 +110,21 @@ in {
message = "Backups for database backends other than sqlite will need customization";
} ];
users.users.bitwarden_rs = {
users.users.vaultwarden = {
inherit group;
isSystemUser = true;
};
users.groups.bitwarden_rs = { };
users.groups.vaultwarden = { };
systemd.services.bitwarden_rs = {
systemd.services.vaultwarden = {
aliases = [ "bitwarden_rs" ];
after = [ "network.target" ];
path = with pkgs; [ openssl ];
serviceConfig = {
User = user;
Group = group;
EnvironmentFile = [ configFile ] ++ optional (cfg.environmentFile != null) cfg.environmentFile;
ExecStart = "${bitwarden_rs}/bin/bitwarden_rs";
ExecStart = "${vaultwarden}/bin/vaultwarden";
LimitNOFILE = "1048576";
PrivateTmp = "true";
PrivateDevices = "true";
@ -131,15 +136,16 @@ in {
wantedBy = [ "multi-user.target" ];
};
systemd.services.backup-bitwarden_rs = mkIf (cfg.backupDir != null) {
description = "Backup bitwarden_rs";
systemd.services.backup-vaultwarden = mkIf (cfg.backupDir != null) {
aliases = [ "backup-bitwarden_rs" ];
description = "Backup vaultwarden";
environment = {
DATA_FOLDER = "/var/lib/bitwarden_rs";
BACKUP_FOLDER = cfg.backupDir;
};
path = with pkgs; [ sqlite ];
serviceConfig = {
SyslogIdentifier = "backup-bitwarden_rs";
SyslogIdentifier = "backup-vaultwarden";
Type = "oneshot";
User = mkDefault user;
Group = mkDefault group;
@ -148,12 +154,13 @@ in {
wantedBy = [ "multi-user.target" ];
};
systemd.timers.backup-bitwarden_rs = mkIf (cfg.backupDir != null) {
description = "Backup bitwarden_rs on time";
systemd.timers.backup-vaultwarden = mkIf (cfg.backupDir != null) {
aliases = [ "backup-bitwarden_rs" ];
description = "Backup vaultwarden on time";
timerConfig = {
OnCalendar = mkDefault "23:00";
Persistent = "true";
Unit = "backup-bitwarden_rs.service";
Unit = "backup-vaultwarden.service";
};
wantedBy = [ "multi-user.target" ];
};

View file

@ -30,6 +30,9 @@ in
package = lib.mkOption {
type = lib.types.package;
default = pkgs.discourse;
apply = p: p.override {
plugins = lib.unique (p.enabledPlugins ++ cfg.plugins);
};
defaultText = "pkgs.discourse";
description = ''
The discourse package to use.
@ -731,8 +734,6 @@ in
cp -r ${cfg.package}/share/discourse/config.dist/* /run/discourse/config/
cp -r ${cfg.package}/share/discourse/public.dist/* /run/discourse/public/
cp -r ${cfg.package}/share/discourse/plugins.dist/* /run/discourse/plugins/
${lib.concatMapStringsSep "\n" (p: "ln -sf ${p} /run/discourse/plugins/") cfg.plugins}
ln -sf /var/lib/discourse/uploads /run/discourse/public/uploads
ln -sf /var/lib/discourse/backups /run/discourse/public/backups

View file

@ -4,6 +4,11 @@ with lib;
let
cfg = config.services.minio;
legacyCredentials = cfg: pkgs.writeText "minio-legacy-credentials" ''
MINIO_ROOT_USER=${cfg.accessKey}
MINIO_ROOT_PASSWORD=${cfg.secretKey}
'';
in
{
meta.maintainers = [ maintainers.bachp ];
@ -49,6 +54,17 @@ in
'';
};
rootCredentialsFile = mkOption {
type = types.nullOr types.path;
default = null;
description = ''
File containing the MINIO_ROOT_USER, default is "minioadmin", and
MINIO_ROOT_PASSWORD (length >= 8), default is "minioadmin"; in the format of
an EnvironmentFile=, as described by systemd.exec(5).
'';
example = "/etc/nixos/minio-root-credentials";
};
region = mkOption {
default = "us-east-1";
type = types.str;
@ -72,6 +88,8 @@ in
};
config = mkIf cfg.enable {
warnings = optional ((cfg.accessKey != "") || (cfg.secretKey != "")) "services.minio.`accessKey` and services.minio.`secretKey` are deprecated, please use services.minio.`rootCredentialsFile` instead.";
systemd.tmpfiles.rules = [
"d '${cfg.configDir}' - minio minio - -"
] ++ (map (x: "d '" + x + "' - minio minio - - ") cfg.dataDir);
@ -86,14 +104,13 @@ in
User = "minio";
Group = "minio";
LimitNOFILE = 65536;
EnvironmentFile = if (cfg.rootCredentialsFile != null) then cfg.rootCredentialsFile
else if ((cfg.accessKey != "") || (cfg.secretKey != "")) then (legacyCredentials cfg)
else null;
};
environment = {
MINIO_REGION = "${cfg.region}";
MINIO_BROWSER = "${if cfg.browser then "on" else "off"}";
} // optionalAttrs (cfg.accessKey != "") {
MINIO_ACCESS_KEY = "${cfg.accessKey}";
} // optionalAttrs (cfg.secretKey != "") {
MINIO_SECRET_KEY = "${cfg.secretKey}";
};
};

View file

@ -99,7 +99,8 @@ in
autoSuspend = mkOption {
default = true;
description = ''
Suspend the machine after inactivity.
On the GNOME Display Manager login screen, suspend the machine after inactivity.
(Does not affect automatic suspend while logged in, or at lock screen.)
'';
type = types.bool;
};

View file

@ -4,7 +4,7 @@ with lib;
let
cfg = config.services.xserver.windowManager.fvwm;
fvwm = pkgs.fvwm.override { gestures = cfg.gestures; };
fvwm = pkgs.fvwm.override { enableGestures = cfg.gestures; };
in
{

View file

@ -13,7 +13,7 @@ let
# !!! fix this
children = mapAttrs (childName: childConfig:
(import ../../../lib/eval-config.nix {
inherit baseModules specialArgs;
inherit lib baseModules specialArgs;
system = config.nixpkgs.initialSystem;
modules =
(optionals childConfig.inheritParentConfig modules)

View file

@ -38,11 +38,11 @@ in
default = pkgs.linuxPackages;
type = types.unspecified // { merge = mergeEqualOption; };
apply = kernelPackages: kernelPackages.extend (self: super: {
kernel = super.kernel.override {
kernel = super.kernel.override (originalArgs: {
inherit randstructSeed;
kernelPatches = super.kernel.kernelPatches ++ kernelPatches;
kernelPatches = (originalArgs.kernelPatches or []) ++ kernelPatches;
features = lib.recursiveUpdate super.kernel.features features;
};
});
});
# We don't want to evaluate all of linuxPackages for the manual
# - some of it might not even evaluate correctly.

View file

@ -61,7 +61,7 @@ def write_loader_conf(profile: Optional[str], generation: int) -> None:
def profile_path(profile: Optional[str], generation: int, name: str) -> str:
return os.readlink("%s/%s" % (system_dir(profile, generation), name))
return os.path.realpath("%s/%s" % (system_dir(profile, generation), name))
def copy_from_profile(profile: Optional[str], generation: int, name: str, dry_run: bool = False) -> str:

View file

@ -621,6 +621,8 @@ in
Whether to allow TRIM requests to the underlying device. This option
has security implications; please read the LUKS documentation before
activating it.
This option is incompatible with authenticated encryption (dm-crypt
stacked over dm-integrity).
'';
};

View file

@ -42,7 +42,6 @@ in
bind = handleTest ./bind.nix {};
bitcoind = handleTest ./bitcoind.nix {};
bittorrent = handleTest ./bittorrent.nix {};
bitwarden = handleTest ./bitwarden.nix {};
blockbook-frontend = handleTest ./blockbook-frontend.nix {};
boot = handleTestOn ["x86_64-linux"] ./boot.nix {}; # syslinux is unsupported on aarch64
boot-stage1 = handleTest ./boot-stage1.nix {};
@ -88,6 +87,7 @@ in
containers-tmpfs = handleTest ./containers-tmpfs.nix {};
convos = handleTest ./convos.nix {};
corerad = handleTest ./corerad.nix {};
coturn = handleTest ./coturn.nix {};
couchdb = handleTest ./couchdb.nix {};
cri-o = handleTestOn ["x86_64-linux"] ./cri-o.nix {};
custom-ca = handleTest ./custom-ca.nix {};
@ -446,6 +446,7 @@ in
v2ray = handleTest ./v2ray.nix {};
vault = handleTest ./vault.nix {};
vault-postgresql = handleTest ./vault-postgresql.nix {};
vaultwarden = handleTest ./vaultwarden.nix {};
vector = handleTest ./vector.nix {};
victoriametrics = handleTest ./victoriametrics.nix {};
virtualbox = handleTestOn ["x86_64-linux"] ./virtualbox.nix {};

29
nixos/tests/coturn.nix Normal file
View file

@ -0,0 +1,29 @@
import ./make-test-python.nix ({ ... }: {
name = "coturn";
nodes = {
default = {
services.coturn.enable = true;
};
secretsfile = {
boot.postBootCommands = ''
echo "some-very-secret-string" > /run/coturn-secret
'';
services.coturn = {
enable = true;
static-auth-secret-file = "/run/coturn-secret";
};
};
};
testScript =
''
start_all()
with subtest("by default works without configuration"):
default.wait_for_unit("coturn.service")
with subtest("works with static-auth-secret-file"):
secretsfile.wait_for_unit("coturn.service")
secretsfile.succeed("grep 'some-very-secret-string' /run/coturn/turnserver.cfg")
'';
})

View file

@ -32,6 +32,7 @@ with pkgs; {
linux_5_4 = makeKernelTest "5.4" linuxPackages_5_4;
linux_5_10 = makeKernelTest "5.10" linuxPackages_5_10;
linux_5_12 = makeKernelTest "5.12" linuxPackages_5_12;
linux_5_13 = makeKernelTest "5.13" linuxPackages_5_13;
linux_testing = makeKernelTest "testing" linuxPackages_testing;
}

View file

@ -40,7 +40,7 @@ let
allowedTCPPorts = [
10250 # kubelet
];
trustedInterfaces = ["docker0"];
trustedInterfaces = ["mynet"];
extraCommands = concatMapStrings (node: ''
iptables -A INPUT -s ${node.config.networking.primaryIPAddress} -j ACCEPT
@ -61,6 +61,13 @@ let
advertiseAddress = master.ip;
};
masterAddress = "${masterName}.${config.networking.domain}";
# workaround for:
# https://github.com/kubernetes/kubernetes/issues/102676
# (workaround from) https://github.com/kubernetes/kubernetes/issues/95488
kubelet.extraOpts = ''\
--cgroups-per-qos=false \
--enforce-node-allocatable="" \
'';
};
}
(optionalAttrs (any (role: role == "master") machine.roles) {

View file

@ -33,7 +33,7 @@ in {
autosnap = true;
};
datasets."pool/sanoid".useTemplate = [ "test" ];
datasets."pool/sanoid".use_template = [ "test" ];
extraArgs = [ "--verbose" ];
};

View file

@ -19,6 +19,8 @@ import ./make-test-python.nix ({ pkgs, ... }:
machine.wait_for_unit("vault.service")
machine.wait_for_open_port(8200)
machine.succeed("vault operator init")
machine.succeed("vault status | grep Sealed | grep true")
# vault now returns exit code 2 for sealed vaults
machine.fail("vault status")
machine.succeed("vault status || test $? -eq 2")
'';
})

View file

@ -4,7 +4,7 @@
}:
# These tests will:
# * Set up a bitwarden-rs server
# * Set up a vaultwarden server
# * Have Firefox use the web vault to create an account, log in, and save a password to the valut
# * Have the bw cli log in and read that password from the vault
#
@ -24,8 +24,8 @@ let
storedPassword = "seeeecret";
makeBitwardenTest = backend: makeTest {
name = "bitwarden_rs-${backend}";
makeVaultwardenTest = backend: makeTest {
name = "vaultwarden-${backend}";
meta = {
maintainers = with pkgs.lib.maintainers; [ jjjollyjim ];
};
@ -45,9 +45,9 @@ let
package = pkgs.mariadb;
};
services.bitwarden_rs.config.databaseUrl = "mysql://bitwardenuser:${dbPassword}@localhost/bitwarden";
services.vaultwarden.config.databaseUrl = "mysql://bitwardenuser:${dbPassword}@localhost/bitwarden";
systemd.services.bitwarden_rs.after = [ "mysql.service" ];
systemd.services.vaultwarden.after = [ "mysql.service" ];
};
postgresql = {
@ -60,9 +60,9 @@ let
'';
};
services.bitwarden_rs.config.databaseUrl = "postgresql://bitwardenuser:${dbPassword}@localhost/bitwarden";
services.vaultwarden.config.databaseUrl = "postgresql://bitwardenuser:${dbPassword}@localhost/bitwarden";
systemd.services.bitwarden_rs.after = [ "postgresql.service" ];
systemd.services.vaultwarden.after = [ "postgresql.service" ];
};
sqlite = { };
@ -71,7 +71,7 @@ let
mkMerge [
backendConfig.${backend}
{
services.bitwarden_rs = {
services.vaultwarden = {
enable = true;
dbBackend = backend;
config.rocketPort = 80;
@ -152,7 +152,7 @@ let
testScript = ''
start_all()
server.wait_for_unit("bitwarden_rs.service")
server.wait_for_unit("vaultwarden.service")
server.wait_for_open_port(80)
with subtest("configure the cli"):
@ -184,6 +184,6 @@ let
in
builtins.listToAttrs (
map
(backend: { name = backend; value = makeBitwardenTest backend; })
(backend: { name = backend; value = makeVaultwardenTest backend; })
backends
)

View file

@ -23,7 +23,7 @@ import ./make-test-python.nix ({ pkgs, ...} : {
# Login
default.wait_until_tty_matches(1, "login: ")
default.send_chars("root\n")
default.wait_until_tty_matches(1, "root@default>")
default.wait_until_tty_matches(1, r"\nroot@default\b")
# Generate some history
default.send_chars("echo foobar\n")

View file

@ -9,13 +9,13 @@
stdenv.mkDerivation rec {
pname = "freac";
version = "1.1.4";
version = "1.1.5";
src = fetchFromGitHub {
owner = "enzo1982";
repo = "freac";
rev = "v${version}";
sha256 = "sha256-JwZJOV4mxNKqhhdlfFcX06NwBxmbye2mgMfdM//bHYI=";
sha256 = "sha256-cRmN9D/+FLiXqZW/PYhw61EoZuL3y61YtQ/ZNjnhfmY=";
};
buildInputs = [

View file

@ -1,49 +1,117 @@
{ lib, mkDerivation, fetchurl, fetchFromGitHub, chromaprint
, fftw, flac, faad2, glibcLocales, mp4v2
, libid3tag, libmad, libopus, libshout, libsndfile, libusb1, libvorbis
, libGLU, libxcb, lilv, lv2, opusfile
, pkg-config, portaudio, portmidi, protobuf, qtbase, qtscript, qtsvg
, qtx11extras, rubberband, sconsPackages, sqlite, taglib, upower, vamp-plugin-sdk
{ lib
, mkDerivation
, fetchurl
, fetchFromGitHub
, chromaprint
, cmake
, faad2
, ffmpeg
, fftw
, flac
, glibcLocales
, hidapi
, lame
, libebur128
, libGLU
, libid3tag
, libkeyfinder
, libmad
, libmodplug
, libopus
, libsecret
, libshout
, libsndfile
, libusb1
, libvorbis
, libxcb
, lilv
, lv2
, mp4v2
, opusfile
, pcre
, pkg-config
, portaudio
, portmidi
, protobuf
, qtbase
, qtkeychain
, qtscript
, qtsvg
, qtx11extras
, rubberband
, serd
, sord
, soundtouch
, sratom
, sqlite
, taglib
, upower
, vamp-plugin-sdk
, wavpack
}:
let
# Because libshout 2.4.2 and newer seem to break streaming in mixxx, build it
# with 2.4.1 instead.
libshout241 = libshout.overrideAttrs (o: rec {
name = "libshout-2.4.1";
src = fetchurl {
url = "http://downloads.xiph.org/releases/libshout/${name}.tar.gz";
sha256 = "0kgjpf8jkgyclw11nilxi8vyjk4s8878x23qyxnvybbgqbgbib7k";
};
});
in
mkDerivation rec {
pname = "mixxx";
version = "2.2.4";
version = "2.3.0";
src = fetchFromGitHub {
owner = "mixxxdj";
repo = "mixxx";
rev = "release-${version}";
sha256 = "1dj9li8av9b2kbm76jvvbdmihy1pyrw0s4xd7dd524wfhwr1llxr";
rev = version;
sha256 = "18sx4l3zzbn5142xfv5bp0crdd615a5728fkprqacnx3zpa144x6";
};
nativeBuildInputs = [ sconsPackages.scons_3_1_2 ];
nativeBuildInputs = [ cmake pkg-config ];
buildInputs = [
chromaprint fftw flac faad2 glibcLocales mp4v2 libid3tag libmad libopus libshout241 libsndfile
libusb1 libvorbis libxcb libGLU lilv lv2 opusfile pkg-config portaudio portmidi protobuf qtbase qtscript qtsvg
qtx11extras rubberband sqlite taglib upower vamp-plugin-sdk
chromaprint
faad2
ffmpeg
fftw
flac
glibcLocales
hidapi
lame
libebur128
libGLU
libid3tag
libkeyfinder
libmad
libmodplug
libopus
libsecret
libshout
libsndfile
libusb1
libvorbis
libxcb
lilv
lv2
mp4v2
opusfile
pcre
portaudio
portmidi
protobuf
qtbase
qtkeychain
qtscript
qtsvg
qtx11extras
rubberband
serd
sord
soundtouch
sratom
sqlite
taglib
upower
vamp-plugin-sdk
wavpack
];
enableParallelBuilding = true;
sconsFlags = [
"build=release"
"qtdir=${qtbase}"
"faad=1"
"opus=1"
];
qtWrapperArgs = [
"--set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive"
];
@ -52,7 +120,7 @@ mkDerivation rec {
homepage = "https://mixxx.org";
description = "Digital DJ mixing software";
license = licenses.gpl2Plus;
maintainers = [ maintainers.goibhniu maintainers.bfortz ];
maintainers = with maintainers; [ goibhniu bfortz ];
platforms = platforms.linux;
};
}

View file

@ -1,26 +1,29 @@
{ stdenv, lib, config, fetchFromGitHub, cmake, pkg-config
, alsaSupport ? stdenv.isLinux, alsa-lib
, pulseSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio
, jackSupport ? false, libjack2
}:
stdenv.mkDerivation rec {
pname = "scream";
version = "3.6";
version = "3.7";
src = fetchFromGitHub {
owner = "duncanthrax";
repo = pname;
rev = version;
sha256 = "01k2zhfb781gfj3apmcjqbm5m05m6pvnh7fb5k81zwvqibai000v";
sha256 = "0d9abrw62cd08lcg4il415b7ap89iggbljvbl5jqv2y23il0pvyz";
};
buildInputs = lib.optional pulseSupport libpulseaudio
++ lib.optional jackSupport libjack2
++ lib.optional alsaSupport alsa-lib;
nativeBuildInputs = [ cmake pkg-config ];
cmakeFlags = [
"-DPULSEAUDIO_ENABLE=${if pulseSupport then "ON" else "OFF"}"
"-DALSA_ENABLE=${if alsaSupport then "ON" else "OFF"}"
"-DJACK_ENABLE=${if jackSupport then "ON" else "OFF"}"
];
cmakeDir = "../Receivers/unix";

View file

@ -0,0 +1,41 @@
{ lib
, mkDerivation
, fetchFromGitea
, cmake
, libsecret
, qtkeychain
, restic
}:
mkDerivation rec {
pname = "restique";
version = "unstable-2021-05-03";
src = fetchFromGitea {
domain = "git.srcbox.net";
owner = "stefan";
repo = "restique";
rev = "f83ea63c2e2f2a41e845f54c7fe2c391a528a121";
sha256 = "0j1qihv7hd90xkfm4ksv74q6m7cq781fbdnc3l4spcd7h2p8lh0z";
};
nativeBuildInputs = [
cmake
];
buildInputs = [
libsecret
qtkeychain
];
qtWrapperArgs = [
"--prefix" "PATH" ":" (lib.makeBinPath [ restic ])
];
meta = with lib; {
description = "Restic GUI for Desktop/Laptop Backups";
homepage = "https://git.srcbox.net/stefan/restique";
license = with licenses; [ gpl3Plus cc-by-sa-40 cc0 ];
maintainers = with maintainers; [ dotlambda ];
};
}

View file

@ -0,0 +1,99 @@
{ stdenv
, lib
, makeWrapper
, fetchurl
, makeDesktopItem
, copyDesktopItems
, imagemagick
, openjdk11
, dpkg
, writeScript
, coreutils
, bash
, tor
, psmisc
}:
let
bisq-launcher = writeScript "bisq-launcher" ''
#! ${bash}/bin/bash
# Setup a temporary Tor instance
TMPDIR=$(${coreutils}/bin/mktemp -d)
CONTROLPORT=$(${coreutils}/bin/shuf -i 9100-9499 -n 1)
SOCKSPORT=$(${coreutils}/bin/shuf -i 9500-9999 -n 1)
${coreutils}/bin/head -c 1024 < /dev/urandom > $TMPDIR/cookie
${tor}/bin/tor --SocksPort $SOCKSPORT --ControlPort $CONTROLPORT \
--ControlPortWriteToFile $TMPDIR/port --CookieAuthFile $TMPDIR/cookie \
--CookieAuthentication 1 >$TMPDIR/tor.log --RunAsDaemon 1
torpid=$(${psmisc}/bin/fuser $CONTROLPORT/tcp)
echo Temp directory: $TMPDIR
echo Tor PID: $torpid
echo Tor control port: $CONTROLPORT
echo Tor SOCKS port: $SOCKSPORT
echo Tor log: $TMPDIR/tor.log
echo Bisq log file: $TMPDIR/bisq.log
JAVA_TOOL_OPTIONS="-XX:MaxRAM=4g" bisq-desktop-wrapped \
--torControlCookieFile=$TMPDIR/cookie \
--torControlUseSafeCookieAuth \
--torControlPort $CONTROLPORT "$@" > $TMPDIR/bisq.log
echo Bisq exited. Killing Tor...
kill $torpid
'';
in
stdenv.mkDerivation rec {
version = "1.7.0";
pname = "bisq-desktop";
nativeBuildInputs = [ makeWrapper copyDesktopItems dpkg ];
src = fetchurl {
url = "https://github.com/bisq-network/bisq/releases/download/v${version}/Bisq-64bit-${version}.deb";
sha256 = "0crry5k7crmrqn14wxiyrnhk09ac8a9ksqrwwky7jsnyah0bx5k4";
};
desktopItems = [
(makeDesktopItem {
name = "Bisq";
exec = "bisq-desktop";
icon = "bisq";
desktopName = "Bisq";
genericName = "Decentralized bitcoin exchange";
categories = "Network;Utility;";
})
];
unpackPhase = ''
dpkg -x $src .
'';
installPhase = ''
mkdir -p $out/lib $out/bin
cp opt/bisq/lib/app/desktop-${version}-all.jar $out/lib
makeWrapper ${openjdk11}/bin/java $out/bin/bisq-desktop-wrapped \
--add-flags "-jar $out/lib/desktop-${version}-all.jar bisq.desktop.app.BisqAppMain"
makeWrapper ${bisq-launcher} $out/bin/bisq-desktop \
--prefix PATH : $out/bin
copyDesktopItems
for n in 16 24 32 48 64 96 128 256; do
size=$n"x"$n
${imagemagick}/bin/convert opt/bisq/lib/Bisq.png -resize $size bisq.png
install -Dm644 -t $out/share/icons/hicolor/$size/apps bisq.png
done;
'';
meta = with lib; {
description = "A decentralized bitcoin exchange network";
homepage = "https://bisq.network";
license = licenses.mit;
maintainers = with maintainers; [ juaningan emmanuelrosa ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -2,12 +2,12 @@
let
pname = "ledger-live-desktop";
version = "2.26.1";
version = "2.29.0";
name = "${pname}-${version}";
src = fetchurl {
url = "https://github.com/LedgerHQ/${pname}/releases/download/v${version}/${pname}-${version}-linux-x86_64.AppImage";
sha256 = "0zbzqq3c0q45dz4vvgfbvqcgda7413mnwixi7yi78qb9mp8zxkhy";
sha256 = "1y4xvnwh2mqbc39pmnpgjg8mlx208s2pipm7dazq4bgmay7k9zh0";
};
appimageContents = appimageTools.extractType2 {

View file

@ -7,16 +7,16 @@
}:
rustPlatform.buildRustPackage rec {
pname = "polkadot";
version = "0.9.6";
version = "0.9.7";
src = fetchFromGitHub {
owner = "paritytech";
repo = "polkadot";
rev = "v${version}";
sha256 = "sha256-waoNCEGHFjY91ted4oBtwxW6/beqW/8IwRIE4rG+fKQ=";
sha256 = "sha256-swPLJIcm8XD0+/e9pGK2bDqUb7AS/5FdQ3A7Ceh5dZc=";
};
cargoSha256 = "17c45xi1wr77jbkcl1mkxflc8f9hilil02c43fihvlh2lm8kcs5j";
cargoSha256 = "sha256-4njx8T3kzyN63Jo0aHee5ImqcObiADvi+dHKWcRmbQw=";
nativeBuildInputs = [ clang ];

View file

@ -46,7 +46,7 @@ appimageTools.wrapType2 rec {
install -m 444 -D ${appimageContents}/${pname}.png $out/share/icons/hicolor/512x512/apps/${pname}.png
install -m 444 -D ${appimageContents}/resources/images/icons/512x512.png $out/share/icons/hicolor/512x512/apps/${pname}.png
substituteInPlace $out/share/applications/${pname}.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
--replace 'Exec=AppRun --no-sandbox %U' 'Exec=${pname}'
# symlink system binaries instead bundled ones
mkdir -p $out/share/${pname}/resources/bin/{bridge,tor}

View file

@ -0,0 +1,17 @@
{ lib, trivialBuild, fetchurl }:
trivialBuild rec {
pname = "ebuild-mode";
version = "1.52";
src = fetchurl {
url = "https://dev.gentoo.org/~ulm/emacs/ebuild-mode-${version}.tar.xz";
sha256 = "10nikbbwh612qlnms2i31963a0h3ccyg85vrxlizdpsqs4cjpg6h";
};
meta = with lib; {
description = "Major modes for Gentoo package files";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ qyliss ];
};
}

View file

@ -640,10 +640,10 @@
elpaBuild {
pname = "consult";
ename = "consult";
version = "0.8";
version = "0.9";
src = fetchurl {
url = "https://elpa.gnu.org/packages/consult-0.8.tar";
sha256 = "0vkq8dsj6k3gsdhiyg6ccv49fqgjw6f0db4wjsvm5zbkadjvlm86";
url = "https://elpa.gnu.org/packages/consult-0.9.tar";
sha256 = "1n3bnvgj92fjd9dai9f95wvyfb20yhaw7b722lkqjg42i10jqzfn";
};
packageRequires = [ emacs ];
meta = {
@ -670,10 +670,10 @@
elpaBuild {
pname = "corfu";
ename = "corfu";
version = "0.8";
version = "0.9";
src = fetchurl {
url = "https://elpa.gnu.org/packages/corfu-0.8.tar";
sha256 = "1qrrky1g4k5vw56435dgkwnmnri7i51gkydd76as3l0ixm4pnp05";
url = "https://elpa.gnu.org/packages/corfu-0.9.tar";
sha256 = "0710bq07j6w6zm49ci1bbx580frdbc62b3hbxwzkwm5204nf78bf";
};
packageRequires = [ emacs ];
meta = {
@ -835,10 +835,10 @@
elpaBuild {
pname = "devdocs";
ename = "devdocs";
version = "0.1";
version = "0.2";
src = fetchurl {
url = "https://elpa.gnu.org/packages/devdocs-0.1.tar";
sha256 = "1ps2jpp1ckq9839l63p6npqrf85b8zb5akwvjvv7fkm8nvspdkil";
url = "https://elpa.gnu.org/packages/devdocs-0.2.tar";
sha256 = "1npc7yra7pvf86ahmz1h7hnjxrz15ar1vjcalg4ilizypycpgrwj";
};
packageRequires = [ emacs ];
meta = {
@ -1015,10 +1015,10 @@
elpaBuild {
pname = "ebdb";
ename = "ebdb";
version = "0.6.23";
version = "0.6.24";
src = fetchurl {
url = "https://elpa.gnu.org/packages/ebdb-0.6.23.tar";
sha256 = "0j3jvy9s606qjqcmcjzgck3dp8bhpgly2g00wnswzcgk4makdzld";
url = "https://elpa.gnu.org/packages/ebdb-0.6.24.tar";
sha256 = "0156rh6fkv2yp509h6i8qzh4gsda2mcmfrxl4r6ywn1z5ahijc3r";
};
packageRequires = [ cl-lib emacs seq ];
meta = {
@ -1075,10 +1075,10 @@
elpaBuild {
pname = "eev";
ename = "eev";
version = "20210607";
version = "20210618";
src = fetchurl {
url = "https://elpa.gnu.org/packages/eev-20210607.tar";
sha256 = "0avd58m8630s4d3ys9g84csscdmf2y1swwwkgzjkrrq8q0j5yd3l";
url = "https://elpa.gnu.org/packages/eev-20210618.tar";
sha256 = "13sb9shpj9fhns8sl3dxdgnn8z4wf14mgi4s87k5x4nrr012sscf";
};
packageRequires = [ emacs ];
meta = {
@ -1198,10 +1198,10 @@
elpaBuild {
pname = "emms";
ename = "emms";
version = "7.2";
version = "7.5";
src = fetchurl {
url = "https://elpa.gnu.org/packages/emms-7.2.tar";
sha256 = "11vqqh9rnzibsfw7wx62rgzl8i8ldpf0hv1sj43nhl5c6dlc8d5z";
url = "https://elpa.gnu.org/packages/emms-7.5.tar";
sha256 = "0d7nsx2idzbp6d5im5rrsnwppbr2cimvxgx31bhwsm2aq3ya5v2j";
};
packageRequires = [ cl-lib nadvice seq ];
meta = {
@ -1867,10 +1867,10 @@
elpaBuild {
pname = "ivy-posframe";
ename = "ivy-posframe";
version = "0.6.0";
version = "0.6.1";
src = fetchurl {
url = "https://elpa.gnu.org/packages/ivy-posframe-0.6.0.tar";
sha256 = "07dzglrcdl54lkznyphw97xwd9bcwzdcgzkav0vqfk7f5cwh1wkf";
url = "https://elpa.gnu.org/packages/ivy-posframe-0.6.1.tar";
sha256 = "1nay2sfbwm2fkp3f1y89innd9h6j3q70q9y4yddrwa69cxlj9m23";
};
packageRequires = [ emacs ivy posframe ];
meta = {
@ -2017,10 +2017,10 @@
elpaBuild {
pname = "leaf";
ename = "leaf";
version = "4.4.8";
version = "4.5.2";
src = fetchurl {
url = "https://elpa.gnu.org/packages/leaf-4.4.8.tar";
sha256 = "0h0ksmgrhn29ci6z8y54dbbzcqlvfs1ra0kmf226gz0dqzk45vb3";
url = "https://elpa.gnu.org/packages/leaf-4.5.2.tar";
sha256 = "0i90shhhkpdcwmfi8zv0008qgmg4g3cqd2yvpycfv9n2axvhag54";
};
packageRequires = [ emacs ];
meta = {
@ -2152,10 +2152,10 @@
elpaBuild {
pname = "marginalia";
ename = "marginalia";
version = "0.6";
version = "0.7";
src = fetchurl {
url = "https://elpa.gnu.org/packages/marginalia-0.6.tar";
sha256 = "05pwaz9643shxnv63l6r9m2c0qf1nc1hy6jiqw01bkvvgg8g4jag";
url = "https://elpa.gnu.org/packages/marginalia-0.7.tar";
sha256 = "1nz55nx6xp72nahs4g6asl5y5yrlnlnza58bjrlwwzmwsf7daz18";
};
packageRequires = [ emacs ];
meta = {
@ -2829,10 +2829,10 @@
elpaBuild {
pname = "posframe";
ename = "posframe";
version = "1.0.3";
version = "1.0.4";
src = fetchurl {
url = "https://elpa.gnu.org/packages/posframe-1.0.3.tar";
sha256 = "0c3lnrydsysv8j25brgc0cckf1hz54yhkginncmw81y1ia43rqmx";
url = "https://elpa.gnu.org/packages/posframe-1.0.4.tar";
sha256 = "0i2pw90gw9zb22gj8yyvcp3b2k1bxxhbjj0idvr5iz1vd9023bc6";
};
packageRequires = [ emacs ];
meta = {
@ -2889,10 +2889,10 @@
elpaBuild {
pname = "pyim";
ename = "pyim";
version = "3.7.9";
version = "3.8.2";
src = fetchurl {
url = "https://elpa.gnu.org/packages/pyim-3.7.9.tar";
sha256 = "00ff1izdwcy53dcwpdn18wwndnw2jsw4bhg8gkqaa60xm468xzkl";
url = "https://elpa.gnu.org/packages/pyim-3.8.2.tar";
sha256 = "05sgciqb0hzy07j8pvbg7h2vpa9z5z60m6pknxd3b1kpi45vaihw";
};
packageRequires = [ async emacs xr ];
meta = {
@ -3355,10 +3355,10 @@
elpaBuild {
pname = "setup";
ename = "setup";
version = "0.2.0";
version = "0.2.1";
src = fetchurl {
url = "https://elpa.gnu.org/packages/setup-0.2.0.tar";
sha256 = "1xhjkyksilw1vbx12a4yz4bpj0dhl3m02yi8d9nyd19z098cfa9y";
url = "https://elpa.gnu.org/packages/setup-0.2.1.tar";
sha256 = "15paand086g33w2vb6jkyxd3i2pmpp84f31y3j5v8w9ia68pjzms";
};
packageRequires = [ emacs ];
meta = {
@ -3595,10 +3595,10 @@
elpaBuild {
pname = "sql-indent";
ename = "sql-indent";
version = "1.5";
version = "1.6";
src = fetchurl {
url = "https://elpa.gnu.org/packages/sql-indent-1.5.tar";
sha256 = "07k5rn9hbxppnka7nq0a3a6zyqqa1hp8j6qrb344js6zyak0cb63";
url = "https://elpa.gnu.org/packages/sql-indent-1.6.tar";
sha256 = "000pimlg0k4mrv2wpqq8w8l51wpr1lzlaq6ai8iaximm2a92ap5b";
};
packageRequires = [ cl-lib ];
meta = {
@ -3610,10 +3610,10 @@
elpaBuild {
pname = "ssh-deploy";
ename = "ssh-deploy";
version = "3.1.12";
version = "3.1.13";
src = fetchurl {
url = "https://elpa.gnu.org/packages/ssh-deploy-3.1.12.tar";
sha256 = "0fz49l63jfw9zy459f07bq2irdb8ispnx8m2c3wxwiim9yw5xnjg";
url = "https://elpa.gnu.org/packages/ssh-deploy-3.1.13.tar";
sha256 = "006jr8yc5qvxdfk0pn40604a2b7a1ah6l6hi6rhxm3p5b08d9i5w";
};
packageRequires = [ emacs ];
meta = {
@ -3779,10 +3779,10 @@
elpaBuild {
pname = "tramp";
ename = "tramp";
version = "2.5.0.5";
version = "2.5.1";
src = fetchurl {
url = "https://elpa.gnu.org/packages/tramp-2.5.0.5.tar";
sha256 = "1dclxffynfacvwi2scpda35sxjb42603yyf2p0477qa9b0i4xha0";
url = "https://elpa.gnu.org/packages/tramp-2.5.1.tar";
sha256 = "1r7wifhzy2ipdlc4fqnx6549fnx45ggz57wh0cp7s6y25761si7q";
};
packageRequires = [ emacs ];
meta = {
@ -3824,10 +3824,10 @@
elpaBuild {
pname = "transient";
ename = "transient";
version = "0.3.4";
version = "0.3.5";
src = fetchurl {
url = "https://elpa.gnu.org/packages/transient-0.3.4.tar";
sha256 = "1m71w52cr8f9wm6lybfa003w408lkrl6q9whs53hpp3pl5phhfvb";
url = "https://elpa.gnu.org/packages/transient-0.3.5.tar";
sha256 = "15dlj21gn0zxywic9wdcp5zc8skm1s170bq7smgkpd3p3lxslf68";
};
packageRequires = [ emacs ];
meta = {
@ -3949,6 +3949,21 @@
license = lib.licenses.free;
};
}) {};
vc-hgcmd = callPackage ({ elpaBuild, emacs, fetchurl, lib }:
elpaBuild {
pname = "vc-hgcmd";
ename = "vc-hgcmd";
version = "1.14";
src = fetchurl {
url = "https://elpa.gnu.org/packages/vc-hgcmd-1.14.tar";
sha256 = "0pg6fg0znsmky3iwdpxn2sx5bbn72kw83s077000ilawi6zqwc2d";
};
packageRequires = [ emacs ];
meta = {
homepage = "https://elpa.gnu.org/packages/vc-hgcmd.html";
license = lib.licenses.free;
};
}) {};
vcard = callPackage ({ elpaBuild, emacs, fetchurl, lib }:
elpaBuild {
pname = "vcard";
@ -4015,10 +4030,10 @@
elpaBuild {
pname = "vertico";
ename = "vertico";
version = "0.11";
version = "0.12";
src = fetchurl {
url = "https://elpa.gnu.org/packages/vertico-0.11.tar";
sha256 = "0hzwddkac85i449173az8crlksj9ivrqf969r81kbr45ksgr1ij6";
url = "https://elpa.gnu.org/packages/vertico-0.12.tar";
sha256 = "14qlc438bysg23wfj04zpvpraqzzi4jlz3r11vc56vd0k2hfmvmn";
};
packageRequires = [ emacs ];
meta = {

View file

@ -199,6 +199,8 @@
# Packages made the classical callPackage way
ebuild-mode = callPackage ./ebuild-mode { };
emacspeak = callPackage ./emacspeak { };
ess-R-object-popup = callPackage ./ess-R-object-popup { };

View file

@ -4,10 +4,10 @@
elpaBuild {
pname = "org";
ename = "org";
version = "20210607";
version = "20210628";
src = fetchurl {
url = "https://orgmode.org/elpa/org-20210607.tar";
sha256 = "178z9bnzcdaymnwxf0kkw1yzlzkj5dmdjjwdklc9qb9iv6rckfji";
url = "https://orgmode.org/elpa/org-20210628.tar";
sha256 = "1sn2yyynndk8qf43ss8bayll33r4ina8xfx4ywzcs3m1lm6xy1zl";
};
packageRequires = [];
meta = {
@ -19,10 +19,10 @@
elpaBuild {
pname = "org-plus-contrib";
ename = "org-plus-contrib";
version = "20210607";
version = "20210628";
src = fetchurl {
url = "https://orgmode.org/elpa/org-plus-contrib-20210607.tar";
sha256 = "03liivgfcmp0lh6p57bh2gyn85n3sc4p91y374kq8kzc7fzrgzyr";
url = "https://orgmode.org/elpa/org-plus-contrib-20210628.tar";
sha256 = "0r4kxp1hbhkwvi7939fglng8db4h4n7vigy8pd2gia3a02xcw8l5";
};
packageRequires = [];
meta = {

View file

@ -5,16 +5,16 @@
buildGoModule rec {
pname = "gophernotes";
version = "0.7.2";
version = "0.7.3";
src = fetchFromGitHub {
owner = "gopherdata";
repo = "gophernotes";
rev = "v${version}";
sha256 = "sha256-EEMKV+k5qcep4z7J5r1nSLxmb0fbfpJOPmz5bE91cd8=";
sha256 = "sha256-LiYPos6Ic+se5bTTkvggmyxyS20uhgALkDU2LoXTci8=";
};
vendorSha256 = "sha256-Wy4HcPlrlYUjRQHhw+UPAa+Rn1FvJobWGxgFiJKJTAg=";
vendorSha256 = "sha256-wDMx3B47Vv87/3YEPX8/70Q5/REJ7IPvw8dA/viJiSY=";
meta = with lib; {
description = "Go kernel for Jupyter notebooks";

View file

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "greenfoot";
version = "3.6.1";
version = "3.7.0";
src = fetchurl {
# We use the deb here. First instinct might be to go for the "generic" JAR
# download, but that is actually a graphical installer that is much harder
# to unpack than the deb.
url = "https://www.greenfoot.org/download/files/Greenfoot-linux-${builtins.replaceStrings ["."] [""] version}.deb";
sha256 = "112h6plpclj8kbv093m4pcczljhpd8d47d7a2am1yfgbyckx6hf0";
sha256 = "sha256-K9faU3ZarcR4g8riHpoZYVH0sXtueqfm3Fo+sZAHJA8=";
};
nativeBuildInputs = [ makeWrapper ];

View file

@ -0,0 +1,25 @@
{ fetchFromGitHub, lib, rustPlatform }:
rustPlatform.buildRustPackage rec {
pname = "helix";
version = "0.3.0";
src = fetchFromGitHub {
owner = "helix-editor";
repo = pname;
rev = "v${version}";
fetchSubmodules = true;
sha256 = "sha256-dI5yIP5uUmM9pyMpvvdrk8/0jE/REkU/m9BF081LwMU=";
};
cargoSha256 = "sha256-l3Ikr4IyUsHItJIC4BaIZZb6vio3bchumbbPI+nxIjQ=";
cargoBuildFlags = [ "--features embed_runtime" ];
meta = with lib; {
description = "A post-modern modal text editor";
homepage = "https://helix-editor.com";
license = licenses.mpl20;
maintainers = with maintainers; [ yusdacra ];
};
}

View file

@ -255,12 +255,12 @@ in
datagrip = buildDataGrip rec {
name = "datagrip-${version}";
version = "2021.1.2"; /* updated by script */
version = "2021.1.3"; /* updated by script */
description = "Your Swiss Army Knife for Databases and SQL";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/datagrip/${name}.tar.gz";
sha256 = "1znb4m7sv7xqi1mq3yw0m51m06wfwmhhxmvck0xkv8s0cfg18qim"; /* updated by script */
sha256 = "0lhi3vwhwb359va4sa17y071i03l4mfwqpsp7haqxjf900dcld7d"; /* updated by script */
};
wmClass = "jetbrains-datagrip";
update-channel = "DataGrip RELEASE";
@ -268,12 +268,12 @@ in
goland = buildGoland rec {
name = "goland-${version}";
version = "2021.1.2"; /* updated by script */
version = "2021.1.3"; /* updated by script */
description = "Up and Coming Go IDE";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/go/${name}.tar.gz";
sha256 = "0g20r7yn4r2h08wv3i8bnnma8x4jljixsbmfml8kixk0pzfhv4px"; /* updated by script */
sha256 = "0xy9k90v3kcm9sj48l809qn0vws4ygsxxyqwsg6y9a3r1raqgqxd"; /* updated by script */
};
wmClass = "jetbrains-goland";
update-channel = "GoLand RELEASE";
@ -281,12 +281,12 @@ in
idea-community = buildIdea rec {
name = "idea-community-${version}";
version = "2021.1.2"; /* updated by script */
version = "2021.1.3"; /* updated by script */
description = "Integrated Development Environment (IDE) by Jetbrains, community edition";
license = lib.licenses.asl20;
src = fetchurl {
url = "https://download.jetbrains.com/idea/ideaIC-${version}.tar.gz";
sha256 = "03i5f6p0abr9yfs9fg90fg7hb1a7zar9q4d4iiag30cmndwpslg2"; /* updated by script */
sha256 = "1phpfa9i3k7g92ankmibp53c1469ifnb12g6s8gklln7v7xxakmi"; /* updated by script */
};
wmClass = "jetbrains-idea-ce";
update-channel = "IntelliJ IDEA RELEASE";
@ -294,12 +294,12 @@ in
idea-ultimate = buildIdea rec {
name = "idea-ultimate-${version}";
version = "2021.1.2"; /* updated by script */
version = "2021.1.3"; /* updated by script */
description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/idea/ideaIU-${version}-no-jbr.tar.gz";
sha256 = "0mw4acaik1bkr7gqbwgs3i8f8px8zw95hm1zxgd5gd5kh88n17x5"; /* updated by script */
sha256 = "13c7a96zbw05w1gy4ds4wzac853hdlnbflww2xaz60jnr1k24gnp"; /* updated by script */
};
wmClass = "jetbrains-idea";
update-channel = "IntelliJ IDEA RELEASE";
@ -320,12 +320,12 @@ in
phpstorm = buildPhpStorm rec {
name = "phpstorm-${version}";
version = "2021.1.3"; /* updated by script */
version = "2021.1.4"; /* updated by script */
description = "Professional IDE for Web and PHP developers";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/webide/PhpStorm-${version}.tar.gz";
sha256 = "05hjv1nz1b82bkakadjvsy23v0qv8fyni6h31lcg9198h1890f7v"; /* updated by script */
sha256 = "0p9a8l2bpjm25x4af1hlqhmw5xsirsfajznd6y723yqmjy8hs46l"; /* updated by script */
};
wmClass = "jetbrains-phpstorm";
update-channel = "PhpStorm RELEASE";
@ -333,12 +333,12 @@ in
pycharm-community = buildPycharm rec {
name = "pycharm-community-${version}";
version = "2021.1.2"; /* updated by script */
version = "2021.1.3"; /* updated by script */
description = "PyCharm Community Edition";
license = lib.licenses.asl20;
src = fetchurl {
url = "https://download.jetbrains.com/python/${name}.tar.gz";
sha256 = "0sp7w1xrl0y36dai08kqfd0jk06yr7jdbaf1a9f3fgxp5pmspxp1"; /* updated by script */
sha256 = "0c03grsrjydb6jcnbq1qi4158c14vni3znr7vysnbvldi8al6w8m"; /* updated by script */
};
wmClass = "jetbrains-pycharm-ce";
update-channel = "PyCharm RELEASE";
@ -346,12 +346,12 @@ in
pycharm-professional = buildPycharm rec {
name = "pycharm-professional-${version}";
version = "2021.1.2"; /* updated by script */
version = "2021.1.3"; /* updated by script */
description = "PyCharm Professional Edition";
license = lib.licenses.unfree;
src = fetchurl {
url = "https://download.jetbrains.com/python/${name}.tar.gz";
sha256 = "0ny7rbl8g5azpqnlcq8l6bwh6hrp8rgp06lf4a8gdr9rpvw9xsqb"; /* updated by script */
sha256 = "01nwc9nprlyrwyij98px915w66g6vxbznsmmmg56rv3rvjvjp7yl"; /* updated by script */
};
wmClass = "jetbrains-pycharm";
update-channel = "PyCharm RELEASE";

View file

@ -14,7 +14,7 @@ sub semantic_less {
}
sub get_latest_versions {
my @channels = get("http://www.jetbrains.com/updates/updates.xml") =~ /(<channel .+?<\/channel>)/gs;
my @channels = get("https://www.jetbrains.com/updates/updates.xml") =~ /(<channel .+?<\/channel>)/gs;
my %h = {};
for my $ch (@channels) {
my ($id) = $ch =~ /^<channel id="[^"]+" name="([^"]+)"/;

View file

@ -2,6 +2,7 @@
, libuv, lua, ncurses, pkg-config
, unibilium, xsel, gperf
, libvterm-neovim
, tree-sitter
, glibcLocales ? null, procps ? null
# now defaults to false because some tests can be flaky (clipboard etc)
@ -31,13 +32,13 @@ let
in
stdenv.mkDerivation rec {
pname = "neovim-unwrapped";
version = "0.4.4";
version = "0.5.0";
src = fetchFromGitHub {
owner = "neovim";
repo = "neovim";
rev = "v${version}";
sha256 = "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m";
sha256 = "0lgbf90sbachdag1zm9pmnlbn35964l3khs27qy4462qzpqyi9fi";
};
patches = [
@ -58,6 +59,7 @@ in
msgpack
ncurses
neovimLuaEnv
tree-sitter
unibilium
] ++ optional stdenv.isDarwin libiconv
++ optionals doCheck [ glibcLocales procps ]
@ -96,6 +98,7 @@ in
"-DGPERF_PRG=${gperf}/bin/gperf"
"-DLUA_PRG=${neovimLuaEnv.interpreter}"
"-DLIBLUV_LIBRARY=${luvpath}"
"-DUSE_BUNDLED=OFF"
]
++ optional doCheck "-DBUSTED_PRG=${neovimLuaEnv}/bin/busted"
++ optional (!lua.pkgs.isLuaJIT) "-DPREFER_LUA=ON"

View file

@ -1,8 +1,19 @@
{ ripgrep, git, fzf, makeWrapper, vim_configurable, vimPlugins, fetchFromGitHub
, lib, stdenv, formats, runCommand, spacevim_config ? import ./init.nix }:
{ ripgrep
, git
, fzf
, makeWrapper
, vim_configurable
, vimPlugins
, fetchFromGitHub
, lib
, stdenv
, formats
, runCommand
, spacevim_config ? import ./init.nix
}:
let
format = formats.toml {};
format = formats.toml { };
vim-customized = vim_configurable.customize {
name = "vim";
# Not clear at the moment how to import plugins such that
@ -14,17 +25,18 @@ let
mkdir -p $out
cp ${format.generate "init.toml" spacevim_config} $out/init.toml
'';
in stdenv.mkDerivation rec {
in
stdenv.mkDerivation rec {
pname = "spacevim";
version = "1.6.0";
version = "1.7.0";
src = fetchFromGitHub {
owner = "SpaceVim";
repo = "SpaceVim";
rev = "v${version}";
sha256 = "sha256-QQdtjEdbuzmf0Rw+u2ZltLihnJt8LqkfTrLDWLAnCLE=";
sha256 = "sha256-TmfPeaGkH1Wq2b5lB29PUYDVddJVN3mBuPAmu9EtiGY=";
};
nativeBuildInputs = [ makeWrapper vim-customized];
nativeBuildInputs = [ makeWrapper vim-customized ];
buildInputs = [ vim-customized ];
buildPhase = ''

View file

@ -10,6 +10,9 @@
# Attributes inherit from specific versions
, version, src, meta, sourceRoot
, executableName, longName, shortName, pname, updateScript
# sourceExecutableName is the name of the binary in the source archive, over
# which we have no control
, sourceExecutableName ? executableName
}:
let
@ -77,12 +80,12 @@ let
'' + (if system == "x86_64-darwin" then ''
mkdir -p "$out/Applications/${longName}.app" $out/bin
cp -r ./* "$out/Applications/${longName}.app"
ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${executableName}" $out/bin/${executableName}
ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${sourceExecutableName}" $out/bin/${executableName}
'' else ''
mkdir -p $out/lib/vscode $out/bin
cp -r ./* $out/lib/vscode
ln -s $out/lib/vscode/bin/${executableName} $out/bin
ln -s $out/lib/vscode/bin/${sourceExecutableName} $out/bin/${executableName}
mkdir -p $out/share/applications
ln -s $desktopItem/share/applications/${executableName}.desktop $out/share/applications/${executableName}.desktop

View file

@ -25,6 +25,7 @@ in
version = "1.57.1";
pname = "vscode";
sourceExecutableName = "code";
executableName = "code" + lib.optionalString isInsiders "-insiders";
longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
shortName = "Code" + lib.optionalString isInsiders " - Insiders";

View file

@ -5,11 +5,11 @@
stdenv.mkDerivation rec {
pname = "avocode";
version = "4.14.3";
version = "4.15.0";
src = fetchurl {
url = "https://media.avocode.com/download/avocode-app/${version}/avocode-${version}-linux.zip";
sha256 = "sha256-6OEgSnW96jufc/Z+B17ghtAbj9SLulue26ffKREGzbY=";
sha256 = "sha256-Au1m7CfZkeOczcO/JvIzyVCp6Gn/nhSq0yJOdP8i+0w=";
};
libPath = lib.makeLibraryPath (with xorg; [

View file

@ -91,7 +91,7 @@ stdenv.mkDerivation rec {
homepage = "https://about.draw.io/";
license = licenses.asl20;
changelog = "https://github.com/jgraph/drawio-desktop/releases/tag/v${version}";
maintainers = with maintainers; [ danieldk ];
maintainers = with maintainers; [ ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -1,48 +1,74 @@
{ lib, stdenv, fetchurl, jre, unzip, makeWrapper }:
# Note:
# - User config dir is hard coded by upstream to $HOME/.imagej on linux systems
# and to $HOME/Library/Preferences on macOS.
# (The current trend appears to be to use $HOME/.config/imagej
# on linux systems, but we here do not attempt to fix it.)
{ lib
, stdenv
, fetchurl
, jre
, unzip
, makeWrapper
, makeDesktopItem
, copyDesktopItems
}:
let
imagej150 = stdenv.mkDerivation {
pname = "imagej";
version = "150";
src = fetchurl {
url = "https://wsr.imagej.net/distros/cross-platform/ij150.zip";
sha256 = "97aba6fc5eb908f5160243aebcdc4965726693cb1353d9c0d71b8f5dd832cb7b";
};
nativeBuildInputs = [ makeWrapper unzip ];
inherit jre;
# JAR files that are intended to be used by other packages
# should go to $out/share/java.
# (Some uses ij.jar as a library not as a standalone program.)
installPhase = ''
mkdir -p $out/share/java
# Read permisssion suffices for the jar and others.
# Simple cp shall clear suid bits, if any.
cp ij.jar $out/share/java
cp -dR luts macros plugins $out/share
mkdir $out/bin
makeWrapper ${jre}/bin/java $out/bin/imagej \
--add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
'';
meta = with lib; {
homepage = "https://imagej.nih.gov/ij/";
description = "Image processing and analysis in Java";
longDescription = ''
ImageJ is a public domain Java image processing program
inspired by NIH Image for the Macintosh.
It runs on any computer with a Java 1.4 or later virtual machine.
'';
license = licenses.publicDomain;
platforms = with platforms; linux ++ darwin;
maintainers = with maintainers; [ yuriaisaka ];
};
icon = fetchurl {
url = "https://imagej.net/media/icons/imagej.png";
sha256 = "sha256-nU2nWI1wxZB/xlOKsZzdUjj+qiCTjO6GwEKYgZ5Risg=";
};
in
imagej150
in stdenv.mkDerivation rec {
pname = "imagej";
version = "153";
src = fetchurl {
url = "https://wsr.imagej.net/distros/cross-platform/ij${version}.zip";
sha256 = "sha256-MGuUdUDuW3s/yGC68rHr6xxzmYScUjdXRawDpc1UQqw=";
};
nativeBuildInputs = [ copyDesktopItems makeWrapper unzip ];
desktopItems = lib.optionals stdenv.isLinux [
(makeDesktopItem {
name = "ImageJ";
desktopName = "ImageJ";
icon = "imagej";
categories = "Science;Utility;Graphics;";
exec = "imagej";
})
];
passthru = {
inherit jre;
};
# JAR files that are intended to be used by other packages
# should go to $out/share/java.
# (Some uses ij.jar as a library not as a standalone program.)
installPhase = ''
runHook preInstall
mkdir -p $out/share/java $out/bin
# Read permisssion suffices for the jar and others.
# Simple cp shall clear suid bits, if any.
cp ij.jar $out/share/java
cp -dR luts macros plugins $out/share
makeWrapper ${jre}/bin/java $out/bin/imagej \
--add-flags "-jar $out/share/java/ij.jar -ijpath $out/share"
runHook postInstall
'';
postFixup = lib.optionalString stdenv.isLinux ''
install -Dm644 ${icon} $out/share/icons/hicolor/128x128/apps/imagej.png
substituteInPlace $out/share/applications/ImageJ.desktop \
--replace Exec=imagej Exec=$out/bin/imagej
'';
meta = with lib; {
homepage = "https://imagej.nih.gov/ij/";
description = "Image processing and analysis in Java";
longDescription = ''
ImageJ is a public domain Java image processing program
inspired by NIH Image for the Macintosh.
It runs on any computer with a Java 1.4 or later virtual machine.
'';
license = licenses.publicDomain;
platforms = platforms.unix;
maintainers = with maintainers; [ yuriaisaka ];
};
}

View file

@ -1,8 +1,8 @@
{ buildGoModule, fetchFromGitHub, installShellFiles, lib }:
let
humioCtlVersion = "0.28.3";
sha256 = "sha256-GUn5hg4gPGjQ6U2dboGE22u8XuZ578+EnkmHLASXd3Q=";
humioCtlVersion = "0.28.4";
sha256 = "sha256-X2pc15InfCzVbZ2fmBdr+GKgOySIruA1yD61HcLO164=";
vendorSha256 = "sha256-867x33Aq27D2m14NqqsdByC39pjjyJZbfX3jmwVU2yo=";
in buildGoModule {
name = "humioctl-${humioCtlVersion}";

View file

@ -107,7 +107,7 @@ stdenv.mkDerivation rec {
description = "Multi-platform password manager";
homepage = "https://1password.com/";
license = licenses.unfree;
maintainers = with maintainers; [ danieldk timstott savannidgerinel ];
maintainers = with maintainers; [ timstott savannidgerinel ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -19,13 +19,13 @@
stdenv.mkDerivation rec {
pname = "cherrytree";
version = "0.99.37";
version = "0.99.38";
src = fetchFromGitHub {
owner = "giuspen";
repo = "cherrytree";
rev = version;
sha256 = "1a2scwjrjijxwyfpqih23zzay3yqhyzpxnp66388fcir1cmp8zih";
sha256 = "sha256-04MRw6pMtJGxTMKwOzPNGg1T85SfVY5bMkF3gt2V0e0=";
};
nativeBuildInputs = [

View file

@ -7,18 +7,18 @@
buildGoModule rec {
pname = "expenses";
version = "0.2.1";
version = "0.2.2";
src = fetchFromGitHub {
owner = "manojkarthick";
repo = "expenses";
rev = "v${version}";
sha256 = "11wxaqbnrrg0rykx5905chi6rhmai1nqggdbhh6hiappr5rksl0j";
sha256 = "sha256-CaIbLtP7ziv9UBQE+QsNnqX65OV+6GIvkLwKm1G++iY=";
};
vendorSha256 = "1kwj63wl4kb16zl3lmi9bzj1az7vi453asdy52na0mjx4ymmjyk1";
vendorSha256 = "sha256-NWTFxF4QCH1q1xx+hmVmpvDeOlqH5Ai2+0ParE5px9M=";
# package does not contain any tests as of v0.2.1
# package does not contain any tests as of v0.2.2
doCheck = false;
buildInputs = [ sqlite ];

View file

@ -1,20 +1,28 @@
{ lib, stdenv, fetchFromGitHub, rustPlatform, libiconv }:
{ lib, stdenv, fetchFromGitHub, rustPlatform, libiconv, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "flavours";
version = "0.4.0";
version = "0.5.0";
src = fetchFromGitHub {
owner = "Misterio77";
repo = pname;
rev = "v${version}";
sha256 = "sha256-rDy859jg+F8XC4sJogIgdn1FoT8cf7S+KORt+7kboAc=";
sha256 = "1bgi6p7l0bh9k4vkwvngk7q19ynia0z1ninb1cq8qnwwpll6kbya";
};
buildInputs = [ ]
++ lib.optionals stdenv.isDarwin [ libiconv ];
buildInputs = lib.optionals stdenv.isDarwin [ libiconv ];
cargoSha256 = "sha256-I8ZH35L2CVLy6ypmdOPd8VEG/sQeGaHyT1HWNdwyZVo=";
cargoSha256 = "07hwxhfcbqbwb3hz18w92h1lhdiwwy7abhwpimzx7syyavp4rmn4";
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd flavours \
--zsh <($out/bin/flavours --completions zsh) \
--fish <($out/bin/flavours --completions fish) \
--bash <($out/bin/flavours --completions bash)
'';
meta = with lib; {
description = "An easy to use base16 scheme manager/builder that integrates with any workflow";

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "fuzzel";
version = "1.5.4";
version = "1.6.0";
src = fetchzip {
url = "https://codeberg.org/dnkl/fuzzel/archive/${version}.tar.gz";
sha256 = "sha256-Zg9KrRf2ntg2FU6lhllt/Fd63KJak6zB7hu4ujj/9AI=";
sha256 = "sha256-iTpUWvQszDtNc1gDqkPbhvgUVNWydpivhnOCHMJVtSw=";
};
nativeBuildInputs = [ pkg-config meson ninja scdoc git ];

View file

@ -1,4 +1,4 @@
{ callPackage, buildFHSUserEnv, undaemonize }:
{ callPackage, buildFHSUserEnv, undaemonize, unwrapped ? callPackage ./runtime.nix {} }:
let
houdini-runtime = callPackage ./runtime.nix { };
@ -9,6 +9,10 @@ in buildFHSUserEnv {
mkdir -p $out/usr/lib/sesi
'';
passthru = {
unwrapped = houdini-runtime;
};
runScript = "${undaemonize}/bin/undaemonize ${houdini-runtime}/bin/houdini";
}

View file

@ -1,6 +1,9 @@
{ lib, stdenv, requireFile, zlib, libpng, libSM, libICE, fontconfig, xorg, libGLU, libGL, alsa-lib, dbus, xkeyboardconfig, bc, addOpenGLRunpath }:
{ lib, stdenv, requireFile, zlib, libpng, libSM, libICE, fontconfig, xorg, libGLU, libGL, alsa-lib
, dbus, xkeyboardconfig, nss, nspr, expat, pciutils, libxkbcommon, bc, addOpenGLRunpath
}:
let
# NOTE: Some dependencies only show in errors when run with QT_DEBUG_PLUGINS=1
ld_library_path = builtins.concatStringsSep ":" [
"${stdenv.cc.cc.lib}/lib64"
(lib.makeLibraryPath [
@ -17,6 +20,8 @@ let
xorg.libXcomposite
xorg.libXdamage
xorg.libXtst
xorg.libxcb
xorg.libXScrnSaver
alsa-lib
fontconfig
libSM
@ -25,26 +30,22 @@ let
libpng
dbus
addOpenGLRunpath.driverLink
nss
nspr
expat
pciutils
libxkbcommon
])
];
license_dir = "~/.config/houdini";
in
stdenv.mkDerivation rec {
version = "17.5.327";
version = "18.0.460";
pname = "houdini-runtime";
src = requireFile rec {
name = "houdini-${version}-linux_x86_64_gcc6.3.tar.gz";
sha256 = "1byigmhmby8lgi2vmgxy9jlrrqk7jyr507zqkihq5bv8kfsanv1x";
message = ''
This nix expression requires that ${name} is already part of the store.
Download it from https://www.sidefx.com and add it to the nix store with:
nix-prefetch-url <URL>
This can't be done automatically because you need to create an account on
their website and agree to their license terms before you can download
it. That's what you get for using proprietary software.
'';
sha256 = "18rbwszcks2zfn9zbax62rxmq50z9mc3h39b13jpd39qjqdd3jsd";
url = meta.homepage;
};
buildInputs = [ bc ];
@ -82,7 +83,6 @@ stdenv.mkDerivation rec {
license = lib.licenses.unfree;
platforms = lib.platforms.linux;
hydraPlatforms = [ ]; # requireFile src's should be excluded
maintainers = [ lib.maintainers.canndrew ];
maintainers = with lib.maintainers; [ canndrew kwohlfahrt ];
};
}

View file

@ -2,16 +2,16 @@
buildGoModule rec {
pname = "hugo";
version = "0.84.1";
version = "0.84.3";
src = fetchFromGitHub {
owner = "gohugoio";
repo = pname;
rev = "v${version}";
sha256 = "sha256-ULZa0tepq00v2VHDR3+aYYvRfbxYKcjcltRgRmbVmRA=";
sha256 = "sha256-3SbF4JsanNup0JmtEoZlyu3SvMn01r+nhnPgIi/W8pA=";
};
vendorSha256 = "sha256-jY/g92ON5OxjuZzPHJNduXYMgPU8/0ioAYvp4iqjGnU=";
vendorSha256 = "sha256-ImXTOtN6kQL7Q8IBlmK7+i47cWtyZT0xcnQdCw3NvWM=";
doCheck = false;

View file

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "logseq";
version = "0.2.0";
version = "0.2.2";
src = fetchurl {
url = "https://github.com/logseq/logseq/releases/download/${version}/logseq-linux-x64-${version}.AppImage";
sha256 = "uFINB8WXFbtI/WMFvqirAygzwK7I/8+8YPeyCd+xQ5w=";
sha256 = "03l5w0fg3laiz85k4g4w98ngaziyfr9s24xshjrfl71q6r9s813m";
name = "${pname}-${version}.AppImage";
};

View file

@ -41,6 +41,7 @@ stdenv.mkDerivation rec {
homepage = "https://code-industry.net/free-pdf-editor/";
license = licenses.unfreeRedistributable;
platforms = with platforms; [ "x86_64-linux" ];
maintainers = with maintainers; [ cmcdragonkai flokli ];
broken = true;
maintainers = with maintainers; [ cmcdragonkai ];
};
}

View file

@ -0,0 +1,57 @@
{ lib, fetchFromGitHub
, python3Packages, wrapGAppsHook, gobject-introspection
, gtk-layer-shell, pango, gdk-pixbuf, atk
# Extra packages called by various internal nwg-panel modules
, sway # swaylock, swaymsg
, systemd # systemctl
, wlr-randr # wlr-randr
, nwg-menu # nwg-menu
, light # light
, pamixer # pamixer
, pulseaudio # pactl
}:
python3Packages.buildPythonApplication rec {
pname = "nwg-panel";
version = "0.3.2";
src = fetchFromGitHub {
owner = "nwg-piotr";
repo = "nwg-panel";
rev = "v${version}";
hash = "sha256-x5lGVF6eRhOVXrsBatdsiUiWs/+FxRlCtp79zA206RY=";
};
# No tests
doCheck = false;
# Because of wrapGAppsHook
strictDeps = false;
dontWrapGApps = true;
buildInputs = [ atk gdk-pixbuf gtk-layer-shell pango ];
nativeBuildInputs = [ wrapGAppsHook gobject-introspection ];
propagatedBuildInputs = with python3Packages; [ i3ipc netifaces psutil pybluez pygobject3 ];
postInstall = ''
mkdir -p $out/share/{applications,pixmaps}
cp $src/nwg-panel-config.desktop $out/share/applications/
cp $src/nwg-shell.svg $src/nwg-panel.svg $out/share/pixmaps/
'';
preFixup = ''
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
--prefix XDG_DATA_DIRS : "$out/share"
--prefix PATH : "${lib.makeBinPath [ light nwg-menu pamixer pulseaudio sway systemd wlr-randr ]}"
)
'';
meta = with lib; {
homepage = "https://github.com/nwg-piotr/nwg-panel";
description = "GTK3-based panel for Sway window manager";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ berbiche ];
};
}

View file

@ -44,6 +44,7 @@ let
inherit version;
sha256 = "63509b41d158ae5b7f67eb4ad20fecbb4eee99434e73e140354dc3ff8e09716f";
};
propagatedBuildInputs = [ self.six ];
}
);
}

View file

@ -2,13 +2,13 @@
buildGoModule rec {
pname = "openring";
version = "unstable-2021-04-03";
version = "unstable-2021-06-28";
src = fetchFromSourcehut {
owner = "~sircmpwn";
repo = pname;
rev = "f13edb5dfd882ce608d61cf6b6740650ce9d84a3";
sha256 = "sha256-Z65V77JZ9jCzBg7T2+d5Agxxd+MV2R7nYcLedYP5eOE=";
rev = "e566294050776355ca0d3bfd7a1f6f70767cd08b";
sha256 = "sha256-h9Tout3KGiv6jbq9Ui3crb5NdTOHcn7BIy+aPoWG5sM=";
};
vendorSha256 = "sha256-BbBTmkGyLrIWphXC+dBaHaVzHuXRZ+4N/Jt2k3nF7Z4=";

View file

@ -0,0 +1,36 @@
{ stdenv
, lib
, fetchFromGitHub
, cmake
, pkg-config
, gtk3
, wrapGAppsHook
, jansson
, libgcrypt
, libzip
, libpng
, libcotp
, zbar
}:
stdenv.mkDerivation rec {
pname = "otpclient";
version = "2.4.4";
src = fetchFromGitHub {
owner = "paolostivanin";
repo = pname;
rev = "v${version}";
sha256 = "0zjvhcx9q8nsf97zikddxriky0kghi4j4i7312s94pl8c7kb4abr";
};
buildInputs = [ gtk3 jansson libgcrypt libzip libpng libcotp zbar ];
nativeBuildInputs = [ cmake pkg-config wrapGAppsHook ];
meta = with lib; {
description = "Highly secure and easy to use OTP client written in C/GTK that supports both TOTP and HOTP";
homepage = "https://github.com/paolostivanin/OTPClient";
license = licenses.gpl3Only;
maintainers = with maintainers; [ alexbakker ];
};
}

View file

@ -8,22 +8,22 @@
rustPlatform.buildRustPackage rec {
pname = "reddsaver";
version = "0.3.2";
version = "0.3.3";
src = fetchFromGitHub {
owner = "manojkarthick";
repo = "reddsaver";
rev = "v${version}";
sha256 = "0ffci3as50f55n1v36hji4n0b3lkch5ylc75awjz65jz2gd2y2j4";
sha256 = "1czsy1bb0ja650sndwzq9rcbbhcci7s7ablw0agaynhi403shavv";
};
cargoSha256 = "1xf26ldgfinzpakcp65w52fdl3arsm053vfnq7gk2fwnq55cjwl0";
cargoSha256 = "0wr6y7mfffaqdh6i5nqhx692dih159121sm6k0i37wcdvxhvd51z";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ]
++ lib.optional stdenv.isDarwin Security;
# package does not contain tests as of v0.3.2
# package does not contain tests as of v0.3.3
docCheck = false;
meta = with lib; {

Some files were not shown because too many files have changed in this diff Show more