Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some way of diff'ing your system closure before and after applying facter #52

Closed
brianmcgee opened this issue Oct 27, 2024 · 2 comments · Fixed by #68
Closed

Some way of diff'ing your system closure before and after applying facter #52

brianmcgee opened this issue Oct 27, 2024 · 2 comments · Fixed by #68
Assignees
Labels
enhancement New feature or request

Comments

@brianmcgee
Copy link
Collaborator

Perhaps "nix-diff" combined with extendModules can be used to set an empty report?

@r-vdp I heard this is something that you do, is there a pattern you can share?

@brianmcgee brianmcgee added the enhancement New feature or request label Oct 27, 2024
@brianmcgee brianmcgee self-assigned this Oct 27, 2024
@r-vdp
Copy link
Collaborator

r-vdp commented Nov 4, 2024

So, what you can do is something like adding this in your config:

{ config, extendModules }: {
    config.system.build.toplevelWithEmptyFacter =
      (extendModules {
        modules =
          let
            prevConfig = config;
          in
          [
            {
              config.facter.report = {
                inherit (prevConfig.facter.report) system;
                hardware.graphics_card = [ ];
              };
            }
          ];
      }).config.system.build.toplevel;
} 

And then nix-diff this with your normal toplevel:

nix run 'nixpkgs#nix-diff' -- (nix build -vL '.#nixosConfigurations.framework.config.system.build.toplevelWithEmptyFacter' --print-out-paths) (nix build -vL '.#nixosConfigurations.framework.config.system.build.toplevel' --print-out-paths)

This works ok, but I'm not sure it captures everything.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nixos-facter-moved-to-nix-community/58818/13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants