Start switch to nixos-facter

This commit is contained in:
Fern Garden 2025-08-23 17:00:28 +08:00
parent 891ce0ce17
commit 32c24866e9
3 changed files with 6485 additions and 14 deletions

View file

@ -7,7 +7,7 @@
nixpkgs-pr-feishin.url = "github:NixOS/nixpkgs?ref=pull/414929/head"; # Feishin 0.17.0
deploy-rs.url = "github:serokell/deploy-rs"; # Remote deployment.
nixos-hardware.url = "github:NixOS/nixos-hardware"; # Hardware specific config.
nixos-facter.url = "github:nix-community/nixos-facter-modules"; # Hardware specific config.
# Secure boot.
lanzaboote = {
@ -40,7 +40,7 @@
};
};
outputs = {nixos-hardware, ...} @ inputs: let
outputs = {...} @ inputs: let
# Import helpers & make functions available.
helpers = import ./helpers.nix inputs;
inherit (helpers) mergeHosts mkHost;
@ -49,26 +49,17 @@
# ThinkPad T480.
(mkHost "muskduck" {
suite = "desktop";
hostModules = [
nixos-hardware.nixosModules.lenovo-thinkpad-t480
];
})
# ThinkPad X220.
(mkHost "pardalote" {
suite = "desktop";
hostModules = [
nixos-hardware.nixosModules.lenovo-thinkpad-x220
];
})
# Raspberry Pi 4B.
(mkHost "weebill" {
suite = "server";
platform = "aarch64-linux";
hostModules = [
nixos-hardware.nixosModules.raspberry-pi-4
];
})
# VM running docker containers.

View file

@ -11,7 +11,6 @@ with inputs.nixpkgs.lib; {
platform ? "x86_64-linux",
suite ? "",
docker ? false,
hostModules ? [],
}: let
# System architecture.
system = platform;
@ -21,8 +20,7 @@ with inputs.nixpkgs.lib; {
# Extra modules to import.
extraModules =
hostModules # Host-specific modules.
++ optionals (docker == true) [./suites/server/docker] # Enable docker if required.
optionals (docker == true) [./suites/server/docker] # Enable docker if required.
++ (filesystem.listFilesRecursive ./modules); # Custom modules.
# nixpkgs config.
@ -78,6 +76,10 @@ with inputs.nixpkgs.lib; {
lanzaboote.nixosModules.lanzaboote # Secure boot.
sops-nix.nixosModules.sops # Secrets management.
# Hardware configuration.
nixos-facter.nixosModules.facter
{config.facter.reportPath = ./hosts/${hostname}/facter.json;}
./suites/${suite} # Collection of configuration options for different types of systems.
./hosts/${hostname} # Host-specific config.

6478
hosts/muskduck/facter.json Normal file

File diff suppressed because it is too large Load diff