diff --git a/flake.nix b/flake.nix index a3d487b..5f8ae7c 100644 --- a/flake.nix +++ b/flake.nix @@ -31,10 +31,13 @@ intake, intake-sources, }: { + nixosModules.beatific = import ./modules/beatific.nix; + nixosConfigurations = { backyard = nixpkgs-next.lib.nixosSystem { system = "x86_64-linux"; modules = [ + self.nixosModules.beatific ./machine/backyard ]; }; diff --git a/machine/backyard/default.nix b/machine/backyard/default.nix index e351abc..2720ae6 100644 --- a/machine/backyard/default.nix +++ b/machine/backyard/default.nix @@ -11,7 +11,7 @@ efi.canTouchEfiVariables = true; }; - networking.hostName = "backyard"; # Define your hostname. + beatific.hostName = "backyard"; # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. # Enable networking diff --git a/modules/beatific.nix b/modules/beatific.nix new file mode 100644 index 0000000..c248743 --- /dev/null +++ b/modules/beatific.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +let + inherit (lib) mkOption types; + cfg = config.beatific; +in { + options = { + beatific.hostName = mkOption { + type = types.str; + description = "Hostname"; + }; + }; + + config = let + in { + networking.hostName = cfg.hostName; + }; +}