oops forgot the actually terrible part of ccf5e34

This commit is contained in:
Jill 2024-03-04 13:41:35 +03:00
parent 060e0fa826
commit 25a5c6e1a6
1 changed files with 20 additions and 0 deletions

20
modules/os-release.nix Normal file
View File

@ -0,0 +1,20 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.os-release;
in {
options.modules.os-release = {
enable = mkEnableOption "Modify /etc/os-release. Highly cursed";
logo = mkOption { type = types.str; };
};
config = mkIf cfg.enable {
environment.etc."os-release" = let
orig = config.environment.etc."os-release".text; # help
replaced = replaceStrings [ "nix-snowflake" ] [ cfg.logo ] orig;
in {
source = mkForce (pkgs.writeText "os-release" replaced);
};
};
}