Skip to content

Commit

Permalink
modules (comin): Extract module
Browse files Browse the repository at this point in the history
Enable if on all servers.
  • Loading branch information
britter committed Jun 24, 2024
1 parent 8544803 commit ae1dea5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 40 deletions.
28 changes: 28 additions & 0 deletions modules/nixos/comin/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
config,
lib,
inputs,
...
}: let
cfg = config.my.modules.comin;
in {
imports = [
inputs.comin.nixosModules.comin
];

options.my.modules.comin = {
enable = lib.mkEnableOption "comin";
};

config = lib.mkIf cfg.enable {
services.comin = {
enable = true;
remotes = [
{
name = "origin";
url = "https://github.com/britter/nix-configuration.git";
}
];
};
};
}
2 changes: 2 additions & 0 deletions modules/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ in {
../common
./1password
./adguard
./comin
./disko
./fonts
./gaming
Expand All @@ -29,6 +30,7 @@ in {
gaming.enable = cfg.role == "desktop" && (builtins.elem "private" cfg.profiles);

# enabled only on servers
comin.enable = cfg.role == "server";
ssh-access.enable = cfg.role == "server";

# enabled on all machines by default
Expand Down
11 changes: 0 additions & 11 deletions systems/aarch64-linux/raspberry-pi/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
../../../modules/nixos
./hardware-configuration.nix
inputs.nixos-hardware.nixosModules.raspberry-pi-4
inputs.comin.nixosModules.comin
];

my = {
Expand All @@ -25,16 +24,6 @@
generic-extlinux-compatible.enable = true;
};

services.comin = {
enable = true;
remotes = [
{
name = "origin";
url = "https://github.com/britter/nix-configuration.git";
}
];
};

# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
Expand Down
12 changes: 0 additions & 12 deletions systems/x86_64-linux/cyberoffice/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
imports = [
../../../modules/nixos
inputs.sops-nix.nixosModules.sops
inputs.comin.nixosModules.comin
];

my = {
Expand Down Expand Up @@ -76,17 +75,6 @@
extraAppsEnable = true;
};

# TODO extract this into a server module
services.comin = {
enable = true;
remotes = [
{
name = "origin";
url = "https://github.com/britter/nix-configuration.git";
}
];
};

# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It‘s perfectly fine and recommended to leave
Expand Down
18 changes: 1 addition & 17 deletions systems/x86_64-linux/watchtower/configuration.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
{
config,
inputs,
...
}: {
{config, ...}: {
imports = [
../../../modules/nixos
inputs.comin.nixosModules.comin
];

my = {
Expand Down Expand Up @@ -49,17 +44,6 @@
};
};

# TODO extract this into a server module
services.comin = {
enable = true;
remotes = [
{
name = "origin";
url = "https://github.com/britter/nix-configuration.git";
}
];
};

services.nginx = {
enable = true;
virtualHosts."grafana.ritter.family" = {
Expand Down

0 comments on commit ae1dea5

Please sign in to comment.