working container

This commit is contained in:
Anish Lakhwara 2022-04-16 18:13:02 +10:00
parent c950ce40c9
commit 613d4447bf

View file

@ -8,7 +8,8 @@
};
outputs = { self, nixpkgs, flake-utils, poonam }:
flake-utils.lib.eachDefaultSystem (system:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
my-python = pkgs.python3;
@ -60,20 +61,6 @@
};
defaultPackage = self.packages.${system}.site;
# Test container
nixosConfigurations.container = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
self.nixosModule
({ pkgs, ... }: {
# Only allow this to boot as a container
boot.isContainer = true;
networking.hostName = "basant";
services."anish.lakhwara.com".enable = true;
})
];
};
# also need a module that refreshes this flake.lock, but maybe that shouldn't live here?
nixosModule = { options, lib, config, pkgs, ... }:
let
@ -116,5 +103,22 @@
};
};
});
}) // {
# Test container
nixosConfigurations."test" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
self.nixosModule
({ pkgs, ... }: {
# Only allow this to boot as a container
boot.isContainer = true;
networking.hostName = "basant";
# Allow nginx through the firewall
networking.firewall.allowedTCPPorts = [ 80 ];
services.nginx.enable = true;
services."anish.lakhwara.com".enable = true;
})
];
};
};
}