diff options
| author | Alexander Kassouni <alex@kassouni.net> | 2026-10-23 14:47:17 -0700 |
|---|---|---|
| committer | Alexander Kassouni <alex@kassouni.net> | 2026-10-23 14:47:17 -0700 |
| commit | db16d1d40b22c2502659fdb92014f41129896b61 (patch) | |
| tree | 5fa7bc7fe6b7b12fc0a558b435a94305ba680b17 | |
| parent | 88ff6796dbcd6e12fb4ca7352311de0deddfc1f5 (diff) | |
use flake parts
| -rw-r--r-- | flake.lock | 21 | ||||
| -rw-r--r-- | flake.nix | 51 |
2 files changed, 54 insertions, 18 deletions
@@ -1,5 +1,25 @@ { "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1790898470, + "narHash": "sha256-zTwuwezD0w3hpga6a6P8emidzAZFyWqlNeRBlpWOOl8=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "024633cd702b10285db5cb19b40ad48d2399ba60", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1792503283, @@ -34,6 +54,7 @@ }, "root": { "inputs": { + "flake-parts": "flake-parts", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" } @@ -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 ]; + }; + }; } |