diff --git a/flake.lock b/flake.lock index f44c772..2c0bbd8 100644 --- a/flake.lock +++ b/flake.lock @@ -190,6 +190,21 @@ "type": "github" } }, + "nixos-facter-modules": { + "locked": { + "lastModified": 1736931726, + "narHash": "sha256-aY55yiifyo1XPPpbpH0kWlV1g2dNGBlx6622b7OK8ks=", + "owner": "nix-community", + "repo": "nixos-facter-modules", + "rev": "fa11d87b61b2163efbb9aed7b7a5ae0299e5ab9c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-facter-modules", + "type": "github" + } + }, "nixos-hardware": { "locked": { "lastModified": 1736978406, @@ -315,6 +330,7 @@ "_1password-shell-plugins": "_1password-shell-plugins", "home-manager": "home-manager", "master": "master", + "nixos-facter-modules": "nixos-facter-modules", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "nur": "nur", diff --git a/flake.nix b/flake.nix index 79246a0..6090dc7 100644 --- a/flake.nix +++ b/flake.nix @@ -6,6 +6,7 @@ unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; master.url = "github:NixOS/nixpkgs/master"; nixos-hardware.url = "github:NixOS/nixos-hardware"; + nixos-facter-modules.url = "github:nix-community/nixos-facter-modules"; nur.url = "github:nix-community/NUR"; treefmt-nix = { @@ -126,6 +127,7 @@ system = "x86_64-linux"; host = "thinkpad"; user = "gael"; + facter = true; } { system = "x86_64-linux"; diff --git a/lib/os/default.nix b/lib/os/default.nix index 1e90235..e5c2b5a 100644 --- a/lib/os/default.nix +++ b/lib/os/default.nix @@ -1,10 +1,10 @@ { inputs, ... }: let - inherit (inputs) self nixpkgs sops-nix nur home-manager udev-nix _1password-shell-plugins; + inherit (inputs) self nixpkgs sops-nix nur home-manager nixos-facter-modules udev-nix _1password-shell-plugins; in rec { - mkNixosSystem = { system, host, user, iso ? false, ... }: nixpkgs.lib.nixosSystem { + mkNixosSystem = { system, host, user, iso ? false, facter ? false, ... }: nixpkgs.lib.nixosSystem { inherit system; specialArgs = { @@ -46,6 +46,7 @@ rec { ] ); }) + nixos-facter-modules.nixosModules.facter ../../hosts/${host}/configuration.nix ../../users/${user}/configuration.nix @@ -66,6 +67,8 @@ rec { sops = { defaultSopsFile = ../../secrets/default.yaml; }; + }) // (nixpkgs.lib.optionalAttrs facter { + facter.reportPath = ../../hosts/${host}/facter.json; })) ] ++ (nixpkgs.lib.optionals (!iso) [ ../../mixins/nix diff --git a/mixins/default.nix b/mixins/default.nix index d3b48d9..8247c12 100644 --- a/mixins/default.nix +++ b/mixins/default.nix @@ -87,6 +87,7 @@ pre-commit commitizen gnumake + unstable.nixos-facter ]; users.defaultUserShell = pkgs.bash;