configuration.nix (2910B)
1 { 2 pkgs, 3 hostName, 4 ... 5 }: 6 { 7 imports = [ 8 ../../users/root.nix 9 ../../modules/nix_settings.nix 10 ]; 11 12 system.stateVersion = "25.11"; 13 14 # vm 15 virtualisation.vmVariant = { 16 virtualisation = { 17 diskSize = 50 * 1028; # 50 GB 18 memorySize = 16 * 1028; # 16 GB 19 cores = 6; 20 resolution = { 21 x = 1600; 22 y = 900; 23 }; 24 qemu.options = [ 25 "-enable-kvm" 26 "-cpu host" 27 "-display gtk,zoom-to-fit=false" 28 "-vga virtio" 29 ]; 30 forwardPorts = [ 31 { 32 from = "host"; 33 host.port = 2222; 34 guest.port = 61745; 35 } 36 ]; 37 }; 38 }; 39 40 # boot 41 boot = { 42 loader = { 43 systemd-boot.enable = true; 44 efi.canTouchEfiVariables = true; 45 }; 46 kernelPackages = pkgs.linuxPackages_latest; 47 kernelParams = [ 48 "loglevel=3" 49 "nowatchdog" 50 "migrations=auto" 51 ]; 52 }; 53 54 # netowrk 55 networking = { 56 hostName = "${hostName}"; 57 networkmanager.enable = true; 58 }; 59 60 # time/locale 61 i18n.defaultLocale = "en_US.UTF-8"; 62 63 # users 64 users.users = { 65 r2d2 = { 66 isNormalUser = true; 67 extraGroups = [ "wheel" ]; 68 initialPassword = "123"; 69 shell = pkgs.zsh; 70 openssh.authorizedKeys.keys = [ 71 "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCjUjMsWMlPY0YNtSPMdmCIBnNHzT8PdN7Gc0a+RuQg2slRe7Gh1HgRPAX0pg3CIh0oNTDfuOGrOTcl/SdX+WdhChZJkcoKiDKPB98TCioJnYF9k1vouhx0P3soN/Bd4gQEd2Vx0+XTQzmK9VhFtBoNQt9Eh90ZGCrBtsfPB9odDuymotI9FPXSboUPAe3WttzzUeTpY3JurInHW2rCQsYIvti0ZGwdm6EwVjN+6aZ300uT6olrAc+6csyOZrdQQXm1G35x6MLKpYoyFoGQYkS/4vvHMbzj9F9zp8Y+aUZ0+iQvK2owhS7auzELuO2/nqwODCHXLxn8Sg15r0XJn4tVvgAxqvtG+i0SIeqjfrzsu+fg1n2tJGCAq96nyOCruYHcmLOQ0Z9d+hf04Y1thS4GCtNmqT/RGdboDI1xEmg3PaUUPgaL7pCiG+6OtTC/4F0/f/m6neRn219UAPshI7LZKT1aRsBCqKRnEmbUSKWa0ilDntCDsST2VcHwKk0Tjnb+UIvjoHJ2qQQao7i1dmzZ8oUu/9wpyt5aaNxxvcm6qfjht1TGw/1RBHyhOsPNrlHpzUtzbvDdVwHfO0/6eksb73kJ7WMqU+FutbF5ekogcUzkYMo6G7O6hDMFb+w405ontM5syg6OcYWTq2+kllbKiGETxQpizzuWKERCExpHWQ== mika@frame" 72 ]; 73 }; 74 root = { 75 shell = pkgs.zsh; 76 }; 77 }; 78 security.sudo.wheelNeedsPassword = false; 79 80 # services 81 services = { 82 fwupd.enable = true; 83 automatic-timezoned.enable = true; 84 openssh = { 85 enable = true; 86 ports = [ 61745 ]; 87 settings = { 88 PermitRootLogin = "no"; 89 PasswordAuthentication = false; 90 }; 91 }; 92 }; 93 94 # programs 95 programs = { 96 zsh.enable = false; 97 dconf.enable = true; 98 gnupg.agent = { 99 enable = true; 100 enableSSHSupport = true; 101 }; 102 }; 103 104 environment.variables = { 105 __ETC_ZSHRC_SOURCED = "1"; 106 __ETC_ZSHENV_SOURCED = "1"; 107 }; 108 109 # packages 110 nixpkgs.config.allowUnfree = true; 111 environment.systemPackages = with pkgs; [ 112 neovim 113 wget 114 zsh 115 git 116 curl 117 tree 118 coreutils 119 stdenv 120 util-linux 121 pstree 122 ]; 123 124 # fonts 125 fonts.packages = with pkgs; [ 126 terminus_font 127 ]; 128 }