From 8f7c59e10a48c24120dd580b196acd419e5875d0 Mon Sep 17 00:00:00 2001 From: Max Audron Date: Fri, 11 Aug 2023 16:51:35 +0200 Subject: add custom nixinate impl --- flake.nix | 64 ++++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 19 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index d7bc07e..4746c2e 100644 --- a/flake.nix +++ b/flake.nix @@ -1,28 +1,54 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; - nixinate.url = "github:matthewcroughan/nixinate"; + flake-parts.url = "github:hercules-ci/flake-parts"; }; - outputs = { self, nixpkgs, nixinate }: { - apps = nixinate.nixinate.aarch64-darwin self; - nixosConfigurations = { - nixos-test = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - (import ./machines/nixos-test) + outputs = inputs@{ self, nixpkgs, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } ({ withSystem, flake-parts-lib, ... }: + let + inherit (flake-parts-lib) importApply; + flakeModules.nixinate = importApply ./nixinate { inherit withSystem; }; + in + { + imports = [ + flakeModules.nixinate + ]; + flake = + let + specialArgs = inputs // { inherit inputs; }; + system = "x86_64-linux"; + in { - _module.args.nixinate = { - host = "10.49.212.3"; - sshUser = "root"; - buildOn = "remote"; - substituteOnTarget = true; - hermetic = false; + inherit flakeModules; + nixosConfigurations = { + nixos-test = nixpkgs.lib.nixosSystem { + system = system; + specialArgs = specialArgs // { inherit system; }; + modules = [ + (import ./machines/nixos-test) + + (import ./modules) + (import ./modules/users) + { + _module.args.nixinate = { + host = "10.49.212.3"; + sshUser = "audron"; + buildOn = "remote"; + substituteOnTarget = true; + hermetic = false; + }; + } + ]; + }; }; - } - # ... other configuration ... + }; + systems = [ + "x86_64-linux" + "x86_64-darwin" + "aarch64-linux" + "aarch64-darwin" ]; - }; - }; - }; + perSystem = { config, ... }: { }; + }); } -- cgit v1.2.3