rust-nightly-nix icon indicating copy to clipboard operation
rust-nightly-nix copied to clipboard

maybe an example of a configuration.nix? not working for this noob.

Open bburdette opened this issue 7 years ago • 0 comments

I'm trying to add rust-nightly-nix to my configuration.nix, but its not working for me. What am I doing wrong?

I tried this in my configuration.nix:

# 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, ... }:

{
  nixpkgs.config.packageOverrides = pkgs: {
    rustNightly = pkgs.callPackage /home/bburdette/rust-nightly-nix {};
  };
}

{
  imports 

which yields this result:


[bburdette@trurl:~]$ sudo nixos-rebuild switch
error: attempt to call something which is not a function but a set, at /etc/nixos/configuration.nix:7:1
(use ‘--show-trace’ to show detailed location information)
building Nix...
error: attempt to call something which is not a function but a set, at /etc/nixos/configuration.nix:7:1
(use ‘--show-trace’ to show detailed location information)
building the system configuration...
error: attempt to call something which is not a function but a set, at /etc/nixos/configuration.nix:7:1
(use ‘--show-trace’ to show detailed location information)


And also this one:

# 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, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  nixpkgs.config.packageOverrides = pkgs: {
    rustNightly = pkgs.callPackage /home/bburdette/rust-nightly-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;

this rebuilds fine, but the nix-shell command fails:

[bburdette@trurl:~]$ sudo nixos-rebuild switch
[sudo] password for bburdette: 
building Nix...
building the system configuration...
updating GRUB 2 menu...
activating the configuration...
setting up /etc...
setting up tmpfiles

[bburdette@trurl:~]$ nix-shell -p 'rustNightly.rust { }'
error: attribute ‘rust’ missing, at (string):1:66
(use ‘--show-trace’ to show detailed location information)

full configuration.nix is here:

# 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, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  nixpkgs.config.packageOverrides = pkgs: {
    rustNightly = pkgs.callPackage /home/bburdette/rust-nightly-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

  networking.hostName = "trurl"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  fileSystems."/home" = 
    { device = "/dev/disk/by-label/home"; };

  # Select internationalisation properties.
  # i18n = {
  #   consoleFont = "Lat2-Terminus16";
  #   consoleKeyMap = "us";
  #   defaultLocale = "en_US.UTF-8";
  # };

  # Set your time zone.
  # time.timeZone = "Europe/Amsterdam";

  # List packages installed in system profile. To search by name, run:
  # $ nix-env -qaP | grep wget
  environment.systemPackages = with pkgs; [
    gparted
    firefox
    chromium
    ghc
    elmPackages.elm
    cargo
    stack
    kakoune
    wget
    neovim
    git
    exa
    ethtool
    libreoffice
    vlc
  ];

  # 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;

  # 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;

  services.xserver = {
   # Enable the X11 windowing system.
   enable = true;
   layout = "us";
  
   desktopManager = {
     gnome3.enable = true;
     default = "gnome3";
   };

   windowManager = {
     xmonad.enable = true;
     xmonad.enableContribAndExtras = true;
   };

   # Enable touchpad support.
   libinput.enable = true;
  };


  # services.xserver.xkbOptions = "eurosign:e";
  # 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.bburdette = {
     isNormalUser = true;
     uid = 1000;
     createHome = true;
     home = "/home/bburdette";
     useDefaultShell = true;
     extraGroups = [ "wheel" ];
   };

  # 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 = "17.09"; # Did you read the comment?

}

bburdette avatar Feb 27 '18 17:02 bburdette