1
0
Fork 0

Less rebuilds because of commit versions

This commit is contained in:
Malte 2023-03-06 19:18:50 +01:00
parent 5cc42dac77
commit 3af8c50a52
2 changed files with 15 additions and 14 deletions

View file

@ -6,24 +6,11 @@
}: let }: let
inherit (config.m-0) hosts; inherit (config.m-0) hosts;
inherit (config.networking) hostName; inherit (config.networking) hostName;
inherit (pkgs.flake-inputs.self) sourceInfo;
s = builtins.substring;
formatDate = date: "${s 0 4 date}-${s 4 2 date}-${s 6 2 date}-${s 8 2 date}:${s 10 2 date}";
in { in {
imports = [ imports = [
../../common ../../common
./admin.nix ./admin.nix
]; ];
system = {
configurationRevision = sourceInfo.rev or null;
nixos.label =
if sourceInfo ? shortRev
then "${formatDate sourceInfo.lastModifiedDate}-${sourceInfo.shortRev}"
else "${formatDate sourceInfo.lastModifiedDate}-dirty";
systemBuilderCommands = lib.mkIf (sourceInfo ? rev) ''
echo ${sourceInfo.rev} > $out/config-commit
'';
};
i18n = { i18n = {
defaultLocale = "en_DK.UTF-8"; defaultLocale = "en_DK.UTF-8";

View file

@ -3,10 +3,24 @@
config, config,
lib, lib,
... ...
}: { }: let
inherit (pkgs.flake-inputs.self) sourceInfo;
s = builtins.substring;
formatDate = date: "${s 0 4 date}-${s 4 2 date}-${s 6 2 date}-${s 8 2 date}:${s 10 2 date}";
in {
imports = [ imports = [
../vpn.nix ../vpn.nix
]; ];
services.getty.greetingLine = "Welcome to NixOS ${config.system.nixos.version} (\m) - \l";
system = {
nixos.label =
if sourceInfo ? shortRev
then "${formatDate sourceInfo.lastModifiedDate}-${sourceInfo.shortRev}"
else "${formatDate sourceInfo.lastModifiedDate}-dirty";
systemBuilderCommands = lib.mkIf (sourceInfo ? rev) ''
echo ${sourceInfo.rev} > $out/config-commit
'';
};
boot = { boot = {
plymouth.enable = true; plymouth.enable = true;