Extended registry and ISO+DO generator

This commit is contained in:
Filippo Berto 2022-12-18 12:11:55 +01:00
parent cc1abacb29
commit ad69610e89
Signed by: bertof
GPG key ID: 9DBF7E6A1D2CE9ED
3 changed files with 108 additions and 66 deletions

View file

@ -14,7 +14,7 @@
# };
deploy-rs.url = "github:serokell/deploy-rs";
flake-utils.url = "github:numtide/flake-utils";
# nixos-generators.url = "github:nix-community/nixos-generators";
nixos-generators.url = "github:nix-community/nixos-generators";
nixos-hardware.url = "github:NixOS/nixos-hardware";
nix-rice = {
url = "github:bertof/nix-rice";
@ -28,11 +28,6 @@
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
tex2nix = {
url = "github:Mic92/tex2nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs =
@ -46,8 +41,8 @@
nixos-hardware
, nix-rice
, pre-commit-hooks
, tex2nix
,
, nixos-generators
, ...
}:
let
config = {
@ -117,47 +112,23 @@
commonModules = [
# Nix configuration
({ pkgs, ... }: {
{
nixpkgs = { inherit overlays config; };
nix = {
package = pkgs.nixVersions.stable;
extraOptions = "experimental-features = nix-command flakes";
registry = {
stable = {
from = {
id = "stable";
type = "indirect";
};
flake = nixpkgs;
};
unstable = {
from = {
id = "unstable";
type = "indirect";
};
flake = nixpkgs-u;
};
tex2nix = {
from = {
id = "tex2nix";
type = "indirect";
};
flake = tex2nix;
};
stable = { from = { id = "stable"; type = "indirect"; }; flake = nixpkgs; };
unstable = { from = { id = "unstable"; type = "indirect"; }; flake = nixpkgs-u; };
};
};
})
# Home manager configuration
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
}
# Home manager configuration
home-manager.nixosModules.home-manager
{ home-manager = { useGlobalPkgs = true; useUserPackages = true; }; }
./nixos_modules/bertof_user.nix
./nixos_modules/extended_registry.nix
./nixos_modules/automatic-garbage-collection.nix
./nixos_modules/automatic-upgrade.nix
./nixos_modules/zerotier.nix
@ -295,6 +266,23 @@
};
};
images = with flake-utils.lib; eachSystem [ system.x86_64-linux system.aarch64-linux ] (system: {
packages = {
# Installer ISO
install-iso = nixos-generators.nixosGenerate {
inherit system;
modules = commonModules ++ [{ services.openssh = { enable = true; openFirewall = true; }; }];
format = "install-iso";
};
# Installer DigitalOcean
do = nixos-generators.nixosGenerate {
inherit system;
modules = commonModules ++ [{ services.openssh = { enable = true; openFirewall = true; }; }];
format = "do";
};
};
});
in
builtins.foldl' nixpkgs.lib.recursiveUpdate { } [
basic
@ -304,5 +292,6 @@
# baldurConfig
lokiConfig
deployments
images
];
}