add upgrade-diff
This commit is contained in:
parent
3f55aba94b
commit
7ab2734f3b
4 changed files with 36 additions and 2 deletions
|
@ -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 {
|
||||
|
|
|
@ -5,5 +5,6 @@
|
|||
./media
|
||||
./network
|
||||
./terminal
|
||||
./nixos
|
||||
];
|
||||
}
|
||||
|
|
12
nixos/components/nixos/default.nix
Normal file
12
nixos/components/nixos/default.nix
Normal file
|
@ -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) { };
|
||||
|
||||
}
|
22
nixos/components/nixos/upgrade-diff.nix
Normal file
22
nixos/components/nixos/upgrade-diff.nix
Normal file
|
@ -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
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue