Create a beatific module with options
This commit is contained in:
parent
9948b73eff
commit
4e8a2bb7e4
@ -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
|
||||
];
|
||||
};
|
||||
|
@ -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
|
||||
|
18
modules/beatific.nix
Normal file
18
modules/beatific.nix
Normal file
@ -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;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user