liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

hostname.nix (395B)


      1 { lib, pkgs, config, ...}:
      2 let
      3   inherit (lib) mkOption types;
      4   inherit (pkgs.liminix.services) oneshot;
      5 in {
      6   options = {
      7     hostname = mkOption {
      8       default = "liminix";
      9       type = types.nonEmptyStr;
     10     };
     11   };
     12   config = {
     13     services.hostname = oneshot {
     14       name = "hostname";
     15       up = "echo ${config.hostname} > /proc/sys/kernel/hostname";
     16       down = "true";
     17     };
     18   };
     19 }