Skip to content

Commit

Permalink
feat(lib/os): nixos-facter module
Browse files Browse the repository at this point in the history
  • Loading branch information
gaelreyrol committed Jan 25, 2025
1 parent 92d39a4 commit 8f75fec
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
16 changes: 16 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -126,6 +127,7 @@
system = "x86_64-linux";
host = "thinkpad";
user = "gael";
facter = true;
}
{
system = "x86_64-linux";
Expand Down
7 changes: 5 additions & 2 deletions lib/os/default.nix
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down Expand Up @@ -46,6 +46,7 @@ rec {
]
);
})
nixos-facter-modules.nixosModules.facter

../../hosts/${host}/configuration.nix
../../users/${user}/configuration.nix
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions mixins/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
pre-commit
commitizen
gnumake
unstable.nixos-facter
];

users.defaultUserShell = pkgs.bash;
Expand Down

0 comments on commit 8f75fec

Please sign in to comment.