This commit is contained in:
Mateusz Słodkowicz 2025-05-18 10:05:47 +02:00
parent 80af4584e6
commit ca9e1f520a
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
4 changed files with 22 additions and 5 deletions

1
nix/.#common.nix Symbolic link
View File

@ -0,0 +1 @@
materus@materusPC.1079801:1747170257

View File

@ -180,7 +180,7 @@
} }
{ {
assertion = config.konfig.decrypted; assertion = config.mkk.isDecrypted;
message = "Need to decrypt MKK repo to build"; message = "Need to decrypt MKK repo to build";
} }
]; ];
@ -205,9 +205,9 @@
in in
{ {
options.konfig = lib.mkOption { default = { }; }; options.konfig = lib.mkOption { default = { }; };
options.mkk.isDecrypted = lib.mkOption { default = decryptedBool; };
config = { config = {
konfig = { konfig = {
decrypted = decryptedBool;
unstable = mkkArg.unstable; unstable = mkkArg.unstable;
stable = mkkArg.stable; stable = mkkArg.stable;
current = mkkArg.current; current = mkkArg.current;

View File

@ -1,6 +1,21 @@
# * Outputs - default.nix # * Outputs - default.nix
{ inputs, configRootPath }: { inputs, configRootPath }:
let let
isDecrypted =
npkgs: system:
let
file = ../private/check-encryption;
resultFile = npkgs.legacyPackages."${system}".runCommandLocal "check-encryption" { src = file; } ''
if [[ "$(< $src)" != "DECRYPTED" ]]; then
echo -n "no" >> $out;
else
echo -n "yes" >> $out;
fi
'';
in
(builtins.readFile resultFile == "yes");
stable = inputs.config-stable; stable = inputs.config-stable;
unstable = inputs.config-unstable; unstable = inputs.config-unstable;
nixpkgs = stable.nixpkgs; nixpkgs = stable.nixpkgs;
@ -16,12 +31,14 @@ in
nixosConfigurations = { nixosConfigurations = {
# ** materusPC # ** materusPC
"materusPC" = nixpkgs.lib.nixosSystem { "materusPC" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { mkkArg = mkkArg // {current = stable;}; }; specialArgs = { mkkArg = mkkArg // {current = stable;}; };
modules = [ modules = [
./common.nix
./hosts/materusPC.nix ./hosts/materusPC.nix
(if (isDecrypted stable.nixpkgs system) then ./hosts/materusPC-private.nix else {} )
./common.nix
]; ];
}; };
# * default.nix END # * default.nix END

View File

@ -8,7 +8,6 @@
}: }:
{ {
imports = [ imports = [
./materusPC-private.nix
# * CONFIG # * CONFIG
# ** Nix System Settings # ** Nix System Settings
{ {