From 7e7e42b4d58e90466c9f8926c3804aa23be47877 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 14 Dec 2025 13:20:44 -0800 Subject: display the git SHA for the nixos version in MOTD --- flake.nix | 2 +- justfile | 1 + profiles/defaults.nix | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index ec2f077..f6a9b91 100644 --- a/flake.nix +++ b/flake.nix @@ -155,7 +155,7 @@ }; modules = [ { - system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; + system.configurationRevision = self.rev or self.dirtyRev or null; system.nixos.versionSuffix = nixpkgs.lib.mkForce "git.${builtins.substring 0 11 nixpkgs.rev}"; nixpkgs.pkgs = pkgs; environment.systemPackages = [ pkgs.git ]; diff --git a/justfile b/justfile index 81bf05f..7f62818 100644 --- a/justfile +++ b/justfile @@ -42,6 +42,7 @@ rbuild hostname: [group('linux')] rswitch hostname: @echo "switching {{hostname}} to new config..." + nixos-rebuild switch --keep-going --flake ".#{{hostname}}" --target-host {{hostname}} --fast --use-remote-sudo --use-substitutes # sync agenix key from 1password [group('secrets')] diff --git a/profiles/defaults.nix b/profiles/defaults.nix index d98daa0..6ada4c7 100644 --- a/profiles/defaults.nix +++ b/profiles/defaults.nix @@ -1,5 +1,4 @@ { - self, config, pkgs, lib, @@ -100,8 +99,8 @@ environment.etc.motd.text = '' Machine ${config.networking.hostName} - NixOS ${config.system.nixos.release} - @ ${self.shortRev or self.dirtyShortRev} + NixOS ${config.system.nixos.versionSuffix} + @ ${config.system.configurationRevision} ''; ## disable that slow "building man-cache" step -- cgit v1.2.3