|
| 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 | + |
| 5 | +{ config, pkgs, ... }: |
| 6 | + |
| 7 | +let |
| 8 | + home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz"; |
| 9 | +in |
| 10 | +{ |
| 11 | + imports = |
| 12 | + [ # Include the results of the hardware scan. |
| 13 | + ./hardware-configuration.nix |
| 14 | + (import "${home-manager}/nixos") |
| 15 | + ]; |
| 16 | + |
| 17 | + # Bootloader. |
| 18 | + boot.loader.systemd-boot.enable = true; |
| 19 | + boot.loader.efi.canTouchEfiVariables = true; |
| 20 | + |
| 21 | + networking.hostName = "nixos"; # Define your hostname. |
| 22 | + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. |
| 23 | + |
| 24 | + # Configure network proxy if necessary |
| 25 | + # networking.proxy.default = "http://user:password@proxy:port/"; |
| 26 | + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; |
| 27 | + |
| 28 | + # Enable networking |
| 29 | + networking.networkmanager.enable = true; |
| 30 | + |
| 31 | + # Set your time zone. |
| 32 | + time.timeZone = "America/New_York"; |
| 33 | + |
| 34 | + # Select internationalisation properties. |
| 35 | + i18n.defaultLocale = "en_US.UTF-8"; |
| 36 | + |
| 37 | + i18n.extraLocaleSettings = { |
| 38 | + LC_ADDRESS = "en_US.UTF-8"; |
| 39 | + LC_IDENTIFICATION = "en_US.UTF-8"; |
| 40 | + LC_MEASUREMENT = "en_US.UTF-8"; |
| 41 | + LC_MONETARY = "en_US.UTF-8"; |
| 42 | + LC_NAME = "en_US.UTF-8"; |
| 43 | + LC_NUMERIC = "en_US.UTF-8"; |
| 44 | + LC_PAPER = "en_US.UTF-8"; |
| 45 | + LC_TELEPHONE = "en_US.UTF-8"; |
| 46 | + LC_TIME = "en_US.UTF-8"; |
| 47 | + }; |
| 48 | + |
| 49 | + home-manager.users.parth = { |
| 50 | + /* The home.stateVersion option does not have a default and must be set */ |
| 51 | + home.stateVersion = "18.09"; |
| 52 | + /* Here goes the rest of your home-manager config, e.g. home.packages = [ pkgs.foo ]; */ |
| 53 | + programs.git = { |
| 54 | + enable = true; |
| 55 | + userName = "parth"; |
| 56 | + |
| 57 | + }; |
| 58 | + }; |
| 59 | + |
| 60 | + # Enable the X11 windowing system. |
| 61 | + services.xserver.enable = true; |
| 62 | + |
| 63 | + # Enable the GNOME Desktop Environment. |
| 64 | + services.xserver.displayManager.gdm.enable = true; |
| 65 | + services.xserver.desktopManager.gnome.enable = true; |
| 66 | + |
| 67 | + # Configure keymap in X11 |
| 68 | + services.xserver.xkb = { |
| 69 | + layout = "us"; |
| 70 | + variant = ""; |
| 71 | + }; |
| 72 | + |
| 73 | + # Enable CUPS to print documents. |
| 74 | + services.printing.enable = true; |
| 75 | + |
| 76 | + # Enable sound with pipewire. |
| 77 | + hardware.pulseaudio.enable = false; |
| 78 | + security.rtkit.enable = true; |
| 79 | + services.pipewire = { |
| 80 | + enable = true; |
| 81 | + alsa.enable = true; |
| 82 | + alsa.support32Bit = true; |
| 83 | + pulse.enable = true; |
| 84 | + # If you want to use JACK applications, uncomment this |
| 85 | + #jack.enable = true; |
| 86 | + |
| 87 | + # use the example session manager (no others are packaged yet so this is enabled by default, |
| 88 | + # no need to redefine it in your config for now) |
| 89 | + #media-session.enable = true; |
| 90 | + }; |
| 91 | + |
| 92 | + # Enable touchpad support (enabled default in most desktopManager). |
| 93 | + # services.xserver.libinput.enable = true; |
| 94 | + |
| 95 | + # Define a user account. Don't forget to set a password with ‘passwd’. |
| 96 | + users.users.parth = { |
| 97 | + isNormalUser = true; |
| 98 | + description = "parth"; |
| 99 | + extraGroups = [ "networkmanager" "wheel" ]; |
| 100 | + packages = with pkgs; [ |
| 101 | + # thunderbird |
| 102 | + ]; |
| 103 | + }; |
| 104 | + |
| 105 | + # Enable automatic login for the user. |
| 106 | + services.xserver.displayManager.autoLogin.enable = true; |
| 107 | + services.xserver.displayManager.autoLogin.user = "parth"; |
| 108 | + |
| 109 | + # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229 |
| 110 | + systemd.services."getty@tty1".enable = false; |
| 111 | + systemd.services."autovt@tty1".enable = false; |
| 112 | + |
| 113 | + # Install firefox. |
| 114 | + programs.firefox.enable = true; |
| 115 | + |
| 116 | + # Allow unfree packages |
| 117 | + nixpkgs.config.allowUnfree = true; |
| 118 | + |
| 119 | + # List packages installed in system profile. To search, run: |
| 120 | + # $ nix search wget |
| 121 | + environment.systemPackages = with pkgs; [ |
| 122 | + git |
| 123 | + neovim |
| 124 | + ]; |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + # Some programs need SUID wrappers, can be configured further or are |
| 129 | + # started in user sessions. |
| 130 | + # programs.mtr.enable = true; |
| 131 | + # programs.gnupg.agent = { |
| 132 | + # enable = true; |
| 133 | + # enableSSHSupport = true; |
| 134 | + # }; |
| 135 | + |
| 136 | + # List services that you want to enable: |
| 137 | + |
| 138 | + # Enable the OpenSSH daemon. |
| 139 | + # services.openssh.enable = true; |
| 140 | + |
| 141 | + # Open ports in the firewall. |
| 142 | + # networking.firewall.allowedTCPPorts = [ ... ]; |
| 143 | + # networking.firewall.allowedUDPPorts = [ ... ]; |
| 144 | + # Or disable the firewall altogether. |
| 145 | + # networking.firewall.enable = false; |
| 146 | + |
| 147 | + # This value determines the NixOS release from which the default |
| 148 | + # settings for stateful data, like file locations and database versions |
| 149 | + # on your system were taken. It‘s perfectly fine and recommended to leave |
| 150 | + # this value at the release version of the first install of this system. |
| 151 | + # Before changing this value read the documentation for this option |
| 152 | + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). |
| 153 | + system.stateVersion = "24.05"; # Did you read the comment? |
| 154 | +} |
0 commit comments