diff options
| author | Max Audron <audron@cocaine.farm> | 2025-05-06 16:17:35 +0200 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2025-05-06 16:19:30 +0200 |
| commit | b6350162b4c70abb896613e4ebea65ca1661450d (patch) | |
| tree | 2e55e0477b4d2f7a646a97f92ee1362db769f75e /flake.nix | |
| parent | add nix build and module (diff) | |
update dependencies
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 126 |
1 files changed, 67 insertions, 59 deletions
@@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; nci.url = "github:yusdacra/nix-cargo-integration"; nci.inputs.nixpkgs.follows = "nixpkgs"; parts.url = "github:hercules-ci/flake-parts"; @@ -8,68 +8,76 @@ }; outputs = - inputs@{ self, parts, nci, ... }: - parts.lib.mkFlake { inherit inputs; } ({moduleWithSystem, withSystem, ...}: { - systems = [ - "x86_64-linux" - "aarch64-linux" - ]; - imports = [ nci.flakeModule ]; + inputs@{ + self, + parts, + nci, + ... + }: + parts.lib.mkFlake { inherit inputs; } ( + { moduleWithSystem, withSystem, ... }: + { + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + imports = [ nci.flakeModule ]; - flake = { - # nixosModules.default = flake-parts-lib.importApply ./nix/nixos-module.nix { localFlake = self; inherit withSystem; }; - nixosModules.default = moduleWithSystem ( - perSystem@{ config }: # NOTE: only explicit params will be in perSystem - nixos@{ ... }: - { - services.catinator.package = perSystem.config.packages.default; - imports = [ ./nix/nixos-module.nix ]; - } - ); - }; + flake = { + # nixosModules.default = flake-parts-lib.importApply ./nix/nixos-module.nix { localFlake = self; inherit withSystem; }; + nixosModules.default = moduleWithSystem ( + perSystem@{ config }: # NOTE: only explicit params will be in perSystem + nixos@{ ... }: + { + services.catinator.package = perSystem.config.packages.default; + imports = [ ./nix/nixos-module.nix ]; + } + ); + }; - perSystem = - { - pkgs, - config, - lib, - ... - }: - let - # shorthand for accessing this crate's outputs - # you can access crate outputs under `config.nci.outputs.<crate name>` (see documentation) - crateOutputs = config.nci.outputs."catinator"; - in - { - nci = { - projects."catinator".path = ./.; - crates."catinator" = - let - mkDerivation = { - nativeBuildInputs = [ pkgs.file.dev ]; - }; - in - { - drvConfig = { - inherit mkDerivation; - }; - depsDrvConfig = { - inherit mkDerivation; + perSystem = + { + pkgs, + config, + lib, + ... + }: + let + # shorthand for accessing this crate's outputs + # you can access crate outputs under `config.nci.outputs.<crate name>` (see documentation) + crateOutputs = config.nci.outputs."catinator"; + in + { + nci = { + projects."catinator".path = ./.; + crates."catinator" = + let + mkDerivation = { + nativeBuildInputs = [ pkgs.file.dev ]; + }; + in + { + drvConfig = { + inherit mkDerivation; + }; + depsDrvConfig = { + inherit mkDerivation; + }; }; - }; - toolchainConfig = { - channel = "stable"; - targets = [ "x86_64-unknown-linux-musl" ]; - components = [ - "rustfmt" - "rust-src" - ]; + toolchainConfig = { + channel = "stable"; + targets = [ "x86_64-unknown-linux-musl" ]; + components = [ + "rustfmt" + "rust-src" + ]; + }; }; - }; - devShells.default = crateOutputs.devShell; - packages.default = crateOutputs.packages.release; - }; - }); + devShells.default = crateOutputs.devShell; + packages.default = crateOutputs.packages.release; + }; + } + ); } |
