Skip to content

Commit

Permalink
adapt
Browse files Browse the repository at this point in the history
  • Loading branch information
David Arnold committed Dec 29, 2020
1 parent 85b0a3b commit 93980b3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 26 deletions.
7 changes: 3 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
flake-utils.url = "github:numtide/flake-utils";
devshell.url = "github:numtide/devshell";
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, devshell }:
outputs = inputs@{ self, home, nixos, master, flake-utils, nur, devshell, naersk, mozilla-overlay }:
let
inherit (builtins) attrNames attrValues readDir elem pathExists filter;
inherit (flake-utils.lib) eachDefaultSystem mkApp;
inherit (nixos) lib;
inherit (lib) all removeSuffix recursiveUpdate genAttrs filterAttrs
mapAttrs;
inherit (utils) pathsToImportedAttrs genPkgset overlayPaths modules
genPackages pkgImport devShellModules;
genPackages pkgImport devshells;

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

Expand All @@ -48,7 +47,7 @@

nixosModules = modules;

devShellModules = devShellModules;
devshellModules = devshells;

templates.flk.path = ./.;

Expand Down
2 changes: 1 addition & 1 deletion lib/utils.nix
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ in
(recursiveUpdate cachixAttrs modulesAttrs)
profilesAttrs;

devShellModules =
devshells =
let
# shells
shellList = import ../shells/list.nix;
Expand Down
47 changes: 26 additions & 21 deletions shells/rust/default.nix
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
with pkgs;
{ config, lib, ... }: {
options.nixflk.rust = {
enable = lib.mkEnableOption "nixflk.rust";
openssl = lib.mkEnableOption "nixflk.rust.openssl";
};
config = lib.optionalAttrs nixflk.rust.enable {
name = "Nixflk Rust DevShell";

mkDevShell {
name = "Personal Rust DevShell";
packages = [
latest.rustChannels.stable.rust
wasm-bindgen-cli
binaryen

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

ncurses
pkgconfig
ncurses
pkgconfig
] ++ if options.nixflk.rust.openssl then [
openssl
openssl.dev
];
] else [];

env.RUST_BACKTRACE = "1";
env.RUST_BACKTRACE = "1";

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

0 comments on commit 93980b3

Please sign in to comment.