just report
This commit is contained in:
parent
9704c36cb3
commit
6ddab8dd84
24
flake.nix
24
flake.nix
@ -191,6 +191,27 @@
|
||||
};
|
||||
modules = [ (mkModule domain system inputs stateVersion modules hostname) ];
|
||||
};
|
||||
mkReport = domain: system: inputs: stateVersion: modules: hostname: let
|
||||
nixos = mkConfig domain system inputs stateVersion modules hostname;
|
||||
cfg = nixos.config;
|
||||
inherit (nixos.pkgs) lib;
|
||||
in {
|
||||
inherit system; # TODO: cross system
|
||||
fqdn = cfg.networking.fqdn;
|
||||
allowedTCPPorts = cfg.networking.firewall.allowedTCPPorts;
|
||||
allowedUDPPorts = cfg.networking.firewall.allowedUDPPorts;
|
||||
bootloader = if cfg.boot.loader.grub.enable then "grub"
|
||||
else if cfg.boot.loader.systemd-boot.enable then "systemd-boot"
|
||||
else null;
|
||||
mounts = lib.pipe cfg.fileSystems [
|
||||
(lib.filterAttrs (mount: fs: fs.fsType != "nfs"))
|
||||
(lib.mapAttrs (mount: fs: "${fs.fsType}://${fs.device}"))
|
||||
];
|
||||
nginx-vhosts = lib.pipe cfg.services.nginx.virtualHosts [
|
||||
#(lib.filterAttrs (domain: vhost: )
|
||||
(lib.mapAttrs (domain: vhost: vhost.serverAliases or []))
|
||||
];
|
||||
};
|
||||
mkHosts = mk: let
|
||||
ls = imports: { inherit imports; };
|
||||
hw = nixos-hardware.nixosModules;
|
||||
@ -228,6 +249,7 @@
|
||||
|
||||
nixosModules = mkHosts mkModule;
|
||||
nixosConfigurations = mkHosts mkConfig;
|
||||
nixosReports = mkHosts mkReport;
|
||||
|
||||
packages = forAllSystems ({ inputs, pkgs, lib, flakes, ... }: {
|
||||
nixos-rebuild-nom = pkgs.writeScriptBin "nixos-rebuild" ''
|
||||
@ -277,6 +299,7 @@
|
||||
pkgs.age
|
||||
pkgs.sops
|
||||
pkgs.ssh-to-age
|
||||
pkgs.just
|
||||
];
|
||||
in {
|
||||
envrc-local = mkShell envrc-pkgs;
|
||||
@ -289,6 +312,7 @@
|
||||
flakes.self.pkgs.nixos-rebuild-nom
|
||||
pkgs.age
|
||||
pkgs.ssh-to-age
|
||||
pkgs.just
|
||||
];
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user