From ae4cb860ea2bd99d80e66e48480e0d2a9731c2bd Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 12 Nov 2017 09:43:25 +0100 Subject: per-user module: factor away api and imp --- krebs/3modules/per-user.nix | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'krebs') diff --git a/krebs/3modules/per-user.nix b/krebs/3modules/per-user.nix index 1b8d092bb..9cbd9e1ea 100644 --- a/krebs/3modules/per-user.nix +++ b/krebs/3modules/per-user.nix @@ -1,28 +1,19 @@ -{ config, lib, pkgs, ... }: - with import ; - -let +{ config, pkgs, ... }: let cfg = config.krebs.per-user; - - out = { - options.krebs.per-user = api; - config = imp; - }; - - api = mkOption { - type = with types; attrsOf (submodule { +in { + options.krebs.per-user = mkOption { + type = types.attrsOf (types.submodule { options = { packages = mkOption { - type = listOf path; + type = types.listOf types.path; default = []; }; }; }); default = {}; }; - - imp = { + config = { environment = { etc = flip mapAttrs' cfg (name: { packages, ... }: { name = "per-user/${name}"; @@ -34,5 +25,4 @@ let profiles = ["/etc/per-user/$LOGNAME"]; }; }; - -in out +} -- cgit v1.2.3 From 9c8680981fc93c7bce3c4a5198d1d4cb36bd876a Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 12 Nov 2017 09:57:07 +0100 Subject: per-user module: symlinkJoin -> buildEnv Refs https://github.com/NixOS/nixpkgs/pull/31283 --- krebs/3modules/per-user.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'krebs') diff --git a/krebs/3modules/per-user.nix b/krebs/3modules/per-user.nix index 9cbd9e1ea..9080e3b44 100644 --- a/krebs/3modules/per-user.nix +++ b/krebs/3modules/per-user.nix @@ -17,9 +17,12 @@ in { environment = { etc = flip mapAttrs' cfg (name: { packages, ... }: { name = "per-user/${name}"; - value.source = pkgs.symlinkJoin { + value.source = pkgs.buildEnv { name = "per-user.${name}"; paths = packages; + pathsToLink = [ + "/bin" + ]; }; }); profiles = ["/etc/per-user/$LOGNAME"]; -- cgit v1.2.3 From 7393d245d61eac3f0c4f9f79865f8c9e8aea4839 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 12 Nov 2017 10:47:36 +0100 Subject: per-user module: create profiles only when needed Refs https://github.com/NixOS/nixpkgs/pull/25712 --- krebs/3modules/per-user.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'krebs') diff --git a/krebs/3modules/per-user.nix b/krebs/3modules/per-user.nix index 9080e3b44..a7a07a8e6 100644 --- a/krebs/3modules/per-user.nix +++ b/krebs/3modules/per-user.nix @@ -15,16 +15,19 @@ in { }; config = { environment = { - etc = flip mapAttrs' cfg (name: { packages, ... }: { - name = "per-user/${name}"; - value.source = pkgs.buildEnv { - name = "per-user.${name}"; - paths = packages; - pathsToLink = [ - "/bin" - ]; - }; - }); + etc = + mapAttrs' + (name: per-user: { + name = "per-user/${name}"; + value.source = pkgs.buildEnv { + name = "per-user.${name}"; + paths = per-user.packages; + pathsToLink = [ + "/bin" + ]; + }; + }) + (filterAttrs (_: per-user: per-user.packages != []) cfg); profiles = ["/etc/per-user/$LOGNAME"]; }; }; -- cgit v1.2.3 From 1f50c4e068294bba196695394660527963e7690b Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 12 Nov 2017 11:35:11 +0100 Subject: urlwatch: 2.6 -> 2.7 --- krebs/5pkgs/simple/urlwatch/default.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'krebs') diff --git a/krebs/5pkgs/simple/urlwatch/default.nix b/krebs/5pkgs/simple/urlwatch/default.nix index adaefbc4d..ebf872568 100644 --- a/krebs/5pkgs/simple/urlwatch/default.nix +++ b/krebs/5pkgs/simple/urlwatch/default.nix @@ -1,14 +1,18 @@ -{ stdenv, fetchurl, python3Packages }: +{ stdenv, fetchFromGitHub, python3Packages }: -python3Packages.buildPythonPackage rec { - name = "urlwatch-${meta.version}"; +python3Packages.buildPythonApplication rec { + name = "urlwatch-${version}"; + version = "2.7"; - src = fetchurl { - url = "https://github.com/thp/urlwatch/archive/${meta.version}.tar.gz"; - sha256 = "09bn31gn03swi7yr3s1ql8x07hx96gap1ka77kk44kk0lvfxn55b"; + src = fetchFromGitHub { + owner = "thp"; + repo = "urlwatch"; + rev = version; + sha256 = "0fx964z73yv08b1lpymmjsigf6929zx9ax5bp34rcf2c5gk11l5m"; }; propagatedBuildInputs = with python3Packages; [ + appdirs keyring minidb pycodestyle @@ -16,11 +20,10 @@ python3Packages.buildPythonPackage rec { requests ]; - meta = { + meta = with stdenv.lib; { description = "A tool for monitoring webpages for updates"; homepage = https://thp.io/2008/urlwatch/; - license = stdenv.lib.licenses.bsd3; - maintainers = [ stdenv.lib.maintainers.tv ]; - version = "2.6"; + license = licenses.bsd3; + maintainers = with maintainers; [ tv ]; }; } -- cgit v1.2.3