This is @ajhalili2006's NixOS + Home Manager configuration for his laptop and homelabs, alongside in tildes with Nix installed and in sync with the nixpkgs-specific branch of my dotfiles repository.
| Workflow Name and Type | CI Platform | Badge/Link |
|---|---|---|
| Nix Flake CI - Live ISO builds (push) | GitHub Actions | |
| Nix Flake CI - lockfile updates (schedule, every 22:30 UTC Fridays) | GitHub Actions |
Canonically published at GitLab.com, with push mirroring enabled to GitHub. Along with the following mirrors:
I already ported my GitHub Copilot instructions into the standard AGENTS.md file so
your AI tools can easily speedrun things in different shell sessions with Antigravity CLI
(and friends) up and running. While this is untested, I symlinked the old file location for
compatibility so you're good to go if you are contributing patches or just forking around and
finding out for your own NixOS + home-manager setups.
Since I am also a Zed user, I also tucked in some project-wide settings and you can even use Zed Agent if you need to (I am on the free year of Zed Pro for university/college students since July 24, 2026 alongside holding the Google AI Pro trial for students since October 11, 2026).
It is recommended to install NixOS using either the Calamares-based graphical
installer or manually through the nixos-install utility, especially when you have
consider partitioning on your drive to ensure that you can roll back safely in case
things go wrong.
After installation, copy the generated NixOS configuration files from /etc/nixos
into a new directory named hosts/<host-name>. Note that on the rest of
the README, the placeholder <host-name> is used to denote the hostname of a new
or existing machine under Nix flake-based setup.
cp -rv /etc/nixos/ hosts/<host-name>/On the flake.nix file, under the nixosConfigurations block, add the new host using the template below
<host-name> = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./hosts/<host-name>/configuration.nix
# load Determinate Nix and the rest
determinate.nixosModules.default
home-manager.nixosModules.home-manager
vscode-server.nixosModules.default
nix-ld.nixosModules.nix-ld
# one-liners?
{ programs.nix-ld.dev.enable = true; }
];
specialArgs = {
inherit
self
nixpkgs
home-manager
nixos-hardware
determinate
vscode-server
nix-ld
flake-utils
systems
nixos-generators
zen-browser
nix4vscode
firefox-addons
agenix
agenix-rekey
chaotic
llm-agents
dev-pkgs
;
};
};Then on your hosts/<host-name>/configuration.nix, add the needed imports
as needed:
imports = [
./hardware-configuration.nix
../../shared/gnupg.nix
../../shared/meta-configs.nix
../../shared/server/ssh.nix
../../shared/server/tailscale.nix
../../shared/systemd.nix
# add more imports here
]Adjust as needed before running a nixos-rebuild switch or nixos-rebuild boot
into the new configuration and you're ready to go.
EDITOR="nano" # or code/zed/hx if you do
$EDITOR <path/to/nixfile.nix>
git stage <path/to/nixfile.nix>
git commit --signoff
# update the flake.lock file manually
nix flake update
# on the another machine...
# change {hostname} to something like stellapent-cier
sudo nixos-rebuild --flake github:andreijiroh-dev/nixops-config#{hostname} <switch|boot|build>From a local copy:
# update the flake.lock file manually
nix flake update
# change {hostname} to something like stellapent-cier
sudo nixos-rebuild --flake .#{hostname} <switch|boot|build>You can easily use this flake as an external module in your own flake-based NixOS configuration if you want to reuse some of my configurations.
{
description = "My NixOS configuration";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; # use nixos-unstable instead if preferred
inputs.andreijiroh-dev.url = "github:andreijiroh-dev/nixops-config";
# needed if you use stable instead of unstable
inputs.andreijiroh-dev.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, andreijiroh-dev, nixpkgs }: {
{
nixosConfigurations.{hostname} = nixpkgs.lib.nixosSystem {
# your customizations here
};
nixosConfigurations.your-mom = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
andreijiroh-dev.exportedConfigs.networking # or any other modules
];
};
};
}If you also want to use the custom packages I built through the nixpkgs' system, just add it
to your nixpkgs.overlays config.
# make sure to pass `andreijiroh-dev` as `extraSpecialArgs` to your NixOS/home-manager config
# on the flake.nix to avoid issues
{ pkgs, andreijiroh-dev, lib, ... }:
{
nixpkgs.overlays = [
andreijiroh-dev.overlays.default
# other overlays
];
}Replace <package-name> with the package you want to use. See the pkgs README for details.
nix profile install github:andreijiroh-dev/nixops-config#<package-name>Currently available as amd64 (x86-64) Linux ISO only for now, but you can copy
the recoverykit-amd64 NixOS configuration and change system to any supported CPU
architectures by NixOS.
# Build using the sources as remote
nix build github:andreijiroh-dev/nixops-config/main#nixosConfigurations.recoverykit-amd64.config.system.build.isoImage
# ...or via a local clone
nix build .#nixosConfigurations.recoverykit-amd64.config.system.build.isoImageThese are accessible via exportedConfigs object after importing this flake on your flake.nix file.
base- Individual base components' configuration (systemd, networking, etc.)sshKeys- My SSH public keys, declaratively managed. =hostsFile- Static list of host entries, used for merging with host-specific hosts file.systemd- Systemd configurations and service units.networking- Networking configurations, mostly for configuring DNS resolvers viasystemd-resolved.locale- Time and locale settings (e.g. timezone, i18n configs).gnupg- GPG Agent settings and packages related to GPG and friends =metaConfigs- Nixpkgs and Nix settings, also contains thesystem.stateVersionsetting.
meta- same asbase, but oneliner import.
MPL-2.0