From c8c6c2e6c73cb8d64fd6be7ae7174b11582a9c04 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 31 Dec 2018 10:08:11 +0100 Subject: ma home-manager: init direnv,bat and more move old zsh confi to home-manager --- makefu/2configs/home-manager/cli.nix | 30 +++++++- makefu/2configs/home-manager/desktop.nix | 7 +- makefu/2configs/home-manager/zsh.nix | 126 +++++++++++++++++++++++++++++++ makefu/2configs/zsh-user.nix | 82 ++------------------ 4 files changed, 164 insertions(+), 81 deletions(-) create mode 100644 makefu/2configs/home-manager/zsh.nix (limited to 'makefu') diff --git a/makefu/2configs/home-manager/cli.nix b/makefu/2configs/home-manager/cli.nix index 64aa03bd7..6b5d26111 100644 --- a/makefu/2configs/home-manager/cli.nix +++ b/makefu/2configs/home-manager/cli.nix @@ -1,4 +1,5 @@ {pkgs, ... }: { + imports = [ ./zsh.nix ]; home-manager.users.makefu = { services.gpg-agent = { enable = true; @@ -9,7 +10,34 @@ enableSshSupport = true; enableScDaemon = true; }; - programs.fzf.enable = true; # alt-c + programs.direnv = { + stdlib = '' +use_nix() { + local cache=".direnv.$(nixos-version --hash)" + + if [[ ! -e "$cache" ]] || \ + [[ "$HOME/.direnvrc" -nt "$cache" ]] || \ + [[ ".envrc" -nt "$cache" ]] || \ + [[ "default.nix" -nt "$cache" ]] || \ + [[ "shell.nix" -nt "$cache" ]]; + then + local tmp="$(mktemp "$${cache}.tmp-XXXXXXXX")" + trap "rm -rf '$tmp' >/dev/null" EXIT + nix-shell --show-trace "$@" --run 'direnv dump' > "$tmp" && \ + mv "$tmp" "$cache" + fi + + direnv_load cat "$cache" + + if [[ $# = 0 ]]; then + watch_file default.nix + watch_file shell.nix + rm direnv.* 2>/dev/null + fi +} +''; + enableZshIntegration = true; + }; }; services.udev.packages = [ pkgs.libu2f-host diff --git a/makefu/2configs/home-manager/desktop.nix b/makefu/2configs/home-manager/desktop.nix index ce98e651a..40a1c6497 100644 --- a/makefu/2configs/home-manager/desktop.nix +++ b/makefu/2configs/home-manager/desktop.nix @@ -1,11 +1,13 @@ -{ pkgs, lib, ... }: +{ pkgs, lib, ... }: { + users.users.makefu.packages = with pkgs;[ bat direnv ]; home-manager.users.makefu = { programs.browserpass = { browsers = [ "firefox" ] ; enable = true; }; programs.firefox.enable = true; + programs.obs-studio.enable = true; + xdg.enable = true; services.network-manager-applet.enable = true; - systemd.user.services.network-manager-applet.Service.Environment = ''XDG_DATA_DIRS=/etc/profiles/per-user/makefu/share GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache''; services.blueman-applet.enable = true; services.pasystray.enable = true; systemd.user.services.pasystray.Service.Environment = "PATH=" + (lib.makeBinPath (with pkgs;[ pavucontrol paprefs /* pavumeter */ /* paman */ ]) ); @@ -34,7 +36,6 @@ }; Service = { - Environment = ''XDG_DATA_DIRS=/etc/profiles/per-user/makefu/share GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache''; ExecStart = "${pkgs.clipit}/bin/clipit"; Restart = "on-abort"; }; diff --git a/makefu/2configs/home-manager/zsh.nix b/makefu/2configs/home-manager/zsh.nix new file mode 100644 index 000000000..dff6d9337 --- /dev/null +++ b/makefu/2configs/home-manager/zsh.nix @@ -0,0 +1,126 @@ +{ pkgs, ... }: +{ + imports = [ + { #direnv + home-manager.users.makefu.home.packages = [ pkgs.direnv ]; + home-manager.users.makefu.home.file.".direnvrc".text = '' + use_nix() { + local path="$(nix-instantiate --find-file nixpkgs)" + + if [ -f "$${path}/.version-suffix" ]; then + local version="$(< $path/.version-suffix)" + elif [ -f "$path/.version" ]; then + local version="$(< $path/.version)" + else + local version="$(< $(< $path/.git/HEAD))" + fi + + local cache=".direnv/cache-''${version:-unknown}" + + if [[ ! -e "$cache" ]] || \ + [[ "$HOME/.direnvrc" -nt "$cache" ]] || \ + [[ .envrc -nt "$cache" ]] || \ + [[ default.nix -nt "$cache" ]] || \ + [[ shell.nix -nt "$cache" ]]; + then + [ -d .direnv ] || mkdir .direnv + local tmp=$(nix-shell --show-trace "$@" \ + --run "\"$direnv\" dump bash") + echo "$tmp" > "$cache" + fi + + local path_backup=$PATH term_backup=$TERM + direnv_load cat "$cache" + + export PATH=$PATH:$path_backup TERM=$term_backup + + if [[ $# = 0 ]]; then + watch_file default.nix + watch_file shell.nix + fi + } + ''; + home-manager.users.makefu.programs.zsh.initExtra = '' + nixify() { + if [ ! -e ./.envrc ]; then + echo "use nix" > .envrc + direnv allow + fi + if [ ! -e default.nix ]; then + cat > default.nix <<'EOF' + with import {}; + stdenv.mkDerivation { + name = "env"; + buildInputs = [ + bashInteractive + ]; + } + EOF + ${EDITOR:-vim} default.nix + fi + } + eval "$(direnv hook zsh)" + ''; + } + { # bat + home-manager.users.makefu.home.packages = [ pkgs.bat ]; + home-manager.users.makefu.programs.zsh.shellAliases = { + cat = "bat"; + catn = "${pkgs.coreutils}/bin/cat"; + }; + } + ]; + environment.pathsToLink = [ "/share/zsh" ]; + home-manager.users.makefu = { + programs.fzf.enable = false; # alt-c + programs.zsh = { + enable = true; + enableAutosuggestions = false; + enableCompletion = true; + oh-my-zsh.enable = false; + history = { + size = 900001; + save = 900001; + ignoreDups = true; + extended = true; + share = true; + }; + sessionVariables = { + TERM = "rxvt-unicode-256color"; + LANG = "en_US.UTF8"; + LS_COLORS = ":di=1;31:"; + EDITOR = "vim"; + }; + shellAliases = { + lsl = "ls -lAtr"; + t = "task"; + xo = "mimeopen"; + nmap = "nmap -oN $HOME/loot/scan-`date +\%s`.nmap -oX $HOME/loot/scan-`date +%s`.xml"; + }; + initExtra = '' + bindkey -e + # shift-tab + bindkey '^[[Z' reverse-menu-complete + bindkey "\e[3~" delete-char + zstyle ':completion:*' menu select + + setopt HIST_IGNORE_ALL_DUPS + setopt HIST_IGNORE_SPACE + setopt HIST_FIND_NO_DUPS + + unset SSH_AGENT_PID + export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" + compdef _pass brain + zstyle ':completion::complete:brain::' prefix "$HOME/brain" + compdef _pass secrets + zstyle ':completion::complete:secrets::' prefix "$HOME/.secrets-pass/" + + # ctrl-x ctrl-e + autoload -U edit-command-line + zle -N edit-command-line + bindkey '^xe' edit-command-line + bindkey '^x^e' edit-command-line + ''; + }; + }; +} diff --git a/makefu/2configs/zsh-user.nix b/makefu/2configs/zsh-user.nix index 23ae572da..e0ea046cf 100644 --- a/makefu/2configs/zsh-user.nix +++ b/makefu/2configs/zsh-user.nix @@ -1,83 +1,11 @@ { config, lib, pkgs, ... }: -## -with import ; let mainUser = config.krebs.build.user.name; in { - users.extraUsers.${mainUser}.shell = "/run/current-system/sw/bin/zsh"; programs.zsh= { enable = true; - enableCompletion = true ; #manually at the end - interactiveShellInit = '' - HISTSIZE=900001 - HISTFILESIZE=$HISTSIZE - SAVEHIST=$HISTSIZE - HISTFILE=$HOME/.zsh_history - - setopt HIST_IGNORE_ALL_DUPS - setopt HIST_IGNORE_SPACE - setopt HIST_FIND_NO_DUPS - bindkey -e - # shift-tab - bindkey '^[[Z' reverse-menu-complete - bindkey "\e[3~" delete-char - zstyle ':completion:*' menu select - - ${pkgs.gnupg}/bin/gpg-connect-agent updatestartuptty /bye >/dev/null - GPG_TTY=$(tty) - export GPG_TTY - LS_COLORS=$LS_COLORS:'di=1;31:' ; export LS_COLORS - - unset SSH_AGENT_PID - export SSH_AUTH_SOCK="/run/user/$UID/gnupg/S.gpg-agent.ssh" - - # fzf - __fsel_fzf() { - local cmd="''${FZF_CTRL_T_COMMAND:-"command find -L . -mindepth 1 \\( -path '*/\\.*' -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' \\) -prune \ - -o -type f -print \ - -o -type d -print \ - -o -type l -print 2> /dev/null | cut -b3-"}" - setopt localoptions pipefail 2> /dev/null - eval "$cmd" | FZF_DEFAULT_OPTS="--height ''${FZF_TMUX_HEIGHT:-40%} --reverse $FZF_DEFAULT_OPTS $FZF_CTRL_T_OPTS" $(__fzfcmd) -m "$@" | while read item; do - echo -n "''${(q)item} " - done - local ret=$? - echo - return $ret - } - - __fzf_use_tmux__() { - [ -n "$TMUX_PANE" ] && [ "''${FZF_TMUX:-0}" != 0 ] && [ ''${LINES:-40} -gt 15 ] - } - - __fzfcmd() { - __fzf_use_tmux__ && - echo "fzf-tmux -d''${FZF_TMUX_HEIGHT:-40%}" || echo "fzf" - } - - fzf-file-widget() { - LBUFFER="''${LBUFFER}$(__fsel_fzf)" - local ret=$? - zle redisplay - typeset -f zle-line-init >/dev/null && zle zle-line-init - return $ret - } - zle -N fzf-file-widget - bindkey '^T' fzf-file-widget - - compdef _pass brain - zstyle ':completion::complete:brain::' prefix "$HOME/brain" - compdef _pass secrets - zstyle ':completion::complete:secrets::' prefix "$HOME/.secrets-pass/" - - # ctrl-x ctrl-e - autoload -U edit-command-line - zle -N edit-command-line - bindkey '^xe' edit-command-line - bindkey '^x^e' edit-command-line - - ''; + enableCompletion = false; #manually at the end promptInit = '' RPROMPT="" @@ -93,8 +21,8 @@ in ''; }; - users.users.${mainUser}.packages = [ - pkgs.nix-zsh-completions - pkgs.fzf - ]; + users.users.${mainUser} = { + shell = "/run/current-system/sw/bin/zsh"; + packages = [ pkgs.nix-zsh-completions ]; + }; } -- cgit v1.2.3 From e71561caafa36ad62fee67575bcd8f95af1032b7 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 31 Dec 2018 10:15:22 +0100 Subject: ma cake.r: add Mic92 ssh key to authorized keys --- makefu/1systems/cake/config.nix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'makefu') diff --git a/makefu/1systems/cake/config.nix b/makefu/1systems/cake/config.nix index 1a617e52d..2491352eb 100644 --- a/makefu/1systems/cake/config.nix +++ b/makefu/1systems/cake/config.nix @@ -38,6 +38,9 @@ }) ]; networking.wireless.enable = true; + users.extraUsers.root.openssh.authorizedKeys.keys = [ + config.krebs.users.Mic92.pubkey + ]; # File systems configuration for using the installer's partition layout fileSystems = { -- cgit v1.2.3 From 1e7e39576cf9dec46b067160f5d201d1b8888f57 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 31 Dec 2018 10:15:48 +0100 Subject: ma gum.r: disable cache.nsupdate.info --- makefu/1systems/gum/config.nix | 1 - 1 file changed, 1 deletion(-) (limited to 'makefu') diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index 97b4555a5..6024260dc 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -124,7 +124,6 @@ in { # - -- cgit v1.2.3 From 05916b9a2273554ffe74b8d02d737de987841bd1 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 31 Dec 2018 10:17:15 +0100 Subject: ma download.binaergewitter.de: logrotate nginx logs like a babarian --- makefu/2configs/bgt/download.binaergewitter.de.nix | 30 ++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/bgt/download.binaergewitter.de.nix b/makefu/2configs/bgt/download.binaergewitter.de.nix index 6d64848f5..f223081e9 100644 --- a/makefu/2configs/bgt/download.binaergewitter.de.nix +++ b/makefu/2configs/bgt/download.binaergewitter.de.nix @@ -3,6 +3,8 @@ with import ; let ident = (builtins.readFile ./auphonic.pub); + bgtaccess = "/var/spool/nginx/logs/binaergewitter.access.log"; + bgterror = "/var/spool/nginx/logs/binaergewitter.error.log"; in { services.openssh = { allowSFTP = true; @@ -21,6 +23,19 @@ in { useDefaultShell = true; openssh.authorizedKeys.keys = [ ident config.krebs.users.makefu.pubkey ]; }; + services.logrotate = { + enable = true; + config = '' + ${bgtaccess} ${bgterror} { + rotate 5 + weekly + create 600 nginx nginx + postrotate + ${pkgs.systemd}/bin/systemctl reload nginx + endscript + } + ''; + }; services.nginx = { enable = lib.mkDefault true; recommendedGzipSettings = true; @@ -29,10 +44,21 @@ in { serverAliases = [ "dl2.binaergewitter.de" ]; root = "/var/www/binaergewitter"; extraConfig = '' - access_log /var/spool/nginx/logs/binaergewitter.access.log combined; - error_log /var/spool/nginx/logs/binaergewitter.error.log error; + access_log ${bgtaccess} combined; + error_log ${bgterror} error; autoindex on; ''; }; }; + environment.etc."netdata/python.d/web_log.conf".text = '' + nginx_log3: + name: 'nginx' + path: '/var/spool/nginx/logs/access.log' + nginx_log4: + name: 'bgt' + path: '${bgtaccess}' + ''; + + users.users.netdata.extraGroups = [ "nginx" ]; + } -- cgit v1.2.3 From fa117593ada626b12f81b98c478fdb21ab36bc89 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 31 Dec 2018 10:17:53 +0100 Subject: ma deployment/owncloud: open firewall ports --- makefu/2configs/deployment/owncloud.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu') diff --git a/makefu/2configs/deployment/owncloud.nix b/makefu/2configs/deployment/owncloud.nix index cfde0aba8..d7c082662 100644 --- a/makefu/2configs/deployment/owncloud.nix +++ b/makefu/2configs/deployment/owncloud.nix @@ -169,6 +169,7 @@ in { ( serveCloud [ "o.euer.krebsco.de" ] ) ]; + networking.firewall.allowedTCPPorts = [ 80 443 ]; services.redis.enable = true; services.mysql = { enable = false; -- cgit v1.2.3 From 069fd9be579b5257520ed7ab3578f19cb28badcd Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 3 Jan 2019 21:37:14 +0100 Subject: makefu krops.nix: use nixpkgs derivation for ci --- makefu/krops.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'makefu') diff --git a/makefu/krops.nix b/makefu/krops.nix index 2a2f70a05..30db07667 100644 --- a/makefu/krops.nix +++ b/makefu/krops.nix @@ -27,15 +27,15 @@ # TODO: we want to track the unstable channel symlink = "/nix/var/nix/profiles/per-user/root/channels/nixos/"; } else { - file = { - path = toString (pkgs.fetchFromGitHub { + derivation = '' + with import {}; + pkgs.fetchFromGitHub { owner = "makefu"; repo = "nixpkgs"; - rev = nixpkgs-src.rev; - sha256 = nixpkgs-src.sha256; - }); - useChecksum = true; - }; + rev = "${nixpkgs-src.rev}"; + sha256 = "${nixpkgs-src.sha256}"; + } + ''; }; nixos-config.symlink = "stockholm/makefu/1systems/${name}/config.nix"; -- cgit v1.2.3 From 7d5937b734f8a6e8379e494f91049aeee63c3300 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 3 Jan 2019 23:56:59 +0100 Subject: ma gum: enable home-manager --- makefu/1systems/gum/config.nix | 2 ++ makefu/1systems/gum/source.nix | 1 + 2 files changed, 3 insertions(+) (limited to 'makefu') diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index 6024260dc..918fd843d 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -22,6 +22,8 @@ in { }; } + + # diff --git a/makefu/1systems/gum/source.nix b/makefu/1systems/gum/source.nix index 1e36c6e87..43586ede4 100644 --- a/makefu/1systems/gum/source.nix +++ b/makefu/1systems/gum/source.nix @@ -2,4 +2,5 @@ name="gum"; torrent = true; clever_kexec = true; + home-manager = true; } -- cgit v1.2.3 From d27dd90bb9d8231668aa4f1b89113231303722fe Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 3 Jan 2019 23:57:24 +0100 Subject: ma gum: set the default gateway on the correct interface --- makefu/1systems/gum/hardware-config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/1systems/gum/hardware-config.nix b/makefu/1systems/gum/hardware-config.nix index e9670a5a4..542b79fe7 100644 --- a/makefu/1systems/gum/hardware-config.nix +++ b/makefu/1systems/gum/hardware-config.nix @@ -34,7 +34,7 @@ in { prefixLength = external-netmask6; }]; }; - defaultGateway6 = external-gw6; + defaultGateway6 = { address = external-gw6; interface = ext-if; }; defaultGateway = external-gw; }; boot.kernelParams = [ ]; -- cgit v1.2.3 From eb55a8dc0c7091f2a5b0fd78f4245f12d81afcf7 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 11 Jan 2019 00:37:13 +0100 Subject: ma pkgs.rclone: add auto-completion --- makefu/5pkgs/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'makefu') diff --git a/makefu/5pkgs/default.nix b/makefu/5pkgs/default.nix index 6e86f4264..59db86a8e 100644 --- a/makefu/5pkgs/default.nix +++ b/makefu/5pkgs/default.nix @@ -24,6 +24,15 @@ in { patches = [ ./custom/quodlibet/single-digit-discnumber.patch ./custom/quodlibet/remove-override-warning.patch ]; }); + rclone = super.pkgs.stdenv.lib.overrideDerivation super.rclone (old: { + postInstall = old.postInstall + '' + + $bin/bin/rclone genautocomplete zsh _rclone + install -D -m644 _rclone $bin/share/zsh/vendor-completions/_rclone + $bin/bin/rclone genautocomplete bash _rclone + install -D -m644 _rclone $bin/etc/bash_completion.d/rclone + ''; + }); alsa-hdspconf = callPackage ./custom/alsa-tools { alsaToolTarget="hdspconf";}; alsa-hdspmixer = callPackage ./custom/alsa-tools { alsaToolTarget="hdspmixer";}; alsa-hdsploader = callPackage ./custom/alsa-tools { alsaToolTarget="hdsploader";}; -- cgit v1.2.3 From 9ed07a2dcf24a22965ccf26ab8915c2b02cb17af Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 11 Jan 2019 00:37:58 +0100 Subject: ma home-manager: escape ${EDITOR} --- makefu/2configs/home-manager/zsh.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/2configs/home-manager/zsh.nix b/makefu/2configs/home-manager/zsh.nix index dff6d9337..59658e667 100644 --- a/makefu/2configs/home-manager/zsh.nix +++ b/makefu/2configs/home-manager/zsh.nix @@ -56,7 +56,7 @@ ]; } EOF - ${EDITOR:-vim} default.nix + ''${EDITOR:-vim} default.nix fi } eval "$(direnv hook zsh)" -- cgit v1.2.3 From 91190ad66b3ca8ac6446ec8ef38e69ef51606dc7 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 11 Jan 2019 14:26:30 +0100 Subject: ma nixpkgs: 9728b2e -> eebd1a9 --- makefu/nixpkgs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'makefu') diff --git a/makefu/nixpkgs.json b/makefu/nixpkgs.json index ae35f9e76..c22aa9f31 100644 --- a/makefu/nixpkgs.json +++ b/makefu/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/makefu/nixpkgs", - "rev": "9728b2e83406c76efc734ebb1923f23b8e687819", - "date": "2018-11-19T20:36:35+01:00", - "sha256": "0nk75ldppjr6x04hgghgg9vanr1cw4k5xhg699d38g2rpxviz5bp", + "rev": "eebd1a9263716a04689a37b6537e50801d376b5e", + "date": "2019-01-03T20:01:07+01:00", + "sha256": "0s1fylhjqp2h4j044iwbwndgnips3nrynh2ip5ijh96kavizf2gb", "fetchSubmodules": false } -- cgit v1.2.3 From 7cb25ff9553f7506a99a571537b37dc86dea2efb Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 11 Jan 2019 14:28:38 +0100 Subject: ma gum.r: disable iso building --- makefu/1systems/gum/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index 918fd843d..e274b4bf8 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -125,7 +125,7 @@ in { # # - + # -- cgit v1.2.3 From 82ecfd8086baf4ceb2efc50ff24c52fc61f1b837 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 11 Jan 2019 16:31:47 +0100 Subject: ma pkgs.quodlibet: disable tests for now --- makefu/5pkgs/default.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu') diff --git a/makefu/5pkgs/default.nix b/makefu/5pkgs/default.nix index 59db86a8e..8ae41427c 100644 --- a/makefu/5pkgs/default.nix +++ b/makefu/5pkgs/default.nix @@ -21,6 +21,7 @@ with super.lib; with builtins; let in { quodlibet = super.pkgs.stdenv.lib.overrideDerivation super.quodlibet (old: { + doCheck = false; # 1 error because of warnings (possibly upstream) patches = [ ./custom/quodlibet/single-digit-discnumber.patch ./custom/quodlibet/remove-override-warning.patch ]; }); -- cgit v1.2.3 From 772f763afc56edbc34088f48351d7f2ebea82c0b Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 11 Jan 2019 19:11:25 +0100 Subject: ma nixpkgs: eebd1a9263 -> 1258730 ... i am stupid --- makefu/nixpkgs.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'makefu') diff --git a/makefu/nixpkgs.json b/makefu/nixpkgs.json index c22aa9f31..d62fd65ca 100644 --- a/makefu/nixpkgs.json +++ b/makefu/nixpkgs.json @@ -1,7 +1,7 @@ { "url": "https://github.com/makefu/nixpkgs", - "rev": "eebd1a9263716a04689a37b6537e50801d376b5e", - "date": "2019-01-03T20:01:07+01:00", - "sha256": "0s1fylhjqp2h4j044iwbwndgnips3nrynh2ip5ijh96kavizf2gb", + "rev": "125873064a6eabd2896833d00aede7778a453fdf", + "date": "2019-01-11T14:24:21+01:00", + "sha256": "1ki50426m9simqvxdzckfgycibz5rdhwl6hzi31i72dqiafl8j6s", "fetchSubmodules": false } -- cgit v1.2.3 From 33655bfd89f7ea6f8ab3e3139cd79f4c2d2a0ef6 Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 13 Jan 2019 23:05:12 +0100 Subject: ma cake.r: remove hack to get wifi working --- makefu/1systems/cake/config.nix | 41 +++----------------------------- makefu/1systems/cake/hardware-config.nix | 26 ++++++++++++++++++++ 2 files changed, 29 insertions(+), 38 deletions(-) create mode 100644 makefu/1systems/cake/hardware-config.nix (limited to 'makefu') diff --git a/makefu/1systems/cake/config.nix b/makefu/1systems/cake/config.nix index 2491352eb..e40042b2d 100644 --- a/makefu/1systems/cake/config.nix +++ b/makefu/1systems/cake/config.nix @@ -2,6 +2,7 @@ { imports = [ + ./hardware-config.nix # configure your hw: # @@ -11,46 +12,10 @@ tinc.retiolum.enable = true; build.host = config.krebs.hosts.cake; }; - boot.loader.grub.enable = false; - boot.loader.generic-extlinux-compatible.enable = true; - boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelParams = ["cma=32M" "console=ttyS0,115200n8" "console=tty0" ]; - programs.info.enable = false; - programs.man.enable = false; + documentation.info.enable = false; + documentation.man.enable = false; services.nixosManual.enable = false; - boot.tmpOnTmpfs = lib.mkForce false; sound.enable = false; - hardware.enableRedistributableFirmware = true; - hardware.firmware = [ - (pkgs.stdenv.mkDerivation { - name = "broadcom-rpi3-rest"; - src = pkgs.fetchurl { - url = "https://raw.githubusercontent.com/RPi-Distro/firmware-nonfree/54bab3d/brcm80211/brcm/brcmfmac43430-sdio.txt"; - sha256 = "19bmdd7w0xzybfassn7x4rb30l70vynnw3c80nlapna2k57xwbw7"; - }; - phases = [ "installPhase" ]; - installPhase = '' - mkdir -p $out/lib/firmware/brcm - cp $src $out/lib/firmware/brcm/brcmfmac43430-sdio.txt - ''; - }) - ]; - networking.wireless.enable = true; - users.extraUsers.root.openssh.authorizedKeys.keys = [ - config.krebs.users.Mic92.pubkey - ]; - -# File systems configuration for using the installer's partition layout - fileSystems = { - "/boot" = { - device = "/dev/disk/by-label/NIXOS_BOOT"; - fsType = "vfat"; - }; - "/" = { - device = "/dev/disk/by-label/NIXOS_SD"; - fsType = "ext4"; - }; - }; } diff --git a/makefu/1systems/cake/hardware-config.nix b/makefu/1systems/cake/hardware-config.nix new file mode 100644 index 000000000..a81dce4f9 --- /dev/null +++ b/makefu/1systems/cake/hardware-config.nix @@ -0,0 +1,26 @@ +{ pkgs, lib, ... }: +{ + # raspi3 + boot.loader.grub.enable = false; + boot.loader.generic-extlinux-compatible.enable = true; + boot.kernelParams = ["cma=32M" "console=ttyS0,115200n8" "console=tty0" ]; + boot.tmpOnTmpfs = lib.mkForce false; + hardware.enableRedistributableFirmware = true; + + ## wifi not working, will be fixed with https://github.com/NixOS/nixpkgs/pull/53747 + # boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelPackages = pkgs.linuxPackages; + + networking.wireless.enable = true; + # File systems configuration for using the installer's partition layout + fileSystems = { + "/boot" = { + device = "/dev/disk/by-label/NIXOS_BOOT"; + fsType = "vfat"; + }; + "/" = { + device = "/dev/disk/by-label/NIXOS_SD"; + fsType = "ext4"; + }; + }; +} -- cgit v1.2.3 From da79d23ebbc0c3fb7c579b366f29fb3744948706 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 21 Jan 2019 10:32:15 +0100 Subject: krebs: move dns stuff to dedicated file --- makefu/2configs/default.nix | 1 - 1 file changed, 1 deletion(-) (limited to 'makefu') diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 61cba86d9..cbfb4da1c 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -36,7 +36,6 @@ with import ; enable = true; dns.providers.lan = "hosts"; - search-domain = "r"; build.user = config.krebs.users.makefu; }; -- cgit v1.2.3 From 6af865b1e6bba605f11f5d4c6cfb7e92b4f01666 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 21 Jan 2019 11:17:27 +0100 Subject: ma 2default: extra pathsToLink --- makefu/2configs/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/2configs/default.nix b/makefu/2configs/default.nix index 61cba86d9..d66b492a4 100644 --- a/makefu/2configs/default.nix +++ b/makefu/2configs/default.nix @@ -85,5 +85,5 @@ with import ; SystemMaxUse=1G RuntimeMaxUse=128M ''; - + environment.pathsToLink = [ "/share" ]; } -- cgit v1.2.3 From 9312695b39bb490c76d7297c346ef17ac462b569 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Jan 2019 08:13:44 +0100 Subject: ma cake.r: update hardware-config --- makefu/1systems/cake/hardware-config.nix | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'makefu') diff --git a/makefu/1systems/cake/hardware-config.nix b/makefu/1systems/cake/hardware-config.nix index a81dce4f9..d021f9458 100644 --- a/makefu/1systems/cake/hardware-config.nix +++ b/makefu/1systems/cake/hardware-config.nix @@ -1,18 +1,34 @@ { pkgs, lib, ... }: { # raspi3 + boot.kernelParams = ["cma=32M" "console=ttyS0,115200n8" "console=tty0" "console=ttyS1,115200n8" ]; boot.loader.grub.enable = false; - boot.loader.generic-extlinux-compatible.enable = true; - boot.kernelParams = ["cma=32M" "console=ttyS0,115200n8" "console=tty0" ]; + boot.loader.raspberryPi.enable = true; + boot.loader.raspberryPi.version = 3; + boot.loader.raspberryPi.uboot.enable = true; + boot.loader.raspberryPi.uboot.configurationLimit = 3; + boot.loader.raspberryPi.firmwareConfig = '' + gpu_mem=32 + arm_freq=1350 + core_freq=500 + over_voltage=4 + disable_splash=1 + # bye bye warranty + force_turbo=1 + ''; + boot.loader.generationsDir.enable = lib.mkDefault false; + boot.tmpOnTmpfs = lib.mkForce false; + boot.cleanTmpDir = true; hardware.enableRedistributableFirmware = true; ## wifi not working, will be fixed with https://github.com/NixOS/nixpkgs/pull/53747 # boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelPackages = pkgs.linuxPackages; - + boot.kernelPackages = pkgs.linuxPackages_latest; + environment.systemPackages = [ pkgs.raspberrypi-tools ]; networking.wireless.enable = true; # File systems configuration for using the installer's partition layout + swapDevices = [ { device = "/var/swap"; size = 2048; } ]; fileSystems = { "/boot" = { device = "/dev/disk/by-label/NIXOS_BOOT"; -- cgit v1.2.3 From 04ddb5307bc68e91e4ce534469faa3cc52b4dd02 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Jan 2019 08:14:34 +0100 Subject: ma hw/malduino_elite: init required so modem-manager does not try to use it as modem --- makefu/1systems/x/config.nix | 1 + makefu/2configs/hw/malduino_elite.nix | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 makefu/2configs/hw/malduino_elite.nix (limited to 'makefu') diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 5a4eea2e4..35779507b 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -69,6 +69,7 @@ # Hardware + # # diff --git a/makefu/2configs/hw/malduino_elite.nix b/makefu/2configs/hw/malduino_elite.nix new file mode 100644 index 000000000..1af85493f --- /dev/null +++ b/makefu/2configs/hw/malduino_elite.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +{ + + services.udev.extraRules = '' + ACTION!="add|change", GOTO="mm_usb_device_blacklist_local_end" + SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_local_end" + ENV{DEVTYPE}!="usb_device", GOTO="mm_usb_device_blacklist_local_end" + + ATTRS{idVendor}=="1b4f" ATTRS{idProduct}=="9204", ENV{ID_MM_DEVICE_IGNORE}="1" + ATTRS{idVendor}=="1b4f" ATTRS{idProduct}=="9203", ENV{ID_MM_DEVICE_IGNORE}="1" + + LABEL="mm_usb_device_blacklist_local_end" + ''; +} -- cgit v1.2.3 From 1a9957cc87e7bd3a2f0e4aa610c0c68350682b4f Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Jan 2019 08:15:13 +0100 Subject: ma tools: add nix-review, accept sdk license --- makefu/2configs/tools/android-pentest.nix | 1 + makefu/2configs/tools/dev.nix | 1 + 2 files changed, 2 insertions(+) (limited to 'makefu') diff --git a/makefu/2configs/tools/android-pentest.nix b/makefu/2configs/tools/android-pentest.nix index 9dedafdd2..05560db90 100644 --- a/makefu/2configs/tools/android-pentest.nix +++ b/makefu/2configs/tools/android-pentest.nix @@ -1,6 +1,7 @@ { pkgs, ... }: { + nixpkgs.config.android_sdk.accept_license = true; users.users.makefu.packages = with pkgs; [ mitmproxy nmap diff --git a/makefu/2configs/tools/dev.nix b/makefu/2configs/tools/dev.nix index 09ee63498..f8e3f9f46 100644 --- a/makefu/2configs/tools/dev.nix +++ b/makefu/2configs/tools/dev.nix @@ -22,6 +22,7 @@ cdrtools # nix related nix-index + nix-review # git-related tig ]; -- cgit v1.2.3 From d8ab2b7f65d72931aac87059c91c04223af8ea1b Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Jan 2019 08:15:33 +0100 Subject: ma printer: use splix instead of samsung drivers --- makefu/2configs/printer.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/2configs/printer.nix b/makefu/2configs/printer.nix index fb1a67358..0889ebbc1 100644 --- a/makefu/2configs/printer.nix +++ b/makefu/2configs/printer.nix @@ -6,7 +6,8 @@ in { services.printing = { enable = true; drivers = with pkgs; [ - samsungUnifiedLinuxDriver + # samsungUnifiedLinuxDriver + splix # scx 3200 cups-dymo # dymo labelwriter foo2zjs # magicolor 1690mf cups-zj-58 -- cgit v1.2.3 From d6b74138c33c7458ebb6c87f171e7efcb9908f98 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Jan 2019 09:02:54 +0100 Subject: ma home-manager: set the XDG_DATA_DIRS and GDK_PIXBUF_MODULE_FILE load icons --- makefu/2configs/home-manager/desktop.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/2configs/home-manager/desktop.nix b/makefu/2configs/home-manager/desktop.nix index 40a1c6497..3be020faa 100644 --- a/makefu/2configs/home-manager/desktop.nix +++ b/makefu/2configs/home-manager/desktop.nix @@ -1,8 +1,9 @@ { pkgs, lib, ... }: { - users.users.makefu.packages = with pkgs;[ bat direnv ]; + users.users.makefu.packages = with pkgs;[ bat direnv clipit ]; home-manager.users.makefu = { + systemd.user.services.network-manager-applet.Service.Environment = ''XDG_DATA_DIRS=/run/current-system/sw/share:${pkgs.networkmanagerapplet}/share GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache''; programs.browserpass = { browsers = [ "firefox" ] ; enable = true; }; programs.firefox.enable = true; programs.obs-studio.enable = true; @@ -36,6 +37,7 @@ }; Service = { + Environment = ''XDG_DATA_DIRS=/run/current-system/sw/share:${pkgs.clipit}/share GDK_PIXBUF_MODULE_FILE=${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache''; ExecStart = "${pkgs.clipit}/bin/clipit"; Restart = "on-abort"; }; -- cgit v1.2.3 From 1cb0ec0b03bad3fb57a200d425da0b936fa20436 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Jan 2019 09:03:13 +0100 Subject: ma krops: bump home-manager ref --- makefu/krops.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/krops.nix b/makefu/krops.nix index 30db07667..57a3b3bbf 100644 --- a/makefu/krops.nix +++ b/makefu/krops.nix @@ -74,7 +74,7 @@ (lib.mkIf ( host-src.home-manager ) { home-manager.git = { url = https://github.com/rycee/home-manager; - ref = "f947faf"; + ref = "4aa07c3"; }; }) ]; -- cgit v1.2.3 From a8586920832b55b43b5cb4bdd61c081fb821a113 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Jan 2019 09:03:57 +0100 Subject: ma bureautomation: rename plugs --- makefu/2configs/bureautomation/hass.nix | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/bureautomation/hass.nix b/makefu/2configs/bureautomation/hass.nix index a89a4813f..57184bdf7 100644 --- a/makefu/2configs/bureautomation/hass.nix +++ b/makefu/2configs/bureautomation/hass.nix @@ -3,19 +3,14 @@ let tasmota_plug = name: topic: { platform = "mqtt"; inherit name; - state_topic = "/bam/${topic}/stat/POWER1"; - command_topic = "/bam/${topic}/cmnd/POWER1"; + state_topic = "/bam/${topic}/stat/POWER"; + command_topic = "/bam/${topic}/cmnd/POWER"; availability_topic = "/bam/${topic}/tele/LWT"; payload_on= "ON"; payload_off= "OFF"; payload_available= "Online"; payload_not_available= "Offline"; }; - tasmota_stecki = name: topic: - ( tasmota_plug name topic) // - { state_topic = "/bam/${topic}/stat/POWER"; - command_topic = "/bam/${topic}/cmnd/POWER"; - }; espeasy_dht22 = name: [ { platform = "mqtt"; name = "${name} DHT22 Temperature"; @@ -77,8 +72,8 @@ in { switch = [ (tasmota_plug "Bauarbeiterlampe" "plug") (tasmota_plug "Blitzdings" "plug2") - (tasmota_stecki "Fernseher" "fernseher") - (tasmota_plug "Pluggy" "plug4") + (tasmota_plug "Fernseher" "plug3") + (tasmota_plug "Feuer" "plug4") ]; binary_sensor = [ { platform = "mqtt"; @@ -179,7 +174,7 @@ in { "switch.bauarbeiterlampe" "switch.blitzdings" "switch.fernseher" - "switch.pluggy" + "switch.feuer" ]; camera = [ "camera.Baumarkt" @@ -212,7 +207,7 @@ in { }; action = { service = "homeassistant.turn_on"; - entity_id = [ "switch.fernseher" "switch.blitzdings" ]; + entity_id = [ "switch.fernseher" "switch.feuer" ]; }; } { alias = "Turn off Fernseher 10 minutes after last movement"; @@ -231,7 +226,7 @@ in { ]; action = { service = "homeassistant.turn_off"; - entity_id = [ "switch.fernseher" "switch.blitzdings" ]; + entity_id = [ "switch.fernseher" "switch.feuer" ]; }; condition = { condition = "and"; -- cgit v1.2.3 From 5f96265d83228d581730da9a85488342010080dc Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Jan 2019 09:04:20 +0100 Subject: ma gui: disable transparency --- makefu/2configs/gui/base.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu') diff --git a/makefu/2configs/gui/base.nix b/makefu/2configs/gui/base.nix index 6bcd09826..63ce6201a 100644 --- a/makefu/2configs/gui/base.nix +++ b/makefu/2configs/gui/base.nix @@ -28,6 +28,7 @@ in windowManager = { awesome.enable = true; + awesome.noArgb = true; awesome.luaModules = [ pkgs.luaPackages.vicious ]; default = "awesome"; }; -- cgit v1.2.3 From b8bd543a79684d1c63a06fe5c1784d75e6dbbf85 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Jan 2019 09:05:56 +0100 Subject: ma pkgs.baidudl: init --- makefu/5pkgs/baidudl/default.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 makefu/5pkgs/baidudl/default.nix (limited to 'makefu') diff --git a/makefu/5pkgs/baidudl/default.nix b/makefu/5pkgs/baidudl/default.nix new file mode 100644 index 000000000..3c701fd6a --- /dev/null +++ b/makefu/5pkgs/baidudl/default.nix @@ -0,0 +1,23 @@ +{ stdenv, lib, pkgs, curl, jansson ,fetchFromGitHub, autoreconfHook }: +stdenv.mkDerivation rec { + pname = "baidudl"; + version = "2018-01-16"; + name = "${pname}-${version}"; + + src = fetchFromGitHub { + owner = "yzfedora"; + repo = "baidudl"; + rev = "712f2554a5ef7b2eba5c248d6406a6c535ef47b2"; + sha256 = "1nfzalyd9k87q6njdxpg7pa62q6hyfr2vwxwvahaflyp31nlpa0y"; + }; + + + nativeBuildInputs = [ autoreconfHook ]; + buildInputs = [ curl.dev jansson ]; + + meta = { + homepage = https://github.com/yzfedora/baidudl; + description = "This is a multi-thread download tool for pan.baidu.com"; + license = lib.licenses.gpl3; + }; +} -- cgit v1.2.3 From 2a5d8bcb4b9c49adea517083e8f1e30d7ab6df41 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 22 Jan 2019 23:07:54 +0100 Subject: ma virtualbox: enable the correct extensionPack --- makefu/2configs/virtualisation/virtualbox.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/virtualisation/virtualbox.nix b/makefu/2configs/virtualisation/virtualbox.nix index e90cc1e8d..a8a50939f 100644 --- a/makefu/2configs/virtualisation/virtualbox.nix +++ b/makefu/2configs/virtualisation/virtualbox.nix @@ -2,8 +2,7 @@ { virtualisation.virtualbox.host.enable = true; - nixpkgs.config.virtualbox.enableExtensionPack = true; - virtualisation.virtualbox.host.enableHardening = false; - + virtualisation.virtualbox.host.enableExtensionPack = true; + # virtualisation.virtualbox.host.enableHardening = false; users.extraGroups.vboxusers.members = [ config.krebs.build.user.name ]; } -- cgit v1.2.3 From dbf0926f8b702633e37259fd411d4c16242b7740 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 28 Jan 2019 08:27:57 +0100 Subject: ma dict: enable module --- makefu/1systems/x/config.nix | 1 + makefu/2configs/dict.nix | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 makefu/2configs/dict.nix (limited to 'makefu') diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 35779507b..143b9c729 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -14,6 +14,7 @@ + # diff --git a/makefu/2configs/dict.nix b/makefu/2configs/dict.nix new file mode 100644 index 000000000..6db9102ba --- /dev/null +++ b/makefu/2configs/dict.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: +{ + services.dictd.enable = true; + services.dictd.DBs = with pkgs.dictdDBs; [ wiktionary wordnet deu2eng eng2deu ]; +} -- cgit v1.2.3 From a3919eb1af48fadfea06e17f5245b7748f497191 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 28 Jan 2019 08:29:54 +0100 Subject: ma aarch64-community: add builder --- makefu/1systems/x/config.nix | 5 +++-- makefu/2configs/remote-build/aarch64-community.nix | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 makefu/2configs/remote-build/aarch64-community.nix (limited to 'makefu') diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 143b9c729..ce2199a41 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -19,6 +19,7 @@ # + # Debugging # @@ -51,7 +52,7 @@ # Virtualization - + # { networking.firewall.allowedTCPPorts = [ 8080 ]; networking.nat = { @@ -65,7 +66,7 @@ # - # + # Hardware diff --git a/makefu/2configs/remote-build/aarch64-community.nix b/makefu/2configs/remote-build/aarch64-community.nix new file mode 100644 index 000000000..d57eacd68 --- /dev/null +++ b/makefu/2configs/remote-build/aarch64-community.nix @@ -0,0 +1,15 @@ +{ + nix = { + distributedBuilds = true; + buildMachines = [ + { + hostName = "aarch64.nixos.community"; + maxJobs = 64; + sshKey = toString ; + sshUser = "makefu"; + system = "aarch64-linux"; + supportedFeatures = [ "big-parallel" ]; + } + ]; + }; +} -- cgit v1.2.3 From d6e1edf62c1a174a9da7089659776085f3dbbcce Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 28 Jan 2019 08:30:23 +0100 Subject: ma hass: add more devices --- makefu/2configs/bureautomation/hass.nix | 97 ++++++++++++++++++++++++++++++++- 1 file changed, 94 insertions(+), 3 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/bureautomation/hass.nix b/makefu/2configs/bureautomation/hass.nix index 57184bdf7..b70c9b030 100644 --- a/makefu/2configs/bureautomation/hass.nix +++ b/makefu/2configs/bureautomation/hass.nix @@ -1,5 +1,40 @@ { pkgs, lib, ... }: let + tasmota_rgb = name: topic: +# LED WS2812b +# effect_state_topic: "stat/led/Scheme" +# effect_command_topic: "cmnd/led/Scheme" +# effect_value_template: "{{ value_json.Scheme }}" + { platform = "mqtt"; + inherit name; + retain = false; + qos = 1; + optimistic = false; + # state + # TODO: currently broken, will not use the custom state topic + state_topic = "/bam/${topic}/stat/POWER"; + command_topic = "/bam/${topic}/cmnd/POWER"; + availability_topic = "/bam/${topic}/tele/LWT"; + payload_on= "ON"; + payload_off= "OFF"; + payload_available= "Online"; + payload_not_available= "Offline"; + # brightness + brightness_state_topic = "/bam/${topic}/stat/Dimmer"; + brightness_command_topic = "/bam/${topic}/cmnd/Dimmer"; + brightness_value_template = "{{ value_json.Dimmer }}"; + brightness_scale = 100; + # color + rgb_state_topic = "/bam/${topic}/stat/Color"; + rgb_command_topic = "/bam/${topic}/cmnd/Color2"; + rgb_command_mode = "hex"; + rgb_command_template = "{{ '%02x%02x%02x' | format(red, green, blue)}}"; + # effects + effect_state_topic = "/bam/${topic}/stat/Scheme"; + effect_command_topic = "/bam/${topic}/cmnd/Scheme"; + effect_value_template = "{{ value_json.Scheme }}"; + effect_list = [ 0 1 2 3 4 5 6 7 8 9 10 11 12 ]; +}; tasmota_plug = name: topic: { platform = "mqtt"; inherit name; @@ -74,6 +109,10 @@ in { (tasmota_plug "Blitzdings" "plug2") (tasmota_plug "Fernseher" "plug3") (tasmota_plug "Feuer" "plug4") + (tasmota_plug "Nachtlicht" "plug5") + ]; + light = [ + (tasmota_rgb "Status Felix" "status1") ]; binary_sensor = [ { platform = "mqtt"; @@ -169,12 +208,16 @@ in { }; automation = [ "automation.turn_off_fernseher_10_minutes_after_last_movement" + "automation.turn_off_nachtlicht_on_sunrise" + "automation.turn_on_nachtlicht_on_motion_and_dusk" ]; switches = [ "switch.bauarbeiterlampe" "switch.blitzdings" "switch.fernseher" "switch.feuer" + "switch.nachtlicht" + "light.status_felix" ]; camera = [ "camera.Baumarkt" @@ -207,11 +250,55 @@ in { }; action = { service = "homeassistant.turn_on"; - entity_id = [ "switch.fernseher" "switch.feuer" ]; + entity_id = [ + "switch.fernseher" + "switch.feuer" + "light.status_felix" + ]; + }; + } + { + alias = "Turn off Nachtlicht on sunrise"; + trigger = + { + platform = "sun"; + event = "sunrise"; + }; + action = + { + service = "homeassistant.turn_off"; + entity_id = [ "switch.nachtlicht" ]; + }; + } + { + alias = "Turn on Nachtlicht on motion and dusk"; + trigger = + { + platform = "state"; + entity_id = "binary_sensor.motion"; + to = "on"; + }; + condition = # 'when dark' + { + condition = "or"; + conditions = [ + { condition = "sun"; + after = "sunset"; + after_offset = "-00:45:00"; # on dusk + } + { condition = "sun"; + before = "sunrise"; + } + ]; + }; + action = + { + service = "homeassistant.turn_on"; + entity_id = [ "switch.nachtlicht" ]; }; } { alias = "Turn off Fernseher 10 minutes after last movement"; - trigger = [ + trigger = [ { # trigger when movement was detected at the time platform = "state"; entity_id = "binary_sensor.motion"; @@ -226,7 +313,11 @@ in { ]; action = { service = "homeassistant.turn_off"; - entity_id = [ "switch.fernseher" "switch.feuer" ]; + entity_id = [ + "switch.fernseher" + "switch.feuer" + "light.status_felix" + ]; }; condition = { condition = "and"; -- cgit v1.2.3 From 742c041b7246176f96709561b6c51ad87b3d861e Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 28 Jan 2019 08:30:50 +0100 Subject: ma tools: add picocom --- makefu/2configs/tools/dev.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu') diff --git a/makefu/2configs/tools/dev.nix b/makefu/2configs/tools/dev.nix index f8e3f9f46..0c877fc7b 100644 --- a/makefu/2configs/tools/dev.nix +++ b/makefu/2configs/tools/dev.nix @@ -4,6 +4,7 @@ users.users.makefu.packages = with pkgs;[ python3 python3Packages.pyserial + picocom python3Packages.virtualenv # embedded gi -- cgit v1.2.3 From 0c25e9790578821a1038831ea852c6bfbc83ff97 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 28 Jan 2019 08:31:35 +0100 Subject: ma bureautomation: use mqtt instead of curl seems they've change something in their security security --- makefu/2configs/bureautomation/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/bureautomation/default.nix b/makefu/2configs/bureautomation/default.nix index 3897537ea..917044d63 100644 --- a/makefu/2configs/bureautomation/default.nix +++ b/makefu/2configs/bureautomation/default.nix @@ -5,7 +5,7 @@ let port = 3001; runit = pkgs.writeDash "runit" '' set -xeuf - PATH=${pkgs.curl}/bin:${pkgs.coreutils}/bin + PATH=${pkgs.mosquitto}/bin:${pkgs.coreutils}/bin name=''${1?must provide name as first arg} state=''${2?must provide state as second arg} # val=''${3?must provide val as third arg} @@ -14,9 +14,10 @@ let test $state = alerting || exit 0 echo $name - $state - curl 'http://bauarbeiterlampe/ay?o=1' + topic=plug + mosquitto_pub -t /bam/$topic/cmnd/POWER -m ON sleep 5 - curl 'http://bauarbeiterlampe/ay?o=1' + mosquitto_pub -t /bam/$topic/cmnd/POWER -m OFF ''; in { services.logstash = { -- cgit v1.2.3 From c64d6785ac77ec09ebd92fec36b03b899f0f07c3 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 28 Jan 2019 11:57:04 +0100 Subject: ma 0tests/secrets: add nixos-community --- makefu/0tests/data/secrets/nixos-community | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 makefu/0tests/data/secrets/nixos-community (limited to 'makefu') diff --git a/makefu/0tests/data/secrets/nixos-community b/makefu/0tests/data/secrets/nixos-community new file mode 100644 index 000000000..e69de29bb -- cgit v1.2.3 From dc7caec1a74f79c619e14d22ee5f0a48064dd129 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 28 Jan 2019 13:51:36 +0100 Subject: ma x.r: enable virtualbox (again) --- makefu/1systems/x/config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index ce2199a41..138735d91 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -52,7 +52,7 @@ # Virtualization - # + { networking.firewall.allowedTCPPorts = [ 8080 ]; networking.nat = { -- cgit v1.2.3