Skip to content

Commit

Permalink
A very inmature exploration of #38
Browse files Browse the repository at this point in the history
  • Loading branch information
David Arnold committed Dec 29, 2020
1 parent 9321473 commit cf204db
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
16 changes: 13 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,30 @@
nixos.url = "nixpkgs/release-20.09";
home.url = "github:nix-community/home-manager/release-20.09";
flake-utils.url = "github:numtide/flake-utils";

# 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; };
};

outputs = inputs@{ self, home, nixos, master, flake-utils, nur }:
outputs = inputs@{ self, home, nixos, master, flake-utils, nur , devshell, naersk, mozilla-overlay }:
let
inherit (builtins) attrNames attrValues readDir elem;
inherit (flake-utils.lib) eachDefaultSystem;
inherit (nixos) lib;
inherit (lib) all removeSuffix recursiveUpdate genAttrs filterAttrs;
inherit (utils) pathsToImportedAttrs genPkgset overlayPaths modules
genPackages pkgImport;
genPackages pkgImport devShellModules;

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

system = "x86_64-linux";

externOverlays = [ nur.overlay ];
externOverlays = [ nur.overlay (import mozilla-overlay) devshell.overlay naersk.overlay];
externModules = [ home.nixosModules.home-manager ];

pkgset =
Expand All @@ -43,6 +51,8 @@

nixosModules = modules;

devShellModules = devShellModules;

templates.flk.path = ./.;

templates.flk.description = "flk template";
Expand Down
7 changes: 7 additions & 0 deletions lib/utils.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ in
(recursiveUpdate cachixAttrs modulesAttrs)
profilesAttrs;

devShellModules =
let
# shells
shellList = import ../shells/list.nix;
in
pathsToImportedAttrs moduleList;

genPackages = { overlay, overlays, pkgs }:
let
packages = overlay pkgs pkgs;
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 cf204db

Please sign in to comment.