From 3139bebd0f0b52302d7e9574a6e0cbcd57a09313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Mon, 22 Apr 2019 22:40:41 +0200 Subject: [PATCH] update to 19.03 --- configs/default.nix | 26 ++++++++++++++++++------ configs/haskell/default.nix | 8 ++++---- configs/haskell/packages.nix | 2 +- configs/i3.nix | 10 +++++++--- configs/mopidy.nix | 6 ++++-- configs/nixpkgs-unstable.nix | 8 ++++++++ configs/todoist.nix | 16 +++++---------- configs/zsh.nix | 7 ------- modules/telegram-bot.nix | 2 +- modules/todoist.nix | 32 ++++++++++++++++++++++++++++++ nixpkgs.json | 6 +++--- packages/literature-quote.nix | 2 +- systems/catullus/configuration.nix | 1 + systems/catullus/containers.nix | 2 +- systems/homeros/configuration.nix | 2 +- 15 files changed, 89 insertions(+), 41 deletions(-) create mode 100644 configs/nixpkgs-unstable.nix create mode 100644 modules/todoist.nix diff --git a/configs/default.nix b/configs/default.nix index 6304f1a..9e956c2 100644 --- a/configs/default.nix +++ b/configs/default.nix @@ -19,6 +19,7 @@ # + @@ -89,10 +90,6 @@ acronym = pkgs.callPackage {}; urban = pkgs.callPackage {}; mpv-poll = pkgs.callPackage {}; - - unstable = import { - config = config.nixpkgs.config; - }; }; }; } @@ -137,6 +134,24 @@ environment.systemPackages = [ pkgs.pavucontrol pkgs.pamixer ]; } + { + environment.systemPackages = [ + (pkgs.unstable.writers.writeDashBin "niveum-deploy" '' + NIVEUM_DIR=/home/kfm/prog/git/niveum + + for system in "$@"; do + eval $(nix-build --no-out-link "$NIVEUM_DIR/deploy.nix" -A "$system") & + done + + wait + '') + (pkgs.unstable.writers.writeDashBin "niveum-update" '' + NIVEUM_DIR=/home/kfm/prog/git/niveum + + nix-prefetch-git --url https://github.com/NixOS/nixpkgs-channels --rev refs/heads/nixos-18.09 > "$NIVEUM_DIR/nixpkgs.json" + '') + ]; + } { environment.interactiveShellInit = "export PATH=$PATH:$HOME/.local/bin:$HOME/.cargo/bin"; environment.shellAliases = { @@ -153,7 +168,6 @@ ls = "${pkgs.exa}/bin/exa"; ll = "${pkgs.exa}/bin/exa -l"; la = "${pkgs.exa}/bin/exa -la"; - niveum-update = "nix-prefetch-git --url https://github.com/NixOS/nixpkgs-channels --rev refs/heads/nixos-18.09 > ~niveum/nixpkgs.json"; }; } { @@ -271,7 +285,7 @@ }) pandoc haskellPackages.pandoc-citeproc - haskellPackages.patat + # haskellPackages.patat asciidoctor proselint ] ++ [ # programming diff --git a/configs/haskell/default.nix b/configs/haskell/default.nix index 7d221dc..d27cce1 100644 --- a/configs/haskell/default.nix +++ b/configs/haskell/default.nix @@ -6,10 +6,10 @@ :def hoogle \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --count=15 \"" ++ s ++ "\"" :def doc \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --info \"" ++ s ++ "\"" :def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\"" - :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\"" :set prompt "\o033[1m%s\o033[1;34m λ\o033[0m " :set -Wall ''; + # :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\"" ".stack/config.yaml".text = let user = config.niveum.user; in '' templates: params: @@ -30,16 +30,16 @@ stack2nix cabal-install hlint - haskellPackages.brittany + # haskellPackages.brittany (haskellPackages.ghcWithHoogle (import ./packages.nix)) ] ++ map haskell.lib.justStaticExecutables [ haskellPackages.ghcid haskellPackages.hakyll - haskellPackages.hfmt + # haskellPackages.hfmt haskellPackages.hasktags haskellPackages.hindent haskellPackages.pointfree - haskellPackages.pointful + # haskellPackages.pointful haskellPackages.hpack ]; } diff --git a/configs/haskell/packages.nix b/configs/haskell/packages.nix index 39f75c8..cf18c43 100644 --- a/configs/haskell/packages.nix +++ b/configs/haskell/packages.nix @@ -8,7 +8,7 @@ with haskellPackages; [ ad adjunctions aeson - algebra + # algebra ansi-terminal async attoparsec diff --git a/configs/i3.nix b/configs/i3.nix index 1627982..c62aff8 100644 --- a/configs/i3.nix +++ b/configs/i3.nix @@ -133,9 +133,9 @@ in with config.niveum; { "${modifier}+Shift+Left" = "move left"; "${modifier}+Shift+Right" = "move right"; "${modifier}+Shift+Up" = "move up"; + "${modifier}+Shift+b" = "move window to workspace prev"; "${modifier}+Shift+c" = "reload"; "${modifier}+Shift+n" = "move window to workspace next"; - "${modifier}+Shift+b" = "move window to workspace prev"; "${modifier}+Shift+q" = "kill"; "${modifier}+Shift+r" = "restart"; "${modifier}+Shift+w" = "exec ${pkgs.xautolock}/bin/xautolock -locknow"; @@ -143,12 +143,16 @@ in with config.niveum; { "${modifier}+Shift+z" = "floating toggle"; "${modifier}+Up" = "focus up"; "${modifier}+a" = "exec ${pkgs.rofi}/bin/rofi -display-window — -show window"; + "${modifier}+b" = "workspace prev"; + "${modifier}+c" = "split h"; "${modifier}+d" = "exec ${pkgs.rofi}/bin/rofi -display-run — -show run"; "${modifier}+e" = "layout toggle split"; "${modifier}+f" = "fullscreen toggle"; - "${modifier}+h" = "split h"; + "${modifier}+h" = "focus left"; + "${modifier}+j" = "focus down"; + "${modifier}+k" = "focus up"; + "${modifier}+l" = "focus right"; "${modifier}+n" = "workspace next"; - "${modifier}+b" = "workspace prev"; "${modifier}+p" = "exec ${pkgs.rofi-pass}/bin/rofi-pass"; "${modifier}+r" = "mode resize"; "${modifier}+s" = "layout stacking"; diff --git a/configs/mopidy.nix b/configs/mopidy.nix index f9b9fee..f5e86d1 100644 --- a/configs/mopidy.nix +++ b/configs/mopidy.nix @@ -4,11 +4,13 @@ in { services.mopidy = { enable = true; extensionPackages = [ - pkgs.mopidy-spotify - pkgs.mopidy-iris pkgs.mopidy-gmusic + pkgs.mopidy-iris pkgs.mopidy-moped + pkgs.mopidy-mopify pkgs.mopidy-soundcloud + pkgs.mopidy-spotify + pkgs.mopidy-spotify-tunigo pkgs.mopidy-youtube ]; configuration = '' diff --git a/configs/nixpkgs-unstable.nix b/configs/nixpkgs-unstable.nix new file mode 100644 index 0000000..9594e70 --- /dev/null +++ b/configs/nixpkgs-unstable.nix @@ -0,0 +1,8 @@ +{ config, ... }: +{ + nixpkgs.config.packageOverrides = pkgs: { + unstable = import { + config = config.nixpkgs.config; + }; + }; +} diff --git a/configs/todoist.nix b/configs/todoist.nix index bd60ed3..cd952c0 100644 --- a/configs/todoist.nix +++ b/configs/todoist.nix @@ -1,17 +1,11 @@ { pkgs, ... }: let secrets = import ; - todoist = pkgs.unstable.callPackage {}; in { - environment.systemPackages = [ - (pkgs.unstable.writers.writeDashBin "todoist" '' - ${todoist}/bin/todoist --color $@ - '') - ]; + imports = [ ]; - home-manager.users.me.home.file.".todoist.config.json".text = '' - { - "token": "${secrets.todoist.token}" - } - ''; + niveum.todoist = { + enable = true; + token = secrets.todoist.token; + }; } diff --git a/configs/zsh.nix b/configs/zsh.nix index 5344e4e..94d411c 100644 --- a/configs/zsh.nix +++ b/configs/zsh.nix @@ -39,13 +39,6 @@ mkdir $1 cd $1 } - - niveum-deploy() { - for system in "$@"; do - eval $(nix-build --no-out-link ~niveum/deploy.nix -A "$system") & - done - wait - } ''; promptInit = '' autoload -Uz vcs_info diff --git a/modules/telegram-bot.nix b/modules/telegram-bot.nix index 58b73a2..d58e021 100644 --- a/modules/telegram-bot.nix +++ b/modules/telegram-bot.nix @@ -8,7 +8,7 @@ let startAt = bot.time; serviceConfig.Type = "oneshot"; wants = [ "network-online.target" ]; - script = lists.concatStringsSep "\n" (map (chatId: '' + script = strings.concatStringsSep "\n" (map (chatId: '' ${pkgs.curl}/bin/curl -s -X POST "https://api.telegram.org/bot${bot.token}/sendMessage" \ -d chat_id="${chatId}" \ -d text="$(${bot.command})" ${ diff --git a/modules/todoist.nix b/modules/todoist.nix new file mode 100644 index 0000000..d2dbb26 --- /dev/null +++ b/modules/todoist.nix @@ -0,0 +1,32 @@ +{ pkgs, config, lib, ... }: +with lib; +let + cfg = config.niveum.todoist; + todoist = pkgs.unstable.callPackage {}; +in { + options.niveum.todoist = { + enable = mkEnableOption "todoist CLI"; + token = mkOption { type = types.strMatching "[0-9a-f]+"; }; + color = mkOption { type = types.bool; default = true; }; + }; + + config = { + environment.systemPackages = mkIf cfg.enable [ + (pkgs.unstable.writers.writeDashBin "todoist" '' + ${todoist}/bin/todoist $@ + '') + ]; + + home-manager.users.me.home.file.".todoist.config.json".text = mkIf cfg.enable (builtins.toJSON { + token = cfg.token; + color = cfg.color; + }); + + systemd.user.services.todoist-sync = { + enable = cfg.enable; + wants = [ "network-online.target" ]; + startAt = "*:0/5"; + script = ''${todoist}/bin/todoist sync''; + }; + }; +} diff --git a/nixpkgs.json b/nixpkgs.json index 7a6f41b..9d75dab 100644 --- a/nixpkgs.json +++ b/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/NixOS/nixpkgs-channels", - "rev": "05ef70a46fe22a0d4030dc92424b4ae72793abd2", - "date": "2019-04-13T16:30:47+02:00", - "sha256": "1hgsrday43nn6hsha5ggdw5f4lf60m0k45yfjf7d6l3w13vnpnk5", + "rev": "330b9fac6000ced90756d56fdbaab1ded58a13cb", + "date": "2019-04-21T19:35:46-04:00", + "sha256": "164g1qg2yp9w5a8klfxpw29xjslbxxz6q4v5d0zsxx6rsf04dzgy", "fetchSubmodules": false } diff --git a/packages/literature-quote.nix b/packages/literature-quote.nix index ee41a32..3bd43c2 100644 --- a/packages/literature-quote.nix +++ b/packages/literature-quote.nix @@ -1,6 +1,6 @@ { writeShellScriptBin, curl, xsv, gnused }: writeShellScriptBin "literature-quote" '' - ROW=$(${curl}/bin/curl -s https://raw.githubusercontent.com/kmein/quotes/master/quotes.csv?token=ACO7O6523EG3TDCYTT2K4224XTW5W | shuf -n1) + ROW=$(${curl}/bin/curl -Ls http://kmein.github.io/quotes/quotes.csv | shuf -n1) ( printf '%s\n(%s: _%s_, %s)\n' \ diff --git a/systems/catullus/configuration.nix b/systems/catullus/configuration.nix index 7a3a3b2..eebcddf 100644 --- a/systems/catullus/configuration.nix +++ b/systems/catullus/configuration.nix @@ -10,6 +10,7 @@ in { ./hardware-configuration.nix + diff --git a/systems/catullus/containers.nix b/systems/catullus/containers.nix index a43d17e..9573404 100644 --- a/systems/catullus/containers.nix +++ b/systems/catullus/containers.nix @@ -12,7 +12,7 @@ in { niveum.telegramBots.quotebot = { enable = true; - time = "08:00"; + time = "08/6:00"; token = lib.strings.removeSuffix "\n" (builtins.readFile ); chatIds = [ "18980945" ]; command = "${pkgs.literature-quote}/bin/literature-quote"; diff --git a/systems/homeros/configuration.nix b/systems/homeros/configuration.nix index b3128c5..f7be224 100644 --- a/systems/homeros/configuration.nix +++ b/systems/homeros/configuration.nix @@ -1,7 +1,7 @@ { config, pkgs, ... }: { imports = [ - + { services.xserver.xrandrHeads = [ "LVDS1" { output = "HDMI1"; primary = true; } ]; }