configuration.nix 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. # Edit this configuration file to define what should be installed on
  2. # your system. Help is available in the configuration.nix(5) man page
  3. # and in the NixOS manual (accessible by running ‘nixos-help’).
  4. { config, pkgs, ... }:
  5. let
  6. #personalunixhacks = fetchGit "https://notabug.org/strlst/personalunixhacks";
  7. personalunixhacks = /root/dotfiles/misc/personalunixhacks;
  8. in
  9. {
  10. imports =
  11. [ # Include the results of the hardware scan.
  12. ./hardware-configuration.nix
  13. /root/nix/postgresql-config.nix
  14. /root/nix/nginx-config.nix
  15. /root/nix/acme-config.nix
  16. /root/nix/gitea-config.nix
  17. /root/nix/keycloak-config.nix
  18. ];
  19. # Use the GRUB 2 boot loader.
  20. boot.loader.grub.enable = true;
  21. boot.loader.grub.version = 2;
  22. # boot.loader.grub.efiSupport = false;
  23. # boot.loader.grub.efiInstallAsRemovable = true;
  24. # boot.loader.efi.efiSysMountPoint = "/boot/efi";
  25. # Define on which hard drive you want to install Grub.
  26. boot.loader.grub.device = "/dev/vda"; # or "nodev" for efi only
  27. # networking.hostName = "nixos"; # Define your hostname.
  28. # Pick only one of the below networking options.
  29. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
  30. # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
  31. # Set your time zone.
  32. time.timeZone = "Europe/Zurich";
  33. # Configure network proxy if necessary
  34. # networking.proxy.default = "http://user:password@proxy:port/";
  35. # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
  36. # Select internationalisation properties.
  37. # i18n.defaultLocale = "en_US.UTF-8";
  38. # console = {
  39. # font = "Lat2-Terminus16";
  40. # keyMap = "us";
  41. # useXkbConfig = true; # use xkbOptions in tty.
  42. # };
  43. # Enable the X11 windowing system.
  44. services.xserver.enable = true;
  45. services.xserver.windowManager.dwm.enable = true;
  46. services.xserver.displayManager.lightdm.enable = true;
  47. # autoLogin doesn't work for some reason
  48. services.xserver.displayManager.defaultSession = "none+dwm";
  49. services.xserver.displayManager.autoLogin.enable = true;
  50. services.xserver.displayManager.autoLogin.user = "root";
  51. services.xserver.resolutions = [{x = 1920; y = 1080;}];
  52. nixpkgs.overlays = [
  53. (final: prev: {
  54. dwm = prev.dwm.overrideAttrs (old: { src = "${personalunixhacks}/dwm-6.1"; });
  55. st = prev.st.overrideAttrs (old: { src = "${personalunixhacks}/st-0.8.2"; });
  56. dmenu = prev.dmenu.overrideAttrs (old: { src = "${personalunixhacks}/dmenu-4.7"; });
  57. slstatus = prev.slstatus.overrideAttrs (old: { src = "${personalunixhacks}/slstatus"; });
  58. })
  59. ];
  60. fonts.fonts = with pkgs; [
  61. mplus-outline-fonts.githubRelease
  62. ubuntu_font_family
  63. #terminus # unmaintained :(
  64. #ubuntu
  65. ];
  66. # Configure keymap in X11
  67. services.xserver.layout = "us";
  68. # services.xserver.xkbOptions = {
  69. # "eurosign:e";
  70. # "caps:escape" # map caps to escape.
  71. # };
  72. # Enable CUPS to print documents.
  73. # services.printing.enable = true;
  74. # Enable sound.
  75. # sound.enable = true;
  76. # hardware.pulseaudio.enable = true;
  77. # Enable touchpad support (enabled default in most desktopManager).
  78. # services.xserver.libinput.enable = true;
  79. # Define a user account. Don't forget to set a password with ‘passwd’.
  80. # users.users.alice = {
  81. # isNormalUser = true;
  82. # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
  83. # packages = with pkgs; [
  84. # firefox
  85. # thunderbird
  86. # ];
  87. # };
  88. # List packages installed in system profile. To search, run:
  89. # $ nix search wget
  90. environment.systemPackages = with pkgs; [
  91. neovim
  92. wget
  93. git
  94. st
  95. dmenu
  96. slstatus
  97. firefox
  98. system-sendmail
  99. ];
  100. # Some programs need SUID wrappers, can be configured further or are
  101. # started in user sessions.
  102. # programs.mtr.enable = true;
  103. programs.gnupg.agent = {
  104. enable = true;
  105. enableSSHSupport = true;
  106. };
  107. # List services that you want to enable:
  108. # Enable the OpenSSH daemon.
  109. services.openssh.enable = true;
  110. # Open ports in the firewall.
  111. # networking.firewall.allowedTCPPorts = [ ... ];
  112. # networking.firewall.allowedUDPPorts = [ ... ];
  113. # Or disable the firewall altogether.
  114. # networking.firewall.enable = false;
  115. networking.extraHosts = ''
  116. 127.0.0.1 gitea.local
  117. 127.0.0.1 keycloak.local
  118. '';
  119. # Copy the NixOS configuration file and link it from the resulting system
  120. # (/run/current-system/configuration.nix). This is useful in case you
  121. # accidentally delete configuration.nix.
  122. # system.copySystemConfiguration = true;
  123. # This value determines the NixOS release from which the default
  124. # settings for stateful data, like file locations and database versions
  125. # on your system were taken. It‘s perfectly fine and recommended to leave
  126. # this value at the release version of the first install of this system.
  127. # Before changing this value read the documentation for this option
  128. # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  129. system.stateVersion = "22.11"; # Did you read the comment?
  130. # Enable libvirt spice server guest tools
  131. services.spice-vdagentd.enable = true;
  132. services.qemuGuest.enable = true;
  133. }