Skip to content

Commit 992743f

Browse files
committed
Make custom-desktop-entries separate derivations
Instead of joining all desktop entries into one derivation (from a list of derivations), expose the entries in an attrset. This allows users to use select entries instead of being forced to use all.
1 parent 7494e4d commit 992743f

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

cfg/base-medium.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@
6060
mtr
6161
mutt
6262
my.nix-check-before-push
63-
my.custom-desktop-entries
63+
my.custom-desktop-entries.gmail
64+
my.custom-desktop-entries.netflix
65+
my.custom-desktop-entries.sbanken
66+
my.custom-desktop-entries.tv-get-no
67+
my.custom-desktop-entries.tv-nrk-no
68+
my.custom-desktop-entries.youtube
6469
ncdu
6570
nethogs
6671
networkmanager
Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ lib, fetchurl, runCommand, pkgs }:
1+
{ lib, fetchurl, makeDesktopItem, pkgs }:
22

33
# StartupWMClass is found with `xprop WM_CLASS`. When multiple entries are
44
# returned, use the first one (most specific). (Ideally, all values could be
@@ -9,9 +9,9 @@ let
99

1010
makeSimpleWebApp = localLib.makeSimpleWebApp;
1111

12-
entries = [
12+
entries = {
1313

14-
(makeSimpleWebApp {
14+
tv-get-no = makeSimpleWebApp {
1515
server = "tv.get.no";
1616
# Chromium fails with
1717
# This video file cannot be played.
@@ -24,18 +24,18 @@ let
2424
sha256 = "0acrlix5qmnb32zaqcch0khb6s7ajrw4qv5ikx33bpf71mimkc94";
2525
};
2626
comment = "Get Nett-TV";
27-
})
27+
};
2828

29-
(makeSimpleWebApp {
29+
gmail = makeSimpleWebApp {
3030
server = "mail.google.com";
3131
icon = fetchurl {
3232
url = "https://upload.wikimedia.org/wikipedia/commons/a/ab/Gmail_Icon.svg";
3333
sha256 = "1avrc2laqmviih3gx4pkxrd7v2hkcgp48c7zcb1wmxbnxvcqxgqr";
3434
};
3535
comment = "GMail";
36-
})
36+
};
3737

38-
(makeSimpleWebApp {
38+
netflix = makeSimpleWebApp {
3939
server = "www.netflix.com";
4040
# It's a pain to maintain widewine for Chromium (slow to build, breaks), so
4141
# use google-chrome for netflix.
@@ -45,19 +45,19 @@ let
4545
sha256 = "06n3crmfc3k8yahybic399p832vzj5afrdqvlizrk8lbk3plrjd2";
4646
};
4747
comment = "Netflix";
48-
})
48+
};
4949

50-
(makeSimpleWebApp {
50+
tv-nrk-no = makeSimpleWebApp {
5151
server = "tv.nrk.no";
5252
icon = fetchurl {
5353
name = "nrk-tv-logo.png";
5454
url = "http://mirrors.kodi.tv/addons/leia/plugin.video.nrk/icon.png";
5555
sha256 = "0a0cn831qcn1wn2zqrgjhw3q3ch9li7fqgazvcii4a8gcrvcc3sm";
5656
};
5757
comment = "NRK TV";
58-
})
58+
};
5959

60-
(makeSimpleWebApp {
60+
sbanken = makeSimpleWebApp {
6161
server = "sbanken.no";
6262
# icon from google play
6363
# (https://play.google.com/store/apps/details?id=no.skandiabanken)
@@ -67,24 +67,18 @@ let
6767
sha256 = "1n4mjyhjn3npc785bvb3r0cpwndrzdzq8qq60d93hbgh9y04mdda";
6868
};
6969
comment = "Sbanken";
70-
})
70+
};
7171

72-
(makeSimpleWebApp {
72+
youtube = makeSimpleWebApp {
7373
server = "www.youtube.com";
7474
icon = fetchurl {
7575
url = "https://upload.wikimedia.org/wikipedia/commons/4/40/Youtube_icon.svg";
7676
sha256 = "0gqnp61pbcsfd34w6r9bjxnpzkrlb0nhwb8z3h2a4xbyawa9dpcq";
7777
};
7878
comment = "YouTube";
79-
})
79+
};
8080

81-
];
82-
83-
mkCommand = drv: ''
84-
cp -r "${drv}/"* "$out"; chmod -R +w "$out"
85-
'';
81+
};
8682

8783
in
88-
runCommand "custom-desktop-entries" {} (''
89-
mkdir -p "$out"
90-
'' + (lib.concatMapStringsSep "\n" mkCommand entries))
84+
entries

0 commit comments

Comments
 (0)