flake: remove flake-util and add formatter

This commit is contained in:
morgan 2023-12-12 17:05:22 +08:00
parent 97db1ea08b
commit fa8ad0b686
2 changed files with 23 additions and 57 deletions

View File

@ -1,30 +1,12 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1701680307,
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1701539137,
"narHash": "sha256-nVO/5QYpf1GwjvtpXhyxx5M3U/WN0MwBro4Lsk+9mL0=",
"lastModified": 1702233072,
"narHash": "sha256-H5G2wgbim2Ku6G6w+NSaQaauv6B6DlPhY9fMvArKqRo=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "933d7dc155096e7575d207be6fb7792bc9f34f6d",
"rev": "781e2a9797ecf0f146e81425c822dca69fe4a348",
"type": "github"
},
"original": {
@ -36,24 +18,8 @@
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",

View File

@ -1,24 +1,25 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11"; };
outputs = { nixpkgs, ... }:
in rec {
devShell = pkgs.mkShell {
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
rec {
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt;
devShell.x86_64-linux = pkgs.mkShell {
name = "WRPLL-sim";
venvDir = "./.venv";
buildInputs = with pkgs.python3Packages; [
python
numba
numpy
notebook # use jupyter notebook without missing libstdc++.so.6
venvShellHook
buildInputs = with pkgs; [
nixpkgs-fmt
python3Packages.python
python3Packages.numba
python3Packages.numpy
python3Packages.notebook # use jupyter notebook without missing libstdc++.so.6
python3Packages.venvShellHook
];
# Only run once when venv is created
@ -33,6 +34,5 @@
'';
};
}
);
}
};
}