Files
nixos/flake.nix
T

70 lines
2.1 KiB
Nix

{
description = "luochen570's NixOS configuration";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
agent-nixpkgs.url = "tarball+https://mirrors.cernet.edu.cn/nix-channels/nixos-26.05/nixexprs.tar.xz";
nixpkgs-unstable.url = "tarball+https://mirrors.cernet.edu.cn/nix-channels/nixos-unstable/nixexprs.tar.xz";
# Exact revisions of the source archives previously used on agent.
hermes-agent.url = "github:NousResearch/hermes-agent/3f2afed3eb813cb00bd381d29b084d0e01de048f";
omp.url = "github:can1357/oh-my-pi/08542ed0df02ecaa78aaab28388aa6a563045f16";
herdr-nix = {
url = "github:herdrdev/herdr-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
# Nix4NvChad
nix4nvchad = {
url = "github:nix-community/nix4nvchad";
inputs.nixpkgs.follows = "nixpkgs";
};
# Keep the agent VM on its currently installed NvChad module revision.
agent-nix4nvchad = {
url = "github:nix-community/nix4nvchad/042bbb1be519d01c76d8c65b2e004212b5b706ad";
inputs.nixpkgs.follows = "agent-nixpkgs";
};
# NixOS WSL
nixos-wsl = {
url = "github:nix-community/NixOS-WSL/main";
inputs.nixpkgs.follows = "nixpkgs";
};
# VS Code Server
vscode-server.url = "github:nix-community/nixos-vscode-server";
# SOPS for Nix
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ nixpkgs, home-manager, ... }:
let
username = "luochen570";
hosts = import ./lib/hosts.nix;
mkConfiguredHost =
hostname: cfg:
(import ./lib/mkHost.nix {
nixpkgs = if hostname == "agent" then inputs.agent-nixpkgs else nixpkgs;
inherit home-manager inputs;
})
(
{
inherit hostname username;
}
// cfg
);
in
{
nixosConfigurations = nixpkgs.lib.mapAttrs mkConfiguredHost hosts;
};
}