diff --git a/flake.lock b/flake.lock index 7c499b6..cf0fa40 100644 --- a/flake.lock +++ b/flake.lock @@ -124,6 +124,42 @@ "type": "github" } }, + "nixlib": { + "locked": { + "lastModified": 1636849918, + "narHash": "sha256-nzUK6dPcTmNVrgTAC1EOybSMsrcx+QrVPyqRdyKLkjA=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "28a5b0557f14124608db68d3ee1f77e9329e9dd5", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixos-generators": { + "inputs": { + "nixlib": "nixlib", + "nixpkgs": [ + "nixpkgs-stable" + ] + }, + "locked": { + "lastModified": 1671355134, + "narHash": "sha256-ZtnUWTDDyFog+NQBjZpnhgPdj3gHp5ImxFVWy+ObNno=", + "owner": "nix-community", + "repo": "nixos-generators", + "rev": "64a96ca8621d03cb3889daf0d3ff58d8209e3e0c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-generators", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1671359686, @@ -178,6 +214,7 @@ "home-manager": "home-manager", "home-manager-stable": "home-manager-stable", "kmonad": "kmonad", + "nixos-generators": "nixos-generators", "nixpkgs": "nixpkgs", "nixpkgs-stable": "nixpkgs-stable", "nur": "nur" diff --git a/flake.nix b/flake.nix index f6c5ce7..13e5dc0 100644 --- a/flake.nix +++ b/flake.nix @@ -31,9 +31,14 @@ url = "github:ryantm/agenix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + nixos-generators = { + url = "github:nix-community/nixos-generators"; + inputs.nixpkgs.follows = "nixpkgs-stable"; + }; }; - outputs = inputs @ { self, nixpkgs, home-manager, nur, kmonad, nixpkgs-stable, home-manager-stable, deploy-rs, agenix, ... }: { + outputs = inputs @ { self, nixpkgs, home-manager, nur, kmonad, nixpkgs-stable, home-manager-stable, deploy-rs, agenix, nixos-generators, ... }: { nixosConfigurations = { io = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -88,5 +93,15 @@ }; }; }; + + packages.x86_64-linux = { + install-iso = nixos-generators.nixosGenerate { + system = "x86_64-linux"; + modules = [ + {users.users.nixos.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKcwF1yuWEfYGScNocEbs0AmGxyTIzGc4/IhpU587SJE" ];} + ]; + format = "install-iso"; + }; + }; }; }