From 30f1b4d92142ed378bac9edb54f438a7f1ba5e0a Mon Sep 17 00:00:00 2001 From: alex Date: Fri, 16 Oct 2026 23:58:30 +0200 Subject: init --- flake.nix | 44 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'flake.nix') 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 +} -- cgit v1.2.3