Skip to content

Commit 8a05e5c

Browse files
committed
add flake.nix
1 parent 90c9e3e commit 8a05e5c

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

default.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
with import <nixpkgs> {};
1+
{
2+
pkgs ? import <nixpkgs> {},
3+
}:
4+
5+
with pkgs;
26
stdenv.mkDerivation {
37
name = "nixos-shell";
48
src = builtins.filterSource

flake.lock

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
description = "Spawns lightweight nixos vms in a shell";
3+
4+
inputs = {
5+
nixpkgs.url = "nixpkgs/nixos-unstable";
6+
};
7+
8+
outputs = inp:
9+
let
10+
lib = inp.nixpkgs.lib;
11+
supportedSystems = [ "x86_64-linux" ];
12+
in
13+
lib.foldl' lib.recursiveUpdate {} (lib.forEach supportedSystems (system: rec {
14+
15+
packages."${system}".nixos-shell = import ./default.nix {
16+
pkgs = inp.nixpkgs.legacyPackages."${system}";
17+
};
18+
19+
defaultPackage."${system}" = packages."${system}".nixos-shell;
20+
21+
}));
22+
}

0 commit comments

Comments
 (0)