add network module
This commit is contained in:
parent
15de1e42e9
commit
7f2def19e8
@ -18,10 +18,9 @@
|
|||||||
desktop = true;
|
desktop = true;
|
||||||
gpu.amd.enable = true;
|
gpu.amd.enable = true;
|
||||||
laptop = 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’.
|
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||||
users.users.max = {
|
users.users.max = {
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
@ -30,8 +29,6 @@
|
|||||||
shell = pkgs.zsh;
|
shell = pkgs.zsh;
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.enable = false;
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
extraSpecialArgs = {inherit inputs;};
|
extraSpecialArgs = {inherit inputs;};
|
||||||
users = {
|
users = {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
}: let
|
}: let
|
||||||
cfg = config.myConfig;
|
cfg = config.myConfig;
|
||||||
in {
|
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 = {
|
options.myConfig = {
|
||||||
enable = lib.mkEnableOption "my custom config";
|
enable = lib.mkEnableOption "my custom config";
|
||||||
@ -17,7 +17,6 @@ in {
|
|||||||
example = "foo";
|
example = "foo";
|
||||||
description = "The main user working on this machine";
|
description = "The main user working on this machine";
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nonEmptyStr;
|
||||||
readOnly = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -30,6 +29,7 @@ in {
|
|||||||
podman.enable = true;
|
podman.enable = true;
|
||||||
qemu.enable = true;
|
qemu.enable = true;
|
||||||
qemu.kvm = lib.mkIf (system == "x86_64-linux") true;
|
qemu.kvm = lib.mkIf (system == "x86_64-linux") true;
|
||||||
|
network.enable = true;
|
||||||
|
|
||||||
greetd.enable = lib.mkIf cfg.desktop true;
|
greetd.enable = lib.mkIf cfg.desktop true;
|
||||||
sway.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;
|
sway.laptop = lib.mkIf cfg.laptop true;
|
||||||
wifi.enable = lib.mkIf cfg.laptop true;
|
wifi.enable = lib.mkIf cfg.laptop true;
|
||||||
touch.enable = lib.mkIf cfg.laptop true;
|
touch.enable = lib.mkIf cfg.laptop true;
|
||||||
|
bluetooth.enable = lib.mkIf cfg.laptop true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
24
modules/nixos/network.nix
Normal file
24
modules/nixos/network.nix
Normal file
@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user