{ description = "NixOs configuration for my server"; inputs = { nixpkgs.url = "github:NixOs/nixpkgs/nixos-23.11"; nixos-config.url = "git+https://githug.xyz/rachel/nixos-config"; }; outputs = { self, nixpkgs, nixos-config, ... }: let nix-config-module = { nix.registry.nixpkgs.flake = nixpkgs; system.configurationRevision = nixpkgs.lib.mkIf (self ? rev) self.rev; }; # 8080 on host is 80 on guest # 2222 on host is 22 on guest # 22222 on host is 222 on guest virt-module = { virtualisation.vmVariant = { virtualisation.cores = 4; virtualisation.memorySize = 4096; virtualisation.forwardPorts = [ { from = "host"; host.port = 8080; guest.port = 80; } { from = "host"; host.port = 2222; guest.port = 22; } { from = "host"; host.port = 22222; guest.port = 222; } ]; }; }; keyboard-module = { console = { useXkbConfig = true; }; services.xserver = { xkb = { layout = "fox"; extraLayouts.fox = { description = "Layout suitable to be used by a fox"; languages = [ "se" ]; symbolsFile = nixos-config.keyboardLayouts.fox; }; }; }; }; state-version = "23.11"; modules = [ nix-config-module keyboard-module (import ./host.nix state-version { pkgs = nixpkgs.legacyPackages.x86_64-linux; }) ]; in { nixosConfigurations.cafe = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; inherit modules; }; nixosConfigurations.cafe-virt = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = modules ++ [ virt-module ]; }; }; }