diff --git a/.gitignore b/.gitignore index 4cc9af5..b687b22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.swp result +*.qcow2 diff --git a/flake.lock b/flake.lock index e99ff9e..d1a648f 100644 --- a/flake.lock +++ b/flake.lock @@ -21,6 +21,42 @@ "type": "github" } }, + "nixlib": { + "locked": { + "lastModified": 1719708727, + "narHash": "sha256-XFNKtyirrGNdehpg7lMNm1skEcBApjqGhaHc/OI95HY=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "1bba8a624b3b9d4f68db94fb63aaeb46039ce9e6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixos-generators": { + "inputs": { + "nixlib": "nixlib", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1720055043, + "narHash": "sha256-SKizewU4UeYrkZWPUjur8EoxscGoNb0pGcrNL4YzAIg=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "168b220231a70e47cc1f0919048fa5914415fb18", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1720553833, @@ -40,6 +76,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "nixos-generators": "nixos-generators", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 49a7238..281ff94 100644 --- a/flake.nix +++ b/flake.nix @@ -5,9 +5,13 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05"; home-manager.url = "github:nix-community/home-manager/release-24.05"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nixos-generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; - outputs = { self, nixpkgs, home-manager, ...}: + outputs = { self, nixpkgs, home-manager, nixos-generators,...}: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; @@ -28,5 +32,9 @@ modules = [ ./home/rothe.nix ]; }; }; + box = nixos-generators.nixosGenerate { + system = "x86_64-linux"; + format = "vm"; + }; }; }