Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Install from NixOS channel #20

Closed
matthew-piziak opened this issue Mar 31, 2019 · 9 comments
Closed

Install from NixOS channel #20

matthew-piziak opened this issue Mar 31, 2019 · 9 comments

Comments

@matthew-piziak
Copy link

Strange that I have to install lorri with nix-env instead of just tossing it in my configuration file as environment.systemPackages = [ lorri ];. Is there going to be an upstream package in the future?

I tried making my own like this:

{ config, pkgs, ... }:

let
  lorri = pkgs.stdenv.mkDerivation rec {
    pname = "lorri";
    version = "rolling-release";
    src = pkgs.fetchFromGitHub {
      owner = "target";
      repo = "lorri";
      rev = "094a903d19eb652a79ad6e7db6ad1ee9ad78d26c";
      sha256 = "11i4kbwclwyvznyd9q69fq36fjasvs72ziz0555hl3fjbbq0n72q";
    };
  };
in
{
  environment.systemPackages = [ lorri ];
}

But it failed like this:

shkhgcxs3aljqz771rilj8c-nixpkgs-18.09.2436.395a543f360/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:177:11:
while evaluating the attribute 'system.activationScripts.script' at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/nixos/modules/system/activation/activation-script.nix:67:9:
while evaluating 'textClosureMap' at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/strings-with-deps.nix:70:35, called from /nix/var/nix/profiles/per-user/root/channels/nixpkgs/nixos/modules/system/activation/activation-script.nix:88:18:
while evaluating 'id' at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/trivial.nix:14:5, called from undefined position:
while evaluating the attribute 'text' at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/nixos/modules/system/activation/activation-script.nix:9:5:
while evaluating the attribute 'text' at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/strings-with-deps.nix:77:38:
while evaluating the attribute 'sources' of the derivation 'etc' at /nix/store/yn6df0qzkshkhgcxs3aljqz771rilj8c-nixpkgs-18.09.2436.395a543f360/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:177:11:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/nixos/modules/system/etc/etc.nix:20:20, called from undefined position:
while evaluating the attribute 'source' at undefined position:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/modules.nix:75:45, called from undefined position:
while evaluating the attribute 'value' at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/modules.nix:336:9:
while evaluating the option `environment.etc.crontab.source':
while evaluating the attribute 'mergedValue' at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/modules.nix:369:5:
while evaluating anonymous function at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/modules.nix:369:32, called from /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/modules.nix:369:19:
while evaluating 'check' at /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/types.nix:240:15, called from /nix/var/nix/profiles/per-user/root/channels/nixpkgs/lib/modules.nix:370:10:
while evaluating the attribute 'allFiles' of the derivation 'crontabs' at /nix/store/yn6df0qzkshkhgcxs3aljqz771rilj8c-nixpkgs-18.09.2436.395a543f360/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:177:11:
while evaluating the attribute 'text' of the derivation 'system-crontab' at /nix/store/yn6df0qzkshkhgcxs3aljqz771rilj8c-nixpkgs-18.09.2436.395a543f360/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:177:11:
while evaluating the attribute 'passAsFile' of the derivation 'system-path' at /nix/store/yn6df0qzkshkhgcxs3aljqz771rilj8c-nixpkgs-18.09.2436.395a543f360/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:177:11:
illegal name: '.drv'
@sveitser
Copy link

sveitser commented Apr 2, 2019

I installed it with with the following overlay

~/.config/nixpkgs/overlays/lorri.nix:

self: super: {
  lorri =
    let src =
      (super.fetchFromGitHub {
        owner = "target";
        repo = "lorri";
        rev = "e943fa403234f1a5e403b6fdc112e79abc1e29ba";
        sha256 = "1ar7clza117qdzldld9qzg4q0wr3g20zxrnd1s51cg6gxwlpg7fa";
      });
    in super.callPackage src { inherit src; };
}

@Profpatsch
Copy link
Collaborator

For now we are on a rolling-release schedule via lorri self-upgrade, which is a small wrapper around nix-env (see https://github.com/target/lorri#upgrading). We’ll migrate to semver (and push it to nixpkgs) once we stabilize the interface and functionality, but we want to be able to make fast iterations for now.

@matthew-piziak
Copy link
Author

@sveitser Your solution looks good! But after I home-manager switch no lorri executable appears. How do I get home-manager to recognize the overlay?

@sveitser
Copy link

sveitser commented Apr 3, 2019

@matthew-piziak I thought overlays put into ~/.config/nixpkgs/overlays would be applied automatically but that doesn't seem to be the case.

I think this should work in configuration.nix or home.nix.

nixpkgs.overlays = [
  (import ./path/to/lorri.nix) 
];

@matthew-piziak
Copy link
Author

Aw, I tried that too, with a fully qualified path as well. No dice. 😢 😕

@sveitser
Copy link

sveitser commented Apr 3, 2019

Hmm. Did you add lorri to home.packages ?

@matthew-piziak
Copy link
Author

Yeah, I added pkgs = import <nixpkgs> and home.packages = [ pkgs.lorri ];

@sveitser
Copy link

sveitser commented Apr 3, 2019

@matthew-piziak
Copy link
Author

That did it! Yes! Thank you for bearing with me. :)

Now it's failing with a cargo error, but that's something I can take look into myself. I'm just happy my configuration is picking it up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants