mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-14 16:42:43 +02:00
feat: simplify flake.nix
This commit is contained in:
@@ -1,24 +1,28 @@
|
||||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
##############################################################################
|
||||
#
|
||||
# Template for Proxmox's VM, mainly based on:
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/virtualisation/proxmox-image.nix
|
||||
#
|
||||
# the url above is used by `nixos-generator` to generate the Proxmox's VMA image file.
|
||||
#
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
|
||||
# DO NOT promote ryan to input password for sudo.
|
||||
# this is a workaround for the issue of remote deploy:
|
||||
# https://github.com/NixOS/nixpkgs/issues/118655
|
||||
security.sudo.extraRules = [
|
||||
{ users = [ "ryan" ];
|
||||
{
|
||||
users = [ username ];
|
||||
commands = [
|
||||
{ command = "ALL" ;
|
||||
options = [ "NOPASSWD" ];
|
||||
{
|
||||
command = "ALL";
|
||||
options = ["NOPASSWD"];
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -27,7 +31,7 @@
|
||||
boot = {
|
||||
# after resize the disk, it will grow partition automatically.
|
||||
growPartition = true;
|
||||
kernelParams = [ "console=ttyS0" ];
|
||||
kernelParams = ["console=ttyS0"];
|
||||
loader.grub = {
|
||||
device = "/dev/vda";
|
||||
|
||||
@@ -36,8 +40,8 @@
|
||||
efiInstallAsRemovable = false;
|
||||
};
|
||||
|
||||
loader.timeout = 3; # wait for 3 seconds to select the boot entry
|
||||
initrd.availableKernelModules = [ "uas" "virtio_blk" "virtio_pci" ];
|
||||
loader.timeout = lib.mkForce 3; # wait for 3 seconds to select the boot entry
|
||||
initrd.availableKernelModules = ["uas" "virtio_blk" "virtio_pci"];
|
||||
};
|
||||
|
||||
fileSystems."/" = {
|
||||
@@ -47,7 +51,6 @@
|
||||
};
|
||||
# we do not have a /boot partition, so do not mount it.
|
||||
|
||||
|
||||
# it alse had qemu-guest-agent installed by default.
|
||||
services.qemuGuest.enable = lib.mkDefault true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user