Merge remote-tracking branch 'ni/master'

This commit is contained in:
lassulus 2017-11-14 20:21:16 +01:00
commit 7d95a0fc45
3 changed files with 39 additions and 38 deletions

View File

@ -1,38 +1,34 @@
{ config, lib, pkgs, ... }:
with import <stockholm/lib>; with import <stockholm/lib>;
{ config, pkgs, ... }: let
let
cfg = config.krebs.per-user; cfg = config.krebs.per-user;
in {
out = { options.krebs.per-user = mkOption {
options.krebs.per-user = api; type = types.attrsOf (types.submodule {
config = imp;
};
api = mkOption {
type = with types; attrsOf (submodule {
options = { options = {
packages = mkOption { packages = mkOption {
type = listOf path; type = types.listOf types.path;
default = []; default = [];
}; };
}; };
}); });
default = {}; default = {};
}; };
config = {
imp = {
environment = { environment = {
etc = flip mapAttrs' cfg (name: { packages, ... }: { etc =
mapAttrs'
(name: per-user: {
name = "per-user/${name}"; name = "per-user/${name}";
value.source = pkgs.symlinkJoin { value.source = pkgs.buildEnv {
name = "per-user.${name}"; name = "per-user.${name}";
paths = packages; paths = per-user.packages;
pathsToLink = [
"/bin"
];
}; };
}); })
(filterAttrs (_: per-user: per-user.packages != []) cfg);
profiles = ["/etc/per-user/$LOGNAME"]; profiles = ["/etc/per-user/$LOGNAME"];
}; };
}; };
}
in out

View File

@ -1,14 +1,18 @@
{ stdenv, fetchurl, python3Packages }: { stdenv, fetchFromGitHub, python3Packages }:
python3Packages.buildPythonPackage rec { python3Packages.buildPythonApplication rec {
name = "urlwatch-${meta.version}"; name = "urlwatch-${version}";
version = "2.7";
src = fetchurl { src = fetchFromGitHub {
url = "https://github.com/thp/urlwatch/archive/${meta.version}.tar.gz"; owner = "thp";
sha256 = "09bn31gn03swi7yr3s1ql8x07hx96gap1ka77kk44kk0lvfxn55b"; repo = "urlwatch";
rev = version;
sha256 = "0fx964z73yv08b1lpymmjsigf6929zx9ax5bp34rcf2c5gk11l5m";
}; };
propagatedBuildInputs = with python3Packages; [ propagatedBuildInputs = with python3Packages; [
appdirs
keyring keyring
minidb minidb
pycodestyle pycodestyle
@ -16,11 +20,10 @@ python3Packages.buildPythonPackage rec {
requests requests
]; ];
meta = { meta = with stdenv.lib; {
description = "A tool for monitoring webpages for updates"; description = "A tool for monitoring webpages for updates";
homepage = https://thp.io/2008/urlwatch/; homepage = https://thp.io/2008/urlwatch/;
license = stdenv.lib.licenses.bsd3; license = licenses.bsd3;
maintainers = [ stdenv.lib.maintainers.tv ]; maintainers = with maintainers; [ tv ];
version = "2.6";
}; };
} }

View File

@ -3,6 +3,7 @@ pkgs.writeHaskell "xmonad-tv" {
executables.xmonad = { executables.xmonad = {
extra-depends = [ extra-depends = [
"containers" "containers"
"extra"
"unix" "unix"
"X11" "X11"
"xmonad" "xmonad"
@ -19,11 +20,12 @@ pkgs.writeHaskell "xmonad-tv" {
module Main where module Main where
import Control.Exception import Control.Exception
import Control.Monad.Extra (whenJustM)
import Graphics.X11.ExtraTypes.XF86 import Graphics.X11.ExtraTypes.XF86
import Text.Read (readEither) import Text.Read (readEither)
import XMonad import XMonad
import System.IO (hPutStrLn, stderr) import System.IO (hPutStrLn, stderr)
import System.Environment (getArgs, withArgs, getEnv, getEnvironment) import System.Environment (getArgs, withArgs, getEnv, getEnvironment, lookupEnv)
import System.Posix.Process (executeFile) import System.Posix.Process (executeFile)
import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace import XMonad.Actions.DynamicWorkspaces ( addWorkspacePrompt, renameWorkspace
, removeEmptyWorkspace) , removeEmptyWorkspace)
@ -84,9 +86,9 @@ mainNoArgs = do
-- , handleEventHook = myHandleEventHooks <+> handleTimerEvent -- , handleEventHook = myHandleEventHooks <+> handleTimerEvent
--, handleEventHook = handleTimerEvent --, handleEventHook = handleTimerEvent
, manageHook = placeHook (smart (1,0)) <+> floatNextHook , manageHook = placeHook (smart (1,0)) <+> floatNextHook
, startupHook = do , startupHook =
path <- liftIO (getEnv "XMONAD_STARTUP_HOOK") whenJustM (liftIO (lookupEnv "XMONAD_STARTUP_HOOK"))
forkFile path [] Nothing (\path -> forkFile path [] Nothing)
, normalBorderColor = "#1c1c1c" , normalBorderColor = "#1c1c1c"
, focusedBorderColor = "#f000b0" , focusedBorderColor = "#f000b0"
, handleEventHook = handleShutdownEvent , handleEventHook = handleShutdownEvent