Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gets rebuilt after each garbage collection #42

Open
Zahrun opened this issue Apr 3, 2023 · 9 comments
Open

gets rebuilt after each garbage collection #42

Zahrun opened this issue Apr 3, 2023 · 9 comments

Comments

@Zahrun
Copy link
Contributor

Zahrun commented Apr 3, 2023

When installed in NixOS via configuration.nix, if I garbage-collect, and then nixos-rebuild, the software-center gets built again. I may want to try the solution mentioned in https://discourse.nixos.org/t/pinned-nixpkgs-keeps-getting-garbage-collected/12912/6 and if that fixes, I'll PR that.

Same goes with nixos-conf-editor.

@pinkcreeper100
Copy link

there is a cachix
copied from discord:

For NixOS users add this to your config:

  nix.settings.substituters = [ "https://snowflakeos.cachix.org/" ];
  nix.settings.trusted-public-keys = [
    "snowflakeos.cachix.org-1:gXb32BL86r9bw1kBiw9AJuIkqN49xBvPd1ZW8YlqO70="
  ];

@Zahrun
Copy link
Contributor Author

Zahrun commented Apr 4, 2023

Ok thank you for the information. I will try it for some time. Maybe then we can add it to the readme.

@Zahrun
Copy link
Contributor Author

Zahrun commented Apr 4, 2023

Hum, this seems to break nixos-conf-editor

nixos-conf-editor-0.1.1-vendor.tar.gz> building '/nix/store/mwdwhrb58iig3qs4gzzksl9vlh9nsx2k-nixos-conf-editor-0.1.1-vendor.tar.gz.drv'
nixos-conf-editor-0.1.1-vendor.tar.gz> unpacking sources
nixos-conf-editor-0.1.1-vendor.tar.gz> unpacking source archive /nix/store/w9cj7n6p0ls01x9wx4rm5ym4xn59xhzw-d0ddxbyalkfbxdbnfa6xprl8g87n8zn1-source
nixos-conf-editor-0.1.1-vendor.tar.gz> source root is d0ddxbyalkfbxdbnfa6xprl8g87n8zn1-source
nixos-conf-editor-0.1.1-vendor.tar.gz> patching sources
nixos-conf-editor-0.1.1-vendor.tar.gz> configuring
nixos-conf-editor-0.1.1-vendor.tar.gz> no configure script, doing nothing
nixos-conf-editor-0.1.1-vendor.tar.gz> building
nixos-conf-editor-0.1.1-vendor.tar.gz> source = "git+https://github.com/snowflakelinux/nix-data#a75a234c2ffa661b6d3f6d276dc372677e5e2c74"
nixos-conf-editor-0.1.1-vendor.tar.gz> 
nixos-conf-editor-0.1.1-vendor.tar.gz> ERROR: The Cargo.lock contains git dependencies
nixos-conf-editor-0.1.1-vendor.tar.gz> 
nixos-conf-editor-0.1.1-vendor.tar.gz> This is currently not supported in the fixed-output derivation fetcher.
nixos-conf-editor-0.1.1-vendor.tar.gz> Use cargoLock.lockFile / importCargoLock instead.
nixos-conf-editor-0.1.1-vendor.tar.gz> 
error: builder for '/nix/store/mwdwhrb58iig3qs4gzzksl9vlh9nsx2k-nixos-conf-editor-0.1.1-vendor.tar.gz.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/izkzwi1ci7xyvd15rybq3nwwz81snnc7-nixos-conf-editor-0.1.1.drv' failed to build

EDIT: not related, I just can't build nixos-conf-editor for some reason

@Zahrun
Copy link
Contributor Author

Zahrun commented Apr 7, 2023

there is a cachix copied from discord:

For NixOS users add this to your config:

  nix.settings.substituters = [ "https://snowflakeos.cachix.org/" ];
  nix.settings.trusted-public-keys = [
    "snowflakeos.cachix.org-1:gXb32BL86r9bw1kBiw9AJuIkqN49xBvPd1ZW8YlqO70="
  ];

Now that I added the cachix, everytime I do a garbage collection and then a rebuild, the sources get downloaded again. At least it is not rebuilding, so it is definitly an improvement. Is there any way to pin the sources in the store, so that they don't get garbage collected?

source> building '/nix/store/r4q7irab4dhzm2k6dmkamdyn4pd28n26-source.drv'
source> 
source> trying https://github.com/vlinkz/nixos-conf-editor/archive/9be2ed1183ca1cdf9c3a7a437032f41241d7a3b5.tar.gz
source>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
source>                                  Dload  Upload   Total   Spent    Left  Speed
source>   0     0    0     0    0     0      0      0 --:--:--  0:00:16 --:--:--     0
source> 100  680k    0  680k    0     0  12360      0 --:--:--  0:00:56 --:--:-- 24783
source> unpacking source archive /build/9be2ed1183ca1cdf9c3a7a437032f41241d7a3b5.tar.gz
source> building '/nix/store/ybj6x2px1g8x6f75rq1xiqsnkbk4n667-source.drv'
source> 
source> trying https://github.com/vlinkz/nix-software-center/archive/0.1.2.tar.gz
source>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
source>                                  Dload  Upload   Total   Spent    Left  Speed
source>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
source> 100 1244k    0 1244k    0     0  25458      0 --:--:--  0:00:50 --:--:-- 19756
source> unpacking source archive /build/0.1.2.tar.gz
source> building '/nix/store/xzavfdvayccwd09y33wz9jni4yianh34-source.drv'
source> 
source> trying https://github.com/vlinkz/nixos-appstream-data/archive/66b3399e6d81017c10265611a151d1109ff1af1b.tar.gz
source>   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
source>                                  Dload  Upload   Total   Spent    Left  Speed
source>   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
source> 100 16.0M    0 16.0M    0     0   794k      0 --:--:--  0:00:20 --:--:--  774k
source> unpacking source archive /build/66b3399e6d81017c10265611a151d1109ff1af1b.tar.gz

@jakehamilton
Copy link
Member

@Zahrun can you share your full configuration file(s)? Garbage collection will only remove packages that don't have a gc root. If you're installing the package in your NixOS configuration it won't be garbage collected as long as that system generation is active.

@Zahrun
Copy link
Contributor Author

Zahrun commented Apr 7, 2023

The package is not garbage collected, but the source is.
My config file is more than 600 lines long, but the relevant part is this:

{ config, pkgs, lib, ... }:
let
  nix-software-center = import (pkgs.fetchFromGitHub {
    owner = "vlinkz";
    repo = "nix-software-center";
    rev = "0.1.2";
    sha256 = "xiqF1mP8wFubdsAQ1BmfjzCgOD3YZf7EGWl9i69FTls=";
  }) {};
  nixos-conf-editor = import (pkgs.fetchFromGitHub {
    owner = "vlinkz";
    repo = "nixos-conf-editor";
    rev = "9be2ed1183ca1cdf9c3a7a437032f41241d7a3b5";
    sha256 = "sha256-QOigD8CaueznOKjjTpz1+lwiOX1o6qPTgZE6GmrCL/o=";
  }) {};
in 
{
  nix.settings.substituters = [ "https://snowflakeos.cachix.org/" ];
  nix.settings.trusted-public-keys = [
    "snowflakeos.cachix.org-1:gXb32BL86r9bw1kBiw9AJuIkqN49xBvPd1ZW8YlqO70="
  ];
  environment.systemPackages = with pkgs; [
    nixos-conf-editor
    nix-software-center
  ];
}

@jakehamilton
Copy link
Member

jakehamilton commented Apr 7, 2023

@Zahrun I wonder if setting keep-outputs in your nix.conf is the answer?

{
  nix.settings.keep-outputs = true;
}

https://nixos.org/manual/nix/unstable/command-ref/conf-file.html#conf-keep-outputs

@Zahrun
Copy link
Contributor Author

Zahrun commented Apr 7, 2023

@jakehamilton it does not change the situation.
https://discourse.nixos.org/t/pinned-nixpkgs-keeps-getting-garbage-collected/12912 reports a similar situation. I was not able to apply his solution though.

@eclairevoyant
Copy link

may become irrelevant with #45

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

No branches or pull requests

4 participants