working container
This commit is contained in:
parent
c950ce40c9
commit
613d4447bf
36
flake.nix
36
flake.nix
|
@ -8,7 +8,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, poonam }:
|
outputs = { self, nixpkgs, flake-utils, poonam }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem
|
||||||
|
(system:
|
||||||
let
|
let
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
my-python = pkgs.python3;
|
my-python = pkgs.python3;
|
||||||
|
@ -60,20 +61,6 @@
|
||||||
};
|
};
|
||||||
defaultPackage = self.packages.${system}.site;
|
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?
|
# also need a module that refreshes this flake.lock, but maybe that shouldn't live here?
|
||||||
nixosModule = { options, lib, config, pkgs, ... }:
|
nixosModule = { options, lib, config, pkgs, ... }:
|
||||||
let
|
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;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue