Merge remote-tracking branch 'origin/master' into staging-next
This commit is contained in:
@@ -22845,6 +22845,13 @@
|
||||
githubId = 159372832;
|
||||
keys = [ { fingerprint = "6F54 C08C 37C8 EC78 15FA 0D01 A721 8CBA 2D80 15C3"; } ];
|
||||
};
|
||||
Tert0 = {
|
||||
name = "Tert0";
|
||||
github = "Tert0";
|
||||
githubId = 62036464;
|
||||
email = "tert0byte@gmail.com";
|
||||
keys = [ { fingerprint = "F899 D3B5 00BF 98AE 9097 F616 7069 D89F 9E5C 97ED"; } ];
|
||||
};
|
||||
tesq0 = {
|
||||
email = "mikolaj.galkowski@gmail.com";
|
||||
github = "tesq0";
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
{ config, lib, pkgs, utils, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
utils,
|
||||
...
|
||||
}:
|
||||
let
|
||||
# Type for a valid systemd unit option. Needed for correctly passing "timerConfig" to "systemd.timers"
|
||||
inherit (utils.systemdUtils.unitOptions) unitOption;
|
||||
@@ -8,269 +14,297 @@ in
|
||||
description = ''
|
||||
Periodic backups to create with Restic.
|
||||
'';
|
||||
type = lib.types.attrsOf (lib.types.submodule ({ name, ... }: {
|
||||
options = {
|
||||
passwordFile = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
Read the repository password from a file.
|
||||
'';
|
||||
example = "/etc/nixos/restic-password";
|
||||
};
|
||||
type = lib.types.attrsOf (
|
||||
lib.types.submodule (
|
||||
{ name, ... }:
|
||||
{
|
||||
options = {
|
||||
passwordFile = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
Read the repository password from a file.
|
||||
'';
|
||||
example = "/etc/nixos/restic-password";
|
||||
};
|
||||
|
||||
environmentFile = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
file containing the credentials to access the repository, in the
|
||||
format of an EnvironmentFile as described by {manpage}`systemd.exec(5)`
|
||||
'';
|
||||
};
|
||||
environmentFile = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
file containing the credentials to access the repository, in the
|
||||
format of an EnvironmentFile as described by {manpage}`systemd.exec(5)`
|
||||
'';
|
||||
};
|
||||
|
||||
rcloneOptions = lib.mkOption {
|
||||
type = with lib.types; nullOr (attrsOf (oneOf [ str bool ]));
|
||||
default = null;
|
||||
description = ''
|
||||
Options to pass to rclone to control its behavior.
|
||||
See <https://rclone.org/docs/#options> for
|
||||
available options. When specifying option names, strip the
|
||||
leading `--`. To set a flag such as
|
||||
`--drive-use-trash`, which does not take a value,
|
||||
set the value to the Boolean `true`.
|
||||
'';
|
||||
example = {
|
||||
bwlimit = "10M";
|
||||
drive-use-trash = "true";
|
||||
rcloneOptions = lib.mkOption {
|
||||
type =
|
||||
with lib.types;
|
||||
nullOr (
|
||||
attrsOf (oneOf [
|
||||
str
|
||||
bool
|
||||
])
|
||||
);
|
||||
default = null;
|
||||
description = ''
|
||||
Options to pass to rclone to control its behavior.
|
||||
See <https://rclone.org/docs/#options> for
|
||||
available options. When specifying option names, strip the
|
||||
leading `--`. To set a flag such as
|
||||
`--drive-use-trash`, which does not take a value,
|
||||
set the value to the Boolean `true`.
|
||||
'';
|
||||
example = {
|
||||
bwlimit = "10M";
|
||||
drive-use-trash = "true";
|
||||
};
|
||||
};
|
||||
|
||||
rcloneConfig = lib.mkOption {
|
||||
type =
|
||||
with lib.types;
|
||||
nullOr (
|
||||
attrsOf (oneOf [
|
||||
str
|
||||
bool
|
||||
])
|
||||
);
|
||||
default = null;
|
||||
description = ''
|
||||
Configuration for the rclone remote being used for backup.
|
||||
See the remote's specific options under rclone's docs at
|
||||
<https://rclone.org/docs/>. When specifying
|
||||
option names, use the "config" name specified in the docs.
|
||||
For example, to set `--b2-hard-delete` for a B2
|
||||
remote, use `hard_delete = true` in the
|
||||
attribute set.
|
||||
Warning: Secrets set in here will be world-readable in the Nix
|
||||
store! Consider using the `rcloneConfigFile`
|
||||
option instead to specify secret values separately. Note that
|
||||
options set here will override those set in the config file.
|
||||
'';
|
||||
example = {
|
||||
type = "b2";
|
||||
account = "xxx";
|
||||
key = "xxx";
|
||||
hard_delete = true;
|
||||
};
|
||||
};
|
||||
|
||||
rcloneConfigFile = lib.mkOption {
|
||||
type = with lib.types; nullOr path;
|
||||
default = null;
|
||||
description = ''
|
||||
Path to the file containing rclone configuration. This file
|
||||
must contain configuration for the remote specified in this backup
|
||||
set and also must be readable by root. Options set in
|
||||
`rcloneConfig` will override those set in this
|
||||
file.
|
||||
'';
|
||||
};
|
||||
|
||||
inhibitsSleep = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
example = true;
|
||||
description = ''
|
||||
Prevents the system from sleeping while backing up.
|
||||
'';
|
||||
};
|
||||
|
||||
repository = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
repository to backup to.
|
||||
'';
|
||||
example = "sftp:backup@192.168.1.100:/backups/${name}";
|
||||
};
|
||||
|
||||
repositoryFile = lib.mkOption {
|
||||
type = with lib.types; nullOr path;
|
||||
default = null;
|
||||
description = ''
|
||||
Path to the file containing the repository location to backup to.
|
||||
'';
|
||||
};
|
||||
|
||||
paths = lib.mkOption {
|
||||
# This is nullable for legacy reasons only. We should consider making it a pure listOf
|
||||
# after some time has passed since this comment was added.
|
||||
type = lib.types.nullOr (lib.types.listOf lib.types.str);
|
||||
default = [ ];
|
||||
description = ''
|
||||
Which paths to backup, in addition to ones specified via
|
||||
`dynamicFilesFrom`. If null or an empty array and
|
||||
`dynamicFilesFrom` is also null, no backup command will be run.
|
||||
This can be used to create a prune-only job.
|
||||
'';
|
||||
example = [
|
||||
"/var/lib/postgresql"
|
||||
"/home/user/backup"
|
||||
];
|
||||
};
|
||||
|
||||
exclude = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Patterns to exclude when backing up. See
|
||||
https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files for
|
||||
details on syntax.
|
||||
'';
|
||||
example = [
|
||||
"/var/cache"
|
||||
"/home/*/.cache"
|
||||
".git"
|
||||
];
|
||||
};
|
||||
|
||||
timerConfig = lib.mkOption {
|
||||
type = lib.types.nullOr (lib.types.attrsOf unitOption);
|
||||
default = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
description = ''
|
||||
When to run the backup. See {manpage}`systemd.timer(5)` for
|
||||
details. If null no timer is created and the backup will only
|
||||
run when explicitly started.
|
||||
'';
|
||||
example = {
|
||||
OnCalendar = "00:05";
|
||||
RandomizedDelaySec = "5h";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "root";
|
||||
description = ''
|
||||
As which user the backup should run.
|
||||
'';
|
||||
example = "postgresql";
|
||||
};
|
||||
|
||||
extraBackupArgs = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra arguments passed to restic backup.
|
||||
'';
|
||||
example = [
|
||||
"--exclude-file=/etc/nixos/restic-ignore"
|
||||
];
|
||||
};
|
||||
|
||||
extraOptions = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra extended options to be passed to the restic --option flag.
|
||||
'';
|
||||
example = [
|
||||
"sftp.command='ssh backup@192.168.1.100 -i /home/user/.ssh/id_rsa -s sftp'"
|
||||
];
|
||||
};
|
||||
|
||||
initialize = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Create the repository if it doesn't exist.
|
||||
'';
|
||||
};
|
||||
|
||||
pruneOpts = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
A list of options (--keep-\* et al.) for 'restic forget
|
||||
--prune', to automatically prune old snapshots. The
|
||||
'forget' command is run *after* the 'backup' command, so
|
||||
keep that in mind when constructing the --keep-\* options.
|
||||
'';
|
||||
example = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 75"
|
||||
];
|
||||
};
|
||||
|
||||
runCheck = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = (builtins.length config.services.restic.backups.${name}.checkOpts > 0);
|
||||
defaultText = lib.literalExpression ''builtins.length config.services.backups.${name}.checkOpts > 0'';
|
||||
description = "Whether to run the `check` command with the provided `checkOpts` options.";
|
||||
example = true;
|
||||
};
|
||||
|
||||
checkOpts = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
A list of options for 'restic check'.
|
||||
'';
|
||||
example = [
|
||||
"--with-cache"
|
||||
];
|
||||
};
|
||||
|
||||
dynamicFilesFrom = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
A script that produces a list of files to back up. The
|
||||
results of this command are given to the '--files-from'
|
||||
option. The result is merged with paths specified via `paths`.
|
||||
'';
|
||||
example = "find /home/matt/git -type d -name .git";
|
||||
};
|
||||
|
||||
backupPrepareCommand = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
A script that must run before starting the backup process.
|
||||
'';
|
||||
};
|
||||
|
||||
backupCleanupCommand = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
A script that must run after finishing the backup process.
|
||||
'';
|
||||
};
|
||||
|
||||
package = lib.mkPackageOption pkgs "restic" { };
|
||||
|
||||
createWrapper = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to generate and add a script to the system path, that has the same environment variables set
|
||||
as the systemd service. This can be used to e.g. mount snapshots or perform other opterations, without
|
||||
having to manually specify most options.
|
||||
'';
|
||||
};
|
||||
|
||||
progressFps = lib.mkOption {
|
||||
type = with lib.types; nullOr numbers.nonnegative;
|
||||
default = null;
|
||||
description = ''
|
||||
Controls the frequency of progress reporting.
|
||||
'';
|
||||
example = 0.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
rcloneConfig = lib.mkOption {
|
||||
type = with lib.types; nullOr (attrsOf (oneOf [ str bool ]));
|
||||
default = null;
|
||||
description = ''
|
||||
Configuration for the rclone remote being used for backup.
|
||||
See the remote's specific options under rclone's docs at
|
||||
<https://rclone.org/docs/>. When specifying
|
||||
option names, use the "config" name specified in the docs.
|
||||
For example, to set `--b2-hard-delete` for a B2
|
||||
remote, use `hard_delete = true` in the
|
||||
attribute set.
|
||||
Warning: Secrets set in here will be world-readable in the Nix
|
||||
store! Consider using the `rcloneConfigFile`
|
||||
option instead to specify secret values separately. Note that
|
||||
options set here will override those set in the config file.
|
||||
'';
|
||||
example = {
|
||||
type = "b2";
|
||||
account = "xxx";
|
||||
key = "xxx";
|
||||
hard_delete = true;
|
||||
};
|
||||
};
|
||||
|
||||
rcloneConfigFile = lib.mkOption {
|
||||
type = with lib.types; nullOr path;
|
||||
default = null;
|
||||
description = ''
|
||||
Path to the file containing rclone configuration. This file
|
||||
must contain configuration for the remote specified in this backup
|
||||
set and also must be readable by root. Options set in
|
||||
`rcloneConfig` will override those set in this
|
||||
file.
|
||||
'';
|
||||
};
|
||||
|
||||
inhibitsSleep = lib.mkOption {
|
||||
default = false;
|
||||
type = lib.types.bool;
|
||||
example = true;
|
||||
description = ''
|
||||
Prevents the system from sleeping while backing up.
|
||||
'';
|
||||
};
|
||||
|
||||
repository = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
repository to backup to.
|
||||
'';
|
||||
example = "sftp:backup@192.168.1.100:/backups/${name}";
|
||||
};
|
||||
|
||||
repositoryFile = lib.mkOption {
|
||||
type = with lib.types; nullOr path;
|
||||
default = null;
|
||||
description = ''
|
||||
Path to the file containing the repository location to backup to.
|
||||
'';
|
||||
};
|
||||
|
||||
paths = lib.mkOption {
|
||||
# This is nullable for legacy reasons only. We should consider making it a pure listOf
|
||||
# after some time has passed since this comment was added.
|
||||
type = lib.types.nullOr (lib.types.listOf lib.types.str);
|
||||
default = [ ];
|
||||
description = ''
|
||||
Which paths to backup, in addition to ones specified via
|
||||
`dynamicFilesFrom`. If null or an empty array and
|
||||
`dynamicFilesFrom` is also null, no backup command will be run.
|
||||
This can be used to create a prune-only job.
|
||||
'';
|
||||
example = [
|
||||
"/var/lib/postgresql"
|
||||
"/home/user/backup"
|
||||
];
|
||||
};
|
||||
|
||||
exclude = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Patterns to exclude when backing up. See
|
||||
https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files for
|
||||
details on syntax.
|
||||
'';
|
||||
example = [
|
||||
"/var/cache"
|
||||
"/home/*/.cache"
|
||||
".git"
|
||||
];
|
||||
};
|
||||
|
||||
timerConfig = lib.mkOption {
|
||||
type = lib.types.nullOr (lib.types.attrsOf unitOption);
|
||||
default = {
|
||||
OnCalendar = "daily";
|
||||
Persistent = true;
|
||||
};
|
||||
description = ''
|
||||
When to run the backup. See {manpage}`systemd.timer(5)` for
|
||||
details. If null no timer is created and the backup will only
|
||||
run when explicitly started.
|
||||
'';
|
||||
example = {
|
||||
OnCalendar = "00:05";
|
||||
RandomizedDelaySec = "5h";
|
||||
Persistent = true;
|
||||
};
|
||||
};
|
||||
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "root";
|
||||
description = ''
|
||||
As which user the backup should run.
|
||||
'';
|
||||
example = "postgresql";
|
||||
};
|
||||
|
||||
extraBackupArgs = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra arguments passed to restic backup.
|
||||
'';
|
||||
example = [
|
||||
"--exclude-file=/etc/nixos/restic-ignore"
|
||||
];
|
||||
};
|
||||
|
||||
extraOptions = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
Extra extended options to be passed to the restic --option flag.
|
||||
'';
|
||||
example = [
|
||||
"sftp.command='ssh backup@192.168.1.100 -i /home/user/.ssh/id_rsa -s sftp'"
|
||||
];
|
||||
};
|
||||
|
||||
initialize = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Create the repository if it doesn't exist.
|
||||
'';
|
||||
};
|
||||
|
||||
pruneOpts = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
A list of options (--keep-\* et al.) for 'restic forget
|
||||
--prune', to automatically prune old snapshots. The
|
||||
'forget' command is run *after* the 'backup' command, so
|
||||
keep that in mind when constructing the --keep-\* options.
|
||||
'';
|
||||
example = [
|
||||
"--keep-daily 7"
|
||||
"--keep-weekly 5"
|
||||
"--keep-monthly 12"
|
||||
"--keep-yearly 75"
|
||||
];
|
||||
};
|
||||
|
||||
runCheck = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = (builtins.length config.services.restic.backups.${name}.checkOpts > 0);
|
||||
defaultText = lib.literalExpression ''builtins.length config.services.backups.${name}.checkOpts > 0'';
|
||||
description = "Whether to run the `check` command with the provided `checkOpts` options.";
|
||||
example = true;
|
||||
};
|
||||
|
||||
checkOpts = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
description = ''
|
||||
A list of options for 'restic check'.
|
||||
'';
|
||||
example = [
|
||||
"--with-cache"
|
||||
];
|
||||
};
|
||||
|
||||
dynamicFilesFrom = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
A script that produces a list of files to back up. The
|
||||
results of this command are given to the '--files-from'
|
||||
option. The result is merged with paths specified via `paths`.
|
||||
'';
|
||||
example = "find /home/matt/git -type d -name .git";
|
||||
};
|
||||
|
||||
backupPrepareCommand = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
A script that must run before starting the backup process.
|
||||
'';
|
||||
};
|
||||
|
||||
backupCleanupCommand = lib.mkOption {
|
||||
type = with lib.types; nullOr str;
|
||||
default = null;
|
||||
description = ''
|
||||
A script that must run after finishing the backup process.
|
||||
'';
|
||||
};
|
||||
|
||||
package = lib.mkPackageOption pkgs "restic" { };
|
||||
|
||||
createWrapper = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to generate and add a script to the system path, that has the same environment variables set
|
||||
as the systemd service. This can be used to e.g. mount snapshots or perform other opterations, without
|
||||
having to manually specify most options.
|
||||
'';
|
||||
};
|
||||
};
|
||||
}));
|
||||
}
|
||||
)
|
||||
);
|
||||
default = { };
|
||||
example = {
|
||||
localbackup = {
|
||||
@@ -300,119 +334,142 @@ in
|
||||
assertion = (v.repository == null) != (v.repositoryFile == null);
|
||||
message = "services.restic.backups.${n}: exactly one of repository or repositoryFile should be set";
|
||||
}) config.services.restic.backups;
|
||||
systemd.services =
|
||||
lib.mapAttrs'
|
||||
(name: backup:
|
||||
let
|
||||
extraOptions = lib.concatMapStrings (arg: " -o ${arg}") backup.extraOptions;
|
||||
inhibitCmd = lib.concatStringsSep " " [
|
||||
"${pkgs.systemd}/bin/systemd-inhibit"
|
||||
"--mode='block'"
|
||||
"--who='restic'"
|
||||
"--what='sleep'"
|
||||
"--why=${lib.escapeShellArg "Scheduled backup ${name}"} "
|
||||
];
|
||||
resticCmd = "${lib.optionalString backup.inhibitsSleep inhibitCmd}${backup.package}/bin/restic${extraOptions}";
|
||||
excludeFlags = lib.optional (backup.exclude != []) "--exclude-file=${pkgs.writeText "exclude-patterns" (lib.concatStringsSep "\n" backup.exclude)}";
|
||||
filesFromTmpFile = "/run/restic-backups-${name}/includes";
|
||||
doBackup = (backup.dynamicFilesFrom != null) || (backup.paths != null && backup.paths != []);
|
||||
pruneCmd = lib.optionals (builtins.length backup.pruneOpts > 0) [
|
||||
(resticCmd + " forget --prune " + (lib.concatStringsSep " " backup.pruneOpts))
|
||||
];
|
||||
checkCmd = lib.optionals backup.runCheck [
|
||||
(resticCmd + " check " + (lib.concatStringsSep " " backup.checkOpts))
|
||||
];
|
||||
# Helper functions for rclone remotes
|
||||
rcloneRemoteName = builtins.elemAt (lib.splitString ":" backup.repository) 1;
|
||||
rcloneAttrToOpt = v: "RCLONE_" + lib.toUpper (builtins.replaceStrings [ "-" ] [ "_" ] v);
|
||||
rcloneAttrToConf = v: "RCLONE_CONFIG_" + lib.toUpper (rcloneRemoteName + "_" + v);
|
||||
toRcloneVal = v: if lib.isBool v then lib.boolToString v else v;
|
||||
in
|
||||
lib.nameValuePair "restic-backups-${name}" ({
|
||||
environment = {
|
||||
systemd.services = lib.mapAttrs' (
|
||||
name: backup:
|
||||
let
|
||||
extraOptions = lib.concatMapStrings (arg: " -o ${arg}") backup.extraOptions;
|
||||
inhibitCmd = lib.concatStringsSep " " [
|
||||
"${pkgs.systemd}/bin/systemd-inhibit"
|
||||
"--mode='block'"
|
||||
"--who='restic'"
|
||||
"--what='sleep'"
|
||||
"--why=${lib.escapeShellArg "Scheduled backup ${name}"} "
|
||||
];
|
||||
resticCmd = "${lib.optionalString backup.inhibitsSleep inhibitCmd}${backup.package}/bin/restic${extraOptions}";
|
||||
excludeFlags = lib.optional (
|
||||
backup.exclude != [ ]
|
||||
) "--exclude-file=${pkgs.writeText "exclude-patterns" (lib.concatStringsSep "\n" backup.exclude)}";
|
||||
filesFromTmpFile = "/run/restic-backups-${name}/includes";
|
||||
doBackup = (backup.dynamicFilesFrom != null) || (backup.paths != null && backup.paths != [ ]);
|
||||
pruneCmd = lib.optionals (builtins.length backup.pruneOpts > 0) [
|
||||
(resticCmd + " forget --prune " + (lib.concatStringsSep " " backup.pruneOpts))
|
||||
];
|
||||
checkCmd = lib.optionals backup.runCheck [
|
||||
(resticCmd + " check " + (lib.concatStringsSep " " backup.checkOpts))
|
||||
];
|
||||
# Helper functions for rclone remotes
|
||||
rcloneRemoteName = builtins.elemAt (lib.splitString ":" backup.repository) 1;
|
||||
rcloneAttrToOpt = v: "RCLONE_" + lib.toUpper (builtins.replaceStrings [ "-" ] [ "_" ] v);
|
||||
rcloneAttrToConf = v: "RCLONE_CONFIG_" + lib.toUpper (rcloneRemoteName + "_" + v);
|
||||
toRcloneVal = v: if lib.isBool v then lib.boolToString v else v;
|
||||
in
|
||||
lib.nameValuePair "restic-backups-${name}" (
|
||||
{
|
||||
environment =
|
||||
{
|
||||
# not %C, because that wouldn't work in the wrapper script
|
||||
RESTIC_CACHE_DIR = "/var/cache/restic-backups-${name}";
|
||||
RESTIC_PASSWORD_FILE = backup.passwordFile;
|
||||
RESTIC_REPOSITORY = backup.repository;
|
||||
RESTIC_REPOSITORY_FILE = backup.repositoryFile;
|
||||
} // lib.optionalAttrs (backup.rcloneOptions != null) (lib.mapAttrs'
|
||||
(name: value:
|
||||
lib.nameValuePair (rcloneAttrToOpt name) (toRcloneVal value)
|
||||
)
|
||||
backup.rcloneOptions) // lib.optionalAttrs (backup.rcloneConfigFile != null) {
|
||||
}
|
||||
// lib.optionalAttrs (backup.rcloneOptions != null) (
|
||||
lib.mapAttrs' (
|
||||
name: value: lib.nameValuePair (rcloneAttrToOpt name) (toRcloneVal value)
|
||||
) backup.rcloneOptions
|
||||
)
|
||||
// lib.optionalAttrs (backup.rcloneConfigFile != null) {
|
||||
RCLONE_CONFIG = backup.rcloneConfigFile;
|
||||
} // lib.optionalAttrs (backup.rcloneConfig != null) (lib.mapAttrs'
|
||||
(name: value:
|
||||
lib.nameValuePair (rcloneAttrToConf name) (toRcloneVal value)
|
||||
)
|
||||
backup.rcloneConfig);
|
||||
path = [ config.programs.ssh.package ];
|
||||
restartIfChanged = false;
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
serviceConfig = {
|
||||
}
|
||||
// lib.optionalAttrs (backup.rcloneConfig != null) (
|
||||
lib.mapAttrs' (
|
||||
name: value: lib.nameValuePair (rcloneAttrToConf name) (toRcloneVal value)
|
||||
) backup.rcloneConfig
|
||||
)
|
||||
// lib.optionalAttrs (backup.progressFps != null) {
|
||||
RESTIC_PROGRESS_FPS = toString backup.progressFps;
|
||||
};
|
||||
path = [ config.programs.ssh.package ];
|
||||
restartIfChanged = false;
|
||||
wants = [ "network-online.target" ];
|
||||
after = [ "network-online.target" ];
|
||||
serviceConfig =
|
||||
{
|
||||
Type = "oneshot";
|
||||
ExecStart = (lib.optionals doBackup [ "${resticCmd} backup ${lib.concatStringsSep " " (backup.extraBackupArgs ++ excludeFlags)} --files-from=${filesFromTmpFile}" ])
|
||||
++ pruneCmd ++ checkCmd;
|
||||
ExecStart =
|
||||
(lib.optionals doBackup [
|
||||
"${resticCmd} backup ${
|
||||
lib.concatStringsSep " " (backup.extraBackupArgs ++ excludeFlags)
|
||||
} --files-from=${filesFromTmpFile}"
|
||||
])
|
||||
++ pruneCmd
|
||||
++ checkCmd;
|
||||
User = backup.user;
|
||||
RuntimeDirectory = "restic-backups-${name}";
|
||||
CacheDirectory = "restic-backups-${name}";
|
||||
CacheDirectoryMode = "0700";
|
||||
PrivateTmp = true;
|
||||
} // lib.optionalAttrs (backup.environmentFile != null) {
|
||||
}
|
||||
// lib.optionalAttrs (backup.environmentFile != null) {
|
||||
EnvironmentFile = backup.environmentFile;
|
||||
};
|
||||
} // lib.optionalAttrs (backup.initialize || doBackup || backup.backupPrepareCommand != null) {
|
||||
preStart = ''
|
||||
${lib.optionalString (backup.backupPrepareCommand != null) ''
|
||||
${pkgs.writeScript "backupPrepareCommand" backup.backupPrepareCommand}
|
||||
''}
|
||||
${lib.optionalString (backup.initialize) ''
|
||||
${resticCmd} cat config > /dev/null || ${resticCmd} init
|
||||
''}
|
||||
${lib.optionalString (backup.paths != null && backup.paths != []) ''
|
||||
cat ${pkgs.writeText "staticPaths" (lib.concatLines backup.paths)} >> ${filesFromTmpFile}
|
||||
''}
|
||||
${lib.optionalString (backup.dynamicFilesFrom != null) ''
|
||||
${pkgs.writeScript "dynamicFilesFromScript" backup.dynamicFilesFrom} >> ${filesFromTmpFile}
|
||||
''}
|
||||
'';
|
||||
} // lib.optionalAttrs (doBackup || backup.backupCleanupCommand != null) {
|
||||
postStop = ''
|
||||
${lib.optionalString (backup.backupCleanupCommand != null) ''
|
||||
${pkgs.writeScript "backupCleanupCommand" backup.backupCleanupCommand}
|
||||
''}
|
||||
${lib.optionalString doBackup ''
|
||||
rm ${filesFromTmpFile}
|
||||
''}
|
||||
'';
|
||||
})
|
||||
)
|
||||
config.services.restic.backups;
|
||||
systemd.timers =
|
||||
lib.mapAttrs'
|
||||
(name: backup: lib.nameValuePair "restic-backups-${name}" {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = backup.timerConfig;
|
||||
})
|
||||
(lib.filterAttrs (_: backup: backup.timerConfig != null) config.services.restic.backups);
|
||||
}
|
||||
// lib.optionalAttrs (backup.initialize || doBackup || backup.backupPrepareCommand != null) {
|
||||
preStart = ''
|
||||
${lib.optionalString (backup.backupPrepareCommand != null) ''
|
||||
${pkgs.writeScript "backupPrepareCommand" backup.backupPrepareCommand}
|
||||
''}
|
||||
${lib.optionalString (backup.initialize) ''
|
||||
${resticCmd} cat config > /dev/null || ${resticCmd} init
|
||||
''}
|
||||
${lib.optionalString (backup.paths != null && backup.paths != [ ]) ''
|
||||
cat ${pkgs.writeText "staticPaths" (lib.concatLines backup.paths)} >> ${filesFromTmpFile}
|
||||
''}
|
||||
${lib.optionalString (backup.dynamicFilesFrom != null) ''
|
||||
${pkgs.writeScript "dynamicFilesFromScript" backup.dynamicFilesFrom} >> ${filesFromTmpFile}
|
||||
''}
|
||||
'';
|
||||
}
|
||||
// lib.optionalAttrs (doBackup || backup.backupCleanupCommand != null) {
|
||||
postStop = ''
|
||||
${lib.optionalString (backup.backupCleanupCommand != null) ''
|
||||
${pkgs.writeScript "backupCleanupCommand" backup.backupCleanupCommand}
|
||||
''}
|
||||
${lib.optionalString doBackup ''
|
||||
rm ${filesFromTmpFile}
|
||||
''}
|
||||
'';
|
||||
}
|
||||
)
|
||||
) config.services.restic.backups;
|
||||
systemd.timers = lib.mapAttrs' (
|
||||
name: backup:
|
||||
lib.nameValuePair "restic-backups-${name}" {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = backup.timerConfig;
|
||||
}
|
||||
) (lib.filterAttrs (_: backup: backup.timerConfig != null) config.services.restic.backups);
|
||||
|
||||
# generate wrapper scripts, as described in the createWrapper option
|
||||
environment.systemPackages = lib.mapAttrsToList (name: backup: let
|
||||
extraOptions = lib.concatMapStrings (arg: " -o ${arg}") backup.extraOptions;
|
||||
resticCmd = "${backup.package}/bin/restic${extraOptions}";
|
||||
in pkgs.writeShellScriptBin "restic-${name}" ''
|
||||
set -a # automatically export variables
|
||||
${lib.optionalString (backup.environmentFile != null) "source ${backup.environmentFile}"}
|
||||
# set same environment variables as the systemd service
|
||||
${lib.pipe config.systemd.services."restic-backups-${name}".environment [
|
||||
(lib.filterAttrs (n: v: v != null && n != "PATH"))
|
||||
(lib.mapAttrsToList (n: v: "${n}=${v}"))
|
||||
(lib.concatStringsSep "\n")
|
||||
]}
|
||||
PATH=${config.systemd.services."restic-backups-${name}".environment.PATH}:$PATH
|
||||
environment.systemPackages = lib.mapAttrsToList (
|
||||
name: backup:
|
||||
let
|
||||
extraOptions = lib.concatMapStrings (arg: " -o ${arg}") backup.extraOptions;
|
||||
resticCmd = "${backup.package}/bin/restic${extraOptions}";
|
||||
in
|
||||
pkgs.writeShellScriptBin "restic-${name}" ''
|
||||
set -a # automatically export variables
|
||||
${lib.optionalString (backup.environmentFile != null) "source ${backup.environmentFile}"}
|
||||
# set same environment variables as the systemd service
|
||||
${lib.pipe config.systemd.services."restic-backups-${name}".environment [
|
||||
(lib.filterAttrs (n: v: v != null && n != "PATH"))
|
||||
(lib.mapAttrsToList (n: v: "${n}=${v}"))
|
||||
(lib.concatStringsSep "\n")
|
||||
]}
|
||||
PATH=${config.systemd.services."restic-backups-${name}".environment.PATH}:$PATH
|
||||
|
||||
exec ${resticCmd} "$@"
|
||||
'') (lib.filterAttrs (_: v: v.createWrapper) config.services.restic.backups);
|
||||
exec ${resticCmd} "$@"
|
||||
''
|
||||
) (lib.filterAttrs (_: v: v.createWrapper) config.services.restic.backups);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ let
|
||||
NoNewPrivileges = true;
|
||||
PrivateUsers = true;
|
||||
PrivateTmp = true;
|
||||
PrivateDevices = true;
|
||||
PrivateDevices = cfg.accelerationDevices == [ ];
|
||||
DeviceAllow = mkIf (cfg.accelerationDevices != null) cfg.accelerationDevices;
|
||||
PrivateMounts = true;
|
||||
ProtectClock = true;
|
||||
ProtectControlGroups = true;
|
||||
@@ -161,6 +162,17 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
accelerationDevices = mkOption {
|
||||
type = types.nullOr (types.listOf types.str);
|
||||
default = [ ];
|
||||
example = [ "/dev/dri/renderD128" ];
|
||||
description = ''
|
||||
A list of device paths to hardware acceleration devices that immich should
|
||||
have access to. This is useful when transcoding media files.
|
||||
The special value `[ ]` will disallow all devices using `PrivateDevices`. `null` will give access to all devices.
|
||||
'';
|
||||
};
|
||||
|
||||
database = {
|
||||
enable =
|
||||
mkEnableOption "the postgresql database for use with immich. See {option}`services.postgresql`"
|
||||
|
||||
@@ -1314,6 +1314,18 @@ final: prev:
|
||||
meta.homepage = "https://github.com/ribru17/blink-cmp-spell/";
|
||||
};
|
||||
|
||||
blink-cmp-git = buildVimPlugin {
|
||||
pname = "blink-cmp-git";
|
||||
version = "2025-01-27";
|
||||
src = fetchFromGitHub {
|
||||
owner = "Kaiser-Yang";
|
||||
repo = "blink-cmp-git";
|
||||
rev = "7c6cfa3d427f50a6eae5c38628b31b8675bab05d";
|
||||
sha256 = "08hfwnjgsl88bkphpdxkdswdnc10mlxpsrk084kgzk4j19w55gyq";
|
||||
};
|
||||
meta.homepage = "https://github.com/Kaiser-Yang/blink-cmp-git/";
|
||||
};
|
||||
|
||||
blink-compat = buildVimPlugin {
|
||||
pname = "blink.compat";
|
||||
version = "2025-01-20";
|
||||
@@ -3019,6 +3031,18 @@ final: prev:
|
||||
meta.homepage = "https://github.com/hat0uma/csvview.nvim/";
|
||||
};
|
||||
|
||||
ctags-lsp-nvim = buildVimPlugin {
|
||||
pname = "ctags-lsp.nvim";
|
||||
version = "2024-12-08";
|
||||
src = fetchFromGitHub {
|
||||
owner = "netmute";
|
||||
repo = "ctags-lsp.nvim";
|
||||
rev = "aaae7b5d8dc7aeb836c63301b8eb7311af49bb2a";
|
||||
sha256 = "06h388vkp8nv15wbh96pza85994xf979s7kjqrli4s6y5ygw6m02";
|
||||
};
|
||||
meta.homepage = "https://github.com/netmute/ctags-lsp.nvim/";
|
||||
};
|
||||
|
||||
ctrlp-cmatcher = buildVimPlugin {
|
||||
pname = "ctrlp-cmatcher";
|
||||
version = "2015-10-15";
|
||||
|
||||
@@ -296,6 +296,10 @@ in
|
||||
dependencies = [ self.blink-cmp ];
|
||||
};
|
||||
|
||||
blink-cmp-git = super.blink-cmp-git.overrideAttrs {
|
||||
dependencies = [ self.plenary-nvim ];
|
||||
};
|
||||
|
||||
bluloco-nvim = super.bluloco-nvim.overrideAttrs {
|
||||
dependencies = [ self.lush-nvim ];
|
||||
};
|
||||
|
||||
@@ -106,6 +106,7 @@ https://github.com/max397574/better-escape.nvim/,,
|
||||
https://github.com/LunarVim/bigfile.nvim/,,
|
||||
https://github.com/APZelos/blamer.nvim/,HEAD,
|
||||
https://github.com/giuxtaposition/blink-cmp-copilot/,HEAD,
|
||||
https://github.com/Kaiser-Yang/blink-cmp-git/,HEAD,
|
||||
https://github.com/ribru17/blink-cmp-spell/,HEAD,
|
||||
https://github.com/fang2hou/blink-copilot/,HEAD,
|
||||
https://github.com/moyiz/blink-emoji.nvim/,HEAD,
|
||||
@@ -249,6 +250,7 @@ https://github.com/Decodetalkers/csharpls-extended-lsp.nvim/,HEAD,
|
||||
https://github.com/davidmh/cspell.nvim/,HEAD,
|
||||
https://github.com/chrisbra/csv.vim/,,
|
||||
https://github.com/hat0uma/csvview.nvim/,HEAD,
|
||||
https://github.com/netmute/ctags-lsp.nvim/,HEAD,
|
||||
https://github.com/JazzCore/ctrlp-cmatcher/,,
|
||||
https://github.com/FelikZ/ctrlp-py-matcher/,,
|
||||
https://github.com/amiorin/ctrlp-z/,,
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
{
|
||||
pkgsi686Linux,
|
||||
lib,
|
||||
stdenv,
|
||||
fetchurl,
|
||||
dpkg,
|
||||
makeWrapper,
|
||||
ghostscript,
|
||||
file,
|
||||
gnused,
|
||||
gnugrep,
|
||||
coreutils,
|
||||
which,
|
||||
perl,
|
||||
}:
|
||||
let
|
||||
version = "1.0.2-0";
|
||||
model = "dcpl3550cdw";
|
||||
interpreter = "${pkgsi686Linux.stdenv.cc.libc}/lib/ld-linux.so.2";
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
pname = "cups-brother-${model}";
|
||||
inherit version;
|
||||
src = fetchurl {
|
||||
url = "https://download.brother.com/welcome/dlf103919/dcpl3550cdwpdrv-${version}.i386.deb";
|
||||
hash = "sha256-FbtqISK3f1q1+JXJ+RP5O/8G0ZW9gcCS7OI0YRljwyY=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
dpkg
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
unpackPhase = ''
|
||||
runHook preUnpack
|
||||
|
||||
dpkg-deb -x $src $out
|
||||
|
||||
runHook postUnpack
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/${model}/lpd/filter_${model} \
|
||||
--replace-fail /usr/bin/perl ${lib.getExe perl} \
|
||||
--replace-fail "PRINTER =~" "PRINTER = \"${model}\"; #" \
|
||||
--replace-fail "BR_PRT_PATH =~" "BR_PRT_PATH = \"$out/opt/brother/Printers/${model}/\"; #"
|
||||
|
||||
substituteInPlace $out/opt/brother/Printers/${model}/cupswrapper/brother_lpdwrapper_${model} \
|
||||
--replace-fail /usr/bin/perl ${lib.getExe perl} \
|
||||
--replace-fail "basedir =~ " "basedir = \"$out/opt/brother/Printers/${model}/\"; #" \
|
||||
--replace-fail "PRINTER =~ " "PRINTER = \"${model}\"; #" \
|
||||
--replace-fail "LPDCONFIGEXE=" "LPDCONFIGEXE=\"$out/usr/bin/brprintconf_\"; #"
|
||||
|
||||
patchelf --set-interpreter ${interpreter} $out/opt/brother/Printers/${model}/lpd/br${model}filter
|
||||
patchelf --set-interpreter ${interpreter} $out/usr/bin/brprintconf_${model}
|
||||
|
||||
mkdir -p $out/lib/cups/filter $out/share/cups/model
|
||||
ln -s $out/opt/brother/Printers/${model}/lpd/filter_${model} $out/lib/cups/filter/brlpdwrapper${model}
|
||||
ln -s $out/opt/brother/Printers/${model}/cupswrapper/brother_lpdwrapper_${model} $out/lib/cups/filter/brother_lpdwrapper_${model}
|
||||
ln -s $out/opt/brother/Printers/${model}/cupswrapper/brother_${model}_printer_en.ppd $out/share/cups/model/brother_${model}_printer_en.ppd
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram $out/opt/brother/Printers/${model}/lpd/filter_${model} \
|
||||
--prefix PATH ":" ${
|
||||
lib.makeBinPath [
|
||||
ghostscript
|
||||
file
|
||||
gnused
|
||||
gnugrep
|
||||
coreutils
|
||||
which
|
||||
]
|
||||
}
|
||||
wrapProgram $out/opt/brother/Printers/${model}/cupswrapper/brother_lpdwrapper_${model} \
|
||||
--prefix PATH ":" ${
|
||||
lib.makeBinPath [
|
||||
gnugrep
|
||||
coreutils
|
||||
]
|
||||
}
|
||||
wrapProgram $out/usr/bin/brprintconf_${model} \
|
||||
--set LD_PRELOAD "${pkgsi686Linux.libredirect}/lib/libredirect.so" \
|
||||
--set NIX_REDIRECTS /opt=$out/opt
|
||||
wrapProgram $out/opt/brother/Printers/${model}/lpd/br${model}filter \
|
||||
--set LD_PRELOAD "${pkgsi686Linux.libredirect}/lib/libredirect.so" \
|
||||
--set NIX_REDIRECTS /opt=$out/opt
|
||||
'';
|
||||
|
||||
meta = {
|
||||
homepage = "https://www.brother.com/";
|
||||
downloadPage = "https://support.brother.com/g/b/downloadlist.aspx?c=eu_ot&lang=en&prod=${model}_eu&os=128";
|
||||
description = "Brother DCP-L3550CDW printer driver";
|
||||
license = with lib.licenses; [
|
||||
unfreeRedistributable
|
||||
gpl2Only
|
||||
];
|
||||
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
||||
platforms = [
|
||||
"x86_64-linux"
|
||||
"i686-linux"
|
||||
];
|
||||
maintainers = with lib.maintainers; [ Tert0 ];
|
||||
};
|
||||
}
|
||||
@@ -22,11 +22,11 @@ rustPlatform.buildRustPackage {
|
||||
owner = "imvaskel";
|
||||
repo = "soteria";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-CinJEzH4GsCAzU8FiInulPHLm73KI4nLlAcskkjgeJM=";
|
||||
hash = "sha256-T6bJOXSXFWZYAxZ+nTDu+H8Wi75QRKddXkXdSOPwHbI=";
|
||||
};
|
||||
|
||||
useFetchCargoVendor = true;
|
||||
cargoHash = "sha256-inesrYFVIRIcckYWjFCG1dYyhLBInC8ODFEXwXgMjb4=";
|
||||
cargoHash = "sha256-5f915lrymOwg5bPsTp6sxKikCcTpbeia1fQzKnLYGOs=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
pkg-config
|
||||
|
||||
@@ -6,16 +6,16 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "tgpt";
|
||||
version = "2.7.4";
|
||||
version = "2.9.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "aandrew-me";
|
||||
repo = "tgpt";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-Nk+iLsTXnw6RAc1VztW8ZqeUVsywFjMCOBY2yuWbUXQ=";
|
||||
hash = "sha256-8R6rb4GvSf4nw78Yxcuh9Vct/qUTkQNatRolT1m7JR4=";
|
||||
};
|
||||
|
||||
vendorHash = "sha256-docq/r6yyMPsuUyFbtCMaYfEVL0gLmyTy4PbrAemR00=";
|
||||
vendorHash = "sha256-HObEC0SqSHJOgiJxlniN4yJ3U8ksv1HeiMhtOiZRq50=";
|
||||
|
||||
ldflags = [
|
||||
"-s"
|
||||
@@ -25,14 +25,15 @@ buildGoModule rec {
|
||||
preCheck = ''
|
||||
# Remove test which need network access
|
||||
rm providers/koboldai/koboldai_test.go
|
||||
rm providers/phind/phind_test.go
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
description = "ChatGPT in terminal without needing API keys";
|
||||
homepage = "https://github.com/aandrew-me/tgpt";
|
||||
changelog = "https://github.com/aandrew-me/tgpt/releases/tag/v${version}";
|
||||
license = licenses.gpl3Only;
|
||||
maintainers = with maintainers; [ fab ];
|
||||
license = lib.licenses.gpl3Only;
|
||||
maintainers = with lib.maintainers; [ fab ];
|
||||
mainProgram = "tgpt";
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "volatility3";
|
||||
version = "2.8.0";
|
||||
version = "2.11.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "volatilityfoundation";
|
||||
repo = "volatility3";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-XMoVfT1Wd8r684y4crTOjW9GklSTkivOGv1Ii10KzII=";
|
||||
hash = "sha256-X2cTZaEUQm7bE0k2ve4vKj0k1N6zeLXfDzhWm32diVY=";
|
||||
};
|
||||
|
||||
build-system = with python3.pkgs; [
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
rustPlatform,
|
||||
cmake,
|
||||
installShellFiles,
|
||||
testers,
|
||||
yara-x,
|
||||
@@ -11,20 +10,19 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "yara-x";
|
||||
version = "0.12.0";
|
||||
version = "0.13.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "VirusTotal";
|
||||
repo = "yara-x";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-gIYqWRJI/IZwEyc1Fke/CD8PPoSZvwtvOT0rnK+LFIo=";
|
||||
hash = "sha256-ZSJHvpRZO6Tbw7Ct4oD6QmuV4mJ4RGW5gnT6PTX+nC8=";
|
||||
};
|
||||
|
||||
useFetchCargoVendor = true;
|
||||
cargoHash = "sha256-w/jMrWu/JKhrlI5Ux+6UNkIgnVpxJtTX2LU+wP+kYFY=";
|
||||
cargoHash = "sha256-pD4qyw+TTpmcoX1N3C65VelYszYifm9sFOsEkXEysvo=";
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
installShellFiles
|
||||
];
|
||||
|
||||
|
||||
@@ -13,16 +13,16 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "aiosmtplib";
|
||||
version = "3.0.2";
|
||||
version = "4.0.0";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
disabled = pythonOlder "3.9";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cole";
|
||||
repo = "aiosmtplib";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-1GuxlgNvzVv6hEQY1Mkv7NxAoOik9gpIS90a6flfC+k=";
|
||||
hash = "sha256-Bj5wkNaNm9ojjffsS4nNKUucwbitvApIK1Ux88MSOoE=";
|
||||
};
|
||||
|
||||
build-system = [ hatchling ];
|
||||
@@ -41,7 +41,7 @@ buildPythonPackage rec {
|
||||
description = "Module which provides a SMTP client";
|
||||
homepage = "https://github.com/cole/aiosmtplib";
|
||||
changelog = "https://github.com/cole/aiosmtplib/releases/tag/v${version}";
|
||||
license = with licenses; [ mit ];
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ fab ];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -359,7 +359,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "boto3-stubs";
|
||||
version = "1.36.10";
|
||||
version = "1.36.11";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@@ -367,7 +367,7 @@ buildPythonPackage rec {
|
||||
src = fetchPypi {
|
||||
pname = "boto3_stubs";
|
||||
inherit version;
|
||||
hash = "sha256-/fgvvifEuQnfEwgJIv4nsuVlv1tUa/7JgF5m6YPBtdk=";
|
||||
hash = "sha256-tBzTzvXEQvL3fRCkYJ//qowiMjKzYRVK9nT1WWUfcIk=";
|
||||
};
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "botocore-stubs";
|
||||
version = "1.36.10";
|
||||
version = "1.36.11";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
@@ -18,7 +18,7 @@ buildPythonPackage rec {
|
||||
src = fetchPypi {
|
||||
pname = "botocore_stubs";
|
||||
inherit version;
|
||||
hash = "sha256-Jubwgr4mJigOgCEAK1u1j4DffOmtXgF5AaAxv0FBe4c=";
|
||||
hash = "sha256-TBjwmUJURW+DTQEp7R9JQhyM2ABHxOXbkAcPafDm89I=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ setuptools ];
|
||||
|
||||
@@ -6,14 +6,15 @@
|
||||
fetchFromGitHub,
|
||||
poetry-core,
|
||||
pythonOlder,
|
||||
unittestCheckHook,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "enturclient";
|
||||
version = "0.2.4";
|
||||
disabled = pythonOlder "3.8";
|
||||
pyproject = true;
|
||||
|
||||
format = "pyproject";
|
||||
disabled = pythonOlder "3.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "hfurubotten";
|
||||
@@ -22,23 +23,27 @@ buildPythonPackage rec {
|
||||
hash = "sha256-Y2sBPikCAxumylP1LUy8XgjBRCWaNryn5XHSrRjJIIo=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ poetry-core ];
|
||||
build-system = [ poetry-core ];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
dependencies = [
|
||||
aiohttp
|
||||
async-timeout
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace 'async_timeout = "^3.0.1"' 'async_timeout = ">=3.0.1"'
|
||||
'';
|
||||
|
||||
# Project has no tests
|
||||
doCheck = false;
|
||||
pythonRelaxDeps = [
|
||||
"async_timeout"
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "enturclient" ];
|
||||
|
||||
nativeCheckInputs = [
|
||||
unittestCheckHook
|
||||
];
|
||||
|
||||
unittestFlagsArray = [
|
||||
"tests/dto/"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Python library for interacting with the Entur.org API";
|
||||
homepage = "https://github.com/hfurubotten/enturclient";
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
lib,
|
||||
buildPythonPackage,
|
||||
fetchPypi,
|
||||
pythonAtLeast,
|
||||
setuptools,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pynfsclient";
|
||||
version = "0.1.5";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonAtLeast "3.13";
|
||||
|
||||
src = fetchPypi {
|
||||
pname = "pyNfsClient";
|
||||
inherit version;
|
||||
hash = "sha256-xgZL08NlMCpSkALQwklh7Xq16bK2Sm2hAynbrIWsgaU=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
# HISTORY.md is missing
|
||||
substituteInPlace setup.py \
|
||||
--replace-fail "HISTORY.md" "README.rst"
|
||||
'';
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
# Module has no tests
|
||||
doCheck = false;
|
||||
|
||||
pythonImportsCheck = [ "pyNfsClient" ];
|
||||
|
||||
meta = {
|
||||
description = "Pure python NFS client";
|
||||
homepage = "https://pypi.org/project/pyNfsClient/";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ fab ];
|
||||
};
|
||||
}
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "checkov";
|
||||
version = "3.2.360";
|
||||
version = "3.2.361";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "bridgecrewio";
|
||||
repo = "checkov";
|
||||
tag = version;
|
||||
hash = "sha256-kFLtEVbj0XTa19MOS0di6bHBMHeHH4b9+H/iHqV39kU=";
|
||||
hash = "sha256-7w8oAIBAgYH/TXNnAVKC6E3AT37WJDSSgnpAeRfY4vA=";
|
||||
};
|
||||
|
||||
patches = [ ./flake8-compat-5.x.patch ];
|
||||
|
||||
@@ -1342,7 +1342,8 @@ let
|
||||
ACPI_HOTPLUG_CPU = yes;
|
||||
ACPI_HOTPLUG_MEMORY = yes;
|
||||
MEMORY_HOTPLUG = yes;
|
||||
MEMORY_HOTPLUG_DEFAULT_ONLINE = yes;
|
||||
MEMORY_HOTPLUG_DEFAULT_ONLINE = whenOlder "6.14" yes;
|
||||
MHP_DEFAULT_ONLINE_TYPE_ONLINE_AUTO = whenAtLeast "6.14" yes;
|
||||
MEMORY_HOTREMOVE = yes;
|
||||
HOTPLUG_CPU = yes;
|
||||
MIGRATION = yes;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"testing": {
|
||||
"version": "6.13-rc7",
|
||||
"hash": "sha256:12c9bd0ikppkdpqmvg7g2062s60ks9p0qxx1jis29wl9swr74120"
|
||||
"version": "6.14-rc1",
|
||||
"hash": "sha256:0schcgij7kdzj0zb6g3sjf32mq7s388hysrfzjzi5g1y3py21igk"
|
||||
},
|
||||
"6.1": {
|
||||
"version": "6.1.128",
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
linux,
|
||||
scripts ? fetchsvn {
|
||||
url = "https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/";
|
||||
rev = "19683";
|
||||
sha256 = "1xp4vslbvvwys2pmms3y9phxwc7gnar3zvbwbgbp9vgjq0bsadjw";
|
||||
rev = "19707";
|
||||
sha256 = "1ixvavd9rhhwfnyvkdnyyjwckdijh02xppl0sjv1vw9i0jn1s1l2";
|
||||
},
|
||||
...
|
||||
}@args:
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
}@args:
|
||||
|
||||
let
|
||||
version = "5.10.231-rt123"; # updated by ./update-rt.sh
|
||||
version = "5.10.233-rt125"; # updated by ./update-rt.sh
|
||||
branch = lib.versions.majorMinor version;
|
||||
kversion = builtins.elemAt (lib.splitString "-" version) 0;
|
||||
in
|
||||
@@ -25,7 +25,7 @@ buildLinux (
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://kernel/linux/kernel/v5.x/linux-${kversion}.tar.xz";
|
||||
sha256 = "0xcnlz5ib4b368z5cyp4qwys3jsbm18wlvwn73rzj2j6rj1lhnjn";
|
||||
sha256 = "0lkz2g8r032f027j3gih3f7crx991mrpng9qgqc5k4cc1wl5g7i3";
|
||||
};
|
||||
|
||||
kernelPatches =
|
||||
@@ -34,7 +34,7 @@ buildLinux (
|
||||
name = "rt";
|
||||
patch = fetchurl {
|
||||
url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz";
|
||||
sha256 = "01ibh8krzmwdh7229fc3ajbg1mlmd4sv969px6nh7z8fvpb60lfn";
|
||||
sha256 = "1cx91p88h169v69lxz7vbjjnxdzdz9v28liypz099xghibwhcwfh";
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
}@args:
|
||||
|
||||
let
|
||||
version = "5.15.173-rt82"; # updated by ./update-rt.sh
|
||||
version = "5.15.177-rt83"; # updated by ./update-rt.sh
|
||||
branch = lib.versions.majorMinor version;
|
||||
kversion = builtins.elemAt (lib.splitString "-" version) 0;
|
||||
in
|
||||
@@ -29,7 +29,7 @@ buildLinux (
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://kernel/linux/kernel/v5.x/linux-${kversion}.tar.xz";
|
||||
sha256 = "1a3x3ld6g7ny0hdfqfvj5j2i5sx5l5p236pdnsr0icn9ri3jljwa";
|
||||
sha256 = "1q56w3lqwi3ynny6z7siqzv3h8nryksyw70r3fhghca2il4bi7pa";
|
||||
};
|
||||
|
||||
kernelPatches =
|
||||
@@ -38,7 +38,7 @@ buildLinux (
|
||||
name = "rt";
|
||||
patch = fetchurl {
|
||||
url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz";
|
||||
sha256 = "1xykbqkj4pqd7rdqnjk91mbdia3lxlng3c2nz7lnhhjnbva6b3vw";
|
||||
sha256 = "1rc0cbc5jkgr3q3q2syqidak744lxcq3f5zdq6si2rsfxjz45www";
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
}@args:
|
||||
|
||||
let
|
||||
version = "6.1.120-rt47"; # updated by ./update-rt.sh
|
||||
version = "6.1.127-rt48"; # updated by ./update-rt.sh
|
||||
branch = lib.versions.majorMinor version;
|
||||
kversion = builtins.elemAt (lib.splitString "-" version) 0;
|
||||
in
|
||||
@@ -29,7 +29,7 @@ buildLinux (
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://kernel/linux/kernel/v6.x/linux-${kversion}.tar.xz";
|
||||
sha256 = "06gp5fdq0bc39hd8mf9mrdrygdybdr3nzsb58lcapf5vmjw9gjb1";
|
||||
sha256 = "0xkqpwhvz6qhaxzg1j993lv1iyvb2zydgq6d8mhdbfkz38fx9c0q";
|
||||
};
|
||||
|
||||
kernelPatches =
|
||||
@@ -38,7 +38,7 @@ buildLinux (
|
||||
name = "rt";
|
||||
patch = fetchurl {
|
||||
url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz";
|
||||
sha256 = "0nq8diqbanlkglb0liva3s43wx8g6pr9znvl9cq6df093by4gcya";
|
||||
sha256 = "1sq79iibjsph3jmmihabamzmm4sr68sw87jqqa3khzq7f2s6cwmg";
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
}@args:
|
||||
|
||||
let
|
||||
version = "6.6.65-rt47"; # updated by ./update-rt.sh
|
||||
version = "6.6.74-rt48"; # updated by ./update-rt.sh
|
||||
branch = lib.versions.majorMinor version;
|
||||
kversion = builtins.elemAt (lib.splitString "-" version) 0;
|
||||
in
|
||||
@@ -29,7 +29,7 @@ buildLinux (
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://kernel/linux/kernel/v6.x/linux-${kversion}.tar.xz";
|
||||
sha256 = "1q53xiwnszchl9c4g4yfxyzk4nffzgb4a7aq9rsyg1jcidp4gqbs";
|
||||
sha256 = "0ka9snxl0y57fajy8vszwa4ggn48pid8m1879d4vl3mbicd2nppi";
|
||||
};
|
||||
|
||||
kernelPatches =
|
||||
@@ -38,7 +38,7 @@ buildLinux (
|
||||
name = "rt";
|
||||
patch = fetchurl {
|
||||
url = "mirror://kernel/linux/kernel/projects/rt/${branch}/older/patch-${version}.patch.xz";
|
||||
sha256 = "1sb6mmbiwh7kijb2bxhlz09dgvd2hpxh6rxghwi1d4cg2151jsr5";
|
||||
sha256 = "1rpbbm9fln2v6xigxrsajivr4zmh0nika3nmm1y7ws31njkg57gq";
|
||||
};
|
||||
};
|
||||
in
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
getent,
|
||||
glibcLocales,
|
||||
autoPatchelfHook,
|
||||
fetchpatch,
|
||||
|
||||
# glib is only used during tests (test-bus-gvariant, test-bus-marshal)
|
||||
glib,
|
||||
@@ -281,6 +282,14 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
"0025-adjust-header-inclusion-order-to-avoid-redeclaration.patch"
|
||||
"0026-build-path.c-avoid-boot-time-segfault-for-musl.patch"
|
||||
]
|
||||
++ [
|
||||
# add a missing include
|
||||
(fetchpatch {
|
||||
url = "https://github.com/systemd/systemd/commit/34fcd3638817060c79e1186b370e46d9b3a7409f.patch";
|
||||
hash = "sha256-Uaewo3jPrZGJttlLcqO6cCj1w3IGZmvbur4+TBdIPxc=";
|
||||
excludes = [ "src/udev/udevd.c" ];
|
||||
})
|
||||
]
|
||||
);
|
||||
|
||||
postPatch =
|
||||
|
||||
@@ -106,11 +106,11 @@ in
|
||||
# Note: when upgrading this package, please run the list-missing-tools.sh script as described below!
|
||||
python.pkgs.buildPythonApplication rec {
|
||||
pname = "diffoscope";
|
||||
version = "285";
|
||||
version = "287";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://diffoscope.org/archive/diffoscope-${version}.tar.bz2";
|
||||
hash = "sha256-OTS4Lr2OF1mdIAiPGK31Ptc/gr3D216Z1kvKOMNeaJI=";
|
||||
hash = "sha256-0s7pT8pAMCE+csd9/+Dv4AbCK0qxDacQ9fNcMYCNDbw=";
|
||||
};
|
||||
|
||||
outputs = [
|
||||
|
||||
@@ -27,32 +27,35 @@ let
|
||||
in
|
||||
python.pkgs.buildPythonApplication rec {
|
||||
pname = "netexec";
|
||||
version = "1.1.0-unstable-2024-01-15";
|
||||
version = "1.3.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Pennyw0rth";
|
||||
repo = "NetExec";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-Pub7PAw6CTN4c/PHTPE9KcnDR2a6hSza1ODp3EWMOH0=";
|
||||
};
|
||||
|
||||
pythonRelaxDeps = true;
|
||||
|
||||
pythonRemoveDeps = [
|
||||
# Fail to detect dev version requirement
|
||||
"neo4j"
|
||||
];
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "Pennyw0rth";
|
||||
repo = "NetExec";
|
||||
rev = "9df72e2f68b914dfdbd75b095dd8f577e992615f";
|
||||
hash = "sha256-oQHtTE5hdlxHX4uc412VfNUrN0UHVbwI0Mm9kmJpNW4=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace pyproject.toml \
|
||||
--replace '{ git = "https://github.com/Pennyw0rth/impacket.git", branch = "gkdi" }' '"*"' \
|
||||
--replace '{ git = "https://github.com/Pennyw0rth/oscrypto" }' '"*"'
|
||||
--replace-fail '{ git = "https://github.com/fortra/impacket.git" }' '"*"' \
|
||||
--replace-fail '{ git = "https://github.com/Pennyw0rth/NfsClient" }' '"*"'
|
||||
'';
|
||||
|
||||
nativeBuildInputs = with python.pkgs; [
|
||||
build-system = with python.pkgs; [
|
||||
poetry-core
|
||||
poetry-dynamic-versioning
|
||||
];
|
||||
|
||||
propagatedBuildInputs = with python.pkgs; [
|
||||
dependencies = with python.pkgs; [
|
||||
aardwolf
|
||||
aioconsole
|
||||
aiosqlite
|
||||
@@ -67,13 +70,15 @@ python.pkgs.buildPythonApplication rec {
|
||||
masky
|
||||
minikerberos
|
||||
msgpack
|
||||
msldap
|
||||
neo4j
|
||||
oscrypto
|
||||
paramiko
|
||||
pyasn1-modules
|
||||
pylnk3
|
||||
pynfsclient
|
||||
pypsrp
|
||||
pypykatz
|
||||
python-dateutil
|
||||
python-libnmap
|
||||
pywerview
|
||||
requests
|
||||
@@ -84,9 +89,10 @@ python.pkgs.buildPythonApplication rec {
|
||||
xmltodict
|
||||
];
|
||||
|
||||
nativeCheckInputs = with python.pkgs; [
|
||||
pytestCheckHook
|
||||
];
|
||||
nativeCheckInputs = with python.pkgs; [ pytestCheckHook ];
|
||||
|
||||
# Tests no longer works out-of-box with 1.3.0
|
||||
doCheck = false;
|
||||
|
||||
preCheck = ''
|
||||
export HOME=$(mktemp -d)
|
||||
@@ -96,9 +102,9 @@ python.pkgs.buildPythonApplication rec {
|
||||
description = "Network service exploitation tool (maintained fork of CrackMapExec)";
|
||||
homepage = "https://github.com/Pennyw0rth/NetExec";
|
||||
changelog = "https://github.com/Pennyw0rth/NetExec/releases/tag/v${version}";
|
||||
license = with licenses; [ bsd2 ];
|
||||
mainProgram = "nxc";
|
||||
license = licenses.bsd2;
|
||||
maintainers = with maintainers; [ vncsb ];
|
||||
mainProgram = "nxc";
|
||||
# FIXME: failing fixupPhase:
|
||||
# $ Rewriting #!/nix/store/<hash>-python3-3.11.7/bin/python3.11 to #!/nix/store/<hash>-python3-3.11.7
|
||||
# $ /nix/store/<hash>-wrap-python-hook/nix-support/setup-hook: line 65: 47758 Killed: 9 sed -i "$f" -e "1 s^#!/nix/store/<hash>-python3-3.11.7^#!/nix/store/<hash>-python3-3.11.7^"
|
||||
|
||||
@@ -10717,6 +10717,8 @@ self: super: with self; {
|
||||
|
||||
pylsl = callPackage ../development/python-modules/pylsl { };
|
||||
|
||||
pynfsclient = callPackage ../development/python-modules/pynfsclient { };
|
||||
|
||||
pyngo = callPackage ../development/python-modules/pyngo { };
|
||||
|
||||
pyngrok = callPackage ../development/python-modules/pyngrok { };
|
||||
|
||||
Reference in New Issue
Block a user