Files
muscl/nix/nixos-configurations/vm.nix
h7x4 b0ae6e563d
All checks were successful
Build and test / check (push) Successful in 1m55s
Build and test / build (push) Successful in 4m1s
Build and test / check-license (push) Successful in 4m55s
Build and test / test (push) Successful in 3m26s
Build and test / docs (push) Successful in 6m18s
Add nix support for suid/sgid testing
2025-12-04 11:42:49 +09:00

69 lines
1.5 KiB
Nix

{ self, nixpkgs, ... }:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
pkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [
self.overlays.muscl-crane
];
};
modules = [
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
"${nixpkgs}/nixos/tests/common/user-account.nix"
self.nixosModules.default
({ config, pkgs, ... }: {
system.stateVersion = config.system.nixos.release;
virtualisation.graphics = false;
users = {
groups = {
a = { };
b = { };
};
users.alice.extraGroups = [
"a"
"b"
"wheel"
"systemd-journal"
];
extraUsers.root.password = "root";
};
services.getty.autologinUser = "alice";
users.motd = ''
=================================
Welcome to the muscl vm!
Try running:
${config.services.muscl.package.meta.mainProgram}
Password for alice is 'foobar'
Password for root is 'root'
To exit, press Ctrl+A, then X
=================================
'';
services.mysql = {
enable = true;
package = pkgs.mariadb;
};
services.muscl = {
enable = true;
logLevel = "trace";
createLocalDatabaseUser = true;
};
programs.vim = {
enable = true;
defaultEditor = true;
};
environment.systemPackages = with pkgs; [ jq ];
})
];
}