system: create server profile, move networkmanager

This commit is contained in:
NullBite 2024-06-20 21:44:28 -04:00
parent 91cf59ff47
commit 7b2286b728
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A
5 changed files with 23 additions and 12 deletions

View File

@ -10,21 +10,18 @@
./hardware-configuration.nix ./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) # Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
boot.loader.grub.enable = false; boot.loader.grub.enable = false;
# Enables the generation of /boot/extlinux/extlinux.conf # Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true; boot.loader.generic-extlinux-compatible.enable = true;
nixfiles = { nixfiles = {
profile.base.enable = true; profile.server.enable = true;
}; };
services.openssh = { services.openssh = {
enable = true; enable = true;
openFirewall = true; openFirewall = true;
}; };
# networking.hostName = "nixos"; # Define your hostname. # networking.hostName = "nixos"; # Define your hostname.
networking.hostName = "rpi4"; networking.hostName = "rpi4";

View File

@ -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: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; let environment.systemPackages = with pkgs; let

View File

@ -3,5 +3,6 @@
imports = [ imports = [
./base.nix ./base.nix
./pc.nix ./pc.nix
./server.nix
]; ];
} }

View File

@ -7,5 +7,11 @@ in
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
nixfiles.profile.base.enable = lib.mkDefault true; nixfiles.profile.base.enable = lib.mkDefault true;
nixfiles.binfmt.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.
}; };
} }

13
system/profile/server.nix Normal file
View File

@ -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;
};
}