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": { "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": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1701539137, "lastModified": 1702233072,
"narHash": "sha256-nVO/5QYpf1GwjvtpXhyxx5M3U/WN0MwBro4Lsk+9mL0=", "narHash": "sha256-H5G2wgbim2Ku6G6w+NSaQaauv6B6DlPhY9fMvArKqRo=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "933d7dc155096e7575d207be6fb7792bc9f34f6d", "rev": "781e2a9797ecf0f146e81425c822dca69fe4a348",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,24 +18,8 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "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", "root": "root",

View File

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