1
0
Fork 0

improve usage manual

This commit is contained in:
ibizaman 2024-01-20 20:22:42 -08:00 committed by Pierre Penninckx
parent 7e2f76e7f9
commit a669fce572

View file

@ -8,6 +8,24 @@ Self Host Blocks is available as a flake. To use it in your project, add the fol
inputs.selfhostblocks.url = "github:ibizaman/selfhostblocks"; inputs.selfhostblocks.url = "github:ibizaman/selfhostblocks";
``` ```
Then, in your `nixosConfigurations`, import the module with:
```nix
imports = [
inputs.selfhostblocks.nixosModules.x86_64-linux.default
];
```
For now, Self Host Blocks has a hard dependency on `sops-nix`. I am [working on removing
that](https://github.com/ibizaman/selfhostblocks/issues/24) so you can use any secrets manager you
want. Until then, you also need to import the `sops-nix` module:
```nix
imports = [
inputs.selfhostblocks.inputs.sops-nix.nixosModules.default
];
```
Self Host Blocks provides its own `nixpkgs` input so both can be updated in lock step, ensuring Self Host Blocks provides its own `nixpkgs` input so both can be updated in lock step, ensuring
maximum compatibility. It is recommended to use the following `nixpkgs` as input for your deployments: maximum compatibility. It is recommended to use the following `nixpkgs` as input for your deployments:
@ -38,20 +56,20 @@ The following snippets show how to deploy Self Host Blocks using the deployment
}; };
outputs = { self, selfhostblocks }: { outputs = { self, selfhostblocks }: {
colmena = { colmena =
meta = let
let system = "x86_64-linux";
system = "x86_64-linux"; in {
in { meta = {
nixpkgs = import selfhostblocks.inputs.nixpkgs { inherit system; }; nixpkgs = import selfhostblocks.inputs.nixpkgs { inherit system; };
}; };
machine = { selfhostblocks, ... }: { machine = { selfhostblocks, ... }: {
imports = [ imports = [
selfhostblocks.nixosModules.${system}.default selfhostblocks.nixosModules.${system}.default
]; ];
};
}; };
};
}; };
} }
``` ```
@ -69,23 +87,23 @@ is defined exclusively by the `selfhostblocks` input. It is more likely that you
outputs = { self, selfhostblocks }: { outputs = { self, selfhostblocks }: {
colmena = { colmena = {
meta = let
let system = "x86_64-linux";
system = "x86_64-linux"; in {
in { meta =
nixpkgs = import nixpkgs { inherit system; }; nixpkgs = import nixpkgs { inherit system; };
nodeNixpkgs = { nodeNixpkgs = {
machine2 = import selfhostblocks.inputs.nixpkgs { inherit system; }; machine2 = import selfhostblocks.inputs.nixpkgs { inherit system; };
}; };
}; };
machine1 = ...; machine1 = ...;
machine2 = { selfhostblocks, ... }: { machine2 = { selfhostblocks, ... }: {
imports = [ imports = [
selfhostblocks.nixosModules.${system}.default selfhostblocks.nixosModules.${system}.default
]; ];
}; };
}; };
}; };
} }