From fa8ad0b686538701c43a3934ad7654afe1d5305e Mon Sep 17 00:00:00 2001 From: morgan Date: Tue, 12 Dec 2023 17:05:22 +0800 Subject: [PATCH] flake: remove flake-util and add formatter --- flake.lock | 40 +++------------------------------------- flake.nix | 40 ++++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 57 deletions(-) diff --git a/flake.lock b/flake.lock index 7f2ff4a..7d779f5 100644 --- a/flake.lock +++ b/flake.lock @@ -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", diff --git a/flake.nix b/flake.nix index 753d03f..030ebc2 100644 --- a/flake.nix +++ b/flake.nix @@ -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 @@ ''; }; - } - ); -} \ No newline at end of file + }; +}