From db16d1d40b22c2502659fdb92014f41129896b61 Mon Sep 17 00:00:00 2001 From: Alexander Kassouni Date: Fri, 23 Oct 2026 14:47:17 -0700 Subject: use flake parts --- flake.nix | 51 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 18 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 7c3b59d..dd9358e 100644 --- a/flake.nix +++ b/flake.nix @@ -4,27 +4,42 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-parts = { + url = "github:hercules-ci/flake-parts"; + inputs.nixpkgs-lib.follows = "nixpkgs"; + }; }; - outputs = inputs: { - nixosConfigurations.kassouni-net = inputs.nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - modules = [ ./configuration.nix ]; - }; + outputs = inputs@{ flake-parts, nixpkgs, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; - packages = builtins.mapAttrs (system: pkgs: rec { - website = import ./nix/site.nix { inherit pkgs; }; - cgit-theme = import ./git/theme.nix { inherit pkgs; }; - default = website; - }) inputs.nixpkgs.legacyPackages; + perSystem = { pkgs, ... }: { + packages = rec { + website = import ./nix/site.nix { inherit pkgs; }; + cgit-theme = import ./git/theme.nix { inherit pkgs; }; + default = website; + }; - devShells = builtins.mapAttrs (system: pkgs: { - default = pkgs.mkShell { - packages = with pkgs; [ - just - zola - ]; + devShells.default = pkgs.mkShell { + packages = with pkgs; [ + just + zola + ]; + }; + + formatter = pkgs.nixfmt-tree; }; - }) inputs.nixpkgs.legacyPackages; - }; + + flake.nixosConfigurations.kassouni-net = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ ./configuration.nix ]; + }; + }; } -- cgit v1.3.1