Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Below is /etc/nixos/overlays/overlay-1/default.nix
- self: super: {
- overlay1 = super.fetchFromGitHub {
- owner = "NixOS";
- repo = "nixpkgs";
- # nixos-master as of 2018-05-16T08:47:00-00:00
- rev = "e03acfe161f6c28518211df6a9d1611c84957b8f";
- sha256 = "00bjc83dp1i18ndfs0sy5hlfhwigd3308m0sij6l62155jsnr8vw";
- };
- }
- # below is /etc/nixos/configuration.nix
- # the important part is where overlay1 is referenced to include it and secondly to access it when adding postgres extraPlugins.
- # if you search for "line 129" this is where nixos-rebuild switch errors out.
- # the error from running nixos-rebuild switch is:
- [root@nixos:~]# nixos-rebuild switch
- building Nix...
- building the system configuration...
- error: attribute 'cstore_fdw' missing, at /etc/nixos/configuration.nix:129:12
- (use '--show-trace' to show detailed location information)
- # configuration.nix below:
- # 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, lib, pkgs, ... }:
- {
- imports =
- [ # Include the results of the hardware scan.
- ./hardware-configuration.nix
- ];
- nixpkgs = { overlays = [ (import ./overlays/overlay-1) ]; };
- # 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.initrd.checkJournalingFS = false;
- boot.initrd.kernelModules = [ "hv_vmbus" "hv_netvsc" "hv_utils" "hv_storvsc" ];
- boot.kernelParams = ["nomodeset" ];
- #networking.hostName = "nixos"; # Define your hostname.
- #networking.interfaces.eth0.ipv4.addresses = [ { address = "192.168.0.3"; prefixLength = 24; } ];
- #networking.defaultGateway = "192.168.0.1";
- #networking.nameservers = [ "192.168.0.2" ];
- # example from https://nixos.org/nix-dev/2012-August/009680.html
- networking = {
- hostName = "nixos";
- #enableIPv6 = true;
- useDHCP = false;
- defaultGateway = "192.168.0.99";
- nameservers = [ "192.168.0.2" ];
- interfaces = [ { name = "eth0"; ipv4.addresses = [ { address = "192.168.0.3"; prefixLength = 24; } ]; } ];
- # localCommands = "ip route add default via 2a03:2900:2:1::1";
- };
- # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
- # Select internationalisation properties.
- i18n = {
- consoleFont = "Lat2-Terminus16";
- consoleKeyMap = "us";
- defaultLocale = "en_US.UTF-8";
- };
- # Set your time zone.
- time.timeZone = "America/Puerto_Rico";
- nix.nixPath = [
- "nixpkgs-overlays=/etc/nixos/overlays/"
- ];
- nixpkgs.config.allowUnfree = true;
- #nixpkgs.config.packageOverrides = with pkgs; {
- # timescaledb = callPackage <nixpkgs/timescaledb.nix { postgresql = pkgs.postgresql100; };
- #};
- # List packages installed in system profile. To search by name, run:
- # $ nix-env -qaP | grep wget
- environment.systemPackages = with pkgs; [
- wget vim curl screen git vscode python python36 gnumake chromium firefox
- findutils mono58 telnet unrar unzip wine zip libreoffice
- #pg_repack psqlodbc timescaledb
- overlay1.postgresql overlay1.timescaledb
- python27Packages.psycopg2 python36Packages.psycopg2
- pg_top pgadmin pgcli pgmanage postgis pg_repack
- overlay1.pg_topn overlay1.pg_cron overlay1.cstore_fdw
- clickhouse grafana
- fsharp41
- azure-vhd-utils
- ];
- # Some programs need SUID wrappers, can be configured further or are
- # started in user sessions.
- # programs.bash.enableCompletion = true;
- # programs.mtr.enable = true;
- # programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
- # List services that you want to enable:
- # Enable the OpenSSH daemon.
- services.openssh.enable = true;
- services.openssh.extraConfig = ''
- ClientAliveInterval 180
- '';
- # 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;
- # Enable sound.
- # sound.enable = true;
- # hardware.pulseaudio.enable = true;
- # Enable the X11 windowing system.
- services.xserver.enable = true;
- services.xserver.layout = "us";
- services.xserver.xkbOptions = "eurosign:e";
- # enable postgresql
- # but also see nixos evolution of these options here:
- # https://github.com/NixOS/nixpkgs/pull/38698
- # For override syntax, see
- # https://github.com/NixOS/nixpkgs/issues/21042
- # https://github.com/NixOS/nixpkgs/issues/38616
- services.postgresql = {
- enable = true;
- package = pkgs.overlay1.postgresql100;
- enableTCPIP = true;
- dataDir = "/data/pgdb";
- authentication = pkgs.lib.mkOverride 10 ''
- local all all trust
- host all all 192.168.0.0/24 trust
- '';
- extraPlugins = [
- (pkgs.timescaledb.override { postgresql = pkgs.overlay1.postgresql100; })
- (pkgs.postage.override { postgresql = pkgs.overlay1.postgresql100; })
- (pkgs.pg_repack.override { postgresql = pkgs.overlay1.postgresql100; })
- (pkgs.postgis.override { postgresql = pkgs.overlay1.postgresql100; })
- #(pkgs.overlay1.pg_cron.override { postgresql = pkgs.overlay1.postgresql100; })
- #(pkgs.pg_topn.override { postgresql = pkgs.overlay1.postgresql100; })
- (pkgs.overlay1.cstore_fdw.override { postgresql = pkgs.overlay1.postgresql100; }) #line 129 where the error is
- ];
- extraConfig = "shared_preload_libraries = 'timescaledb'";
- };
- services.pgmanage.enable = true;
- services.pgmanage.connections = { myserver = "host=localhost port=5432 dbname=postgres"; };
- # 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;
- # Define a user account. Don't forget to set a password with ‘passwd’.
- # users.extraUsers.guest = {
- # isNormalUser = true;
- # uid = 1000;
- # };
- users.extraUsers.u1 = {
- isNormalUser = true;
- home = "/home/u2";
- description = "u1";
- extraGroups = [ "wheel" "networkmanager" ];
- uid = 1000;
- };
- # This value determines the NixOS release with which your system is to be
- # compatible, in order to avoid breaking some software such as database
- # servers. You should change this only after NixOS release notes say you
- # should.
- system.stateVersion = "18.03"; # Did you read the comment?
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement