shell.nix -> flake.nix (#7892)

* init

* lock file
This commit is contained in:
Jack Kavanagh
2024-08-30 23:04:54 +02:00
committed by GitHub
parent ccf577b9df
commit d4bfeb31ec
3 changed files with 89 additions and 12 deletions

58
flake.lock generated Normal file
View File

@@ -0,0 +1,58 @@
{
"nodes": {
"electron-31-nixpkgs": {
"locked": {
"lastModified": 1724146343,
"narHash": "sha256-SLB5mmhHGLhb7npka7lPrIwymuOAHrsLblkWImLh2HE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a04eac9c5aa7f82e02d6e9e0b203b6eb5704c141",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "a04eac9c5aa7f82e02d6e9e0b203b6eb5704c141",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1724855419,
"narHash": "sha256-WXHSyOF4nBX0cvHN3DfmEMcLOVdKH6tnMk9FQ8wTNRc=",
"path": "/nix/store/s6d8irfyp66lvy9kapbfp2ass36c8lfl-source",
"rev": "ae2fc9e0e42caaf3f068c1bfdc11c71734125e06",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"node-20-16-nixpkgs": {
"locked": {
"lastModified": 1723649821,
"narHash": "sha256-1NHEc1dRGObdqqc4hXLIN3J62U68lOv/stpDvrLPzxY=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8a977702729f2d763adc3e214513d517dcb94d9b",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8a977702729f2d763adc3e214513d517dcb94d9b",
"type": "github"
}
},
"root": {
"inputs": {
"electron-31-nixpkgs": "electron-31-nixpkgs",
"nixpkgs": "nixpkgs",
"node-20-16-nixpkgs": "node-20-16-nixpkgs"
}
}
},
"root": "root",
"version": 7
}

31
flake.nix Normal file
View File

@@ -0,0 +1,31 @@
{
inputs = {
electron-31-nixpkgs.url = "github:nixos/nixpkgs/a04eac9c5aa7f82e02d6e9e0b203b6eb5704c141";
node-20-16-nixpkgs.url = "github:nixos/nixpkgs/8a977702729f2d763adc3e214513d517dcb94d9b";
};
outputs = { self, nixpkgs, ... }@inputs:
let
forAllSystems = with nixpkgs.lib; f: foldAttrs mergeAttrs { }
(map (s: { ${s} = f s; }) systems.flakeExposed);
in
{
devShell = forAllSystems
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
pkgs.mkShell {
buildInputs = [
inputs.node-20-16-nixpkgs.legacyPackages.${system}.nodejs_20
inputs.electron-31-nixpkgs.legacyPackages.${system}.electron
];
packages = [
];
ELECTRON_OVERRIDE_DIST_PATH = "${inputs.electron-31-nixpkgs.legacyPackages.${system}.electron}/bin/";
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
LD_LIBRARY_PATH = "${pkgs.stdenv.cc.cc.lib}/lib64:$LD_LIBRARY_PATH";
});
};
}

View File

@@ -1,12 +0,0 @@
with import <nixpkgs> { };
mkShell {
nativeBuildInputs = [
nodejs_20
electron_30
stdenv.cc.cc.lib
];
LD_LIBRARY_PATH = "${stdenv.cc.cc.lib}/lib64:$LD_LIBRARY_PATH";
ELECTRON_OVERRIDE_DIST_PATH = "${electron_30}/bin/";
ELECTRON_SKIP_BINARY_DOWNLOAD = 1;
}