{ description = "tlater.net host configuration"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-20.09"; nixos-hardware.url = "github:nixos/nixos-hardware/master"; flake-utils.url = "github:numtide/flake-utils"; tlaternet-webserver = { url = "git+https://gitea.tlater.net/tlaternet/tlaternet.git"; inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; tlaternet-templates = { url = "git+https://gitea.tlater.net/tlaternet/tlaternet-templates.git"; inputs = { flake-utils.follows = "flake-utils"; nixpkgs.follows = "nixpkgs"; }; }; }; outputs = { nixpkgs, nixos-hardware, flake-utils, tlaternet-webserver , tlaternet-templates, ... }@inputs: let overlays = [ (final: prev: { tlaternet-webserver = tlaternet-webserver.legacyPackages.${prev.system}.packages; tlaternet-templates = tlaternet-templates.legacyPackages.${prev.system}.packages; }) ]; in { nixosConfigurations = { tlaternet = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ({ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/headless.nix") ]; nixpkgs.overlays = overlays; }) (import ./modules) (import ./configuration) (import ./configuration/linode.nix) (import ./configuration/hardware-configuration.nix) ]; }; vm = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ({ modulesPath, ... }: { imports = [ (modulesPath + "/profiles/headless.nix") ]; nixpkgs.overlays = overlays; }) (import ./modules) (import ./configuration) ({ ... }: { users.users.tlater.password = "insecure"; # virtualisation.memorySize = 3941; # virtualisation.cores = 2; }) ]; }; }; } // flake-utils.lib.eachDefaultSystem (system: { devShell = with nixpkgs.legacyPackages.${system}; mkShell { buildInputs = [ nixfmt git-lfs ]; shellHook = '' export QEMU_OPTS="-m 3941 -smp 2" export QEMU_NET_OPTS="hostfwd=::3022-:2222,hostfwd=::3080-:80,hostfwd=::3443-:443,hostfwd=::3021-:2221,hostfwd=::25565-:25565" ''; }; }); }