Initialize nixos server config

This commit is contained in:
thiloho
2025-10-24 11:21:28 +02:00
parent e2cb8845b0
commit 272fc2f256
3 changed files with 190 additions and 0 deletions

56
flake.nix Normal file
View File

@@ -0,0 +1,56 @@
{
description = "NixOS configuration";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs =
inputs@{ nixpkgs, home-manager, ... }:
let
systems = [
"x86_64-linux"
"aarch64-linux"
];
forAllSystems =
f:
builtins.listToAttrs (
map (system: {
name = system;
value = f system;
}) systems
);
in
{
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell {
packages = with pkgs; [
nixd
nixfmt
];
};
}
);
nixosConfigurations =
let
mkSystem =
entrypoint:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
entrypoint
{ nix.registry.nixpkgs.flake = nixpkgs; }
];
};
in
{
server = mkSystem ./server;
};
};
}