Getting Started
Installation
Initialize a new project from a template:
nix flake init -t github:anialic/nixy#minimal
Available templates:
minimal- Single NixOS machinemulti-platform- NixOS + Darwin + Home Managerdeploy-rs- Remote deploymentwithout-flakes- Traditional setup
Project Structure
my-config/
├── flake.nix
├── modules/
│ └── base.nix
└── nodes/
└── my-machine.nix
Basic Configuration
flake.nix
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.nixy.url = "github:anialic/nixy";
outputs = { nixpkgs, nixy, ... }@inputs: nixy.mkFlake {
inherit nixpkgs;
imports = [ ./. ];
args = { inherit inputs; };
};
}
modules/base.nix
{ mkStr, ... }:
{
modules.base = {
target = "nixos";
options.hostName = mkStr null;
module = { node, ... }: {
networking.hostName = node.base.hostName;
system.stateVersion = "24.11";
};
};
}
nodes/my-machine.nix
{
nodes.my-machine = {
system = "x86_64-linux";
base.enable = true;
base.hostName = "my-machine";
};
}
Building
nixos-rebuild switch --flake .#my-machine