-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(nix): add home-manager modules
- Loading branch information
1 parent
6c46d79
commit 7d13559
Showing
17 changed files
with
1,101 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
use nix | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
amatrelan
Contributor
|
||
use flake | ||
watch_file default.nix | ||
watch_file shell.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
imports = [ | ||
./qBittorrent.nix | ||
./transmission.nix | ||
./rqbit.nix | ||
./other.nix | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ lib, ... }: | ||
{ | ||
options.programs.nyaa.clients.cmd = { | ||
cmd = lib.mkOption { | ||
type = lib.types.str; | ||
default = ''curl "{torrent}" > ~/{file}''; | ||
description = '' | ||
The command to run on enter | ||
Possible substitutions are: | ||
- `{magnet}` | ||
- `{torrent}` | ||
- `{title}` | ||
- `{file}` | ||
''; | ||
}; | ||
shell_cmd = lib.mkOption { | ||
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
description = '' | ||
The shell to spawn the command with (optional) | ||
Example value: | ||
`"bash -c"` | ||
''; | ||
}; | ||
}; | ||
|
||
options.programs.nyaa.clients.default_app = { | ||
use_magnet = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether to open magnet links with the default app or torrent links (optional) | ||
''; | ||
}; | ||
}; | ||
|
||
options.programs.nyaa.clients.download = { | ||
save_dir = lib.mkOption { | ||
type = lib.types.str; | ||
default = "~/Downloads"; | ||
description = '' | ||
The default path to save .torrent files to | ||
''; | ||
}; | ||
filename = lib.mkOption { | ||
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
description = '' | ||
The filename to save the `.torrent` file as (optional) | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
|
||
{ lib, ... }: | ||
{ | ||
options.programs.nyaa.clients.qBittorrent = { | ||
base_url = lib.mkOption { | ||
type = lib.types.str; | ||
default = "http://localhost:8080"; | ||
description = '' | ||
The base url for qBittorrent | ||
''; | ||
}; | ||
username = lib.mkOption { | ||
type = lib.types.str; | ||
default = "admin"; | ||
description = '' | ||
The username to login to qBittorrent | ||
''; | ||
}; | ||
password = lib.mkOption { | ||
type = lib.types.str; | ||
default = "adminadmin"; | ||
description = '' | ||
The password to login to qBittorrent | ||
''; | ||
}; | ||
use_magnet = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether or not to send magnet links or torrent links (optional) | ||
''; | ||
}; | ||
savepath = lib.mkOption { | ||
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
description = '' | ||
The path to save downloaded torrents to (optional) | ||
''; | ||
}; | ||
category = lib.mkOption { | ||
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
description = '' | ||
The category to assign to torrents sent to qBittorrent (optional) | ||
''; | ||
}; | ||
tags = lib.mkOption { | ||
type = lib.types.nullOr (lib.types.listOf lib.types.str); | ||
default = null; | ||
description = '' | ||
List of tags to assign to torrents sent to qBittorrent (optional) | ||
''; | ||
}; | ||
skip_checking = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether to skip checking on all downloaded torrents (optional) | ||
''; | ||
}; | ||
paused = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether new torrents should start in the paused state (optional) | ||
''; | ||
}; | ||
create_root_folder = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether to create the root download folder if it does not exist (optional) | ||
''; | ||
}; | ||
up_limit = lib.mkOption { | ||
type = lib.types.nullOr lib.types.int; | ||
default = null; | ||
description = '' | ||
The upload limit (in Bytes/sec) for new torrents (optional) | ||
''; | ||
}; | ||
dl_limit = lib.mkOption { | ||
type = lib.types.nullOr lib.types.int; | ||
default = null; | ||
description = '' | ||
The download limit (in Bytes/sec) for new torrents (optional) | ||
''; | ||
}; | ||
ratio_limit = lib.mkOption { | ||
type = lib.types.nullOr lib.types.float; | ||
default = null; | ||
description = '' | ||
The ratio limit (floating point number) for new torrents (optional) | ||
''; | ||
}; | ||
seeding_time_limit = lib.mkOption { | ||
type = lib.types.nullOr lib.types.int; | ||
default = null; | ||
description = '' | ||
Limit for how long torrents can seed (measured in minutes) (optional) | ||
Only works if autoTMM is false/null | ||
''; | ||
}; | ||
auto_tmm = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether to enable automatic torrent management (optional) | ||
''; | ||
}; | ||
sequential_download = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether to download file contents in sequential order (optional) | ||
''; | ||
}; | ||
prioritize_first_last_pieces = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether to prioritize the first and last pieces of the file (optional) | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ lib, ... }: | ||
{ | ||
options.programs.nyaa.clients.rqbit = { | ||
base_url = lib.mkOption { | ||
type = lib.types.str; | ||
default = "http://localhost:3030"; | ||
description = '' | ||
The base url for rqbit | ||
''; | ||
}; | ||
use_magnet = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether to send magnet links or torrent links (optional) | ||
''; | ||
}; | ||
overwrite = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether to overwrite existing files while downloading (optional) | ||
''; | ||
}; | ||
output_folder = lib.mkOption { | ||
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
description = '' | ||
The path to save downloaded torrents to (optional) | ||
''; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ lib, ... }: | ||
{ | ||
options.programs.nyaa.clients.transmission = { | ||
base_url = lib.mkOption { | ||
type = lib.types.str; | ||
default = "http://localhost:9091/transmission/rpc"; | ||
description = '' | ||
The base url for Transmission | ||
''; | ||
}; | ||
username = lib.mkOption { | ||
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
description = '' | ||
The username to login to Transmission (optional) | ||
''; | ||
}; | ||
password = lib.mkOption { | ||
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
description = '' | ||
The password to login to Transmission (optional) | ||
''; | ||
}; | ||
use_magnet = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether or not to send magnet links or torrent links (optional) | ||
''; | ||
}; | ||
labels = lib.mkOption { | ||
type = lib.types.nullOr (lib.types.listOf lib.types.str); | ||
default = null; | ||
description = '' | ||
List of labels to assign to torrents sent to Transmission (optional) | ||
''; | ||
}; | ||
paused = lib.mkOption { | ||
type = lib.types.nullOr lib.types.bool; | ||
default = null; | ||
description = '' | ||
Whether new torrents should start in the paused state (optional) | ||
''; | ||
}; | ||
peer_limit = lib.mkOption { | ||
type = lib.types.nullOr lib.types.int; | ||
default = null; | ||
description = '' | ||
Limits the number of connected peers (optional) | ||
''; | ||
}; | ||
download_dir = lib.mkOption { | ||
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
description = '' | ||
The path to save downloaded torrents to (optional) | ||
''; | ||
}; | ||
bandwidth_priority = lib.mkOption { | ||
type = lib.types.nullOr lib.types.str; | ||
default = null; | ||
description = '' | ||
The bandwidth priority assigned to new torrents (optional) | ||
This value can be `Low`, `Normal`, or `High` | ||
''; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.
You can remove this line if you use
use flake
they do same thing, except use flake is just for flakes, so there is some underlying differences.