shell: switch to using mkDevShell

This commit is contained in:
Timothy DeHerrera 2020-12-28 23:12:27 -07:00
parent e7c0700959
commit 893e09278b
No known key found for this signature in database
GPG Key ID: 8985725DB5B0C122
4 changed files with 37 additions and 18 deletions

View File

@ -1,5 +1,20 @@
{
"nodes": {
"devshell": {
"locked": {
"lastModified": 1607956014,
"narHash": "sha256-kcmh1ZO56GFYStDeM2VngJSvx/e8aKhFSYqLwfiq+Es=",
"owner": "numtide",
"repo": "devshell",
"rev": "17f46732ce299daa2977be2978f60d258c2d1b41",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1605370193,
@ -93,6 +108,7 @@
},
"root": {
"inputs": {
"devshell": "devshell",
"flake-utils": "flake-utils",
"home": "home",
"master": "master",

View File

@ -7,9 +7,10 @@
nixos.url = "nixpkgs/release-20.09";
home.url = "github:nix-community/home-manager/release-20.09";
flake-utils.url = "github:numtide/flake-utils";
devshell.url = "github:numtide/devshell";
};
outputs = inputs@{ self, home, nixos, master, flake-utils, nur }:
outputs = inputs@{ self, home, nixos, master, flake-utils, nur, devshell }:
let
inherit (builtins) attrNames attrValues readDir elem pathExists filter;
inherit (flake-utils.lib) eachDefaultSystem mkApp;
@ -23,7 +24,7 @@
system = "x86_64-linux";
externOverlays = [ nur.overlay ];
externOverlays = [ nur.overlay devshell.overlay ];
externModules = [ home.nixosModules.home-manager ];
pkgset =
@ -57,7 +58,7 @@
pkgs' = pkgImport {
pkgs = master;
system = system';
overlays = [ ];
overlays = [ devshell.overlay ];
};
packages' = genPackages {
@ -79,7 +80,6 @@
{
devShell = import ./shell.nix {
pkgs = pkgs';
nixpkgs = nixos;
};
apps =

View File

@ -46,6 +46,7 @@ in
systemPackages = with pkgs; [
bat
bzip2
devshell
exa
gitAndTools.hub
gzip

View File

@ -1,7 +1,11 @@
let
nixpkgs = import ./compat/nixpkgs.nix;
fetch = import ./compat/fetch.nix;
devshell' = fetch "devshell";
pkgs' = import devshell' { inherit nixpkgs; };
in
{ pkgs ? import nixpkgs { }, nixpkgs ? nixpkgs' }:
{ pkgs ? pkgs', ... }:
let
configs = "${toString ./.}#nixosConfigurations";
build = "config.system.build";
@ -22,14 +26,20 @@ let
sudo nixos-rebuild --flake ".#$1" $@
fi
'';
nix = pkgs.writeShellScriptBin "nix" ''
${pkgs.nixFlakes}/bin/nix --option experimental-features "nix-command flakes ca-references" "$@"
'';
in
pkgs.mkShell {
pkgs.mkDevShell {
name = "nixflk";
nativeBuildInputs = with pkgs; with installPkgs; [
packages = with pkgs; with installPkgs; [
git
git-crypt
flk
nix-zsh-completions
nix
nixpkgs-fmt
python38Packages.grip
nixos-install
nixos-generate-config
@ -37,14 +47,6 @@ pkgs.mkShell {
nixos-rebuild
];
shellHook = ''
mkdir -p secrets
if ! nix flake show &> /dev/null; then
PATH=${
pkgs.writeShellScriptBin "nix" ''
${pkgs.nixFlakes}/bin/nix --option experimental-features "nix-command flakes ca-references" "$@"
''
}/bin:$PATH
fi
'';
env = { };
}