Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- description = "Custom NixOS ISO flake";
- inputs = {
- nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
- # nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
- nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
- flake-utils.url = "github:numtide/flake-utils";
- proxmox-nixos.url = "github:SaumonNet/proxmox-nixos";
- netsecrets.url = "github:SpiderUnderUrBed/net-secrets";
- };
- outputs = { self, nixpkgs, nixpkgs-unstable, flake-utils, proxmox-nixos, netsecrets, ... }:
- flake-utils.lib.eachDefaultSystem (system:
- let
- inputs = self.inputs;
- lib = nixpkgs.lib;
- pkgs = import nixpkgs {
- inherit system;
- overlays = [
- proxmox-nixos.overlays.${system}
- # Custom overlay for Tailscale using unstable nixpkgs
- (final: prev: {
- tailscale-custom = let
- pkgs-unstable = import nixpkgs-unstable { inherit system; };
- in pkgs-unstable.callPackage ./pkgs/tailscale.nix {};
- })
- ];
- };
- isoDerivation = lib.nixosSystem {
- inherit system;
- specialArgs = {
- inputs = inputs;
- # Pass the resolved package directly
- netsecrets = netsecrets.packages.${system}.default;
- pkgs = pkgs;
- };
- modules = [
- "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
- proxmox-nixos.nixosModules.proxmox-ve
- netsecrets.nixosModules.default
- ./configuration.nix
- ({ config, pkgs, ... }: {
- isoImage = {
- isoName = lib.mkForce "custom-nixos.iso";
- volumeID = "CUSTOMISO";
- #contents = [];
- };
- })
- ];
- };
- iso = isoDerivation.config.system.build.isoImage;
- in {
- packages = {
- iso = iso;
- default = iso;
- };
- }
- );
- }
Add Comment
Please, Sign In to add comment