Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move repo to nixpkgs-24.05 #523

Merged
merged 12 commits into from
Jul 22, 2024
Merged
53 changes: 35 additions & 18 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

inputs = {
# packages
nixpkgs.url = "github:nixos/nixpkgs/23.11";
nixpkgs.url = "github:nixos/nixpkgs/24.05";
nixpkgs-2311.url = "github:nixos/nixpkgs/23.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";

foundry-nix = {
Expand Down Expand Up @@ -80,6 +81,7 @@
config,
pkgs,
pkgsUnstable,
pkgs2311,
system,
self',
...
Expand All @@ -94,6 +96,10 @@
inherit system;
nixpkgs = inputs.nixpkgs-unstable;
};
pkgs2311 = lib.extras.nix.mkNixpkgs {
inherit system;
nixpkgs = inputs.nixpkgs-2311;
};
};

# devshell
Expand Down
12 changes: 6 additions & 6 deletions modules/backup/lib.nix
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
lib: {
options = with lib; {
enable = mkEnableOption (mdDoc "Enable backup");
enable = mkEnableOption "Enable backup";

btrfs = {
enable = mkEnableOption (mdDoc "Enable btrfs snapshots for the state directory, if supported by the underlying filesystem");
enable = mkEnableOption "Enable btrfs snapshots for the state directory, if supported by the underlying filesystem";

snapshotRetention = mkOption {
type = types.int;
description = mdDoc "Number of days to retain snapshots";
description = "Number of days to retain snapshots";
default = 7;
example = "10";
};

snapshotDirectory = mkOption {
type = types.path;
description = mdDoc ''
description = ''
Directory in which to create the btrfs snapshots. Must be located on the same volume as the state directory
'';
default = "/snapshots";
Expand All @@ -23,13 +23,13 @@ lib: {

metadata.interval = mkOption {
type = types.ints.between 1 60;
description = mdDoc "Time interval in seconds between capturing backup metadata";
description = "Time interval in seconds between capturing backup metadata";
default = 10;
};

schedule = mkOption {
type = types.str;
description = mdDoc "Schedule for creating a backup. Format is the same as systemd.time";
description = "Schedule for creating a backup. Format is the same as systemd.time";
default = "hourly";
example = "daily";
};
Expand Down
18 changes: 9 additions & 9 deletions modules/backup/restic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ lib:
with lib; {
passwordFile = mkOption {
type = types.str;
description = lib.mdDoc ''
description = ''
Read the repository password from a file.
'';
example = "/etc/nixos/restic-password";
Expand All @@ -12,7 +12,7 @@ with lib; {
environmentFile = mkOption {
type = with types; nullOr str;
default = null;
description = lib.mdDoc ''
description = ''
file containing the credentials to access the repository, in the
format of an EnvironmentFile as described by systemd.exec(5)
'';
Expand All @@ -21,7 +21,7 @@ with lib; {
rcloneOptions = mkOption {
type = with types; nullOr (attrsOf (oneOf [str bool]));
default = null;
description = lib.mdDoc ''
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
Expand All @@ -38,7 +38,7 @@ with lib; {
rcloneConfig = mkOption {
type = with types; nullOr (attrsOf (oneOf [str bool]));
default = null;
description = lib.mdDoc ''
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
Expand All @@ -62,7 +62,7 @@ with lib; {
rcloneConfigFile = mkOption {
type = with types; nullOr path;
default = null;
description = lib.mdDoc ''
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
Expand All @@ -74,7 +74,7 @@ with lib; {
repository = mkOption {
type = with types; nullOr str;
default = null;
description = lib.mdDoc ''
description = ''
repository to backup to.
'';
example = "sftp:backup@192.168.1.100:/backups/my-bucket";
Expand All @@ -83,7 +83,7 @@ with lib; {
repositoryFile = mkOption {
type = with types; nullOr path;
default = null;
description = lib.mdDoc ''
description = ''
Path to the file containing the repository location to backup to.
'';
};
Expand All @@ -95,7 +95,7 @@ with lib; {
"keystore"
"**/nodekey"
];
description = lib.mdDoc ''
description = ''
Patterns to exclude when backing up. See
https://restic.readthedocs.io/en/latest/040_backup.html#excluding-files for
details on syntax.
Expand All @@ -110,7 +110,7 @@ with lib; {
extraOptions = mkOption {
type = types.listOf types.str;
default = [];
description = lib.mdDoc ''
description = ''
Extra extended options to be passed to the restic --option flag.
'';
example = [
Expand Down
Loading