chore: scaffold flake + settings + entry-point quartet
Single-source-of-truth pattern: settings.nix threads identity, host, and remote topology into every module via specialArgs. configuration.nix and home.nix stay thin import-lists so module composition is obvious. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
677b8c7c27
commit
3f528623b3
4 changed files with 208 additions and 0 deletions
67
flake.nix
Normal file
67
flake.nix
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
{
|
||||
description = "lnbits-sensei — opinionated NixOS scaffold for an LNbits dev stack";
|
||||
|
||||
inputs = {
|
||||
# Pinned to nixos-unstable for fresh LNbits / Lightning tooling.
|
||||
# Bump intentionally; this template does not chase HEAD.
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Upstream LNbits source. Tracked as a flake input so the lnbits
|
||||
# module can pin to a specific ref and the dev-env helpers can
|
||||
# surface upstream-relative diffs without a separate clone step.
|
||||
#
|
||||
# Override locally with `--override-input lnbits-src path:/your/fork`
|
||||
# when iterating on a feature destined for an upstream PR.
|
||||
lnbits-src = {
|
||||
url = "github:lnbits/lnbits";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
...
|
||||
}@inputs:
|
||||
let
|
||||
system = "x86_64-linux";
|
||||
settings = import ./settings.nix;
|
||||
|
||||
# specialArgs / extraSpecialArgs flow mirrors the omnixy pattern:
|
||||
# `settings` (single source of truth — user, host, identity,
|
||||
# remote topology) is threaded into every NixOS module and into
|
||||
# the home-manager module set, so neither has to re-import it.
|
||||
in
|
||||
{
|
||||
nixosConfigurations.${settings.hostName} = nixpkgs.lib.nixosSystem {
|
||||
inherit system;
|
||||
|
||||
specialArgs = {
|
||||
inherit inputs settings;
|
||||
};
|
||||
|
||||
modules = [
|
||||
./configuration.nix
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
extraSpecialArgs = {
|
||||
inherit inputs settings;
|
||||
};
|
||||
users.${settings.user} = import ./home.nix;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in a new issue