Skip to content
forked from divnix/digga

Commit cf204db

Browse files
author
David Arnold
committed
A very inmature exploration of divnix#38
1 parent 9321473 commit cf204db

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

flake.nix

+13-3
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,30 @@
77
nixos.url = "nixpkgs/release-20.09";
88
home.url = "github:nix-community/home-manager/release-20.09";
99
flake-utils.url = "github:numtide/flake-utils";
10+
11+
# DevShells
12+
# Use the nixpkgs master for access to latest tooling.
13+
devshell.url = "github:numtide/devshell/master";
14+
devshell.inputs.nixpkgs.follows = "master"; # TODO: How does this compare with pkgImport below?
15+
naersk.url = "github:nmattia/naersk";
16+
naersk.inputs.nixpkgs.follows = "master";
17+
mozilla-overlay = { url = "github:mozilla/mozilla-nixpkgs"; flake = false; };
1018
};
1119

12-
outputs = inputs@{ self, home, nixos, master, flake-utils, nur }:
20+
outputs = inputs@{ self, home, nixos, master, flake-utils, nur , devshell, naersk, mozilla-overlay }:
1321
let
1422
inherit (builtins) attrNames attrValues readDir elem;
1523
inherit (flake-utils.lib) eachDefaultSystem;
1624
inherit (nixos) lib;
1725
inherit (lib) all removeSuffix recursiveUpdate genAttrs filterAttrs;
1826
inherit (utils) pathsToImportedAttrs genPkgset overlayPaths modules
19-
genPackages pkgImport;
27+
genPackages pkgImport devShellModules;
2028

2129
utils = import ./lib/utils.nix { inherit lib; };
2230

2331
system = "x86_64-linux";
2432

25-
externOverlays = [ nur.overlay ];
33+
externOverlays = [ nur.overlay (import mozilla-overlay) devshell.overlay naersk.overlay];
2634
externModules = [ home.nixosModules.home-manager ];
2735

2836
pkgset =
@@ -43,6 +51,8 @@
4351

4452
nixosModules = modules;
4553

54+
devShellModules = devShellModules;
55+
4656
templates.flk.path = ./.;
4757

4858
templates.flk.description = "flk template";

lib/utils.nix

+7
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ in
8282
(recursiveUpdate cachixAttrs modulesAttrs)
8383
profilesAttrs;
8484

85+
devShellModules =
86+
let
87+
# shells
88+
shellList = import ../shells/list.nix;
89+
in
90+
pathsToImportedAttrs moduleList;
91+
8592
genPackages = { overlay, overlays, pkgs }:
8693
let
8794
packages = overlay pkgs pkgs;

shells/list.nix

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[
2+
./rust
3+
]

shells/rust/default.nix

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
with pkgs;
2+
3+
mkDevShell {
4+
name = "Personal Rust DevShell";
5+
6+
packages = [
7+
latest.rustChannels.stable.rust
8+
wasm-bindgen-cli
9+
binaryen
10+
11+
ncurses
12+
pkgconfig
13+
openssl
14+
openssl.dev
15+
];
16+
17+
env.RUST_BACKTRACE = "1";
18+
19+
commands = [
20+
{
21+
name = "hello";
22+
help = "say hello";
23+
category = "fun";
24+
command = "echo '''hello''' ";
25+
}
26+
];
27+
}

0 commit comments

Comments
 (0)