From 6182e09a414f12b9eabd37726ab3eac08919a49c Mon Sep 17 00:00:00 2001 From: EsVagy42 Date: Sun, 18 Jan 2026 14:37:45 +0100 Subject: [PATCH] Nixos label fixing regex, fixes #10 --- commit_text | 2 +- configuration.nix | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/commit_text b/commit_text index 1ae2e87..38e6e54 100644 --- a/commit_text +++ b/commit_text @@ -1 +1 @@ -Added additional config for nh +Nixos label fixing regex, fixes #10 diff --git a/configuration.nix b/configuration.nix index 2aafbfb..1adf2a4 100644 --- a/configuration.nix +++ b/configuration.nix @@ -134,9 +134,11 @@ in boot.loader.grub.efiSupport = true; boot.loader.efi.canTouchEfiVariables = true; boot.loader.grub.useOSProber = true; - system.nixos.label = builtins.replaceStrings [ "\n" " " ] [ "" "_" ] ( - builtins.readFile ./commit_text - ); + system.nixos.label = lib.pipe (builtins.readFile ./commit_text) [ + (lib.strings.trim) + (lib.strings.split "[^[:alnum:]:_.-]+") + (lib.strings.concatMapStrings (s: if lib.isList s then "_" else s)) + ]; # Needed for audio to work boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_latest; @@ -398,7 +400,7 @@ in productive = { inheritParentConfig = true; configuration = { - environment.etc."specialisation".text = "productive"; + environment.etc."specialisation".text = "productive"; environment.systemPackages = basePackages; programs.steam.enable = lib.mkOverride 99 false; } @@ -413,7 +415,7 @@ in no_yt = { inheritParentConfig = true; configuration = { - environment.etc."specialisation".text = "no_yt"; + environment.etc."specialisation".text = "no_yt"; environment.systemPackages = basePackages ++ unproductivePackages; } // blocky_config (