-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #68 from nix-community/feat/debug
feat: provide nvd and nix-diff view of facter changes
- Loading branch information
Showing
3 changed files
with
186 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{ | ||
lib, | ||
pkgs, | ||
config, | ||
extendModules, | ||
... | ||
}: | ||
{ | ||
|
||
options = { | ||
|
||
system.build = { | ||
noFacter = lib.mkOption { | ||
type = lib.types.unspecified; | ||
description = "A version of the system closure with facter disabled"; | ||
}; | ||
}; | ||
|
||
facter.debug = { | ||
nvd = lib.mkOption { | ||
type = lib.types.package; | ||
description = '' | ||
A shell application which will produce an nvd diff of the system closure with and without facter enabled. | ||
''; | ||
}; | ||
nix-diff = lib.mkOption { | ||
type = lib.types.package; | ||
description = '' | ||
A shell application which will produce a nix-diff of the system closure with and without facter enabled. | ||
''; | ||
}; | ||
}; | ||
|
||
}; | ||
|
||
config.system.build = { | ||
noFacter = extendModules { | ||
modules = [ | ||
{ | ||
# we 'disable' facter by overriding the report and setting it to empty with one caveat: hostPlatform | ||
config.facter.report = lib.mkForce { | ||
system = config.nixpkgs.hostPlatform; | ||
}; | ||
} | ||
]; | ||
}; | ||
}; | ||
|
||
config.facter.debug = { | ||
|
||
nvd = pkgs.writeShellApplication { | ||
name = "facter-diff"; | ||
runtimeInputs = [ pkgs.nvd ]; | ||
text = '' | ||
nvd diff \ | ||
${config.system.build.noFacter.config.system.build.toplevel} \ | ||
${config.system.build.toplevel} \ | ||
"$@" | ||
''; | ||
}; | ||
|
||
nix-diff = pkgs.writeShellApplication { | ||
name = "facter-diff"; | ||
runtimeInputs = [ pkgs.nix-diff ]; | ||
text = '' | ||
nix-diff \ | ||
${config.system.build.noFacter.config.system.build.toplevel} \ | ||
${config.system.build.toplevel} \ | ||
"$@" | ||
''; | ||
}; | ||
|
||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
imports = [ | ||
./bluetooth.nix | ||
./disk.nix | ||
./debug.nix | ||
./fingerprint | ||
./firmware.nix | ||
./graphics | ||
|