1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

modularize colorscheming and more

This commit is contained in:
Kierán Meinhardt
2019-04-19 15:02:05 +02:00
parent a763c63de4
commit 7d6dbc2809
37 changed files with 483 additions and 496 deletions

16
configs/chromium.nix Normal file
View File

@@ -0,0 +1,16 @@
{ pkgs, ... }:
{
programs.chromium = {
enable = true;
extensions = [
"gighmmpiobklfepjocnamgkkbiglidom" # AdBlock
"hdokiejnpimakedhajhdlcegeplioahd" # LastPass
"jldhpllghnbhlbpcmnajkpdmadaolakh" # Todoist
"dbepggeogbaibhgnhhndojpepiihcmeb" # Vimium
];
};
environment.systemPackages = [ pkgs.chromium ];
niveum.applications.browser = "chromium";
}

View File

@@ -1,17 +1,19 @@
{ pkgs, lib, config, ... }:
let
theme = import <dot/theme.nix>;
unstable = import <nixos-unstable> {};
in {
{
imports = [
<modules/constants.nix>
{
services.dbus.packages = [ pkgs.gnome3.dconf ];
}
<home-manager/nixos>
<configs/sudo.nix>
<configs/chromium.nix>
<configs/fonts.nix>
<configs/sncli.nix>
<configs/bash.nix>
<configs/cloud.nix>
<configs/compton.nix>
<configs/random-background.nix>
<configs/docker.nix>
<configs/vscode.nix>
<configs/htop.nix>
@@ -33,12 +35,15 @@ in {
<configs/ssh.nix>
<configs/unclutter.nix>
<configs/urxvt.nix>
<configs/todoist.nix>
<configs/xautolock.nix>
<configs/xresources.nix>
<configs/hledger.nix>
<configs/zsh.nix>
<configs/bluetooth.nix>
<configs/theming.nix>
<configs/tmux.nix>
<configs/themes/owickstrom-dark.nix>
{
niveum.user = {
github = "kmein";
@@ -47,9 +52,7 @@ in {
};
niveum.applications = rec {
terminal = "${pkgs.rxvt_unicode-with-plugins}/bin/urxvtc";
browser = "${pkgs.chromium}/bin/chromium";
fileManager = "${terminal} -e ${pkgs.ranger}/bin/ranger";
fileManager = "${config.niveum.applications.terminal} -e ${pkgs.ranger}/bin/ranger";
};
niveum.theme = {
@@ -59,14 +62,13 @@ in {
};
}
{
nixpkgs.overlays = [ (import <nix-writers/pkgs>) ];
nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
autorenkalender = pkgs.callPackage <packages/autorenkalender.nix> {};
bvg = pkgs.callPackage <packages/bvg.nix> {};
daybook = pkgs.callPackage <packages/daybook.nix> {};
font-size = pkgs.callPackage <packages/font-size.nix> { font = theme.terminalFont; };
font-size = pkgs.callPackage <packages/font-size.nix> { font = config.niveum.fonts.terminal; };
genius = pkgs.callPackage <packages/genius.nix> {};
instaget = pkgs.callPackage <packages/instaget.nix> {};
instaloader = pkgs.python3Packages.callPackage <packages/instaloader.nix> {};
@@ -75,7 +77,7 @@ in {
nix-git = pkgs.callPackage <packages/nix-git.nix> {};
sncli = pkgs.python3Packages.callPackage <packages/sncli.nix> {};
spotify-cli-linux = pkgs.python3Packages.callPackage <packages/spotify-cli-linux.nix> {};
todoist = pkgs.callPackage <packages/todoist> {};
todoist = pkgs.unstable.callPackage <packages/todoist.nix> {};
wttr = pkgs.callPackage <packages/wttr.nix> {};
n = pkgs.callPackage <packages/n.nix> {};
@@ -84,6 +86,10 @@ in {
acronym = pkgs.callPackage <stockholm/lass/5pkgs/acronym> {};
urban = pkgs.callPackage <stockholm/lass/5pkgs/urban> {};
mpv-poll = pkgs.callPackage <stockholm/lass/5pkgs/mpv-poll> {};
unstable = import <nixos-unstable> {
config = config.nixpkgs.config;
};
};
};
}
@@ -95,23 +101,6 @@ in {
{
time.timeZone = "Europe/Berlin";
}
{
security.sudo = {
enable = true;
extraConfig = ''
Defaults pwfeedback
'';
};
}
{
home-manager.users.me = {
services.random-background = {
enable = true;
imageDirectory = toString <art>;
interval = "2h";
};
};
}
{
home-manager.users.me = {
programs.zathura = {
@@ -129,7 +118,6 @@ in {
home = "/home/kfm";
createHome = true;
group = "users";
extraGroups = [ "wheel" ];
hashedPassword = "$6$w9hXyGFl/.IZBXk$5OiWzS1G.5hImhh1YQmZiCXYNAJhi3X6Y3uSLupJNYYXPLMsQpx2fwF4Xr2uYzGMV8Foqh8TgUavx1APD9rcb/";
shell = pkgs.zsh;
};
@@ -155,7 +143,6 @@ in {
ip = "${pkgs.iproute}/bin/ip -c";
ns = "nix-shell --run zsh";
nixi = ''nix repl "<nixpkgs>"'';
grep = "grep --color=auto";
rm = "rm -i";
cp = "cp -i";
mv = "mv -i";
@@ -206,12 +193,6 @@ in {
desktopManager.xterm.enable = false;
};
}
{
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [ corefonts eb-garamond fira libertine lmodern noto-fonts roboto ubuntu_font_family ];
};
}
{
security.wrappers = {
pmount.source = "${pkgs.pmount}/bin/pmount";
@@ -227,27 +208,12 @@ in {
package = pkgs.openjdk;
};
}
{
home-manager.users.me = {
programs.browserpass.enable = true;
programs.chromium = {
enable = true;
extensions = [
"gighmmpiobklfepjocnamgkkbiglidom" # AdBlock
"hdokiejnpimakedhajhdlcegeplioahd" # LastPass
"jldhpllghnbhlbpcmnajkpdmadaolakh" # Todoist
"dbepggeogbaibhgnhhndojpepiihcmeb" # Vimium
];
};
};
}
{
environment.systemPackages = with pkgs; [
] ++ [ # office
libreoffice
] ++ [ # internet
aria2
chromium
firefox
tor-browser-bundle-bin
thunderbird
@@ -333,8 +299,7 @@ in {
] ++ [ # math
bc
] ++ [ # shell
# todoist
(aspellWithDicts (dict: [dict.de dict.en dict.la]))
(aspellWithDicts (dict: [dict.de dict.en dict.la dict.en-computers dict.ru]))
bvg
autorenkalender
literature-quote
@@ -350,10 +315,7 @@ in {
fzf
(pass.withExtensions (ext: [ext.pass-otp]))
qrencode
sncli
tmuxp
unstable.hledger
unstable.hledger-web
unstable.zola
wordnet
xsv

View File

@@ -1,15 +1,14 @@
{ config, pkgs, ... }:
let theme = import <dot/theme.nix>;
in {
with config.niveum; {
home-manager.users.me.services.dunst = {
enable = true;
iconTheme = config.niveum.theme.icon;
iconTheme = theme.icon;
settings = {
global = {
transparency = 10;
font = "${theme.terminalFont.name} ${toString theme.terminalFont.size}";
font = "${fonts.terminal.name} ${toString fonts.terminal.size}";
geometry = "200x5-30+20";
frame_color = theme.invertedColorScheme.background;
frame_color = colours.foreground;
follow = "mouse";
indicate_hidden = true;
notification_height = 0;
@@ -32,29 +31,29 @@ in {
sticky_history = true;
history_length = 20;
dmenu = "${pkgs.rofi}/bin/rofi -display-run dunst -show run";
browser = config.niveum.applications.browser;
browser = applications.browser;
verbosity = "mesg";
corner_radius = 0;
mouse_left_click = "do_action";
mouse_right_click = "close_current";
mouse_middle_click = "close_all";
};
urgency_low = {
frame_color = theme.invertedColorScheme.background;
background = theme.invertedColorScheme.background;
foreground = theme.invertedColorScheme.foreground;
urgency_low = rec {
frame_color = background;
background = colours.foreground;
foreground = colours.background;
timeout = 5;
};
urgency_normal = {
frame_color = theme.invertedColorScheme.background;
background = theme.invertedColorScheme.background;
foreground = theme.invertedColorScheme.foreground;
urgency_normal = rec {
frame_color = background;
background = colours.foreground;
foreground = colours.background;
timeout = 10;
};
urgency_critical = {
frame_color = theme.invertedColorScheme.red.dark;
background = theme.invertedColorScheme.red.dark;
foreground = theme.invertedColorScheme.foreground;
urgency_critical = rec {
frame_color = background;
background = colours.red.dark;
foreground = colours.background;
timeout = 0;
};
};

18
configs/fonts.nix Normal file
View File

@@ -0,0 +1,18 @@
{ pkgs, ... }:
{
niveum.fonts = {
ui = {
name = "Sans";
size = 9;
};
terminal = {
name = "Monospace";
size = 9;
};
};
fonts = {
enableDefaultFonts = true;
fonts = with pkgs; [ corefonts eb-garamond fira libertine lmodern noto-fonts roboto ubuntu_font_family ];
};
}

13
configs/hledger.nix Normal file
View File

@@ -0,0 +1,13 @@
{ config, ... }:
{
imports = [ <modules/hledger.nix> ];
niveum.hledger = {
enable = true;
server = {
enable = true;
user = config.users.users.me;
capabilities = [ "view" ];
};
};
}

View File

@@ -1,14 +1,13 @@
{ config, pkgs, lib, ... }:
let
theme = import <dot/theme.nix>;
new-workspace = pkgs.writeDash "new-workspace" ''
new-workspace = pkgs.unstable.writers.writeDash "new-workspace" ''
i3-msg workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
'';
move-to-new-workspace = pkgs.writeDash "new-workspace" ''
move-to-new-workspace = pkgs.unstable.writers.writeDash "new-workspace" ''
i3-msg move container to workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
'';
wifi-interface = { scardanelli = "wlp2s0"; homeros = "wlp3s0"; }.${config.networking.hostName};
in {
in with config.niveum; {
services.xserver = {
windowManager.default = "i3";
windowManager.i3.enable = true;
@@ -17,7 +16,7 @@ in {
home-manager.users.me.xsession.windowManager.i3 = {
enable = true;
config = rec {
fonts = [ "${theme.uiFont.name} ${toString theme.uiFont.size}" ];
fonts = [ "${config.niveum.fonts.ui.name} ${toString config.niveum.fonts.ui.size}" ];
modifier = "Mod4";
window = {
titlebar = false;
@@ -29,54 +28,46 @@ in {
border = 1;
};
colors =
let scheme = { background = theme.colorScheme.background; text = theme.colorScheme.foreground; };
in {
let scheme = { background = colours.background; text = colours.foreground; };
in rec {
focused = scheme // {
border = theme.colorScheme.background;
indicator = theme.colorScheme.background;
childBorder = theme.colorScheme.background;
};
focusedInactive = scheme // {
border = theme.colorScheme.background;
indicator = theme.colorScheme.background;
childBorder = theme.colorScheme.background;
};
unfocused = scheme // {
border = theme.colorScheme.background;
indicator = theme.colorScheme.background;
childBorder = theme.colorScheme.background;
border = colours.background;
indicator = colours.background;
childBorder = colours.background;
};
focusedInactive = focused;
unfocused = focused;
urgent = scheme // {
border = theme.colorScheme.red.light;
indicator = theme.colorScheme.red.light;
childBorder = theme.colorScheme.red.light;
border = colours.red.bright;
indicator = colours.red.bright;
childBorder = colours.red.bright;
};
placeholder = scheme // {
border = theme.colorScheme.green.light;
indicator = theme.colorScheme.green.light;
childBorder = theme.colorScheme.green.light;
border = colours.green.bright;
indicator = colours.green.bright;
childBorder = colours.green.bright;
};
};
bars = [{
workspaceButtons = false;
fonts = [ "${theme.terminalFont.name} ${toString theme.terminalFont.size}" ];
fonts = [ "${config.niveum.fonts.terminal.name} ${toString config.niveum.fonts.terminal.size}" ];
mode = "hide";
colors = {
background = theme.colorScheme.background;
separator = theme.colorScheme.background;
statusline = theme.colorScheme.foreground;
colors = rec {
background = colours.background;
separator = background;
statusline = colours.foreground;
bindingMode = {
background = theme.colorScheme.red.light;
border = theme.colorScheme.background;
text = theme.colorScheme.foreground;
background = colours.red.bright;
border = colours.background;
text = colours.foreground;
};
};
statusCommand = "${pkgs.i3status}/bin/i3status -c ${pkgs.writeText "i3status.conf" ''
general {
colors = true
color_good = "${theme.colorScheme.green.dark}"
color_bad = "${theme.colorScheme.red.dark}"
color_degraded = "${theme.colorScheme.black.light}"
color_good = "${colours.green.dark}"
color_bad = "${colours.red.dark}"
color_degraded = "${colours.white.dark}"
interval = 5
separator = " "
}
@@ -136,7 +127,7 @@ in {
keybindings = {
"${modifier}+Down" = "focus down";
"${modifier}+Left" = "focus left";
"${modifier}+Return" = "exec ${config.niveum.applications.terminal}";
"${modifier}+Return" = "exec ${applications.terminal}";
"${modifier}+Right" = "focus right";
"${modifier}+Shift+Down" = "move down";
"${modifier}+Shift+Left" = "move left";
@@ -161,14 +152,14 @@ in {
"${modifier}+p" = "exec ${pkgs.rofi-pass}/bin/rofi-pass";
"${modifier}+r" = "mode resize";
"${modifier}+s" = "layout stacking";
"${modifier}+t" = "exec ${config.niveum.applications.fileManager}";
"${modifier}+t" = "exec ${applications.fileManager}";
"${modifier}+v" = "split v";
"${modifier}+w" = "layout tabbed";
"${modifier}+x" = "exec --no-startup-id ${new-workspace}";
"${modifier}+y" = "exec ${config.niveum.applications.browser}";
"XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5 && pkill -RTMIN+3 i3blocks";
"XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t && pkill -RTMIN+3 i3blocks";
"XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -i 5 && pkill -RTMIN+3 i3blocks";
"${modifier}+y" = "exec ${applications.browser}";
"XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5";
"XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t";
"XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -i 5";
};
};
};

View File

@@ -0,0 +1,9 @@
{
home-manager.users.me = {
services.random-background = {
enable = true;
imageDirectory = toString <art>;
interval = "2h";
};
};
}

View File

@@ -1,38 +1,37 @@
{ config, ... }:
let theme = import <dot/theme.nix>;
in {
with config.niveum; {
home-manager.users.me.programs.rofi = {
enable = true;
separator = "solid";
scrollbar = false;
terminal = config.niveum.applications.terminal;
terminal = applications.terminal;
borderWidth = 0;
lines = 5;
font = "${theme.terminalFont.name} ${toString (theme.terminalFont.size + 1)}";
font = "${fonts.terminal.name} ${toString (fonts.terminal.size + 1)}";
colors = rec {
window = {
background = theme.invertedColorScheme.background;
border = theme.invertedColorScheme.background;
separator = theme.invertedColorScheme.black.light;
window = rec {
background = colours.foreground;
border = background;
separator = colours.black.bright;
};
rows = {
normal = {
background = window.background;
backgroundAlt = window.background;
foreground = theme.invertedColorScheme.foreground;
highlight = { foreground = theme.invertedColorScheme.cyan.dark; inherit (window) background; };
foreground = colours.background;
highlight = { foreground = colours.cyan.dark; inherit (window) background; };
};
active = {
background = window.background;
backgroundAlt = window.background;
foreground = theme.invertedColorScheme.yellow.dark;
highlight = { foreground = theme.invertedColorScheme.green.dark; inherit (window) background; };
foreground = colours.yellow.dark;
highlight = { foreground = colours.green.dark; inherit (window) background; };
};
urgent = {
background = window.background;
backgroundAlt = window.background;
foreground = theme.invertedColorScheme.red.dark;
highlight = { foreground = theme.invertedColorScheme.magenta.dark; inherit (window) background; };
foreground = colours.red.dark;
highlight = { foreground = colours.magenta.dark; inherit (window) background; };
};
};
};

13
configs/sncli.nix Normal file
View File

@@ -0,0 +1,13 @@
{ pkgs, ... }:
let secrets = import <dot/secrets.nix>;
in {
environment.systemPackages = [ pkgs.sncli ];
home-manager.users.me = {
home.file.".snclirc".text = ''
[sncli]
cfg_sn_username = ${secrets.simplenote.username}
cfg_sn_password = ${secrets.simplenote.password}
'';
};
}

10
configs/sudo.nix Normal file
View File

@@ -0,0 +1,10 @@
{
security.sudo = {
enable = true;
extraConfig = ''
Defaults pwfeedback
'';
};
users.users.me.extraGroups = [ "wheel" ];
}

View File

@@ -0,0 +1,15 @@
{
niveum.colours = rec {
black = { bright = "#151515"; dark = "#000000"; };
red = { bright = "#de575c"; dark = "#de575c"; };
yellow = { bright = "#ebe971"; dark = "#ebe971"; };
green = { bright = "#00b853"; dark = "#00b853"; };
blue = { bright = "#90d0f0"; dark = "#7fc6f0"; };
magenta = { bright = "#cf9ffa"; dark = "#cf9ffa"; };
cyan = { bright = "#4ae5e8"; dark = "#4ae5e8"; };
white = { bright = "#ffffff"; dark = "#bbbbbb"; };
background = black.dark;
foreground = white.dark;
cursor = green.bright;
};
}

View File

@@ -0,0 +1,15 @@
{
niveum.colours = {
black = { bright = "#444444"; dark = "#1c1c1c"; };
red = { bright = "#ff8700"; dark = "#af5f5f"; };
green = { bright = "#87af87"; dark = "#5f875f"; };
yellow = { bright = "#ffffaf"; dark = "#87875f"; };
blue = { bright = "#8fafd7"; dark = "#5f87af"; };
magenta = { bright = "#8787af"; dark = "#5f5f87"; };
cyan = { bright = "#5fafaf"; dark = "#5f8787"; };
white = { bright = "#999999"; dark = "#6c6c6c"; };
background = "#262626";
foreground = "#bcbcbc";
cursor = "#bcbcbc";
};
}

View File

@@ -0,0 +1,15 @@
{
niveum.colours = rec {
black = { bright = "#454545"; dark = "#222222"; };
red = { bright = "#FA8072"; dark = "#B22222"; };
green = { bright = "#779A3E"; dark = "#556B2F"; };
yellow = { bright = "#DAA520"; dark = "#B8860B"; };
blue = { bright = "#6495ED"; dark = "#4682B4"; };
magenta = { bright = "#DA70D6"; dark = "#9932CC"; };
cyan = { bright = "#B0E0E6"; dark = "#87CEEB"; };
white = { bright = "#FFFFFF"; dark = "#C0C0C0"; };
background = "#000000";
foreground = "#AAAAAA";
cursor = green.bright;
};
}

15
configs/themes/mac-os.nix Normal file
View File

@@ -0,0 +1,15 @@
{
niveum.colours = rec {
black = { bright = "#818383"; dark = "#000000"; };
red = { bright = "#fc391f"; dark = "#c23621"; };
yellow = { bright = "#eaec23"; dark = "#adad27"; };
green = { bright = "#31e722"; dark = "#25bc24"; };
blue = { bright = "#5833ff"; dark = "#492ee1"; };
magenta = { bright = "#f935f8"; dark = "#d338d3"; };
cyan = { bright = "#14f0f0"; dark = "#33bbc8"; };
white = { bright = "#e9ebeb"; dark = "#cbcccd"; };
background = black.dark;
foreground = white.dark;
cursor = green.bright;
};
}

View File

@@ -0,0 +1,15 @@
{
niveum.colours = rec {
black = { bright = "#4b4b4b"; dark = "#242424"; };
red = { bright = "#fc1c18"; dark = "#d71c15"; };
green = { bright = "#6bc219"; dark = "#5aa513"; };
yellow = { bright = "#fec80e"; dark = "#fdb40c"; };
blue = { bright = "#0955ff"; dark = "#063b8c"; };
magenta = { bright = "#fb0050"; dark = "#e40038"; };
cyan = { bright = "#3ea8fc"; dark = "#2595e1"; };
white = { bright = "#8c00ec"; dark = "#efefef"; };
background = "#181818";
foreground = white.dark;
cursor = "#bbbbbb";
};
}

View File

@@ -0,0 +1,15 @@
{
niveum.colours = rec {
black = { bright = "#282c34"; dark = "#282c34"; };
red = { bright = "#e06c75"; dark = "#e06c75"; };
green = { bright = "#98c379"; dark = "#98c379"; };
yellow = { bright = "#e5c07b"; dark = "#e5c07b"; };
blue = { bright = "#61afef"; dark = "#61afef"; };
magenta = { bright = "#c678dd"; dark = "#c678dd"; };
cyan = { bright = "#56b6c2"; dark = "#56b6c2"; };
white = { bright = "#dcdfe4"; dark = "#dcdfe4"; };
background = black.dark;
foreground = white.bright;
cursor = "#a3b3cc";
};
}

View File

@@ -0,0 +1,15 @@
{
niveum.colours = rec {
black = { dark = "#073642"; bright = "#002b36"; };
red = { dark = "#dc322f"; bright = "#cb4b16"; };
yellow = { dark = "#b58900"; bright = "#657b83"; };
green = { dark = "#859900"; bright = "#586e75"; };
blue = { dark = "#268bd2"; bright = "#839496"; };
magenta = { dark = "#d33682"; bright = "#6c71c4"; };
cyan = { dark = "#2aa198"; bright = "#93a1a1"; };
white = { dark = "#eee8d5"; bright = "#fdf6e3"; };
background = black.bright;
foreground = blue.bright;
cursor = cyan.bright;
};
}

View File

@@ -0,0 +1,15 @@
{
niveum.colours = rec {
black = { dark = "#073642"; bright = "#002b36"; };
red = { dark = "#dc322f"; bright = "#cb4b16"; };
yellow = { dark = "#b58900"; bright = "#657b83"; };
green = { dark = "#859900"; bright = "#586e75"; };
blue = { dark = "#268bd2"; bright = "#839496"; };
magenta = { dark = "#d33682"; bright = "#6c71c4"; };
cyan = { dark = "#2aa198"; bright = "#93a1a1"; };
white = { dark = "#eee8d5"; bright = "#fdf6e3"; };
background = white.bright;
foreground = yellow.bright;
cursor = green.bright;
};
}

View File

@@ -1,35 +1,34 @@
{ lib, config, ... }:
{
i18n.consoleColors = with import <dot/theme.nix>; map (c: lib.strings.removePrefix "#" c) colorPalette;
with config.niveum; {
i18n.consoleColors = map (c: lib.strings.removePrefix "#" c) colourPalette;
environment.systemPackages = [
config.niveum.theme.gtk.package
config.niveum.theme.icon.package
config.niveum.theme.cursor.package
theme.gtk.package
theme.icon.package
theme.cursor.package
];
services.xserver.displayManager.lightdm.greeters.gtk = {
theme = {
name = config.niveum.theme.gtk.name;
package = config.niveum.theme.gtk.package;
name = theme.gtk.name;
package = theme.gtk.package;
};
iconTheme = {
name = config.niveum.theme.icon.name;
package = config.niveum.theme.icon.package;
name = theme.icon.name;
package = theme.icon.package;
};
};
home-manager.users.me = {
gtk = {
enable = true;
iconTheme = config.niveum.theme.icon;
theme = config.niveum.theme.gtk;
iconTheme = theme.icon;
theme = theme.gtk;
};
qt = {
enable = true;
useGtkTheme = true;
};
xsession.pointerCursor = config.niveum.theme.cursor // { size = 16; };
xsession.pointerCursor = theme.cursor // { size = 16; };
};
}

15
configs/todoist.nix Normal file
View File

@@ -0,0 +1,15 @@
{ pkgs, ... }:
let secrets = import <dot/secrets.nix>;
in {
environment.systemPackages = [
(pkgs.unstable.writers.writeDashBin "todoist" ''
${pkgs.todoist}/bin/todoist --color $@
'')
];
home-manager.users.me.home.file.".todoist.config.json".text = ''
{
"token": "${secrets.todoist.token}"
}
'';
}

View File

@@ -1,8 +1,9 @@
{ pkgs, config, ... }:
let theme = import <dot/theme.nix>;
in {
{
services.urxvtd.enable = true;
niveum.applications.terminal = "urxvtc";
home-manager.users.me.programs.urxvt = {
enable = true;
package = pkgs.rxvt_unicode-with-plugins;
@@ -15,7 +16,7 @@ in {
perl-ext = "default,url-select";
"url-select.launcher" = "/usr/bin/env chromium";
"url-select.underline" = true;
"colorUL" = theme.colorScheme.blue.light;
"colorUL" = config.niveum.colours.blue.bright;
"perl-lib" = "${pkgs.urxvt_perls}/lib/urxvt/perl";
urlLauncher = "/usr/bin/env chromium";
fading = 20;

View File

@@ -1,13 +1,12 @@
{ lib, ... }:
let theme = import <dot/theme.nix>;
in {
home-manager.users.me.xresources.properties = {
"*background" = theme.colorScheme.background;
"*foreground" = theme.colorScheme.foreground;
"*fadeColor" = theme.colorScheme.background;
"*cursorColor" = theme.colorScheme.cursorColor;
"*.font" = "xft:${theme.terminalFont.name}:size=${toString theme.terminalFont.size}";
"*.boldFont" = "xft:${theme.terminalFont.name}:style=Bold:size=${toString theme.terminalFont.size}";
"*.italicFont" = "xft:${theme.terminalFont.name}:style=Italic:size=${toString theme.terminalFont.size}";
} // lib.lists.foldr (i: cs: cs // { "*color${toString i}" = builtins.elemAt theme.colorPalette i; }) {} (lib.lists.range 0 15);
{ config, lib, ... }:
{
home-manager.users.me.xresources.properties = with config.niveum; {
"*background" = colours.background;
"*foreground" = colours.foreground;
"*fadeColor" = colours.background;
"*cursorColor" = colours.cursor;
"*.font" = "xft:${fonts.terminal.name}:size=${toString fonts.terminal.size}";
"*.boldFont" = "xft:${fonts.terminal.name}:style=Bold:size=${toString fonts.terminal.size}";
"*.italicFont" = "xft:${fonts.terminal.name}:style=Italic:size=${toString fonts.terminal.size}";
} // lib.lists.foldr (i: cs: cs // { "*color${toString i}" = builtins.elemAt colourPalette i; }) {} (lib.lists.range 0 15);
}

View File

@@ -42,7 +42,7 @@
niveum-deploy() {
for system in "$@"; do
eval $(nix-build ~niveum/deploy.nix -A "$system") &
eval $(nix-build --no-out-link ~niveum/deploy.nix -A "$system") &
done
wait
}

View File

@@ -27,12 +27,7 @@ let
url = https://cgit.krebsco.de/stockholm;
ref = "7e1b197dab13d024ba491c96dc959306324943c0";
};
nix-writers.git = {
url = https://cgit.krebsco.de/nix-writers;
ref = "c528cf970e292790b414b4c1c8c8e9d7e73b2a71";
};
system.file = toString path;
art.file = toString ./art;
lib.file = toString ./lib;
packages.file = toString ./packages;
systems.file = toString ./systems;
@@ -44,12 +39,18 @@ let
} // other)];
systems.scardanelli = pkgs.krops.writeDeploy "deploy-scardanelli" {
source = source { path = ./systems/scardanelli; };
source = source {
path = ./systems/scardanelli;
other.art.file = ./art;
};
target = scardanelli-ssh;
};
systems.homeros = pkgs.krops.writeDeploy "deploy-homeros" {
source = source { path = ./systems/homeros; };
source = source {
path = ./systems/homeros;
other.art.file = ./art;
};
target = homeros-ssh;
};

View File

@@ -1,119 +0,0 @@
let
flip = scheme: scheme // rec {
background = scheme.foreground;
foreground = scheme.background;
fadeColor = background;
};
antares = rec {
black = { light = "#151515"; dark = "#000000"; };
red = { light = "#de575c"; dark = "#de575c"; };
yellow = { light = "#ebe971"; dark = "#ebe971"; };
green = { light = "#00b853"; dark = "#00b853"; };
blue = { light = "#90d0f0"; dark = "#7fc6f0"; };
magenta = { light = "#cf9ffa"; dark = "#cf9ffa"; };
cyan = { light = "#4ae5e8"; dark = "#4ae5e8"; };
white = { light = "#ffffff"; dark = "#bbbbbb"; };
background = black.dark;
foreground = white.dark;
};
connormcd = rec {
black = { light = "#454545"; dark = "#222222"; };
red = { light = "#FA8072"; dark = "#B22222"; };
green = { light = "#779A3E"; dark = "#556B2F"; };
yellow = { light = "#DAA520"; dark = "#B8860B"; };
blue = { light = "#6495ED"; dark = "#4682B4"; };
magenta = { light = "#DA70D6"; dark = "#9932CC"; };
cyan = { light = "#B0E0E6"; dark = "#87CEEB"; };
white = { light = "#FFFFFF"; dark = "#C0C0C0"; };
background = "#000000";
foreground = "#AAAAAA";
cursorColor = green.light;
};
apprentice = rec {
black = { light = "#444444"; dark = "#1c1c1c"; };
red = { light = "#ff8700"; dark = "#af5f5f"; };
green = { light = "#87af87"; dark = "#5f875f"; };
yellow = { light = "#ffffaf"; dark = "#87875f"; };
blue = { light = "#8fafd7"; dark = "#5f87af"; };
magenta = { light = "#8787af"; dark = "#5f5f87"; };
cyan = { light = "#5fafaf"; dark = "#5f8787"; };
white = { light = "#999999"; dark = "#6c6c6c"; };
background = "#262626";
foreground = "#bcbcbc";
cursorColor = "#bcbcbc";
};
macOS = rec {
black = { light = "#818383"; dark = "#000000"; };
red = { light = "#fc391f"; dark = "#c23621"; };
yellow = { light = "#eaec23"; dark = "#adad27"; };
green = { light = "#31e722"; dark = "#25bc24"; };
blue = { light = "#5833ff"; dark = "#492ee1"; };
magenta = { light = "#f935f8"; dark = "#d338d3"; };
cyan = { light = "#14f0f0"; dark = "#33bbc8"; };
white = { light = "#e9ebeb"; dark = "#cbcccd"; };
background = black.dark;
foreground = white.dark;
cursorColor = green.light;
};
solarizedDark = rec {
black = { dark = "#073642"; light = "#002b36"; };
red = { dark = "#dc322f"; light = "#cb4b16"; };
yellow = { dark = "#b58900"; light = "#657b83"; };
green = { dark = "#859900"; light = "#586e75"; };
blue = { dark = "#268bd2"; light = "#839496"; };
magenta = { dark = "#d33682"; light = "#6c71c4"; };
cyan = { dark = "#2aa198"; light = "#93a1a1"; };
white = { dark = "#eee8d5"; light = "#fdf6e3"; };
background = black.light;
foreground = blue.light;
cursorColor = cyan.light;
};
solarizedLight = solarizedDark // {
background = solarizedDark.white.light;
foreground = solarizedDark.yellow.light;
fadeColor = solarizedDark.white.light;
cursorColor = solarizedDark.green.light;
};
owickstrom.default = rec {
black = { light = "#282c34"; dark = "#282c34"; };
red = { light = "#e06c75"; dark = "#e06c75"; };
green = { light = "#98c379"; dark = "#98c379"; };
yellow = { light = "#e5c07b"; dark = "#e5c07b"; };
blue = { light = "#61afef"; dark = "#61afef"; };
magenta = { light = "#c678dd"; dark = "#c678dd"; };
cyan = { light = "#56b6c2"; dark = "#56b6c2"; };
white = { light = "#dcdfe4"; dark = "#dcdfe4"; };
background = black.dark;
foreground = white.light;
cursorColor = "#a3b3cc";
};
owickstrom.dark = rec {
black = { light = "#4b4b4b"; dark = "#242424"; };
red = { light = "#fc1c18"; dark = "#d71c15"; };
green = { light = "#6bc219"; dark = "#5aa513"; };
yellow = { light = "#fec80e"; dark = "#fdb40c"; };
blue = { light = "#0955ff"; dark = "#063b8c"; };
magenta = { light = "#fb0050"; dark = "#e40038"; };
cyan = { light = "#3ea8fc"; dark = "#2595e1"; };
white = { light = "#8c00ec"; dark = "#efefef"; };
background = "#181818";
foreground = white.dark;
fadeColor = background;
cursorColor = "#bbbbbb";
};
in rec {
uiFont = { name = "Sans"; size = 9; };
terminalFont = { name = "Monospace"; size = 9; };
white = "#ffffff";
black = "#000000";
gray = "#888888";
colorScheme = owickstrom.dark // { background = "#000000"; };
invertedColorScheme = flip owickstrom.dark;
colorPalette = [
colorScheme.black.dark colorScheme.red.dark colorScheme.green.dark colorScheme.yellow.dark colorScheme.blue.dark colorScheme.magenta.dark colorScheme.cyan.dark colorScheme.white.dark
colorScheme.black.light colorScheme.red.light colorScheme.green.light colorScheme.yellow.light colorScheme.blue.light colorScheme.magenta.light colorScheme.cyan.light colorScheme.white.light
];
}

View File

@@ -1,39 +1,95 @@
{ config, lib, pkgs, ... }:
with lib;
with import <dot/theme.nix>;
let
stringOption = mkOption { type = types.string; };
themeOption = mkOption {
type = types.submodule {
options = {
name = mkOption { type = types.string; };
package = mkOption { type = types.package; };
};
colourScheme = config.niveum.colours;
my-types.hexColour = types.strMatching "#[0-9A-Fa-f]{6}";
my-types.colourPair = types.submodule {
options = {
dark = mkOption { type = my-types.hexColour; };
bright = mkOption { type = my-types.hexColour; };
};
};
my-types.theme = types.submodule {
options = {
name = mkOption { type = types.str; };
package = mkOption { type = types.package; };
};
};
my-types.font = types.submodule {
options = {
name = mkOption { type = types.str; };
size = mkOption { type = types.ints.positive; };
};
};
my-types.colourTheme = types.submodule {
options = {
black = mkOption { type = my-types.colourPair; };
red = mkOption { type = my-types.colourPair; };
green = mkOption { type = my-types.colourPair; };
yellow = mkOption { type = my-types.colourPair; };
blue = mkOption { type = my-types.colourPair; };
magenta = mkOption { type = my-types.colourPair; };
cyan = mkOption { type = my-types.colourPair; };
white = mkOption { type = my-types.colourPair; };
background = mkOption { type = my-types.hexColour; };
foreground = mkOption { type = my-types.hexColour; };
cursor = mkOption { type = my-types.hexColour; };
};
};
in {
options.niveum = {
applications = {
terminal = stringOption;
browser = stringOption;
fileManager = stringOption;
terminal = mkOption { type = types.str; };
browser = mkOption { type = types.str; };
fileManager = mkOption { type = types.str; };
};
colours = mkOption { type = my-types.colourTheme; };
colourPalette = mkOption {
type = types.listOf my-types.hexColour;
default = with config.niveum.colours; [
black.dark
red.dark
green.dark
yellow.dark
blue.dark
magenta.dark
cyan.dark
white.dark
black.bright
red.bright
green.bright
yellow.bright
blue.bright
magenta.bright
cyan.bright
white.bright
];
};
fonts = {
terminal = mkOption { type = my-types.font; };
ui = mkOption { type = my-types.font; };
};
user = {
github = stringOption;
name = stringOption;
email = stringOption;
github = mkOption { type = types.str; };
name = mkOption { type = types.str; };
email = mkOption { type = types.strMatching ".+@.+\\..+"; };
};
ignore = mkOption {
type = types.listOf types.string;
type = types.listOf types.str;
default = [ "*~" ".stack-work/" "__pycache__/" ".mypy_cache/" "*.py[co]" "*.o" "*.hi" "*.aux" "*.bbl" "*.bcf" "*.blg" "*.fdb_latexmk" "*.fls" "*.out" "*.run.xml" "*.toc" "*.bbl" "*.class" "*.dyn_hi" "*.dyn_o" "dist/" ];
};
theme = {
gtk = themeOption;
icon = themeOption;
cursor = themeOption;
gtk = mkOption { type = my-types.theme; };
icon = mkOption { type = my-types.theme; };
cursor = mkOption { type = my-types.theme; };
};
};
}

44
modules/hledger.nix Normal file
View File

@@ -0,0 +1,44 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.niveum.hledger;
in {
options.niveum.hledger = {
enable = mkEnableOption "hledger";
server = {
enable = mkEnableOption "hledger server";
port = mkOption { type = pkgs.unstable.lib.types.port; default = 5000; };
host = mkOption { type = types.str; default = "127.0.0.1"; };
capabilities = mkOption {
type = types.listOf (types.enum ["view" "add" "manage"]);
default = [ "view" "add" ];
};
flags = mkOption { type = types.listOf types.str; default = []; };
user = mkOption { type = types.attrs; };
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.unstable.hledger ];
systemd.services.hledger-web = mkIf cfg.server.enable {
description = "hledger server";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Restart = "always";
ExecStart = ''
${pkgs.unstable.hledger-web}/bin/hledger-web \
--port=${toString cfg.server.port} \
--host=${cfg.server.host} \
--capabilities=${concatStringsSep "," cfg.server.capabilities} \
${concatStringsSep " " cfg.server.flags}
'';
User = cfg.server.user.name;
PrivateTemp = true;
RuntimeDirectory = "hledger-web";
WorkingDirectory = "%t/hledger-web";
};
};
};
}

View File

@@ -1,5 +1,5 @@
{ writeDashBin, font }:
writeDashBin "font-size" ''
{ writeShellScriptBin, font }:
writeShellScriptBin "font-size" ''
set -efu
# set_font NORMAL_FONT BOLD_FONT

View File

@@ -1,5 +1,5 @@
{ writeDashBin, gnused, curl, pandoc }:
writeDashBin "genius" ''
{ writeShellScriptBin, gnused, curl, pandoc }:
writeShellScriptBin "genius" ''
test $# -eq 2 || (
echo "usage: $0 <artist> <song>"
exit 1

View File

@@ -1,5 +1,5 @@
{ writeDashBin, wget, curl, jq }:
writeDashBin "instaget" ''
{ writeShellScriptBin, wget, curl, jq }:
writeShellScriptBin "instaget" ''
for url in "$@"; do
${curl}/bin/curl -s "$url" \
| grep display_url \

View File

@@ -1,2 +1,2 @@
{ writeDashBin }:
writeDashBin "n" ''nix-shell -p "$1" --run "''${2:-$1}"''
{ writeShellScriptBin }:
writeShellScriptBin "n" ''nix-shell -p "$1" --run "''${2:-$1}"''

View File

@@ -1,4 +1,4 @@
{ writeDashBin, nix-prefetch-git, jq }:
writeDashBin "nix-git" ''
{ writeShellScriptBin, nix-prefetch-git, jq }:
writeShellScriptBin "nix-git" ''
${nix-prefetch-git}/bin/nix-prefetch-git "$@" 2> /dev/null | ${jq}/bin/jq -r '"rev = \"\(.rev)\";\nsha256 = \"\(.sha256)\";"'
''

21
packages/todoist.nix Normal file
View File

@@ -0,0 +1,21 @@
{ buildGoModule, fetchFromGitHub, lib }:
buildGoModule rec {
name = "todoist-${version}";
version = "master";
src = fetchFromGitHub {
owner = "sachaos";
repo = "todoist";
rev = "8c17d7ebf9be78cce24414b5aa3d9c8f1098e506";
sha256 = "1r5kn5sx9g9rvx78cqfh19mqwf7370vk102x1n062whryk1j3562";
};
modSha256 = "09n6abyaqwz4zcdz8934rvpbxhp4v2nmm5v739kkcc98c3h93i64";
meta = with lib; {
description = "Todoist CLI Client";
homepage = "https://github.com/sachaos/todoist";
license = licenses.mit;
platforms = platforms.linux ++ platforms.darwin;
};
}

View File

@@ -1,22 +0,0 @@
# This file was generated by https://github.com/kamilchm/go2nix v1.3.0
{ stdenv, buildGoPackage, fetchgit, fetchhg, fetchbzr, fetchsvn }:
buildGoPackage rec {
name = "todoist-unstable-${version}";
version = "2018-11-09";
rev = "4db9c55408d408ce8385ac6e845b83f320c45c28";
goPackagePath = "github.com/sachaos/todoist";
src = fetchgit {
inherit rev;
url = "https://github.com/sachaos/todoist";
sha256 = "1697mfq7ajr938ps387hj689k7s93274xlfyns1lr4gw1mfpxhzc";
};
goDeps = ./deps.nix;
# TODO: add metadata https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes
meta = {
};
}

View File

@@ -1,156 +0,0 @@
# This file was generated by https://github.com/kamilchm/go2nix v1.3.0
[
{
goPackagePath = "github.com/fatih/color";
fetch = {
type = "git";
url = "https://github.com/fatih/color";
rev = "3f9d52f7176a6927daacff70a3e8d1dc2025c53e";
sha256 = "165ww24x6ba47ji4j14mp3f006ksnmi53ws9280pgd2zcw91nbn8";
};
}
{
goPackagePath = "github.com/fsnotify/fsnotify";
fetch = {
type = "git";
url = "https://github.com/fsnotify/fsnotify";
rev = "ccc981bf80385c528a65fbfdd49bf2d8da22aa23";
sha256 = "0hcrfmiyx27izac3v0ii0qq2kfjvhr9ma1i79hrl6a6y2ayagzz7";
};
}
{
goPackagePath = "github.com/hashicorp/hcl";
fetch = {
type = "git";
url = "https://github.com/hashicorp/hcl";
rev = "65a6292f0157eff210d03ed1bf6c59b190b8b906";
sha256 = "00qgmygfa4vgf9v3lpz4vp1ca1hcfcxnjqjrvp6z4jjklc8x4mqf";
};
}
{
goPackagePath = "github.com/magiconair/properties";
fetch = {
type = "git";
url = "https://github.com/magiconair/properties";
rev = "7c38529aac7222391b7a2661365177a97e21b998";
sha256 = "0g5jrpjnp16x2sw6ifg6dx24grcvsmfyxkrgnlp1cw06075k90dm";
};
}
{
goPackagePath = "github.com/mitchellh/mapstructure";
fetch = {
type = "git";
url = "https://github.com/mitchellh/mapstructure";
rev = "3536a929edddb9a5b34bd6861dc4a9647cb459fe";
sha256 = "03bpv28jz9zhn4947saqwi328ydj7f6g6pf1m2d4m5zdh5jlfkrr";
};
}
{
goPackagePath = "github.com/pelletier/go-toml";
fetch = {
type = "git";
url = "https://github.com/pelletier/go-toml";
rev = "27c6b39a135b7dc87a14afb068809132fb7a9a8f";
sha256 = "13ldxh43xf4prmcrjzriz3gxpnijpqlzrgyhh7bnkj7lkhryfpk9";
};
}
{
goPackagePath = "github.com/pkg/browser";
fetch = {
type = "git";
url = "https://github.com/pkg/browser";
rev = "0a3d74bf9ce488f035cf5bc36f753a711bc74334";
sha256 = "0lv6kwvm31n79mh14a63zslaf4l9bspi2q0i8i9im4njfl42iv1c";
};
}
{
goPackagePath = "github.com/satori/uuid";
fetch = {
type = "git";
url = "https://github.com/satori/uuid";
rev = "b2ce2384e17bbe0c6d34077efa39dbab3e09123b";
sha256 = "1yz4cx02377ijlf8mnn84j1dcmlwh8ncx7y3kw1zg2qw0z4x119c";
};
}
{
goPackagePath = "github.com/spf13/afero";
fetch = {
type = "git";
url = "https://github.com/spf13/afero";
rev = "a5d6946387efe7d64d09dcba68cdd523dc1273a3";
sha256 = "0v1k07c2nn2nx7dhj9q03faq5hqjgc94v3xv3rhhld5b9i7ddjbd";
};
}
{
goPackagePath = "github.com/spf13/cast";
fetch = {
type = "git";
url = "https://github.com/spf13/cast";
rev = "8c9545af88b134710ab1cd196795e7f2388358d7";
sha256 = "0xq1ffqj8y8h7dcnm0m9lfrh0ga7pssnn2c1dnr09chqbpn4bdc5";
};
}
{
goPackagePath = "github.com/spf13/jwalterweatherman";
fetch = {
type = "git";
url = "https://github.com/spf13/jwalterweatherman";
rev = "94f6ae3ed3bceceafa716478c5fbf8d29ca601a1";
sha256 = "1ywmkwci5zyd88ijym6f30fj5c0k2yayxarkmnazf5ybljv50q7b";
};
}
{
goPackagePath = "github.com/spf13/pflag";
fetch = {
type = "git";
url = "https://github.com/spf13/pflag";
rev = "24fa6976df40757dce6aea913e7b81ade90530e1";
sha256 = "0rf6prz6gl0l1b3wijzdgq887cdwigvzxvz6gqbm5l8pkq3fx1m9";
};
}
{
goPackagePath = "github.com/spf13/viper";
fetch = {
type = "git";
url = "https://github.com/spf13/viper";
rev = "6d33b5a963d922d182c91e8a1c88d81fd150cfd4";
sha256 = "1190mg04718r03qriav99sf4kx2n7wdgr8vdni15f74bpbzrdjrl";
};
}
{
goPackagePath = "github.com/urfave/cli";
fetch = {
type = "git";
url = "https://github.com/urfave/cli";
rev = "b67dcf995b6a7b7f14fad5fcb7cc5441b05e814b";
sha256 = "0n5vq4nydlhb7w12jiwphvxqdy4jwpxc3zwlxyhf05lq1nxfb56h";
};
}
{
goPackagePath = "golang.org/x/sys";
fetch = {
type = "git";
url = "https://go.googlesource.com/sys";
rev = "7fbe1cd0fcc20051e1fcb87fbabec4a1bacaaeba";
sha256 = "0y49s4kazign9nsw2x3h39cgs14lqi57m4hrka26w49z8a1xdyc6";
};
}
{
goPackagePath = "golang.org/x/text";
fetch = {
type = "git";
url = "https://go.googlesource.com/text";
rev = "e6919f6577db79269a6443b9dc46d18f2238fb5d";
sha256 = "1p830sa7zqv4vzan3sn34qgfzc8466glv5ln2w6la96yw70wwky3";
};
}
{
goPackagePath = "gopkg.in/yaml.v2";
fetch = {
type = "git";
url = "https://gopkg.in/yaml.v2";
rev = "51d6538a90f86fe93ac480b35f37b2be17fef232";
sha256 = "01wj12jzsdqlnidpyjssmj0r4yavlqy7dwrg7adqd8dicjc4ncsa";
};
}
]

View File

@@ -1,4 +1,4 @@
{ writeDashBin, curl, jq }:
writeDashBin "wttr" ''
{ writeShellScriptBin, curl, jq }:
writeShellScriptBin "wttr" ''
${curl}/bin/curl -s -H "Accept-Language: ''${LANG%_*}" --compressed "wttr.in/''${1-"@$(${curl}/bin/curl -s ipinfo.io | ${jq}/bin/jq -r .ip)"}?0"
''

View File

@@ -6,9 +6,7 @@
services.xserver.xrandrHeads = [ "LVDS1" { output = "HDMI1"; primary = true; } ];
}
{
environment.systemPackages =
let unstable = import <nixos-unstable> {};
in [ unstable.zeroad ];
environment.systemPackages = [ pkgs.unstable.zeroad ];
}
./hardware-configuration.nix
];