Skip to content

Commit 31e5948

Browse files
committed
Problem: building backgrounds from the latest git repo
After upgrading to NixOS 18.09, started (reproducibly) get this error: ``` building '/nix/store/7fly8as31yz5dzzc2n7dz3qnhzsf8wnd-repo-HEAD-httpsgithubcomyrashkbackgrounds.drv'... fatal: unable to access 'https://github.com/yrashk/backgrounds/': Could not resolve host: github.com ``` Solution: switch to a git submodule While it's not a perfect solution, it resolves the problem for now
1 parent cf73da9 commit 31e5948

File tree

3 files changed

+5
-36
lines changed

3 files changed

+5
-36
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
[submodule "nixpkgs-mozilla"]
55
path = nixpkgs-mozilla
66
url = https://github.com/mozilla/nixpkgs-mozilla.git
7+
[submodule "backgrounds"]
8+
path = backgrounds
9+
url = https://github.com/yrashk/backgrounds

backgrounds

Submodule backgrounds added at fe6b596

home.nix

+1-36
Original file line numberDiff line numberDiff line change
@@ -6,39 +6,6 @@ with lib;
66
with import <home-manager/modules/lib/dag.nix> { inherit lib; };
77

88
let
9-
sanitiseName = stringAsChars (c: if elem c (lowerChars ++ upperChars)
10-
then c else "");
11-
fetchGitHashless = args: stdenv.lib.overrideDerivation
12-
# Use a dummy hash, to appease fetchgit's assertions
13-
(fetchgit (args // { sha256 = hashString "sha256" args.url; }))
14-
15-
# Remove the hash-checking
16-
(old: {
17-
outputHash = null;
18-
outputHashAlgo = null;
19-
outputHashMode = null;
20-
sha256 = null;
21-
});
22-
latestGitCommit = { url, ref ? "HEAD" }:
23-
runCommand "repo-${sanitiseName ref}-${sanitiseName url}"
24-
{
25-
# Avoids caching. This is a cheap operation and needs to be up-to-date
26-
version = toString currentTime;
27-
# Required for SSL
28-
GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
29-
30-
buildInputs = [ git gnused ];
31-
}
32-
''
33-
REV=$(git ls-remote "${url}" "${ref}") || exit 1
34-
35-
printf '"%s"' $(echo "$REV" |
36-
head -n1 |
37-
sed -e 's/\s.*//g' ) > "$out"
38-
'';
39-
fetchLatestGit = { url, ref ? "HEAD" }@args:
40-
with { rev = import (latestGitCommit { inherit url ref; }); };
41-
fetchGitHashless (removeAttrs (args // { inherit rev; }) [ "ref" ]);
429
notmuch-apply = stdenv.mkDerivation {
4310
name = "notmuch-apply";
4411
phases = [ "installPhase" ];
@@ -317,9 +284,7 @@ in
317284

318285
".config/awesome/theme.lua".source = awesome/theme.lua;
319286

320-
".config/awesome/backgrounds".source = fetchLatestGit {
321-
url = "https://github.com/yrashk/backgrounds";
322-
};
287+
".config/awesome/backgrounds".source = ./backgrounds;
323288

324289
".config/awesome/foggy".source = fetchFromGitHub {
325290
owner = "k3rni";

0 commit comments

Comments
 (0)