diff --git a/hosts/MaxNixosLaptop/configuration.nix b/hosts/MaxNixosLaptop/configuration.nix index a53889e..1394424 100644 --- a/hosts/MaxNixosLaptop/configuration.nix +++ b/hosts/MaxNixosLaptop/configuration.nix @@ -18,10 +18,9 @@ desktop = true; gpu.amd.enable = true; laptop = true; + network.hostName = "MaxNixosLaptop"; }; - networking.hostName = "MaxNixosLaptop"; # Define your hostname. - # Define a user account. Don't forget to set a password with ‘passwd’. users.users.max = { isNormalUser = true; @@ -30,8 +29,6 @@ shell = pkgs.zsh; }; - networking.firewall.enable = false; - home-manager = { extraSpecialArgs = {inherit inputs;}; users = { diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 0902f2c..eb6615e 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -6,7 +6,7 @@ }: let cfg = config.myConfig; in { - imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix ./touch.nix ./cache.nix ./nix.nix ./update.nix ./podman.nix ./qemu.nix]; + imports = [./bootloader.nix ./locale.nix ./greetd.nix ./rebuild.nix ./sops.nix ./sway.nix ./wifi.nix ./music.nix ./cups.nix ./gpu/amd.nix ./touch.nix ./cache.nix ./nix.nix ./update.nix ./podman.nix ./qemu.nix ./bluetooth.nix ./network.nix]; options.myConfig = { enable = lib.mkEnableOption "my custom config"; @@ -17,7 +17,6 @@ in { example = "foo"; description = "The main user working on this machine"; type = lib.types.nonEmptyStr; - readOnly = true; }; }; @@ -30,6 +29,7 @@ in { podman.enable = true; qemu.enable = true; qemu.kvm = lib.mkIf (system == "x86_64-linux") true; + network.enable = true; greetd.enable = lib.mkIf cfg.desktop true; sway.enable = lib.mkIf cfg.desktop true; @@ -40,5 +40,6 @@ in { sway.laptop = lib.mkIf cfg.laptop true; wifi.enable = lib.mkIf cfg.laptop true; touch.enable = lib.mkIf cfg.laptop true; + bluetooth.enable = lib.mkIf cfg.laptop true; }; } diff --git a/modules/nixos/network.nix b/modules/nixos/network.nix new file mode 100644 index 0000000..48941d8 --- /dev/null +++ b/modules/nixos/network.nix @@ -0,0 +1,24 @@ +{ + lib, + config, + ... +}: let + cfg = config.myConfig.network; +in { + options.myConfig.network = { + enable = lib.mkEnableOption "bluetooth"; + hostName = lib.mkOption { + default = null; + example = "host"; + description = "The host name of this machine"; + type = lib.types.nullOr lib.types.nonEmptyStr; + }; + }; + + config = lib.mkIf cfg.enable { + networking = { + hostName = cfg.hostName; + firewall.enable = false; + }; + }; +}