|
| 1 | +{ config, pkgs, lib, currentSystem, currentSystemName,... }: |
| 2 | + |
| 3 | +{ |
| 4 | + # Be careful updating this. |
| 5 | + boot.kernelPackages = pkgs.linuxPackages_latest; |
| 6 | + |
| 7 | + nix = { |
| 8 | + # use unstable nix so we can access flakes |
| 9 | + package = pkgs.nixUnstable; |
| 10 | + extraOptions = '' |
| 11 | + experimental-features = nix-command flakes |
| 12 | + keep-outputs = true |
| 13 | + keep-derivations = true |
| 14 | + ''; |
| 15 | + |
| 16 | + # TODO: Disabled - figure out caching later |
| 17 | + # public binary cache that I use for all my derivations. You can keep |
| 18 | + # this, use your own, or toss it. Its typically safe to use a binary cache |
| 19 | + # since the data inside is checksummed. |
| 20 | + # settings = { |
| 21 | + # substituters = ["https://mitchellh-nixos-config.cachix.org"]; |
| 22 | + # trusted-public-keys = ["mitchellh-nixos-config.cachix.org-1:bjEbXJyLrL1HZZHBbO4QALnI5faYZppzkU4D2s0G8RQ="]; |
| 23 | + # }; |
| 24 | + }; |
| 25 | + |
| 26 | + # We expect to run the VM on hidpi machines. |
| 27 | + hardware.video.hidpi.enable = true; |
| 28 | + |
| 29 | + # Use the systemd-boot EFI boot loader. |
| 30 | + boot.loader.systemd-boot.enable = true; |
| 31 | + boot.loader.efi.canTouchEfiVariables = true; |
| 32 | + |
| 33 | + # VMware, Parallels both only support this being 0 otherwise you see |
| 34 | + # "error switching console mode" on boot. |
| 35 | + boot.loader.systemd-boot.consoleMode = "0"; |
| 36 | + |
| 37 | + # Define your hostname. |
| 38 | + networking.hostName = "dev"; |
| 39 | + |
| 40 | + # Set your time zone. |
| 41 | + time.timeZone = "US/Central"; |
| 42 | + |
| 43 | + # The global useDHCP flag is deprecated, therefore explicitly set to false here. |
| 44 | + # Per-interface useDHCP will be mandatory in the future, so this generated config |
| 45 | + # replicates the default behaviour. |
| 46 | + networking.useDHCP = false; |
| 47 | + |
| 48 | + # Don't require password for sudo |
| 49 | + security.sudo.wheelNeedsPassword = false; |
| 50 | + |
| 51 | + # Virtualization settings |
| 52 | + virtualisation.docker.enable = true; |
| 53 | + |
| 54 | + # Select internationalisation properties. |
| 55 | + i18n.defaultLocale = "en_US.UTF-8"; |
| 56 | + |
| 57 | + # setup windowing environment |
| 58 | + services.xserver = { |
| 59 | + enable = true; |
| 60 | + layout = "us"; |
| 61 | + dpi = 220; |
| 62 | + |
| 63 | + desktopManager = { |
| 64 | + xterm.enable = false; |
| 65 | + wallpaper.mode = "fill"; |
| 66 | + }; |
| 67 | + |
| 68 | + # TODO: Select a windows manager |
| 69 | + # displayManager = { |
| 70 | + # defaultSession = "none+i3"; |
| 71 | + # lightdm.enable = true; |
| 72 | + |
| 73 | + # # AARCH64: For now, on Apple Silicon, we must manually set the |
| 74 | + # # display resolution. This is a known issue with VMware Fusion. |
| 75 | + # sessionCommands = '' |
| 76 | + # ${pkgs.xorg.xset}/bin/xset r rate 200 40 |
| 77 | + # ''; |
| 78 | + # }; |
| 79 | + |
| 80 | + # windowManager = { |
| 81 | + # i3.enable = true; |
| 82 | + # }; |
| 83 | + }; |
| 84 | + |
| 85 | + # Define a user account. Don't forget to set a password with ‘passwd’. |
| 86 | + users.mutableUsers = false; |
| 87 | + |
| 88 | + # Enable the OpenSSH daemon. |
| 89 | + services.openssh.enable = true; |
| 90 | + services.openssh.passwordAuthentication = true; |
| 91 | + services.openssh.permitRootLogin = "no"; |
| 92 | + |
| 93 | + # Disable the firewall since we're in a VM and we want to make it |
| 94 | + # easy to visit stuff in here. We only use NAT networking anyways. |
| 95 | + networking.firewall.enable = false; |
| 96 | + |
| 97 | + # This value determines the NixOS release from which the default |
| 98 | + # settings for stateful data, like file locations and database versions |
| 99 | + # on your system were taken. It‘s perfectly fine and recommended to leave |
| 100 | + # this value at the release version of the first install of this system. |
| 101 | + # Before changing this value read the documentation for this option |
| 102 | + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). |
| 103 | + system.stateVersion = "22.11"; |
| 104 | +} |
0 commit comments