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
inherit (config.m-0) hosts;
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 {
imports = [
../../common
./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 = {
defaultLocale = "en_DK.UTF-8";

View file

@ -3,10 +3,24 @@
config,
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 = [
../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 = {
plymouth.enable = true;