add suggested changes via NixOS discord
This commit is contained in:
parent
c7b00fac22
commit
11deac87c5
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
11
netbox.nix
11
netbox.nix
|
@ -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 ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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 {
|
|||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue