MOTD avec version de la flake !

telephonie
Pyjacpp 2026-08-26 23:13:19 +02:00
parent e4539a2b69
commit bf2103f9d4
2 changed files with 24 additions and 2 deletions

View File

@ -1,4 +1,9 @@
{ config, lib, ... }:
{
config,
lib,
self,
...
}:
let
cfg = config.crans.users;
@ -34,6 +39,20 @@ in
users = {
mutableUsers = false;
motd =
let
shortRev = self.shortRev or self.dirtyShortRev or "inconnue";
rev = self.rev or (lib.strings.removeSuffix "-dirty" (self.dirtyRev or "inconnue"));
isDirty = !(self ? rev);
in
''
${
if isDirty then "!! DIRTY !! " else ""
}Version déployée ${shortRev}, modifiée le ${self.lastModifiedDate or "??"}.
https://gitlab.crans.org/nounous/nixos/-/commit/${rev}
'';
users.root = {
hashedPasswordFile = config.age.secrets.root-passwd-hash.path;
};

View File

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib, self, ... }:
{
imports = [
@ -25,6 +25,9 @@
cleanOnBoot = true;
};
# Version de la flake pour nixos-version --configuration-revision
system.configurationRevision = self.rev or self.dirtyRev or "inconnue";
# Recommandé depuis le passage à 26.05
boot.zfs.forceImportAll = lib.mkDefault false;
boot.zfs.forceImportRoot = lib.mkDefault false;