Nixos-shell: Difference between revisions
imported>Onny No edit summary |
|||
| (3 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
[https://github.com/Mic92/nixos-shell | {{DISPLAYTITLE:{{#if:{{NAMESPACE}}|{{NAMESPACE}}:|}}{{lcfirst:{{PAGENAME}}}}}} | ||
[https://github.com/Mic92/nixos-shell nixos-shell] is a small helper script for spawning lightweight NixOS virtual machines in a shell. | |||
== Installation == | == Installation == | ||
| Line 20: | Line 21: | ||
settings.title = "My Wiki"; | settings.title = "My Wiki"; | ||
}; | }; | ||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
| Line 56: | Line 57: | ||
description = "Spawns lightweight nixos vm in a shell"; | description = "Spawns lightweight nixos vm in a shell"; | ||
inputs | inputs = { | ||
nixpkgs.url = "nixpkgs/nixos-23.11"; | |||
nixos-shell.url = "github:Mic92/nixos-shell"; | |||
}; | |||
outputs = { self, nixpkgs }: let | outputs = { self, nixpkgs, nixos-shell }: let | ||
pkgs = nixpkgs.legacyPackages.x86_64-linux; | pkgs = nixpkgs.legacyPackages.x86_64-linux; | ||
start = | start = | ||
| Line 72: | Line 76: | ||
modules = [ | modules = [ | ||
(import ./myvm.nix) | (import ./myvm.nix) | ||
nixos-shell.nixosModules.nixos-shell | |||
]; | ]; | ||
}; | }; | ||
packages = { inherit start; }; | packages = { inherit start; }; | ||
| Line 86: | Line 88: | ||
The configuration of the virtual machine is inside the file <code>myvm.nix</code> in the same directory. The virtual machine will use the nixpkgs source defined in the flake inputs. | The configuration of the virtual machine is inside the file <code>myvm.nix</code> in the same directory. The virtual machine will use the nixpkgs source defined in the flake inputs. | ||
[[Category:Container]] | |||