diff --git a/flake.nix b/flake.nix index 95eafd3..4e63a96 100644 --- a/flake.nix +++ b/flake.nix @@ -119,7 +119,6 @@ config.allowUnfree = true; config.permittedInsecurePackages = [ "python-2.7.18.6" - # "openssl-1.1.1u" ]; overlays = [ @@ -141,7 +140,6 @@ landingpage = landingpage.packages.${system}.plain; trilium-server = nixpkgs-unstable.legacyPackages.${system}.trilium-server; kmonad = kmonad.packages.${system}.kmonad; - #deploy-rs = deploy-rs.packages.${system}.deploy-rs; }) (import ./nixos/pkgs) ]; @@ -153,6 +151,7 @@ }; # todo : why redefine it? + # Mic92 means, is not needed anymore nixosSystem = args: (lib.makeOverridable lib.nixosSystem) (lib.recursiveUpdate args { diff --git a/nixos/components/default.nix b/nixos/components/default.nix index 1f86233..8c75e65 100644 --- a/nixos/components/default.nix +++ b/nixos/components/default.nix @@ -5,5 +5,6 @@ ./media ./network ./terminal + ./nixos ]; } diff --git a/nixos/components/nixos/default.nix b/nixos/components/nixos/default.nix new file mode 100644 index 0000000..81341c6 --- /dev/null +++ b/nixos/components/nixos/default.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: +{ + imports = [ ./upgrade-diff.nix ]; + + options.components.nixos.enable = lib.mkOption { + type = lib.types.bool; + default = true; + }; + + config = lib.mkIf (config.components.nixos.enable) { }; + +} diff --git a/nixos/components/nixos/upgrade-diff.nix b/nixos/components/nixos/upgrade-diff.nix new file mode 100644 index 0000000..e28e53a --- /dev/null +++ b/nixos/components/nixos/upgrade-diff.nix @@ -0,0 +1,22 @@ +# MIT Jörg Thalheim - https://github.com/Mic92/dotfiles/blob/c6cad4e57016945c4816c8ec6f0a94daaa0c3203/nixos/modules/upgrade-diff.nix +{ config, lib, ... }: +{ + + options.components.nixos.update-diff.enable = lib.mkOption { + type = lib.types.bool; + default = config.components.nixos.enable; + }; + + config = lib.mkIf (config.components.nixos.update-diff.enable) { + system.activationScripts.diff = { + supportsDryActivation = true; + text = '' + if [[ -e /run/current-system ]]; then + echo "--- diff to current-system" + ${config.nix.package}/bin/nix --extra-experimental-features nix-command store diff-closures /run/current-system "$systemConfig" + echo "---" + fi + ''; + }; + }; +}