mirror of
https://github.com/sbrow/nix.git
synced 2026-02-27 21:31:45 -05:00
feat: Added vagrant module.
This commit is contained in:
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
25
flake.lock
generated
Normal file
25
flake.lock
generated
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1661799568,
|
||||||
|
"narHash": "sha256-P3xXCyYfd6WzVC3anpb5ZvUeZ6vMttcs05OWGWvgc+E=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "c3e4dc4f6d23c7e41dda5ce98956c75c7779e2fa",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "nixpkgs",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
7
flake.nix
Normal file
7
flake.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
description = "A very basic flake";
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs }: {
|
||||||
|
nixosModules.vagrant = { ... }: { imports = [ ./nixosModules/vagrant.nix ]; };
|
||||||
|
};
|
||||||
|
}
|
||||||
25
nixosModules/vagrant.nix
Normal file
25
nixosModules/vagrant.nix
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{ config, ... }: {
|
||||||
|
config = {
|
||||||
|
virtualisation.virtualbox.guest.enable = true;
|
||||||
|
|
||||||
|
# Mount a VirtualBox shared folder.
|
||||||
|
fileSystems."/vagrant" = {
|
||||||
|
fsType = "vboxsf";
|
||||||
|
device = "vagrant";
|
||||||
|
options = [ "rw,uid=1001,gid=60,_netdev" ]; # mount as vagrant:nginx
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.root.password = "vagrant";
|
||||||
|
users.users."vagrant" = {
|
||||||
|
isNormalUser = true;
|
||||||
|
password = "vagrant";
|
||||||
|
extraGroups = [
|
||||||
|
"nginx"
|
||||||
|
"wheel"
|
||||||
|
# Allow mounting of shared folders.
|
||||||
|
"vboxsf"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
services.openssh.enable = true;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user