From b0f7e872e97580555b848282611607a493cdc58e Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sat, 30 Mar 2024 18:03:40 +0000 Subject: [PATCH] Remove flake parts --- flake.lock | 107 +--------------------------- flake.nix | 29 ++++---- templates/fractal/flake.nix.twig | 33 ++++----- templates/php/common/flake.nix.twig | 30 ++++---- 4 files changed, 40 insertions(+), 159 deletions(-) diff --git a/flake.lock b/flake.lock index 6d62af8..0716ea3 100644 --- a/flake.lock +++ b/flake.lock @@ -1,94 +1,6 @@ { "nodes": { - "devshell": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - }, - "locked": { - "lastModified": 1705332421, - "narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=", - "owner": "numtide", - "repo": "devshell", - "rev": "83cb93d6d063ad290beee669f4badf9914cc16ec", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1685662779, - "narHash": "sha256-cKDDciXGpMEjP1n6HlzKinN0H+oLmNpgeCTzYnsA2po=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "71fb97f0d875fd4de4994dfb849f2c75e17eb6c3", - "type": "github" - }, - "original": { - "id": "flake-parts", - "type": "indirect" - } - }, - "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": 1704161960, - "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "63143ac2c9186be6d9da6035fa22620018c85932", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-lib": { - "locked": { - "dir": "lib", - "lastModified": 1685564631, - "narHash": "sha256-8ywr3AkblY4++3lIVxmrWZFzac7+f32ZEhH/A8pNscI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "4f53efe34b3a8877ac923b9350c874e3dcd5dc0a", - "type": "github" - }, - "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { "locked": { "lastModified": 1705856552, "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", @@ -106,24 +18,7 @@ }, "root": { "inputs": { - "devshell": "devshell", - "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_2" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index 2481116..a3e2762 100644 --- a/flake.nix +++ b/flake.nix @@ -1,24 +1,19 @@ # Do not edit this file. It is automatically generated by https://www.oliverdavies.uk/build-configs. - { - inputs = { - devshell.url = "github:numtide/devshell"; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - }; + description = "A Nix Flake for build-configs"; - outputs = inputs@{ flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ inputs.devshell.flakeModule ]; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - systems = [ "x86_64-linux" ]; + outputs = { nixpkgs, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; - perSystem = { config, self', inputs', pkgs, system, ... }: { - devshells.default = { - packages = with pkgs; [ - "php82" - "php82Packages.composer" - ]; - }; - }; + inherit (pkgs) mkShell; + in { + devShells.${system}.default = + mkShell { buildInputs = with pkgs; [ php82 php82Packages.composer ]; }; + + formatter.${system} = pkgs.nixfmt; }; } diff --git a/templates/fractal/flake.nix.twig b/templates/fractal/flake.nix.twig index 8180f23..b8542f3 100644 --- a/templates/fractal/flake.nix.twig +++ b/templates/fractal/flake.nix.twig @@ -1,25 +1,22 @@ # {{ managedText|raw }} - { - inputs = { - devshell.url = "github:numtide/devshell"; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; - }; + description = "A Nix Flake for {{ name }}"; - outputs = inputs@{ flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ inputs.devshell.flakeModule ]; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - systems = [ "x86_64-linux" ]; + outputs = { nixpkgs, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; - perSystem = { config, self', inputs', pkgs, system, ... }: { - devshells.default = { - packages = with pkgs; [ -{% for package in flake.devshell.packages %} - "{{ package }}" -{% endfor %} - ]; - }; - }; + inherit (pkgs) mkShell; + in { + devShells.${system}.default = mkShell { buildInputs = with pkgs; [ + {% for package in flake.devshell.packages %} + {{ package }} + {% endfor %} + ]; }; + + formatter.${system} = pkgs.nixfmt; }; } diff --git a/templates/php/common/flake.nix.twig b/templates/php/common/flake.nix.twig index ba5eff8..f173feb 100644 --- a/templates/php/common/flake.nix.twig +++ b/templates/php/common/flake.nix.twig @@ -1,25 +1,19 @@ # {{ managedText|raw }} - { - inputs = { - devshell.url = "github:numtide/devshell"; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - }; + description = "A Nix Flake for {{ name }}"; - outputs = inputs@{ flake-parts, ... }: - flake-parts.lib.mkFlake { inherit inputs; } { - imports = [ inputs.devshell.flakeModule ]; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - systems = [ "x86_64-linux" ]; + outputs = { nixpkgs, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; - perSystem = { config, self', inputs', pkgs, system, ... }: { - devshells.default = { - packages = with pkgs; [ -{% for package in flake.devshell.packages %} - "{{ package }}" -{% endfor %} - ]; - }; - }; + inherit (pkgs) mkShell; + in { + devShells.${system}.default = + mkShell { buildInputs = with pkgs; [ {{ flake.devshell.packages|join(' ') }} ]; }; + + formatter.${system} = pkgs.nixfmt; }; }