diff options
author | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-10-03 22:06:43 +0200 |
---|---|---|
committer | Patryk Niedźwiedziński <pniedzwiedzinski19@gmail.com> | 2020-10-03 22:06:43 +0200 |
commit | 342155ced8fc78b608f23454cb631decb0b7be9b (patch) | |
tree | 2cc4ffc422d645e17cf456cdcc780287df311b3f /platforms/linux/configuration.nix | |
parent | 5d3c8e21d2d79a6ed3e324b833002a9bb0317b34 (diff) | |
download | dots-342155ced8fc78b608f23454cb631decb0b7be9b.tar.gz dots-342155ced8fc78b608f23454cb631decb0b7be9b.zip |
Update config
Diffstat (limited to 'platforms/linux/configuration.nix')
-rw-r--r-- | platforms/linux/configuration.nix | 283 |
1 files changed, 283 insertions, 0 deletions
diff --git a/platforms/linux/configuration.nix b/platforms/linux/configuration.nix new file mode 100644 index 0000000..9d894e6 --- /dev/null +++ b/platforms/linux/configuration.nix @@ -0,0 +1,283 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: +{ + nix.useSandbox = true; + + # Add NUR + nixpkgs.config.packageOverrides = pkgs: { + nur = import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz") { + inherit pkgs; + }; + }; + + # NUR cachable + #nixpkgs.config.packageOverrides = pkgs: { + # nur = import (builtins.fetchTarball { + # url = "https://github.com/nix-community/NUR/archive/02ba8936dec5010545a97bba41a52a03078a2644.tar.gz"; + # sha256 = "0ix86b53l9hv5minkjhbydi82n6dc4s700k8pwlm0z5fwlgvhy09"; + # }) { + # inherit pkgs; + # }; + #}; + + + imports = + [ # Include the results of the hardware scan. + # <home-manager>/nixos + ../../modules/dockd.nix + ../../hardware-configuration.nix + ]; + + # Use the GRUB 2 boot loader. + boot.loader.grub.enable = true; + boot.loader.grub.version = 2; + # boot.loader.grub.efiSupport = true; + # boot.loader.grub.efiInstallAsRemovable = true; + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; + # Define on which hard drive you want to install Grub. + boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only + boot.plymouth.enable = true; + boot.binfmt.emulatedSystems = [ "aarch64-linux" ]; + + fileSystems = { + "/home" = { + device = "/dev/disk/by-label/home"; + fsType = "ext4"; + }; + "/nix" = { + device = "/dev/disk/by-label/nix"; + fsType = "ext4"; + }; + "/var/lib/docker" = { + device = "/dev/disk/by-label/docker"; + fsType = "ext4"; + }; + "/mnt/qnap" = { + device = "//192.168.1.119/Patryk"; + fsType = "cifs"; + options = let + # this line prevents hanging on network split + automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s,vers=1.0"; + + in ["${automount_opts},credentials=/etc/nixos/smb-secrets"]; + }; + }; + + networking = { + networkmanager = { + enable = true; + wifi.backend = "iwd"; + }; + }; + + networking.hostName = "nixos"; # Define your hostname. + networking.extraHosts = "${ pkgs.stdenv.lib.readFile "${pkgs.fetchurl { + url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn/hosts"; + sha256 = "0fw6p8m4k7r470rjz40fbr7drgpxmmyzp9l9a677g55nif2gnk2x"; + }}"}"; + + # The global useDHCP flag is deprecated, therefore explicitly set to false here. + # Per-interface useDHCP will be mandatory in the future, so this generated config + # replicates the default behaviour. + networking.useDHCP = false; + networking.interfaces.enp0s25.useDHCP = true; + networking.interfaces.wlp3s0.useDHCP = true; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + # i18n.defaultLocale = "en_US.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # }; + + # Set your time zone. + time.timeZone = "Europe/Warsaw"; + + nixpkgs.config = { + allowUnfree = true; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # Basic tools + stdenv wget vim curl htop dnsutils zip unzip + zsh neovim ripgrep jq groff file pinentry_gnome + ssh-ident + + # XORG perfs + xorg.xorgserver xorg.xf86inputevdev xorg.xf86inputsynaptics xorg.xf86inputlibinput + xorg.xf86videointel + noto-fonts-extra dunst xclip + xwallpaper + nur.repos.pn.dmenu xdotool + # screenkey + + # UI apps + zathura ncmpcpp brave sxiv pulsemixer + lynx lf nur.repos.pn.st arandr wpa_supplicant_gui + system-config-printer libreoffice teams + vscodium abook + + # Audio/Video + mpd mpc_cli mpv ffmpeg youtube-dl + + # CLIs + lm_sensors + fzf gitAndTools.gh docker-compose xsel + bc libnotify + pamixer maim killall + quickserve ueberzug chafa + + # Thinkpad utils + nur.repos.pn.dockd + + ]; + + # Pure conf + environment.etc = { + "zsh/zshenv".text = '' + export ZDOTDIR=$HOME/.config/zsh + ''; + }; + + environment.variables = { + XDG_CONFIG_HOME = "$HOME/.config"; + XDG_DATA_HOME = "$HOME/.local/share"; + }; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + programs.gnupg = { + agent = { + enable = true; + enableSSHSupport = true; + pinentryFlavor = "gnome3"; + }; + }; + + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestions.enable = true; + histFile = "$XDG_DATA_HOME/zsh/history"; + + syntaxHighlighting.enable = true; + }; + + programs.vim.defaultEditor = true; + programs.slock.enable = true; + programs.browserpass.enable = true; + programs.dockd.enable = true; + programs.adb.enable = true; + + virtualisation.docker.enable = true; + # virtualisation.anbox.enable = true; + + # List services that you want to enable: + + # services.udev.packages = [ + # pkgs.android-udev-rules + # ]; + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + networking.firewall.enable = false; + + # Enable CUPS to print documents. + services.printing = { + enable = true; + drivers = [ pkgs.epson_201207w ]; + }; + + services.cron.enable = true; + services.fcron.enable = true; + + services.acpid.enable = true; + + # Enable sound. + sound.enable = true; + hardware.pulseaudio.enable = true; + + # Enable the X11 windowing system. + services.xserver.enable = true; + services.xserver.displayManager.startx.enable = true; + services.xserver.layout = "pl"; + # services.xserver.xkbOptions = "eurosign:e"; + + # Enable touchpad support. + services.xserver.libinput.enable = true; + + # Enable the KDE Desktop Environment. + #services.xserver.displayManager.sddm.enable = true; + #services.xserver.desktopManager.plasma5 = { + # enable = true; + #}; + + # i3 + #services.xserver.desktopManager.xterm.enable = false; + #services.xserver.displayManager.defaultSession = "none+i3"; + #services.xserver.windowManager.i3 = { + # enable = true; + # package = pkgs.i3-gaps; + # extraPackages = with pkgs; [ + # i3status + # i3lock + # i3blocks + # ]; + #}; + + # XFCE + i3 + #services.xserver.displayManager.defaultSession = "xfce+i3"; + #services.xserver.desktopManager = { + # xterm.enable = false; + # xfce = { + # enable = true; + # noDesktop = true; + # enableXfwm = false; + # }; + #}; + #services.xserver.windowManager.i3 = { + # enable = true; + # package = pkgs.i3-gaps; + # extraPackages = with pkgs; [ + # i3status + # i3lock + # i3blocks + # ]; + #}; + + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.pn = { + isNormalUser = true; + extraGroups = [ "wheel" "video" "docker" "adbusers" ]; # Enable ‘sudo’ for the user. + }; + + users.defaultUserShell = "/run/current-system/sw/bin/zsh"; + security.sudo.wheelNeedsPassword = false; + + + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "20.09"; # Did you read the comment? + +} |