add suggested changes via NixOS discord

This commit is contained in:
randomuser 2023-07-08 16:22:38 -05:00
parent c7b00fac22
commit 11deac87c5
3 changed files with 198 additions and 227 deletions

View File

@ -1,16 +1,9 @@
{ lib, config, pkgs, ... }:
let
hostname = "virtbox";
isVirtbox = hostname == "virtbox";
isNetbox = hostname == "netbox";
in
{
imports =
[
./hardware-configuration.nix # include the results of the hardware scan
./virtbox.nix
./netbox.nix
];
networking.networkmanager.enable = true;
@ -35,13 +28,4 @@ in
system.copySystemConfiguration = true;
system.stateVersion = "23.05"; # don't change this, lol
# branch and enable different capabilities based on the system
test = lib.mkIf isVirtbox {
services.virtbox.enable = true;
};
test_ = lib.mkIf isNetbox {
services.netbox.enable = true;
};
}

View File

@ -1,18 +1,12 @@
{ lib, config, pkgs, ... }:
let
cfg = config.services.netbox;
in {
options.serviecs.netbox = {
enable = lib.mkEnableOption "netbox configs";
};
{
imports =
[
./mail.nix
./configuration.nix
];
config = lib.mkIf cfg.enable {
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/vda";
@ -130,5 +124,4 @@ in {
# Open ports in the firewall.
networking.firewall.enable = false;
networking.firewall.allowedTCPPorts = [ 55555 80 443 ];
};
}

View File

@ -1,21 +1,16 @@
{ lib, config, pkgs, ...}:
let
cfg = config.services.virtbox;
home-manager = builtins.fetchTarball {
url = "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz";
sha256 = "0dfshsgj93ikfkcihf4c5z876h4dwjds998kvgv7sqbfv0z6a4bc";
};
in {
options.services.virtbox = {
enable = lib.mkEnableOption "virtbox configs";
};
imports = [
(import "${home-manager}/nixos")
./configuration.nix
];
config = lib.mkIf cfg.enable {
boot.loader.grub.enable = true;
boot.loader.grub.device = "/dev/vda";
@ -112,5 +107,4 @@ in {
};
};
};
};
}