Add output for nixos-generators

This commit is contained in:
yuri 2023-07-26 01:09:38 +02:00
parent bff3ca1445
commit fc50e78610
6 changed files with 72 additions and 6 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
.vscode .vscode
result

View file

@ -0,0 +1,14 @@
{ ... }:
{
boot.loader.grub = {
enable = true;
device = "/dev/vda";
};
networking = {
hostName = "base";
firewall.enable = true;
};
system.stateVersion = "23.05";
}

View file

@ -1,8 +1,4 @@
{ ... }: { ... }:
{ {
imports = [
./hardware-configuration.nix
];
services.qemuGuest.enable = true; services.qemuGuest.enable = true;
} }

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, modulesPath, ... }: { config, lib, modulesPath, ... }:
{ {
imports = [ imports = [
(modulesPath + "/profiles/qemu-guest.nix") (modulesPath + "/profiles/qemu-guest.nix")

View file

@ -1,5 +1,41 @@
{ {
"nodes": { "nodes": {
"nixlib": {
"locked": {
"lastModified": 1689469483,
"narHash": "sha256-2SBhY7rZQ/iNCxe04Eqxlz9YK9KgbaTMBssq3/BgdWY=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "02fea408f27186f139153e1ae88f8ab2abd9c22c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixos-generators": {
"inputs": {
"nixlib": "nixlib",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1690133435,
"narHash": "sha256-YNZiefETggroaTLsLJG2M+wpF0pJPwiauKG4q48ddNU=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "b1171de4d362c022130c92d7c8adc4bf2b83d586",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixos-generators",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1689679375, "lastModified": 1689679375,
@ -18,6 +54,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixos-generators": "nixos-generators",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View file

@ -1,9 +1,13 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, ... }: { outputs = { self, nixpkgs, nixos-generators, ... }: {
hosts = { hosts = {
nitter = { nitter = {
site = "vs"; site = "vs";
@ -34,6 +38,7 @@
imports = [ imports = [
./configuration/common ./configuration/common
./configuration/proxmox-vm ./configuration/proxmox-vm
./configuration/proxmox-vm/hardware-configuration.nix
./hosts/${name} ./hosts/${name}
]; ];
}; };
@ -57,5 +62,18 @@
]; ];
}; };
}; };
# Generate a base VM image for Proxmox with `nix build .#base-proxmox`
packages.x86_64-linux = {
base-proxmox = nixos-generators.nixosGenerate {
system = "x86_64-linux";
modules = [
./configuration/common
./configuration/nixos-generators
./configuration/proxmox-vm
];
format = "proxmox";
};
};
}; };
} }