Compare commits

..

No commits in common. "035224eab61b80b5f6053ac7f72a3a6efa2aaa3b" and "d211b2efba99d17eab42439b4353865fa16f40bc" have entirely different histories.

10 changed files with 105 additions and 57 deletions

View File

@ -11,6 +11,11 @@ install-rm-keyfile:
sudo cp ./base/rm-keyfile.service /etc/systemd/system
sudo systemctl enable rm-keyfile.service
install-pamd:
drv=$$(nix-instantiate -E '((import ./pkgs.nix).stable {}).i3lock'); \
store=$$(nix-store --realise $$drv); \
sudo cp $$store"/etc/pam.d/i3lock" /etc/pam.d/i3lock
install-loadout:
@if [ -z "$(HOSTNAME)" ]; then echo "USAGE: make HOSTNAME=... install-loadout"; exit 1; fi
nix-env -v -i loadout -f default.nix --arg hostConfig "import ./config/$(HOSTNAME).nix"

4
awesome/bin/random_i3lock.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
R=`find "$1" | grep -P 'png$' | sort -R | head -n1`
exec i3lock -i $R -t

View File

@ -0,0 +1,3 @@
file:///tmp
file:///home/mediocregopher/Screenshots
file:///home/mediocregopher/Downloads

View File

@ -0,0 +1,2 @@
[Settings]
gtk-icon-theme-name = Tela

View File

@ -2,10 +2,12 @@
config,
}: rec {
pkgs = (import ../pkgs.nix).stable {};
pkgs2305 = (import ../pkgs.nix).stable2305 {};
pkgsEdge = (import ../pkgs.nix).edge {};
xorgInnerEnv = pkgs.buildEnv {
name = "xorg-inner-env";
@ -39,9 +41,10 @@ EOF
done
'';
startx = pkgs.writeShellScriptBin "startx-awesome" ''
startx = pkgs.writeShellScriptBin "startx" ''
# TODO pass .xinitrc into here, somehow
export XORGCONFIG=${xorgConf}
export PATH=${xorgInnerEnv}/bin:$PATH
exec startx
'';
@ -57,6 +60,43 @@ EOF
exec "$@"
'';
browser = pkgs.writeScriptBin "browser" ''
#!${pkgs.bash}/bin/bash
exec ${nativeWrap}/bin/native-wrap ${config.browser} "$@"
'';
env = pkgs.buildEnv {
name = "awesome-env";
paths = [
pkgs.awesome
pkgs.tela-icon-theme
nativeWrap
browser
pkgs.pavucontrol
pkgs.xdg-utils
pkgs.arandr
pkgs.i3lock
pkgs.scrot
pkgs.feh
pkgs.brightnessctl
pkgs.cbatticon
pkgs.phwmon
pkgs2305.libreoffice
pkgs.gimp
pkgs.inkscape
pkgs.vlc
pkgs.sylpheed
pkgs.calibre
pkgsEdge.lagrange
];
};
wp = ../wallpapers;
dirsLua = pkgs.writeTextDir "dirs.lua" ''
@ -71,10 +111,19 @@ EOF
set -e -x
export BROWSER=${browser}/bin/browser
# Turn off powersaving (fuck the environment)
xset -dpms
xset s off
export PATH=${env}/bin:$PATH
export XDG_CONFIG_DIRS=${./config}
export XDG_DATA_DIRS=${env}/share
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/home/mediocregopher/.nix-profile/share
${config.awesome.startupExtra}
# HACK: This sleep is here because phwmon actually creates a separate tray
@ -101,34 +150,11 @@ EOF
echo "New awesome session starting" > $this_log
exec ${pkgs.awesome}/bin/awesome \
exec awesome \
-c ${./rc.lua} \
--search ${dirsLua} \
--search ${./share} \
--search ${pkgs.awesome}/share/awesome/themes \
--search ${env}/share/awesome/themes \
2>&1 2>>$this_log
'';
env = pkgs.buildEnv {
name = "awesome-env";
paths = [
pkgs.tela-icon-theme
# We only include utilities in here which are directly used by awesome.
# General purpose applications go in the root default.nix env.
pkgs.pavucontrol
pkgs.xdg-utils
pkgs.arandr
pkgs.scrot
pkgs.feh
pkgs.brightnessctl
pkgs.cbatticon
pkgs.phwmon
xorgInnerEnv
nativeWrap
awesome
startx
];
};
}

View File

@ -65,6 +65,10 @@ function rand_wp()
return wp_dir .. wp
end
function rand_wp_lock()
awful.spawn(bin_dir.."random_i3lock.sh "..wp_dir, false)
end
local wp = rand_wp()
local imgavg = io.popen("cat " .. wp .. " | " .. bin_dir .. "imgavg")
local avgcolor = imgavg:read()
@ -334,6 +338,9 @@ globalkeys = awful.util.table.join(
naughty.notify({ text = "Screenshot taken" })
end),
--Lock screen
awful.key({ modkey, "Control" }, "Delete", rand_wp_lock),
awful.key( { }, "XF86AudioRaiseVolume", function()
awful.spawn("/usr/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%", false)
awful.spawn("/usr/bin/pactl set-sink-mute @DEFAULT_SINK@ 0", false)

3
bin/sshfs Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
/usr/bin/sshfs -oTCPKeepAlive=yes -oServerAliveCountMax=1 -oServerAliveInterval=5 $@

View File

@ -4,7 +4,6 @@
pkgs ? (import ./pkgs.nix).stable {},
pkgs2305 ? (import ./pkgs.nix).stable2305 {},
pkgsEdge ? (import ./pkgs.nix).edge {},
}: let
@ -37,18 +36,6 @@ in rec {
exec ${pkgs.git}/bin/git "$@"
'';
bin = pkgs.buildEnv {
name = "mediocregopher-bin";
paths = [
(pkgs.runCommand "mediocregopher-default-bin" {} ''
mkdir -p "$out"
cp -rL "${./bin}" "$out"/bin
'')
] ++ (
builtins.map (cFn: cFn pkgs) config.binExtra
);
};
zsh = ((import ./zsh) { inherit config; }).zsh;
awesome = ((import ./awesome) { inherit config; });
@ -107,19 +94,12 @@ in rec {
pkgs.udiskie
pkgs.xterm # nice to have a backup
pkgs2305.libreoffice
pkgs.gimp
pkgs.inkscape
pkgs.vlc
pkgs.sylpheed
pkgs.calibre
pkgsEdge.lagrange
bin
((import ./nvim) {}).nvim
zsh
((import ./alacritty) { inherit config zsh; }).alacritty
awesome.env
awesome.awesome
awesome.startx
];
};

View File

@ -5,9 +5,27 @@
}: rec {
ohMyZsh = ./oh-my-zsh;
bin = pkgs.buildEnv {
name = "mediocregopher-bin";
paths = [
(pkgs.stdenv.mkDerivation {
name = "mediocregopher-default-bin";
src = ../bin;
builder = builtins.toFile "builder.sh" ''
source $stdenv/setup
mkdir -p "$out"
cp -rL "$src" "$out"/bin
'';
})
] ++ (
builtins.map (cFn: cFn pkgs) config.binExtra
);
};
zshrc = pkgs.writeTextDir ".zshrc" ''
# Import before anything else, so that we have the full PATH available for
# everything following
# Import before anything else, so that we have the full PATH available for everything following
. ${pkgs.nix}/etc/profile.d/nix.sh
# oh-my-zsh
@ -18,7 +36,13 @@
plugins=(git vi-mode)
source $ZSH/oh-my-zsh.sh
export BROWSER=${config.browser}/bin/browser
export PATH=${bin}/bin:$PATH
#Global stuff shitty programs use
export EDITOR=~/.nix-profile/bin/nvim
# GPG is needy
export GPG_TTY=$(tty)
. ${./zshrc}
. ${./aliases}

View File

@ -1,9 +1,3 @@
#Global stuff shitty programs use
export EDITOR=~/.nix-profile/bin/nvim
# GPG is needy
export GPG_TTY=$(tty)
#Correctly background processes
setopt nohup