about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--flake.nix7
-rw-r--r--nix/lib/flake-helper.nix19
2 files changed, 20 insertions, 6 deletions
diff --git a/flake.nix b/flake.nix
index 16ab234..ec99444 100644
--- a/flake.nix
+++ b/flake.nix
@@ -19,6 +19,10 @@
     naersk.url = "git+https://github.com/nix-community/naersk";
     naersk.inputs.nixpkgs.follows = "nixpkgs";
 
+    microvm.url = "git+https://github.com/astro/microvm.nix";
+    microvm.inputs.nixpkgs.follows = "nixpkgs";
+
+
     # hefe-internal.url = "git+ssh://gitea@git.emile.space/hanemile/hefe-internal.git?ref=main";
 
     # nix registry add flake:mylocalrepo git+file:///path/to/local/repo
@@ -39,6 +43,7 @@
       home-manager, # manage my home envs
       naersk, # build rust stuff
       hefe-internal, # internal tooling
+      microvm, # microvms
       ...
     }@inputs:
     let
@@ -60,6 +65,8 @@
           ip = "corrino";
           description = "Hetzner AX41 dual 512GB NVME";
           modules = [ hefe-internal.nixosModules.corrino ];
+          microvms = true;
+          # unstable = true;
         };
         chusuk = {
           # ip = "chusuk.pinto-pike.ts.net";
diff --git a/nix/lib/flake-helper.nix b/nix/lib/flake-helper.nix
index ed5e9ba..dde9256 100644
--- a/nix/lib/flake-helper.nix
+++ b/nix/lib/flake-helper.nix
@@ -3,9 +3,11 @@
   agenix,
   nixpkgs,
   nixpkgs-unstable,
+  nixpkgs-master,
   deploy-rs,
   home-manager,
   darwin,
+  microvm,
   ...
 }@inputs:
 
@@ -20,12 +22,19 @@ rec {
       homeManagerEnable ? false,
       group ? null,
       modules ? [ ],
+      unstable ? false,
+      master ? false,
+      microvms ? false,
       ...
     }:
     let
 
-      # inputs.nixpkgs-${name}, if that doesn't exist, just use nixpkgs
-      localNixpkgs =
+      localNixpkgs = if unstable == true then
+        nixpkgs-unstable
+        else if master == true then
+        nixpkgs-master
+        else
+        # inputs.nixpkgs-${name}, if that doesn't exist, just use nixpkgs
         nixpkgs.lib.attrByPath [ "nixpkgs-${name}" ] # path
           nixpkgs # default
           inputs; # base
@@ -52,14 +61,12 @@ rec {
         modules
         ++ [
 
-          (
-            if system == "x86_64-linux" then
+          (if system == "x86_64-linux" then
               self.nixosModules.x86_64-linux
             else if system == "aarch64-darwin" then
               ({ })
             else
-              null
-          )
+              null)
 
           # a module so that we can access the flake output from inside the
           # flake (yes, I need this for fetching the system type while building the hosts for deploy-rs)