diff options
| author | Max Audron <audron@cocaine.farm> | 2023-08-11 16:51:35 +0200 |
|---|---|---|
| committer | Max Audron <audron@cocaine.farm> | 2023-08-11 16:51:35 +0200 |
| commit | 8f7c59e10a48c24120dd580b196acd419e5875d0 (patch) | |
| tree | 57a470c9e726b0e09aede6c8470467f790d77dc8 /flake.nix | |
| parent | refactor k8s module (diff) | |
add custom nixinate impl
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 64 |
1 files changed, 45 insertions, 19 deletions
@@ -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, ... }: { }; + }); } |
