Skip to content

Commit

Permalink
add flake.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
DavHau committed Aug 10, 2021
1 parent 90c9e3e commit 8a05e5c
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
6 changes: 5 additions & 1 deletion default.nix
@@ -1,4 +1,8 @@
with import <nixpkgs> {};
{
pkgs ? import <nixpkgs> {},
}:

with pkgs;
stdenv.mkDerivation {
name = "nixos-shell";
src = builtins.filterSource
Expand Down
26 changes: 26 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions flake.nix
@@ -0,0 +1,22 @@
{
description = "Spawns lightweight nixos vms in a shell";

inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
};

outputs = inp:
let
lib = inp.nixpkgs.lib;
supportedSystems = [ "x86_64-linux" ];
in
lib.foldl' lib.recursiveUpdate {} (lib.forEach supportedSystems (system: rec {

packages."${system}".nixos-shell = import ./default.nix {
pkgs = inp.nixpkgs.legacyPackages."${system}";
};

defaultPackage."${system}" = packages."${system}".nixos-shell;

}));
}

0 comments on commit 8a05e5c

Please sign in to comment.