flake'ify shell.nix

This commit is contained in:
Sridhar Ratnakumar 2022-05-08 10:25:46 -04:00
parent c43dc3f15f
commit 9fec349961
4 changed files with 39 additions and 14 deletions

2
.envrc
View file

@ -1 +1 @@
use nix use flake

22
flake.lock generated
View file

@ -59,6 +59,21 @@
} }
}, },
"flake-utils": { "flake-utils": {
"locked": {
"lastModified": 1649676176,
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": { "locked": {
"lastModified": 1619345332, "lastModified": 1619345332,
"narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=", "narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=",
@ -73,7 +88,7 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": { "flake-utils_3": {
"locked": { "locked": {
"lastModified": 1644229661, "lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
@ -148,7 +163,7 @@
}, },
"neovim-flake": { "neovim-flake": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2", "flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
@ -383,7 +398,7 @@
}, },
"pre-commit-hooks-nix": { "pre-commit-hooks-nix": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
@ -404,6 +419,7 @@
"root": { "root": {
"inputs": { "inputs": {
"darwin": "darwin", "darwin": "darwin",
"flake-utils": "flake-utils",
"hercules-ci-agent": "hercules-ci-agent", "hercules-ci-agent": "hercules-ci-agent",
"himalaya": "himalaya", "himalaya": "himalaya",
"home-manager": "home-manager", "home-manager": "home-manager",

View file

@ -6,6 +6,8 @@
darwin.url = "github:lnl7/nix-darwin/master"; darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "nixpkgs"; darwin.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
flake-utils.inputs.nixpkgs.follows = "nixpkgs";
nixos-hardware.url = github:NixOS/nixos-hardware/master; nixos-hardware.url = github:NixOS/nixos-hardware/master;
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
@ -163,6 +165,22 @@
air = defaultMacosSystem; air = defaultMacosSystem;
sky = defaultMacosSystem; sky = defaultMacosSystem;
}; };
};
} //
inputs.flake-utils.lib.eachSystem [ "x86_64-linux" "aarch64-darwin" ] (system:
let pkgs = nixpkgs.legacyPackages.${system};
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs; [
treefmt
nixpkgs-fmt
# To enable webhint to analyze source files
nodejs
];
};
}
);
} }

View file

@ -1,9 +0,0 @@
{ pkgs ? import <nixpkgs> { }, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
treefmt
nixpkgs-fmt
# To enable webhint to analyze source files
nodejs
];
}