Skip to content

Commit 8d13a93

Browse files
committed
refactor: clean up options definitions
1 parent e3fec27 commit 8d13a93

34 files changed

+105
-81
lines changed

hosts/luna/disko.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ in
3737
settings = {
3838
allowDiscards = true;
3939
};
40-
# TODO: generate prior to nixos-anywhere install
41-
# passwordFile = "/tmp/secret.key"; # commenting will cause Disko to prompt for a passphrase
4240
content = {
4341
type = "btrfs";
4442
extraArgs = [ "-f" ];

modules/.gitkeep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let
55
in
66
with lib;
77
{
8-
options = {
9-
host.PLACEHOLDER.enable = mkEnableOption "PLACEHOLDER";
8+
options.host.PLACEHOLDER = {
9+
enable = mkEnableOption "PLACEHOLDER";
1010
};
1111

1212
config = mkIf cfg.enable {

modules/avahi.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let
55
in
66
with lib;
77
{
8-
options = {
9-
host.avahi.enable = mkEnableOption "avahi";
8+
options.host.avahi = {
9+
enable = mkEnableOption "avahi";
1010
};
1111

1212
config = mkIf cfg.enable {

modules/bluetooth.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ let
99
in
1010
with lib;
1111
{
12-
options = {
13-
host.bluetooth.enable = mkEnableOption "bluetooth";
12+
options.host.bluetooth = {
13+
enable = mkEnableOption "bluetooth";
1414
};
1515

1616
config = mkIf cfg.enable {

modules/borgmatic.nix

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{ config, lib, ... }:
2+
3+
let
4+
cfg = config.host.borgmatic;
5+
in
6+
with lib;
7+
{
8+
options.host.borgmatic = {
9+
enable = mkEnableOption "borgmatic";
10+
};
11+
12+
config = mkIf cfg.enable {
13+
services.borgmatic = {
14+
enable = true;
15+
settings = {
16+
repositories = [
17+
{
18+
label = "Google Drive";
19+
path = "rclone:gdrive/backup";
20+
}
21+
];
22+
};
23+
};
24+
};
25+
}

modules/btrfs.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let
55
in
66
with lib;
77
{
8-
options = {
9-
host.btrfs.enable = mkEnableOption "BTRFS partitioning";
8+
options.host.btrfs = {
9+
enable = mkEnableOption "BTRFS partitioning";
1010
};
1111

1212
config = mkIf cfg.enable {

modules/catt.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ let
1010
in
1111
with lib;
1212
{
13-
options = {
14-
host.catt.enable = mkEnableOption "Cast All The Things - Chromecast";
13+
options.host.catt = {
14+
enable = mkEnableOption "Cast All The Things - Chromecast";
1515
};
1616

1717
config = mkIf cfg.enable {

modules/default.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ with lib;
88
{
99
imports = moduleFilePaths;
1010

11-
options = {
12-
host.root = mkOption {
11+
options.host = {
12+
root = mkOption {
1313
type = types.path;
1414
description = "nix store path declaration";
1515
};

modules/efi.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ let
55
in
66
with lib;
77
{
8-
options = {
9-
host.efi.enable = mkEnableOption "booting via EFI";
8+
options.host.efi = {
9+
enable = mkEnableOption "booting via EFI";
1010
};
1111

1212
config = mkIf cfg.enable {

modules/encryption.nix

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
{config, lib, pkgs, ...}:
1+
{
2+
config,
3+
lib,
4+
pkgs,
5+
...
6+
}:
27

38
let
49
cfg = config.host.encryption;
510
in
6-
with lib;
11+
with lib;
712
{
8-
options = {
9-
host.encryption.enable = mkEnableOption "LUKS filesystem encryption";
13+
options.host.encryption = {
14+
enable = mkEnableOption "LUKS filesystem encryption";
1015
};
1116

1217
config = mkIf cfg.enable {
13-
environment.systemPackages = with pkgs; [
18+
environment.systemPackages = with pkgs; [
1419
cryptsetup
1520
];
1621

17-
boot.initrd = {
22+
boot.initrd = {
1823
luks.devices = {
19-
"pool0_0" = {
20-
allowDiscards = true;
21-
bypassWorkqueues = true;
22-
};
24+
"pool0_0" = {
25+
allowDiscards = true;
26+
bypassWorkqueues = true;
27+
};
2328
};
2429
};
2530
};
26-
}
31+
}

0 commit comments

Comments
 (0)