Extended registry and ISO+DO generator
This commit is contained in:
parent
cc1abacb29
commit
ad69610e89
3 changed files with 108 additions and 66 deletions
79
flake.lock
generated
79
flake.lock
generated
|
|
@ -133,6 +133,40 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixlib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1636849918,
|
||||||
|
"narHash": "sha256-nzUK6dPcTmNVrgTAC1EOybSMsrcx+QrVPyqRdyKLkjA=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "28a5b0557f14124608db68d3ee1f77e9329e9dd5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixos-generators": {
|
||||||
|
"inputs": {
|
||||||
|
"nixlib": "nixlib",
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1671355134,
|
||||||
|
"narHash": "sha256-ZtnUWTDDyFog+NQBjZpnhgPdj3gHp5ImxFVWy+ObNno=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixos-generators",
|
||||||
|
"rev": "64a96ca8621d03cb3889daf0d3ff58d8209e3e0c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixos-generators",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1670174919,
|
"lastModified": 1670174919,
|
||||||
|
|
@ -197,6 +231,22 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1637186689,
|
||||||
|
"narHash": "sha256-NU7BhgnwA/3ibmCeSzFK6xGi+Bari9mPfn+4cBmyEjw=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "7fad01d9d5a3f82081c00fb57918d64145dc904c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1670939335,
|
"lastModified": 1670939335,
|
||||||
"narHash": "sha256-AJmruD+RI6smxiVnfpmNT7275mZsUdCS5zczeQCyy3o=",
|
"narHash": "sha256-AJmruD+RI6smxiVnfpmNT7275mZsUdCS5zczeQCyy3o=",
|
||||||
|
|
@ -269,34 +319,11 @@
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nix-rice": "nix-rice",
|
"nix-rice": "nix-rice",
|
||||||
|
"nixos-generators": "nixos-generators",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_3",
|
||||||
"nixpkgs-u": "nixpkgs-u",
|
"nixpkgs-u": "nixpkgs-u",
|
||||||
"pre-commit-hooks": "pre-commit-hooks_2",
|
"pre-commit-hooks": "pre-commit-hooks_2"
|
||||||
"tex2nix": "tex2nix"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tex2nix": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": [
|
|
||||||
"flake-utils"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1665144382,
|
|
||||||
"narHash": "sha256-CCnC3YsQCGoKIGdMND+pr5Rl7nufT1Krv1TZPBIEm8o=",
|
|
||||||
"owner": "Mic92",
|
|
||||||
"repo": "tex2nix",
|
|
||||||
"rev": "068e8655c754783d86f442f887f2e92305d9bd4a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "Mic92",
|
|
||||||
"repo": "tex2nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"utils": {
|
"utils": {
|
||||||
|
|
|
||||||
69
flake.nix
69
flake.nix
|
|
@ -14,7 +14,7 @@
|
||||||
# };
|
# };
|
||||||
deploy-rs.url = "github:serokell/deploy-rs";
|
deploy-rs.url = "github:serokell/deploy-rs";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
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";
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
||||||
nix-rice = {
|
nix-rice = {
|
||||||
url = "github:bertof/nix-rice";
|
url = "github:bertof/nix-rice";
|
||||||
|
|
@ -28,11 +28,6 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
};
|
};
|
||||||
tex2nix = {
|
|
||||||
url = "github:Mic92/tex2nix";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
@ -46,8 +41,8 @@
|
||||||
nixos-hardware
|
nixos-hardware
|
||||||
, nix-rice
|
, nix-rice
|
||||||
, pre-commit-hooks
|
, pre-commit-hooks
|
||||||
, tex2nix
|
, nixos-generators
|
||||||
,
|
, ...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
config = {
|
config = {
|
||||||
|
|
@ -117,47 +112,23 @@
|
||||||
|
|
||||||
commonModules = [
|
commonModules = [
|
||||||
# Nix configuration
|
# Nix configuration
|
||||||
({ pkgs, ... }: {
|
{
|
||||||
nixpkgs = { inherit overlays config; };
|
nixpkgs = { inherit overlays config; };
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.nixVersions.stable;
|
|
||||||
extraOptions = "experimental-features = nix-command flakes";
|
extraOptions = "experimental-features = nix-command flakes";
|
||||||
registry = {
|
registry = {
|
||||||
stable = {
|
stable = { from = { id = "stable"; type = "indirect"; }; flake = nixpkgs; };
|
||||||
from = {
|
unstable = { from = { id = "unstable"; type = "indirect"; }; flake = nixpkgs-u; };
|
||||||
id = "stable";
|
|
||||||
type = "indirect";
|
|
||||||
};
|
|
||||||
flake = nixpkgs;
|
|
||||||
};
|
|
||||||
unstable = {
|
|
||||||
from = {
|
|
||||||
id = "unstable";
|
|
||||||
type = "indirect";
|
|
||||||
};
|
|
||||||
flake = nixpkgs-u;
|
|
||||||
};
|
|
||||||
tex2nix = {
|
|
||||||
from = {
|
|
||||||
id = "tex2nix";
|
|
||||||
type = "indirect";
|
|
||||||
};
|
|
||||||
flake = tex2nix;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})
|
|
||||||
|
|
||||||
# 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/bertof_user.nix
|
||||||
|
./nixos_modules/extended_registry.nix
|
||||||
./nixos_modules/automatic-garbage-collection.nix
|
./nixos_modules/automatic-garbage-collection.nix
|
||||||
./nixos_modules/automatic-upgrade.nix
|
./nixos_modules/automatic-upgrade.nix
|
||||||
./nixos_modules/zerotier.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
|
in
|
||||||
builtins.foldl' nixpkgs.lib.recursiveUpdate { } [
|
builtins.foldl' nixpkgs.lib.recursiveUpdate { } [
|
||||||
basic
|
basic
|
||||||
|
|
@ -304,5 +292,6 @@
|
||||||
# baldurConfig
|
# baldurConfig
|
||||||
lokiConfig
|
lokiConfig
|
||||||
deployments
|
deployments
|
||||||
|
images
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
26
nixos_modules/extended_registry.nix
Normal file
26
nixos_modules/extended_registry.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
nix.registry = {
|
||||||
|
my-templates = {
|
||||||
|
from = {
|
||||||
|
id = "my-templates";
|
||||||
|
type = "indirect";
|
||||||
|
};
|
||||||
|
to = {
|
||||||
|
type = "github";
|
||||||
|
owner = "bertof";
|
||||||
|
repository = "flake-templates";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
tex2nix = {
|
||||||
|
from = {
|
||||||
|
id = "tex2nix";
|
||||||
|
type = "indirect";
|
||||||
|
};
|
||||||
|
to = {
|
||||||
|
type = "github";
|
||||||
|
owner = "Mic92";
|
||||||
|
repository = "tex2nix";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue