DEV Community

Cover image for Introducing NTIX: bringing declarative packaging on windows
Cristiandis
Cristiandis

Posted on

Introducing NTIX: bringing declarative packaging on windows

NTIX Terminal

What is NTIX?

Ntix is a nix-like package manager for windows. Declare your desired packages in Lua. NTIX figures out what to install, upgrade, and remove across winget, Chocolatey, and Scoop.

NTIX is written purely in C# but compiles to native binaries thanks to NativeAOT, bringing almost c-like performance

Config files

Config files are written in lua, due to the lack of a nix parser on windows.

You can have simple config files such as:

local options = {
    winget = { enable = true, acceptAgreements = true },
    chocolatey = { enable = true, yes = true },
    scoop = { enable = true, buckets = { "main", "extras" } }
}

local pkgs = {}
pkgs.winget = { "Google.Chrome", "7zip.7zip" }
pkgs.chocolatey = { "ripgrep" }
pkgs.scoop = { "fd", "bat" }

return { options = options, pkgs = pkgs }
Enter fullscreen mode Exit fullscreen mode

Or split your configuration across multiple files via the import() function

local env = os.getenv("NTIX_ENV") or "work.dev"

if env == "work.dev" then
    import("environments/work/dev.lua")
elseif env == "work.gaming" then
    import("environments/work/gaming.lua")
elseif env == "personal.gaming" then
    import("environments/personal/gaming.lua")
elseif env == "ci.minimal" then
    import("environments/ci/minimal.lua")
else
    error("Unknown environment: " .. env)
end

return { options = options, pkgs = pkgs }
Enter fullscreen mode Exit fullscreen mode

Package tracking

NTIX has 3 subcommands:

  1. ntix apply, applies current config file and updates state
  2. ntix diff, shows changes between current state and config
  3. ntix state, prints current state

State allow ntix to track which packages it installed so it wont touch packages not managed by it (unless adopted via --adopt flag)

Roadmap

  1. Arbitrary config files: manage dotfiles, shell configs, and system settings declaratively (like NixOS Home Manager);
  2. Windows optional features: enable/disable Hyper-V, OpenSSH, WSL, and other Windows features;
  3. Nix-shells: temporary environments with specific packages for your current session

Try it here!

https://github.com/Cristiandis/NTIX

Top comments (0)