mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
Installed. More configuration
~ move options out
~ redshift: switch to geoclue2
~ wifi: add c-base
+ rofi: add active and urgent colours
~ vim: wildmode made more sensible
~ i3blocks: fix battery script
- i3blocks: brightness indicator
+ i3: rofi window switcher
~ use illum for backlight
+ use unclutter
+ tor-browser-bundle-bin
+ xfce.tumbler
+ xorg.{xbacklight,xcursorthemes,xkill}
+ texlive-full
+ cabal{-install,2nix}
+ idris
~ bash: fix prompt
+ helpers file
This commit is contained in:
54
config.nix
54
config.nix
@@ -1,15 +1,11 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
scripts = import ./dot/scripts.nix pkgs;
|
||||
constants = import ./constants.nix;
|
||||
wallpaper = pkgs.copyPathToStore ./art/haskell-grey.png;
|
||||
theme = {
|
||||
gtk = { name = "Numix-SX-Dark"; package = pkgs.numix-sx-gtk-theme; };
|
||||
icon = { name = "Papirus-Adapta-Nokto"; package = pkgs.papirus-icon-theme; };
|
||||
};
|
||||
scripts = import ./dot/scripts.nix { inherit pkgs; };
|
||||
helpers = import ./helpers.nix;
|
||||
in {
|
||||
imports = [
|
||||
"${builtins.fetchTarball https://github.com/rycee/home-manager/archive/master.tar.gz}/nixos"
|
||||
./options.nix
|
||||
./configs/shells.nix
|
||||
./configs/editors.nix
|
||||
./configs/graphics.nix
|
||||
@@ -64,8 +60,7 @@ in {
|
||||
|
||||
services.redshift = {
|
||||
enable = true;
|
||||
latitude = "52";
|
||||
longitude = "13";
|
||||
provider = "geoclue2";
|
||||
temperature = { night = 25000; day = 1000; };
|
||||
};
|
||||
|
||||
@@ -76,7 +71,6 @@ in {
|
||||
terminal = "screen-256color";
|
||||
};
|
||||
|
||||
# networking.hostName = "scardanelli";
|
||||
networking.hosts = {
|
||||
"192.168.178.27" = [ "printer.local" ];
|
||||
};
|
||||
@@ -85,20 +79,21 @@ in {
|
||||
networking.wireless.networks = {
|
||||
Aether = { pskRaw = "e1b18af54036c5c9a747fe681c6a694636d60a5f8450f7dec0d76bc93e2ec85a"; };
|
||||
"Asoziales Netzwerk" = { pskRaw = "8e234041ec5f0cd1b6a14e9adeee9840ed51b2f18856a52137485523e46b0cb6"; };
|
||||
"c-base-public" = {};
|
||||
};
|
||||
|
||||
home-manager.users.kfm = {
|
||||
gtk = {
|
||||
enable = true;
|
||||
font = with import ./theme.nix; { package = pkgs.roboto; name = uiFont.name; };
|
||||
iconTheme = theme.icon;
|
||||
theme = theme.gtk;
|
||||
iconTheme = config.constants.theme.icon;
|
||||
theme = config.constants.theme.gtk;
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = constants.user.name;
|
||||
userEmail = constants.user.email;
|
||||
userName = config.constants.user.name;
|
||||
userEmail = config.constants.user.email;
|
||||
aliases = {
|
||||
br = "branch";
|
||||
co = "checkout";
|
||||
@@ -110,24 +105,37 @@ in {
|
||||
last = "log -1 HEAD";
|
||||
pull-all = "!${scripts.git-pull-all}";
|
||||
};
|
||||
ignores = constants.ignoredFiles;
|
||||
ignores = config.constants.ignore;
|
||||
};
|
||||
|
||||
programs.rofi = with import ./theme.nix; {
|
||||
enable = true;
|
||||
separator = "solid";
|
||||
scrollbar = false;
|
||||
terminal = config.defaultApplications.terminal;
|
||||
borderWidth = 0;
|
||||
lines = 5;
|
||||
font = "${uiFont.name} ${toString (uiFont.size + 1)}";
|
||||
colors = {
|
||||
colors = rec {
|
||||
window = { background = black; border = black; separator = gray.dark; };
|
||||
rows = {
|
||||
normal = {
|
||||
background = black;
|
||||
background = window.background;
|
||||
backgroundAlt = window.background;
|
||||
foreground = gray.light;
|
||||
backgroundAlt = black;
|
||||
highlight = { background = black; foreground = white; };
|
||||
highlight = { foreground = white; inherit (window) background; };
|
||||
};
|
||||
active = {
|
||||
background = window.background;
|
||||
backgroundAlt = window.background;
|
||||
foreground = blue.dark;
|
||||
highlight = { foreground = blue.light; inherit (window) background; };
|
||||
};
|
||||
urgent = {
|
||||
background = window.background;
|
||||
backgroundAlt = window.background;
|
||||
foreground = red.dark;
|
||||
highlight = { foreground = red.light; inherit (window) background; };
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -137,7 +145,7 @@ in {
|
||||
|
||||
services.dunst = with import ./theme.nix; {
|
||||
enable = true;
|
||||
iconTheme = theme.icon;
|
||||
iconTheme = config.constants.theme.icon;
|
||||
settings = {
|
||||
global = {
|
||||
transparency = 10;
|
||||
@@ -180,9 +188,9 @@ in {
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".background-image".source = wallpaper;
|
||||
".ghci".text = import ./dot/ghci.nix pkgs;
|
||||
".stack/config.yaml".text = import ./dot/stack.nix constants.user;
|
||||
".background-image".source = config.constants.wallpaper;
|
||||
".ghci".text = import ./dot/ghci.nix { inherit pkgs; };
|
||||
".stack/config.yaml".text = import ./dot/stack.nix { user = config.constants.user; };
|
||||
".config/zathura/zathurarc".text = "set selection-clipboard clipboard";
|
||||
".config/mpv/input.conf".text = import ./dot/mpv.nix;
|
||||
".config/xfce4/terminal/terminalrc".text = import ./dot/terminal.nix;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{ pkgs, ... }:
|
||||
let vim_conf = with import ../constants.nix; ''
|
||||
{ pkgs, config, ... }:
|
||||
with import ../helpers.nix;
|
||||
let vim_conf = ''
|
||||
" if tabular
|
||||
vmap a= :Tabularize /=<CR>
|
||||
vmap a; :Tabularize /::<CR>
|
||||
@@ -14,7 +15,7 @@ let vim_conf = with import ../constants.nix; ''
|
||||
set number
|
||||
set path=$PWD/**
|
||||
set completeopt=menu,longest
|
||||
set wildmode=longest,full,list wildignore+=${commaSep ignoredFiles}
|
||||
set wildmode=list:longest wildignore+=${commaSep config.constants.ignore}
|
||||
set shortmess+=aI
|
||||
set nowritebackup noswapfile
|
||||
set mouse=a
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{ pkgs, lib, config, ... }:
|
||||
let
|
||||
spotify_info = pkgs.writeBash "spotify.info" ''
|
||||
STATUS=$(${pkgs.dbus}/bin/dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' string:'PlaybackStatus'|egrep -A 1 "string"|cut -b 26-|cut -d '"' -f 1|egrep -v ^$)
|
||||
@@ -26,7 +26,7 @@ let
|
||||
'';
|
||||
battery_info = pkgs.writeBash "battery.info" ''
|
||||
BAT_DIR="/sys/class/power_supply/$BLOCK_INSTANCE/"
|
||||
[ -d BAT_DIR ] && cd BAT_DIR || exit 1
|
||||
[ -d $BAT_DIR ] && cd $BAT_DIR || exit 1
|
||||
|
||||
status=$(cat status)
|
||||
charge_f=$((100 * $(cat charge_now) / $(cat charge_full)))
|
||||
@@ -122,15 +122,6 @@ let
|
||||
|
||||
[separator]
|
||||
|
||||
[brightness]
|
||||
command=printf "%.1f%%" $(${pkgs.xorg.xbacklight}/bin/xbacklight)
|
||||
label=
|
||||
min_width= 100%
|
||||
signal=2
|
||||
interval=once
|
||||
|
||||
[separator]
|
||||
|
||||
[cpu_usage]
|
||||
command=cut -d' ' -f 1-3 < /proc/loadavg
|
||||
label=
|
||||
@@ -182,11 +173,12 @@ let
|
||||
new_window pixel 1
|
||||
new_float pixel 1
|
||||
|
||||
bindsym $mod+Return exec ${pkgs.xfce.terminal}/bin/xfce4-terminal
|
||||
bindsym $mod+y exec ${pkgs.chromium}/bin/chrome-browser
|
||||
bindsym $mod+t exec ${pkgs.xfce.thunar}/bin/thunar
|
||||
bindsym $mod+Return exec ${config.defaultApplications.terminal}
|
||||
bindsym $mod+y exec ${config.defaultApplications.browser}
|
||||
bindsym $mod+t exec ${config.defaultApplications.fileManager}
|
||||
bindsym $mod+Shift+w exec ${pkgs.xautolock}/bin/xautolock -locknow
|
||||
bindsym $mod+d exec ${pkgs.rofi}/bin/rofi -display-run — -show run
|
||||
bindsym $mod+a exec ${pkgs.rofi}/bin/rofi -display-window — -show window
|
||||
|
||||
bindsym $mod+Shift+q kill
|
||||
bindsym $mod+Left focus left
|
||||
@@ -243,8 +235,6 @@ let
|
||||
bindsym XF86AudioLowerVolume exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5 && pkill -RTMIN+3 i3blocks
|
||||
bindsym XF86AudioRaiseVolume exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -i 5 && pkill -RTMIN+3 i3blocks
|
||||
bindsym XF86AudioMute exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t && pkill -RTMIN+3 i3blocks
|
||||
bindsym XF86MonBrightnessUp exec --no-startup-id ${pkgs.light}/bin/light +A 10 && pkill -RTMIN+2 i3blocks
|
||||
bindsym XF86MonBrightnessDown exec --no-startup-id ${pkgs.light}/bin/light -A 10 && pkill -RTMIN+2 i3blocks
|
||||
|
||||
mode " " {
|
||||
bindsym Left resize shrink width 10 px or 10 ppt
|
||||
@@ -284,17 +274,17 @@ let
|
||||
}
|
||||
'';
|
||||
in {
|
||||
services.xserver = with import ../constants.nix; with import ../theme.nix; {
|
||||
services.xserver = with import ../helpers.nix; with import ../theme.nix; {
|
||||
enable = true;
|
||||
layout = commaSep [ "de" "gr" "ru" ];
|
||||
xkbVariant = commaSep [ "T3" "polytonic" "phonetic_winkeys" ];
|
||||
xkbOptions = commaSep [ "terminate:ctrl_alt_bksp" "grp:alt_space_toggle" ];
|
||||
libinput.enable = true;
|
||||
xautolock = let i3lock = "${pkgs.i3lock}/bin/i3lock -e -c ${lib.strings.removePrefix "#" black}"; in {
|
||||
xautolock = {
|
||||
enable = true;
|
||||
time = 15;
|
||||
locker = i3lock;
|
||||
nowlocker = i3lock;
|
||||
locker = config.defaultApplications.locker;
|
||||
nowlocker = config.defaultApplications.locker;
|
||||
enableNotifier = true;
|
||||
notifier = ''${pkgs.libnotify}/bin/notify-send -u normal -a xautolock "Locking soon" "The screen will lock in 10 seconds."'';
|
||||
};
|
||||
@@ -317,10 +307,11 @@ in {
|
||||
|
||||
services.compton = {
|
||||
enable = true;
|
||||
fade = true;
|
||||
shadow = true;
|
||||
menuOpacity = "0.9";
|
||||
shadowOpacity = "0.5";
|
||||
fadeDelta = 2;
|
||||
shadowOpacity = "0.3";
|
||||
};
|
||||
|
||||
services.illum.enable = true;
|
||||
services.unclutter.enable = true;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
with pkgs;
|
||||
{
|
||||
fonts.fonts = [
|
||||
@@ -13,8 +13,10 @@ with pkgs;
|
||||
|
||||
environment.systemPackages = [
|
||||
chromium
|
||||
config.constants.theme.gtk.package
|
||||
config.constants.theme.icon.package
|
||||
ffmpeg
|
||||
firefox firefoxPackages.tor-browser
|
||||
firefox
|
||||
git
|
||||
gnumake
|
||||
htop
|
||||
@@ -27,6 +29,8 @@ with pkgs;
|
||||
pmount
|
||||
ripgrep tree
|
||||
rlwrap
|
||||
tor-browser-bundle-bin
|
||||
unzip
|
||||
w3m
|
||||
wget
|
||||
whois
|
||||
@@ -34,21 +38,28 @@ with pkgs;
|
||||
xfce.ristretto
|
||||
xfce.terminal
|
||||
xfce.thunar
|
||||
xfce.tumbler
|
||||
xorg.xbacklight
|
||||
xorg.xcursorthemes
|
||||
xorg.xkill
|
||||
youtubeDL
|
||||
zathura
|
||||
zip unzip
|
||||
zip
|
||||
];
|
||||
|
||||
programs.command-not-found.enable = true;
|
||||
programs.java.enable = true;
|
||||
programs.light.enable = true;
|
||||
|
||||
users.users.kfm.packages = [
|
||||
(texlive.combine { inherit (pkgs.texlive) scheme-full latexmk; })
|
||||
audacity
|
||||
biber
|
||||
cabal-install
|
||||
cabal2nix
|
||||
calibre
|
||||
clojure
|
||||
ctags
|
||||
dropbox-cli
|
||||
franz
|
||||
fsharp
|
||||
gcc
|
||||
@@ -59,8 +70,9 @@ with pkgs;
|
||||
haskellPackages.hasktags
|
||||
haskellPackages.hindent
|
||||
haskellPackages.hoogle
|
||||
haskellPackages.idris
|
||||
haskellPackages.pandoc haskellPackages.pandoc-citeproc
|
||||
haskellPackages.pandoc
|
||||
haskellPackages.pandoc-citeproc
|
||||
idris
|
||||
inkscape
|
||||
jo
|
||||
lua
|
||||
@@ -79,7 +91,6 @@ with pkgs;
|
||||
spotify
|
||||
stack
|
||||
swiProlog
|
||||
texlive.combined.scheme-tetex
|
||||
tinycc
|
||||
];
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{ pkgs, ... }:
|
||||
let scripts = import ../dot/scripts.nix pkgs;
|
||||
let scripts = import ../dot/scripts.nix { inherit pkgs; };
|
||||
in {
|
||||
environment.shellAliases =
|
||||
let rlwrap = cmd: "${pkgs.rlwrap}/bin/rlwrap ${cmd}";
|
||||
@@ -12,7 +12,6 @@ in {
|
||||
ip = "${pkgs.iproute}/bin/ip -c";
|
||||
ocaml = rlwrap "${pkgs.ocaml}/bin/ocaml";
|
||||
tmux = "${pkgs.tmux}/bin/tmux -2";
|
||||
gdrive = ''sh -c "cd ~/google-drive && ${pkgs.grive2}/bin/grive" >/dev/null 2>&1 &'';
|
||||
} // scripts;
|
||||
|
||||
environment.extraInit = ''
|
||||
@@ -56,7 +55,7 @@ in {
|
||||
};
|
||||
|
||||
programs.bash = {
|
||||
promptInit = ''PS1="$(tput bold)\w \$([[ \$? == 0 ]] && echo \"\[\033[1;32m\]\" || echo \"\[\033[1;31m\]\")\$$(tput sgr0) '';
|
||||
promptInit = ''PS1="$(tput bold)\w \$([[ \$? == 0 ]] && echo \"\[\033[1;32m\]\" || echo \"\[\033[1;31m\]\")\$$(tput sgr0) "'';
|
||||
enableCompletion = true;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
commaSep = strs: builtins.concatStringsSep "," strs;
|
||||
|
||||
ignoredFiles = [ "*~" ".stack-work/" "__pycache__/" ".mypy_cache/" "*.o" "*.hi" "*.aux" "*.class" "*.dyn_hi" "*.dyn_o" ];
|
||||
|
||||
user = {
|
||||
github = "kmein";
|
||||
name = "Kierán Meinhardt";
|
||||
email = "kieran.meinhardt@gmail.com";
|
||||
};
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
pkgs:
|
||||
{ pkgs }:
|
||||
''
|
||||
:set editor vim
|
||||
:def hoogle \x -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle --color \"" ++ x ++ "\" "
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
pkgs:
|
||||
{ pkgs }:
|
||||
let
|
||||
bingWallpaper = pkgs.writeBash "bing-wallpaper.sh" ''
|
||||
PICTURE_DIR="$HOME/pictures/external/bing/"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
user:
|
||||
{ user }:
|
||||
''
|
||||
templates:
|
||||
params:
|
||||
|
||||
3
helpers.nix
Normal file
3
helpers.nix
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
commaSep = builtins.concatStringsSep ",";
|
||||
}
|
||||
46
options.nix
Normal file
46
options.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{ lib, pkgs, ... }:
|
||||
with lib;
|
||||
with import ./theme.nix;
|
||||
let
|
||||
stringOption = def: mkOption { type = types.string; default = def; };
|
||||
themeOption = def: mkOption {
|
||||
type = types.submodule {
|
||||
options = {
|
||||
name = mkOption { type = types.string; default = def.name; };
|
||||
package = mkOption { type = types.package; default = def.package; };
|
||||
};
|
||||
};
|
||||
default = def;
|
||||
};
|
||||
in {
|
||||
options.defaultApplications = mapAttrs (const stringOption) {
|
||||
terminal = "${pkgs.xfce.terminal}/bin/xfce4-terminal";
|
||||
browser = "${pkgs.chromium}/bin/chromium";
|
||||
fileManager = "${pkgs.xfce.thunar}/bin/thunar";
|
||||
locker = "${pkgs.i3lock}/bin/i3lock -e -c ${strings.removePrefix "#" black}";
|
||||
};
|
||||
|
||||
options.constants = {
|
||||
user = mapAttrs (const stringOption) {
|
||||
github = "kmein";
|
||||
name = "Kierán Meinhardt";
|
||||
email = "kieran.meinhardt@gmail.com";
|
||||
};
|
||||
|
||||
ignore = mkOption {
|
||||
type = types.listOf types.string;
|
||||
default = [ "*~" ".stack-work/" "__pycache__/" ".mypy_cache/" "*.o" "*.hi" "*.aux" "*.class" "*.dyn_hi" "*.dyn_o" "dist/" ];
|
||||
};
|
||||
|
||||
theme = mapAttrs (const themeOption) {
|
||||
gtk = { name = "Paper"; package = pkgs.paper-gtk-theme; };
|
||||
icon = { name = "Paper"; package = pkgs.paper-icon-theme; };
|
||||
};
|
||||
|
||||
wallpaper = mkOption {
|
||||
type = types.path;
|
||||
default = pkgs.copyPathToStore ./art/haskell-grey.png;
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user