summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix44
1 files changed, 36 insertions, 8 deletions
diff --git a/flake.nix b/flake.nix
index a0e0f9d..3f80238 100644
--- a/flake.nix
+++ b/flake.nix
@@ -27,25 +27,53 @@
outputs = {
self,
nixpkgs,
- lanzaboote,
home-manager,
ocnix,
opencode,
...
} @ inputs: let
+ mkHost = {
+ hostname,
+ system ? "x86_64-linux",
+ modules ? [],
+ }:
+ nixpkgs.lib.nixosSystem {
+ inherit system;
+ specialArgs = { inherit inputs opencode; };
+ modules =
+ [
+ {
+ networking.hostName = hostname;
+ nixpkgs.overlays = [ ocnix.overlays.default ];
+ }
+ ocnix.nixosModules.opencode
+ home-manager.nixosModules.home-manager
+ ./nixos/common.nix
+ {
+ home-manager.useGlobalPkgs = true;
+ home-manager.useUserPackages = true;
+ home-manager.extraSpecialArgs = { inherit inputs; };
+ home-manager.users.phos = import ./home-manager/home.nix;
+ }
+ ]
+ ++ modules;
+ };
in {
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
nixosConfigurations = {
- phosphophyllite = nixpkgs.lib.nixosSystem {
- specialArgs = { inherit inputs opencode; };
- # > Our main nixos configuration file <
+ phosphophyllite = mkHost {
+ hostname = "phosphophyllite";
modules = [
- { nixpkgs.overlays = [ ocnix.overlays.default ]; }
- ocnix.nixosModules.opencode
- ./nixos/configuration.nix
+ ./hosts/phosphophyllite
];
};
+
+ # Add your laptop here when ready.
+ # laptop-hostname = mkHost {
+ # hostname = "laptop-hostname";
+ # modules = [ ./hosts/laptop ];
+ # };
};
# Standalone home-manager configuration entrypoint
@@ -61,4 +89,4 @@
};
};
};
-} \ No newline at end of file
+}