Merge remote-tracking branch 'ni/master'

This commit is contained in:
lassulus 2017-02-09 15:33:35 +01:00
commit aac79c6239
3 changed files with 146 additions and 105 deletions

View File

@ -1,13 +1,13 @@
{ config, lib, pkgs, ... }@args: { config, lib, pkgs, ... }@args:
with import <stockholm/lib>; with import <stockholm/lib>;
{ {
nixpkgs.config.packageOverrides = pkgs: let nixpkgs.config.packageOverrides = oldpkgs: let
# This callPackage will try to detect obsolete overrides. # This callPackage will try to detect obsolete overrides.
callPackage = path: args: let callPackage = path: args: let
override = pkgs.callPackage path args; override = pkgs.callPackage path args;
upstream = optionalAttrs (override ? "name") upstream = optionalAttrs (override ? "name")
(pkgs.${(parseDrvName override.name).name} or {}); (oldpkgs.${(parseDrvName override.name).name} or {});
in if upstream ? "name" && in if upstream ? "name" &&
override ? "name" && override ? "name" &&
compareVersions upstream.name override.name != -1 compareVersions upstream.name override.name != -1
@ -22,7 +22,7 @@ with import <stockholm/lib>;
// { // {
empty = pkgs.runCommand "empty-1.0.0" {} "mkdir $out"; empty = pkgs.runCommand "empty-1.0.0" {} "mkdir $out";
haskellPackages = pkgs.haskellPackages.override { haskellPackages = oldpkgs.haskellPackages.override {
overrides = self: super: overrides = self: super:
mapAttrs (name: path: self.callPackage path {}) mapAttrs (name: path: self.callPackage path {})
(mapAttrs' (mapAttrs'
@ -45,16 +45,15 @@ with import <stockholm/lib>;
buildbot-worker = callPackage ./buildbot/worker.nix {}; buildbot-worker = callPackage ./buildbot/worker.nix {};
# https://github.com/proot-me/PRoot/issues/106 # https://github.com/proot-me/PRoot/issues/106
proot = pkgs.writeScriptBin "proot" '' proot = pkgs.writeDashBin "proot" ''
#!${pkgs.dash}/bin/dash
export PROOT_NO_SECCOMP=1 export PROOT_NO_SECCOMP=1
exec ${pkgs.proot}/bin/proot "$@" exec ${oldpkgs.proot}/bin/proot "$@"
''; '';
# XXX symlinkJoin changed arguments somewhere around nixpkgs d541e0d # XXX symlinkJoin changed arguments somewhere around nixpkgs d541e0d
symlinkJoin = { name, paths, ... }@args: let symlinkJoin = { name, paths, ... }@args: let
x = pkgs.symlinkJoin args; x = oldpkgs.symlinkJoin args;
in if typeOf x != "lambda" then x else pkgs.symlinkJoin name paths; in if typeOf x != "lambda" then x else oldpkgs.symlinkJoin name paths;
test = { test = {
infest-cac-centos7 = callPackage ./test/infest-cac-centos7 {}; infest-cac-centos7 = callPackage ./test/infest-cac-centos7 {};

View File

@ -18,6 +18,6 @@ in {
networking.firewall.extraCommands = '' networking.firewall.extraCommands = ''
iptables -A INPUT -i retiolum -p tcp --dport ${toString es-port} -j ACCEPT iptables -A INPUT -i retiolum -p tcp --dport ${toString es-port} -j ACCEPT
iptables -A INPUT -i retiolum -p tcp --dport ${toString es-port} -j ACCEPT iptables -A INPUT -i retiolum -p tcp --dport ${toString kibana-port} -j ACCEPT
''; '';
} }

View File

@ -68,7 +68,7 @@ vicious.register(mailwidget, vicious_mails,only_new ,60,"~/Mail/localhost")
--mdirwidget = wibox.widget.textbox() --mdirwidget = wibox.widget.textbox()
--vicious.register(mdirwidget, vicious.widgets.mdir, ) --vicious.register(mdirwidget, vicious.widgets.mdir, )
cpuwidget = awful.widget.graph() cpuwidget = wibox.widget.graph()
-- Graph properties -- Graph properties
cpuwidget:set_width(50) cpuwidget:set_width(50)
cpuwidget:set_background_color("#494B4F") cpuwidget:set_background_color("#494B4F")
@ -82,23 +82,10 @@ vicious.register(batwidget, vicious.widgets.bat, "$2%", 61, "BAT0")
-- {{{ Variable definitions -- {{{ Variable definitions
-- Themes define colours, icons, and wallpapers -- Themes define colours, icons, and wallpapers
-- beautiful.init("/usr/share/awesome/themes/default/theme.lua")
-- @awesome@/share/awesome/lib/beautiful.lua
-- beautiful.init("@awesome@/share/awesome/themes/default/theme.lua")
-- Find the default theme -- Find the default theme
function find_default_theme()
-- find the default lua theme in the package path
for path in package.path:gmatch('([^;]+);') do
if path:match('awesome.*share') then
theme_path = path:match('^([^?]*)') .. '../themes/default/theme.lua'
if awful.util.file_readable(theme_path) then return theme_path end
end
end
end
beautiful.init(find_default_theme()) beautiful.init(awful.util.get_themes_dir() .. "default/theme.lua")
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
@ -116,7 +103,7 @@ browser = "firefox"
modkey = "@modkey@" modkey = "@modkey@"
-- Table of layouts to cover with awful.layout.inc, order matters. -- Table of layouts to cover with awful.layout.inc, order matters.
local layouts = awful.layout.layouts =
{ {
awful.layout.suit.tile, awful.layout.suit.tile,
-- awful.layout.suit.tile.left, -- awful.layout.suit.tile.left,
@ -128,8 +115,9 @@ local layouts =
-- awful.layout.suit.spiral, -- awful.layout.suit.spiral,
-- awful.layout.suit.spiral.dwindle, -- awful.layout.suit.spiral.dwindle,
awful.layout.suit.max, awful.layout.suit.max,
awful.layout.suit.max.fullscreen awful.layout.suit.max.fullscreen,
-- awful.layout.suit.magnifier -- awful.layout.suit.magnifier,
awful.layout.suit.corner.nw
} }
-- }}} -- }}}
@ -146,7 +134,6 @@ end
tags = {} tags = {}
for s = 1, screen.count() do for s = 1, screen.count() do
-- Each screen has its own tag table. -- Each screen has its own tag table.
tags[s] = awful.tag({ "tmp", "news", "www", "im", "work1","work2","net","misc","remote" }, s, layouts[1])
end end
-- }}} -- }}}
@ -174,11 +161,10 @@ menubar.utils.terminal = terminal -- Set the terminal for applications that requ
-- {{{ Wibox -- {{{ Wibox
-- Create a textclock widget -- Create a textclock widget
mytextclock = awful.widget.textclock() mytextclock = wibox.widget.textclock()
-- Create a wibox for each screen and add it -- Create a wibox for each screen and add it
mywibox = {} mywibox = {}
mypromptbox = {}
mylayoutbox = {} mylayoutbox = {}
mytaglist = {} mytaglist = {}
mytaglist.buttons = awful.util.table.join( mytaglist.buttons = awful.util.table.join(
@ -224,49 +210,67 @@ mytasklist.buttons = awful.util.table.join(
if client.focus then client.focus:raise() end if client.focus then client.focus:raise() end
end)) end))
for s = 1, screen.count() do local function set_wallpaper(s)
-- Wallpaper
if beautiful.wallpaper then
local wallpaper = beautiful.wallpaper
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then
wallpaper = wallpaper(s)
end
gears.wallpaper.maximized(wallpaper, s, true)
end
end
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(s)
-- Each screen has its own tag table.
awful.tag({ "tmp", "news", "www", "im", "work1","work2","net","misc","remote" }, s, awful.layout.layouts[1])
-- Create a promptbox for each screen -- Create a promptbox for each screen
mypromptbox[s] = awful.widget.prompt() s.mypromptbox = awful.widget.prompt()
-- Create an imagebox widget which will contains an icon indicating which layout we're using. -- Create an imagebox widget which will contains an icon indicating which layout we're using.
-- We need one layoutbox per screen. -- We need one layoutbox per screen.
mylayoutbox[s] = awful.widget.layoutbox(s) s.mylayoutbox = awful.widget.layoutbox(s)
mylayoutbox[s]:buttons(awful.util.table.join( s.mylayoutbox:buttons(awful.util.table.join(
awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 1, function () awful.layout.inc( 1) end),
awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), awful.button({ }, 3, function () awful.layout.inc(-1) end),
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), awful.button({ }, 4, function () awful.layout.inc( 1) end),
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) awful.button({ }, 5, function () awful.layout.inc(-1) end)))
-- Create a taglist widget -- Create a taglist widget
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, taglist_buttons)
-- Create a tasklist widget -- Create a tasklist widget
mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons)
-- Create the wibox -- Create the wibox
mywibox[s] = awful.wibox({ position = "top", screen = s }) s.mywibox = awful.wibar({ position = "top", screen = s })
-- Widgets that are aligned to the left -- Add widgets to the wibox
local left_layout = wibox.layout.fixed.horizontal() s.mywibox:setup {
left_layout:add(mylauncher) layout = wibox.layout.align.horizontal,
left_layout:add(mytaglist[s]) { -- Left widgets
left_layout:add(mypromptbox[s]) layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
mykeyboardlayout,
mailwidget,
wibox.widget.systray(),
cpuwidget,
batwidget,
mytextclock,
s.mylayoutbox,
},
}
end)
-- Widgets that are aligned to the right
local right_layout = wibox.layout.fixed.horizontal()
right_layout:add(mailwidget)
if s == 1 then right_layout:add(wibox.widget.systray()) end
right_layout:add(cpuwidget)
right_layout:add(batwidget)
right_layout:add(mytextclock)
right_layout:add(mylayoutbox[s])
-- Now bring it all together (with the tasklist in the middle)
local layout = wibox.layout.align.horizontal()
layout:set_left(left_layout)
layout:set_middle(mytasklist[s])
layout:set_right(right_layout)
mywibox[s]:set_widget(layout)
end
-- }}} -- }}}
-- {{{ Mouse bindings -- {{{ Mouse bindings
@ -310,20 +314,41 @@ globalkeys = awful.util.table.join(
end), end),
-- Standard program -- Standard program
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
awful.key({ modkey, "Control" }, "r", awesome.restart), {description = "open a terminal", group = "launcher"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit), awful.key({ modkey, "Control" }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
{description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
{description = "decrease the number of columns", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}),
awful.key({ modkey, "Control" }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
client.focus = c
c:raise()
end
end,
{description = "restore minimized", group = "client"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),
awful.key({ modkey, "Control" }, "n", awful.client.restore),
awful.key({ }, "XF86AudioRaiseVolume", function () awful.key({ }, "XF86AudioRaiseVolume", function ()
awful.util.spawn("amixer set Master 5%+", false) end), awful.util.spawn("amixer set Master 5%+", false) end),
awful.key({ }, "XF86AudioLowerVolume", function () awful.key({ }, "XF86AudioLowerVolume", function ()
@ -332,18 +357,23 @@ globalkeys = awful.util.table.join(
awful.util.spawn("amixer -q -D default sset Master toggle", false) end), awful.util.spawn("amixer -q -D default sset Master toggle", false) end),
-- Prompt -- Prompt
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
-- awful.key({ modkey }, "r", function () awful.util.spawn( "dmenu_run" ) end ), -- awful.key({ modkey }, "r", function () awful.util.spawn( "dmenu_run" ) end ),
awful.key({ modkey,"Control" }, "BackSpace", function () awful.util.spawn("xlock -mode blank") end), awful.key({ modkey,"Control" }, "BackSpace", function () awful.util.spawn("xlock -mode blank") end),
awful.key({ }, "XF86ScreenSaver", function () awful.util.spawn("xlock -mode blank") end), awful.key({ }, "XF86ScreenSaver", function () awful.util.spawn("xlock -mode blank") end),
awful.key({ modkey }, "x", awful.key({ modkey }, "x",
function () function ()
awful.prompt.run({ prompt = "Run Lua code: " }, awful.prompt.run {
mypromptbox[mouse.screen].widget, prompt = "Run Lua code: ",
awful.util.eval, nil, textbox = awful.screen.focused().mypromptbox.widget,
awful.util.getdir("cache") .. "/history_eval") exe_callback = awful.util.eval,
end), history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"}),
-- Menubar -- Menubar
awful.key({ modkey }, "p", function() menubar.show() end) awful.key({ modkey }, "p", function() menubar.show() end)
) )
@ -370,43 +400,55 @@ clientkeys = awful.util.table.join(
-- Compute the maximum number of digit we need, limited to 9 -- Compute the maximum number of digit we need, limited to 9
keynumber = 0 keynumber = 0
for s = 1, screen.count() do
keynumber = math.min(9, math.max(#tags[s], keynumber))
end
-- Bind all key numbers to tags. for i = 1, 9 do
-- Be careful: we use keycodes to make it works on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, keynumber do
globalkeys = awful.util.table.join(globalkeys, globalkeys = awful.util.table.join(globalkeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9, awful.key({ modkey }, "#" .. i + 9,
function () function ()
local screen = mouse.screen local screen = awful.screen.focused()
if tags[screen][i] then local tag = screen.tags[i]
awful.tag.viewonly(tags[screen][i]) if tag then
tag:view_only()
end end
end), end,
{description = "view tag #"..i, group = "tag"}),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9, awful.key({ modkey, "Control" }, "#" .. i + 9,
function () function ()
local screen = mouse.screen local screen = awful.screen.focused()
if tags[screen][i] then local tag = screen.tags[i]
awful.tag.viewtoggle(tags[screen][i]) if tag then
awful.tag.viewtoggle(tag)
end end
end), end,
{description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9, awful.key({ modkey, "Shift" }, "#" .. i + 9,
function () function ()
if client.focus and tags[client.focus.screen][i] then if client.focus then
awful.client.movetotag(tags[client.focus.screen][i]) local tag = client.focus.screen.tags[i]
end if tag then
end), client.focus:move_to_tag(tag)
end
end
end,
{description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function () function ()
if client.focus and tags[client.focus.screen][i] then if client.focus then
awful.client.toggletag(tags[client.focus.screen][i]) local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end end
end)) end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
)
end end
clientbuttons = awful.util.table.join( clientbuttons = awful.util.table.join(
awful.button({ }, 1, function (c) client.focus = c; c:raise() end), awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
awful.button({ modkey }, 1, awful.mouse.client.move), awful.button({ modkey }, 1, awful.mouse.client.move),