127 lines
3.3 KiB
Nix
127 lines
3.3 KiB
Nix
{
|
|
description = "Fxnet system configurations";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-25.05";
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
photocatalog = {
|
|
url = "github:derfenix/photocatalog";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
disko = {
|
|
url = "github:nix-community/disko/latest";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
raspberry-pi-nix = {
|
|
url = "github:nix-community/raspberry-pi-nix/master";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nixos-hardware = {
|
|
url = "github:NixOS/nixos-hardware/master";
|
|
};
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
self,
|
|
nixpkgs,
|
|
nixpkgs-stable,
|
|
disko,
|
|
...
|
|
}@inputs:
|
|
let
|
|
lib = nixpkgs.lib;
|
|
|
|
timeZone = "Europe/Moscow";
|
|
stateVersion = "25.05";
|
|
|
|
hmModules = builtins.map (name: ./modules/hm + "/${name}") (
|
|
builtins.attrNames (builtins.readDir ./modules/hm)
|
|
);
|
|
sysModules = builtins.map (name: ./modules/sys + "/${name}") (
|
|
builtins.attrNames (builtins.readDir ./modules/sys)
|
|
);
|
|
pkgsSettings = (
|
|
system:
|
|
import nixpkgs {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
}
|
|
);
|
|
pkgsStableSettings =
|
|
system:
|
|
import nixpkgs-stable {
|
|
inherit system;
|
|
config.allowUnfree = true;
|
|
};
|
|
|
|
hosts = import ./hosts.nix;
|
|
hostNames = builtins.attrNames hosts;
|
|
|
|
commonModules = [
|
|
(
|
|
{ lib, pkgs, ... }:
|
|
{
|
|
system.stateVersion = stateVersion;
|
|
time.timeZone = lib.mkDefault timeZone;
|
|
home-manager = {
|
|
backupFileExtension = ".bak";
|
|
useGlobalPkgs = true;
|
|
useUserPackages = true;
|
|
sharedModules = hmModules ++ [
|
|
(
|
|
{ osConfig, ... }:
|
|
{
|
|
home.stateVersion = osConfig.system.stateVersion;
|
|
}
|
|
)
|
|
];
|
|
extraSpecialArgs = {
|
|
inherit inputs;
|
|
pkgsStable = pkgsStableSettings pkgs.system;
|
|
hosts = hosts;
|
|
};
|
|
};
|
|
}
|
|
)
|
|
inputs.home-manager.nixosModules.home-manager
|
|
inputs.photocatalog.nixosModules.photocatalog
|
|
disko.nixosModules.disko
|
|
./options.nix
|
|
./nix.nix
|
|
]
|
|
++ sysModules;
|
|
in
|
|
{
|
|
nixosConfigurations = lib.genAttrs hostNames (
|
|
name:
|
|
let
|
|
host = hosts.${name};
|
|
in
|
|
if host ? system then
|
|
inputs.nixpkgs.lib.nixosSystem {
|
|
system = host.system;
|
|
specialArgs = {
|
|
inherit inputs;
|
|
pkgsStable = pkgsStableSettings host.system;
|
|
hosts = hosts;
|
|
ip = host.ip;
|
|
quirks = (quirks: (import ./quirks { inherit quirks; }));
|
|
};
|
|
pkgs = pkgsSettings host.system;
|
|
modules = commonModules ++ [
|
|
./hosts/${name}
|
|
./hosts/${name}/hardware-configuration.nix
|
|
./roles/${host.role}.nix
|
|
];
|
|
}
|
|
else
|
|
{ }
|
|
);
|
|
};
|
|
}
|