diff --git a/hosts/rpi4/configuration.nix b/hosts/rpi4/configuration.nix index fa0c369..1d5a585 100644 --- a/hosts/rpi4/configuration.nix +++ b/hosts/rpi4/configuration.nix @@ -10,21 +10,18 @@ ./hardware-configuration.nix ]; - # this should be the default unless i am specifically on a pc - networking.networkmanager.enable = false; - # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) boot.loader.grub.enable = false; # Enables the generation of /boot/extlinux/extlinux.conf boot.loader.generic-extlinux-compatible.enable = true; nixfiles = { - profile.base.enable = true; + profile.server.enable = true; }; services.openssh = { - enable = true; - openFirewall = true; + enable = true; + openFirewall = true; }; # networking.hostName = "nixos"; # Define your hostname. networking.hostName = "rpi4"; diff --git a/system/profile/base.nix b/system/profile/base.nix index 709c52b..deab171 100644 --- a/system/profile/base.nix +++ b/system/profile/base.nix @@ -42,12 +42,6 @@ in ]; }; - # networking.hostName = "nixos"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - # FIXME find somewhere else to put this - networking.networkmanager.enable = lib.mkDefault true; # Easiest to use and most distros use this by default. - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; let diff --git a/system/profile/default.nix b/system/profile/default.nix index 5cd0b18..bb14035 100644 --- a/system/profile/default.nix +++ b/system/profile/default.nix @@ -3,5 +3,6 @@ imports = [ ./base.nix ./pc.nix + ./server.nix ]; } diff --git a/system/profile/pc.nix b/system/profile/pc.nix index eba75ad..90c2a92 100644 --- a/system/profile/pc.nix +++ b/system/profile/pc.nix @@ -7,5 +7,11 @@ in config = lib.mkIf cfg.enable { nixfiles.profile.base.enable = lib.mkDefault true; nixfiles.binfmt.enable = lib.mkDefault true; + + # networking.hostName = "nixos"; # Define your hostname. + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # FIXME find somewhere else to put this + networking.networkmanager.enable = lib.mkDefault true; # Easiest to use and most distros use this by default. }; } diff --git a/system/profile/server.nix b/system/profile/server.nix new file mode 100644 index 0000000..1b2fcab --- /dev/null +++ b/system/profile/server.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: +let + cfg = config.nixfiles.profile.server; + inherit (lib) mkEnableOption mkDefault; + inherit (lib.types) bool int str; +in +{ + options.nixfiles.profile.server.enable = mkEnableOption "server profile"; + + config = lib.mkIf cfg.enable { + nixfiles.profile.base.enable = lib.mkDefault true; + }; +}