From 368cb6b0d25db2ae23be42ad51584de059997e51 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Mon, 20 May 2024 16:10:21 +0200 Subject: refactor(sys): Modularize and move to `modules/system` or `pkgs` --- modules/system/version/default.nix | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 modules/system/version/default.nix (limited to 'modules/system/version/default.nix') diff --git a/modules/system/version/default.nix b/modules/system/version/default.nix new file mode 100644 index 00000000..77cada14 --- /dev/null +++ b/modules/system/version/default.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + self, + ... +}: let + cfg = config.soispha.version; +in { + options.soispha.version = { + enable = lib.mkEnableOption "storing the git revision in /etc/nixos_git_rev"; + }; + config = lib.mkIf cfg.enable { + environment.etc.nixos_git_rev = { + text = builtins.toString (self.longRev + or self.lastModified + or "unknown"); + }; + }; +} -- cgit 1.4.1