Skip to content
forked from divnix/digga

Commit

Permalink
A very inmature exploration of divnix#38
Browse files Browse the repository at this point in the history
  • Loading branch information
David Arnold committed Dec 24, 2020
1 parent 5620569 commit 48ff768
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
27 changes: 23 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,17 @@
master.url = "nixpkgs/master";
nixos.url = "nixpkgs/release-20.09";
home.url = "github:nix-community/home-manager/release-20.09";

# DevShells
# Use the nixpkgs master for access to latest tooling.
devshell.url = "github:numtide/devshell/master";
devshell.inputs.nixpkgs.follows = "master"; # TODO: How does this compare with pkgImport below?
naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "master";
mozilla-overlay = { url = "github:mozilla/mozilla-nixpkgs"; flake = false; }; # TODO: How does this compare with ./overlay?
};

outputs = inputs@{ self, home, nixos, master }:
outputs = inputs@{ self, home, nixos, master, devshell, naersk, mozilla-overlay }:
let
inherit (builtins) attrNames attrValues readDir;
inherit (nixos) lib;
Expand Down Expand Up @@ -52,7 +60,11 @@
fullPath = name: overlayDir + "/${name}";
overlayPaths = map fullPath (attrNames (readDir overlayDir));
in
pathsToImportedAttrs overlayPaths;
pathsToImportedAttrs overlayPaths ++ [
(import mozilla-overlay)
devshell.overlay
naersk.overlay
];

packages."${system}" =
let
Expand All @@ -79,10 +91,17 @@
profilesList = import ./profiles/list.nix;
profilesAttrs = { profiles = pathsToImportedAttrs profilesList; };

# shells
shellsList = import ./shells/list.nix;
shellsAttrs = { shells = pathsToImportedAttrs shellsList; };

in
recursiveUpdate
(recursiveUpdate cachixAttrs modulesAttrs)
profilesAttrs;
recursiveUpdate (
(recursiveUpdate cachixAttrs modulesAttrs)
profilesAttrs
)
shellsAttrs;

templates.flk.path = ./.;
templates.flk.description = "flk template";
Expand Down
3 changes: 3 additions & 0 deletions shells/list.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
./rust
]
27 changes: 27 additions & 0 deletions shells/rust/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
with pkgs;

mkDevShell {
name = "Personal Rust DevShell";

packages = [
latest.rustChannels.stable.rust
wasm-bindgen-cli
binaryen

ncurses
pkgconfig
openssl
openssl.dev
];

env.RUST_BACKTRACE = "1";

commands = [
{
name = "hello";
help = "say hello";
category = "fun";
command = "echo '''hello''' ";
}
];
}

0 comments on commit 48ff768

Please sign in to comment.