From 48c3746cf09aedf888692856e33f9a803ae37829 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 22 Mar 2023 23:18:23 +0100 Subject: ma wiregrill: also masquerade ipv6 --- makefu/2configs/wireguard/wiregrill.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'makefu') diff --git a/makefu/2configs/wireguard/wiregrill.nix b/makefu/2configs/wireguard/wiregrill.nix index 082090755..dbe3a91c1 100644 --- a/makefu/2configs/wireguard/wiregrill.nix +++ b/makefu/2configs/wireguard/wiregrill.nix @@ -13,16 +13,32 @@ in mkIf (hasAttr "wiregrill" config.krebs.build.host.nets) { boot.kernel.sysctl = mkIf isRouter { "net.ipv6.conf.all.forwarding" = 1; + "net.ipv4.conf.all.forwarding" = 1; + }; + networking.nat = { + enable = true; + externalInterface = ext-if; + internalInterfaces = [ "wiregrill" ]; }; networking.firewall = { allowedUDPPorts = [ self.wireguard.port ]; extraCommands = '' - iptables -A FORWARD -i wiregrill -o wiregrill -j ACCEPT + ${pkgs.iptables}/bin/iptables -A FORWARD -i wiregrill -o wiregrill -j ACCEPT ''; }; networking.wireguard.interfaces.wiregrill = { + postSetup = '' + ${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.220.245.0/24 -o ${ext-if} -j MASQUERADE + ${pkgs.iptables}/bin/ip6tables -t nat -A POSTROUTING -s 42::/16 -o ${ext-if} -j MASQUERADE + ''; + + # This undoes the above command + postShutdown = '' + ${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.244.245.0/24 -o ${ext-if} -j MASQUERADE + ${pkgs.iptables}/bin/ip6tables -t nat -D POSTROUTING -s 42::/16 -o ${ext-if} -j MASQUERADE + ''; ips = (optional (!isNull self.ip4) self.ip4.addr) ++ (optional (!isNull self.ip6) self.ip6.addr); -- cgit v1.2.3 From 1d1eb043d19a9f1b0c8e8faebede7842a45dabf5 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 22 Mar 2023 23:57:07 +0100 Subject: ma gum.r: enable ipv6 again --- makefu/1systems/gum/config.nix | 5 +++-- makefu/1systems/gum/hetznercloud/network.nix | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'makefu') diff --git a/makefu/1systems/gum/config.nix b/makefu/1systems/gum/config.nix index 26bfd0731..e61af7a7b 100644 --- a/makefu/1systems/gum/config.nix +++ b/makefu/1systems/gum/config.nix @@ -103,6 +103,7 @@ in { # # { krebs.exim.enable = mkDefault true; } + # sharing # samba sahre @@ -125,7 +126,7 @@ in { - # + { # recent changes mediawiki bot networking.firewall.allowedUDPPorts = [ 5005 5006 ]; @@ -173,7 +174,7 @@ in { # # - + # # # # diff --git a/makefu/1systems/gum/hetznercloud/network.nix b/makefu/1systems/gum/hetznercloud/network.nix index 24fe3842f..5159cf570 100644 --- a/makefu/1systems/gum/hetznercloud/network.nix +++ b/makefu/1systems/gum/hetznercloud/network.nix @@ -3,7 +3,7 @@ let external-mac = "96:00:01:24:33:f4"; external-gw = "172.31.1.1"; external-ip = "142.132.189.140"; - external-ip6 = "2a01:4f8:1c17:5cdf::2/64"; + external-ip6 = "2a01:4f8:1c17:5cdf::2"; external-gw6 = "fe80::1"; external-netmask = 32; external-netmask6 = 64; @@ -16,19 +16,20 @@ in SUBSYSTEM=="net", ATTR{address}=="${external-mac}", NAME="${ext-if}" ''; networking = { + enableIPv6 = true; + nat.enableIPv6 = true; interfaces."${ext-if}" = { useDHCP = true; + ipv6.addresses = [{ + address = external-ip6; + prefixLength = external-netmask6; + }]; }; #ipv4.addresses = [{ # address = external-ip; # prefixLength = external-netmask; #}]; - #ipv6.addresses = [{ - # address = external-ip6; - # prefixLength = external-netmask6; - # }]; - #}; - #defaultGateway6 = { address = external-gw6; interface = ext-if; }; + defaultGateway6 = { address = external-gw6; interface = ext-if; }; #defaultGateway = external-gw; nameservers = [ "1.1.1.1" ]; }; -- cgit v1.2.3 From 55b00f7139d07469d6be3037d2443850b6d7496c Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 23 Mar 2023 01:10:21 +0100 Subject: ma wiregrill: allow masquerading between wiregrill/retiolum --- makefu/2configs/wireguard/wiregrill.nix | 43 ++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 9 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/wireguard/wiregrill.nix b/makefu/2configs/wireguard/wiregrill.nix index dbe3a91c1..070f01e10 100644 --- a/makefu/2configs/wireguard/wiregrill.nix +++ b/makefu/2configs/wireguard/wiregrill.nix @@ -15,30 +15,55 @@ in mkIf (hasAttr "wiregrill" config.krebs.build.host.nets) { "net.ipv6.conf.all.forwarding" = 1; "net.ipv4.conf.all.forwarding" = 1; }; - networking.nat = { + networking.nat = mkIf isRouter { enable = true; + enableIPv6 = true; externalInterface = ext-if; internalInterfaces = [ "wiregrill" ]; }; networking.firewall = { allowedUDPPorts = [ self.wireguard.port ]; - extraCommands = '' - ${pkgs.iptables}/bin/iptables -A FORWARD -i wiregrill -o wiregrill -j ACCEPT + interfaces.wiregrill = mkIf isRouter { + allowedUDPPorts = [ 53 ]; + allowedTCPPorts = [ 53 ]; + }; + }; + + services.dnsmasq = mkIf isRouter { + enable = true; + resolveLocalQueries = false; + extraConfig = /* dnsmasq */ '' + bind-interfaces + interface=retiolum,wiregrill ''; + servers = [ "1.1.1.1" ]; }; networking.wireguard.interfaces.wiregrill = { - postSetup = '' - ${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.220.245.0/24 -o ${ext-if} -j MASQUERADE - ${pkgs.iptables}/bin/ip6tables -t nat -A POSTROUTING -s 42::/16 -o ${ext-if} -j MASQUERADE + postSetup = optionalString isRouter '' + ${pkgs.iptables}/bin/iptables -t nat -A PREROUTING -s 10.244.245.0/24 -j ACCEPT + ${pkgs.iptables}/bin/iptables -t nat -A POSTROUTING -s 10.244.245.0/24 ! -d 10.244.245.0/24 -j MASQUERADE + ${pkgs.iptables}/bin/iptables -A FORWARD -i wiregrill -o retiolum -j ACCEPT + ${pkgs.iptables}/bin/iptables -A FORWARD -i retiolum -o wiregrill -j ACCEPT + + ${pkgs.iptables}/bin/ip6tables -t nat -A PREROUTING -s 42:1::/32 -j ACCEPT + ${pkgs.iptables}/bin/ip6tables -t nat -A POSTROUTING -s 42:1::/32 ! -d 42:1::/48 -j MASQUERADE + ${pkgs.iptables}/bin/ip6tables -A FORWARD -i wiregrill -o retiolum -j ACCEPT + ${pkgs.iptables}/bin/ip6tables -A FORWARD -i retiolum -o wiregrill -j ACCEPT ''; # This undoes the above command - postShutdown = '' + postShutdown = optionalString isRouter '' ${pkgs.iptables}/bin/iptables -t nat -D POSTROUTING -s 10.244.245.0/24 -o ${ext-if} -j MASQUERADE - ${pkgs.iptables}/bin/ip6tables -t nat -D POSTROUTING -s 42::/16 -o ${ext-if} -j MASQUERADE - ''; + ${pkgs.iptables}/bin/iptables -D FORWARD -i wiregrill -o retiolum -j ACCEPT + ${pkgs.iptables}/bin/iptables -D FORWARD -i retiolum -o wiregrill -j ACCEPT + + ${pkgs.iptables}/bin/ip6tables -t nat -D PREROUTING -s 42:1::/32 -j ACCEPT + ${pkgs.iptables}/bin/ip6tables -t nat -D POSTROUTING -s 42:1::/32 ! -d 42:1::/48 -j MASQUERADE + ${pkgs.iptables}/bin/ip6tables -D FORWARD -i wiregrill -o retiolum -j ACCEPT + ${pkgs.iptables}/bin/ip6tables -D FORWARD -i retiolum -o wiregrill -j ACCEPT + '' ; ips = (optional (!isNull self.ip4) self.ip4.addr) ++ (optional (!isNull self.ip6) self.ip6.addr); -- cgit v1.2.3 From d335011fce054bebc0e429ea10bccabaf898d2b2 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 29 Mar 2023 22:39:53 +0200 Subject: ma zsh: speedup, fix autocompletion for brain --- makefu/2configs/home-manager/zsh.nix | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'makefu') diff --git a/makefu/2configs/home-manager/zsh.nix b/makefu/2configs/home-manager/zsh.nix index 13755de27..c875d52c8 100644 --- a/makefu/2configs/home-manager/zsh.nix +++ b/makefu/2configs/home-manager/zsh.nix @@ -61,6 +61,8 @@ direnv allow size = 900001; save = 900001; ignoreDups = true; + ignoreSpace = true; + extended = true; share = true; }; @@ -77,31 +79,32 @@ direnv allow xo = "mimeopen"; nmap = "nmap -oN $HOME/loot/scan-`date +\%s`.nmap -oX $HOME/loot/scan-`date +%s`.xml"; }; - # navi package does not come with the navi.plugin.zsh anymore so we use .src + #zplug = { + # enable = true; + # plugins = [ + # { name = "denisidoro/navi" ; } + # { name = "zsh-users/zsh-autosuggestions" ; } + # ]; + #}; initExtra = '' bindkey -e + zle -N edit-command-line + # ctrl-x ctrl-e + bindkey '^xe' edit-command-line + bindkey '^x^e' edit-command-line # 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 compdef _pass brain zstyle ':completion::complete:brain::' prefix "$HOME/brain" + compdef _pass secrets zstyle ':completion::complete:secrets::' prefix "$HOME/.secrets-pass/" - - # navi - . ${pkgs.navi.src}/shell/navi.plugin.zsh - # ctrl-x ctrl-e - autoload -U compinit && compinit - autoload -U edit-command-line - zle -N edit-command-line - bindkey '^xe' edit-command-line - bindkey '^x^e' edit-command-line ''; }; }; -- cgit v1.2.3 From d030aae27223659504eee9775f22755eda0fe5d1 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 26 Apr 2023 18:41:02 +0200 Subject: ma wbob: add brother ql-800 --- makefu/1systems/wbob/config.nix | 5 ++++- makefu/2configs/bureautomation/printer.nix | 25 +++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 makefu/2configs/bureautomation/printer.nix (limited to 'makefu') diff --git a/makefu/1systems/wbob/config.nix b/makefu/1systems/wbob/config.nix index b12a6397d..ffc64587e 100644 --- a/makefu/1systems/wbob/config.nix +++ b/makefu/1systems/wbob/config.nix @@ -53,6 +53,7 @@ in { # new hass entry point + # now runs in thales # # #mpd is only used for TTS, this is the web interface @@ -100,7 +101,9 @@ in { # temporary # - { services.jellyfin.enable = true; } + { + services.jellyfin.enable = true; + } ]; krebs = { diff --git a/makefu/2configs/bureautomation/printer.nix b/makefu/2configs/bureautomation/printer.nix new file mode 100644 index 000000000..f0cf495ef --- /dev/null +++ b/makefu/2configs/bureautomation/printer.nix @@ -0,0 +1,25 @@ +{ pkgs, config, ... }: +let + mainUser = config.krebs.build.user.name; +in { + services.printing = { + enable = true; + drivers = with pkgs;[ + brlaser + cups-ptouch + ]; + }; + users.users.kiosk.extraGroups = [ "scanner" "lp" ]; + state = [ "/var/lib/cups"]; + users.users.kiosk.packages = with pkgs;[ + python3Packages.brother-ql + libreoffice + qrencode + imagemagick + ]; + + services.udev.extraRules = '' + SUBSYSTEMS=="usb", ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="209b", ATTRS{serial}=="000F1Z401759", MODE="0664", GROUP="lp", SYMLINK+="usb/lp0" + ''; + +} -- cgit v1.2.3 From 447b4931439670b566b9cd26e36b8b11de6f7209 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 29 Apr 2023 21:11:06 +0200 Subject: ma wbob.r: add Brother QL-800 + ui --- makefu/1systems/wbob/config.nix | 2 +- makefu/2configs/bureautomation/brother-ql-web.nix | 23 +++++++++++++++++++++++ makefu/2configs/bureautomation/printer.nix | 3 +++ makefu/2configs/gui/pipewire.nix | 3 +-- makefu/2configs/gui/wbob-kiosk.nix | 13 ++++++++++--- makefu/5pkgs/default.nix | 1 + 6 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 makefu/2configs/bureautomation/brother-ql-web.nix (limited to 'makefu') diff --git a/makefu/1systems/wbob/config.nix b/makefu/1systems/wbob/config.nix index ffc64587e..77f0f0337 100644 --- a/makefu/1systems/wbob/config.nix +++ b/makefu/1systems/wbob/config.nix @@ -22,7 +22,7 @@ in { # - { environment.systemPackages = [ pkgs.nano ]; } + { environment.systemPackages = [ pkgs.brother_ql_web pkgs.nano ]; } # # diff --git a/makefu/2configs/bureautomation/brother-ql-web.nix b/makefu/2configs/bureautomation/brother-ql-web.nix new file mode 100644 index 000000000..26887db03 --- /dev/null +++ b/makefu/2configs/bureautomation/brother-ql-web.nix @@ -0,0 +1,23 @@ + {pkgs, ... }: + let + pkg = pkgs.brother_ql_web; + in { + systemd.services.brother-ql-web = { + after = [ "network.target" ]; + description = "Brother QL Web Interface"; + wantedBy = [ "multi-user.target" ]; + environment = { + FLASK_PRINTER = "usb://0x04f9:0x209b/000F1Z401759"; + FLASK_MODEL = "QL-800"; + #FLASK_SERVER_PORT = "8013"; + #FLASK_LABEL_DEFAULT_SIZE = "d24"; + #FLASK_LABEL_DEFAULT_QR_SIZE = "7"; + }; + serviceConfig = { + ExecStart = "${pkg}/bin/brother_ql_web"; + DynamicUser = true; + SupplementaryGroups = "lp"; + Restart = "always"; + }; + }; +} diff --git a/makefu/2configs/bureautomation/printer.nix b/makefu/2configs/bureautomation/printer.nix index f0cf495ef..86d5a4069 100644 --- a/makefu/2configs/bureautomation/printer.nix +++ b/makefu/2configs/bureautomation/printer.nix @@ -2,6 +2,9 @@ let mainUser = config.krebs.build.user.name; in { + imports = [ + ./brother-ql-web.nix + ]; services.printing = { enable = true; drivers = with pkgs;[ diff --git a/makefu/2configs/gui/pipewire.nix b/makefu/2configs/gui/pipewire.nix index eb94f75b7..d52681551 100644 --- a/makefu/2configs/gui/pipewire.nix +++ b/makefu/2configs/gui/pipewire.nix @@ -12,10 +12,9 @@ services.pipewire = { enable = true; - systemWide = true; + # systemWide = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; - jack.enable = true; }; } diff --git a/makefu/2configs/gui/wbob-kiosk.nix b/makefu/2configs/gui/wbob-kiosk.nix index c67aa7cfb..3a21bf213 100644 --- a/makefu/2configs/gui/wbob-kiosk.nix +++ b/makefu/2configs/gui/wbob-kiosk.nix @@ -5,11 +5,11 @@ ./base.nix ]; users.users.kiosk = { - packages = [ pkgs.chromium pkgs.vscode ]; + packages = with pkgs;[ chromium vscode spotify tartube-yt-dlp ]; group = "kiosk"; isNormalUser = true; uid = 1003; - extraGroups = [ "wheel" "audio" "pulse" ]; + extraGroups = [ "wheel" "audio" "pulse" "pipewire" ]; }; users.groups.kiosk.gid = 989 ; services.xserver = { @@ -31,7 +31,10 @@ }; - environment.systemPackages = [ pkgs.gnomeExtensions.appindicator ]; + environment.systemPackages = [ + pkgs.gnomeExtensions.appindicator pkgs.pavucontrol pkgs.jellyfin-media-player pkgs.chromium pkgs.firefox pkgs.kodi + pkgs.pavucontrol +]; services.dbus.packages = with pkgs; [ gnome2.GConf gnome3.gnome-settings-daemon ]; systemd.services.xset-off = { @@ -45,5 +48,9 @@ Restart = "on-failure"; }; }; + services.pipewire.systemWide = lib.mkForce false; + services.pipewire.config.pipewire-pulse = { + "pulse.properties"."server.address" = [ "unix:native" "tcp:4713" ]; + }; } diff --git a/makefu/5pkgs/default.nix b/makefu/5pkgs/default.nix index 66a8d99d1..c057d1470 100644 --- a/makefu/5pkgs/default.nix +++ b/makefu/5pkgs/default.nix @@ -44,6 +44,7 @@ in { alsa-hdspconf = callPackage ./custom/alsa-tools { alsaToolTarget="hdspconf";}; alsa-hdspmixer = callPackage ./custom/alsa-tools { alsaToolTarget="hdspmixer";}; alsa-hdsploader = callPackage ./custom/alsa-tools { alsaToolTarget="hdsploader";}; + brother_ql_web = (builtins.getFlake "github:makefu/brother_ql_web?rev=a3f8625f48111da8cd6f8e562c966cdca445b82d").packages.x86_64-linux.default; qcma = super.pkgs.libsForQt5.callPackage ./custom/qcma { }; inherit (callPackage ./devpi {}) devpi-web ; jellyfin = unstable.jellyfin; -- cgit v1.2.3 From a5066dbb0da2d4cdfb6465911e5f2132734e1ff5 Mon Sep 17 00:00:00 2001 From: makefu Date: Fri, 5 May 2023 23:43:00 +0200 Subject: ma pkgs.shiori: rip --- makefu/5pkgs/shiori/default.nix | 16 -- makefu/5pkgs/shiori/deps.nix | 570 ---------------------------------------- 2 files changed, 586 deletions(-) delete mode 100644 makefu/5pkgs/shiori/default.nix delete mode 100644 makefu/5pkgs/shiori/deps.nix (limited to 'makefu') diff --git a/makefu/5pkgs/shiori/default.nix b/makefu/5pkgs/shiori/default.nix deleted file mode 100644 index 7de1e5ae1..000000000 --- a/makefu/5pkgs/shiori/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ buildGoPackage, fetchFromGitHub }: -let - builder = buildGoPackage; -in -builder rec { - name = "shiori-${version}"; - version = "1.6.0-warc"; - goPackagePath = "github.com/go-shiori/shiori"; - src = fetchFromGitHub { - owner = "go-shiori"; - repo = "shiori"; - rev = "83f133dd07bf661d3c4cf03043392100da489559"; - sha256 = "02b17hjbh4w0ip0snd8hmdjmbc2w1pv9sws9cf9r8w09c225nw2i"; - }; - goDeps = ./deps.nix; -} diff --git a/makefu/5pkgs/shiori/deps.nix b/makefu/5pkgs/shiori/deps.nix deleted file mode 100644 index 67d237fa9..000000000 --- a/makefu/5pkgs/shiori/deps.nix +++ /dev/null @@ -1,570 +0,0 @@ -# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix) -[ - { - goPackagePath = "github.com/BurntSushi/toml"; - fetch = { - type = "git"; - url = "https://github.com/BurntSushi/toml"; - rev = "v0.3.1"; - sha256 = "1fjdwwfzyzllgiwydknf1pwjvy49qxfsczqx5gz3y0izs7as99j6"; - }; - } - { - goPackagePath = "github.com/PuerkitoBio/goquery"; - fetch = { - type = "git"; - url = "https://github.com/PuerkitoBio/goquery"; - rev = "v1.5.0"; - sha256 = "1fqf4rs66wy02nxz6w4mvs2qawf2j8srz17i294v64y8gvxisp56"; - }; - } - { - goPackagePath = "github.com/andybalholm/cascadia"; - fetch = { - type = "git"; - url = "https://github.com/andybalholm/cascadia"; - rev = "v1.0.0"; - sha256 = "09j8cavbhqqdxjqrkwbc40g8p0i49zf3184rpjm5p2rjbprcghcc"; - }; - } - { - goPackagePath = "github.com/armon/consul-api"; - fetch = { - type = "git"; - url = "https://github.com/armon/consul-api"; - rev = "eb2c6b5be1b6"; - sha256 = "1j6fdr1sg36qy4n4xjl7brq739fpm5npq98cmvklzjc9qrx98nk9"; - }; - } - { - goPackagePath = "github.com/coreos/etcd"; - fetch = { - type = "git"; - url = "https://github.com/coreos/etcd"; - rev = "v3.3.10"; - sha256 = "1x2ii1hj8jraba8rbxz6dmc03y3sjxdnzipdvg6fywnlq1f3l3wl"; - }; - } - { - goPackagePath = "github.com/coreos/go-etcd"; - fetch = { - type = "git"; - url = "https://github.com/coreos/go-etcd"; - rev = "v2.0.0"; - sha256 = "1xb34hzaa1lkbq5vkzy9vcz6gqwj7hp6cdbvyack2bf28dwn33jj"; - }; - } - { - goPackagePath = "github.com/coreos/go-semver"; - fetch = { - type = "git"; - url = "https://github.com/coreos/go-semver"; - rev = "v0.2.0"; - sha256 = "1gghi5bnqj50hfxhqc1cxmynqmh2yk9ii7ab9gsm75y5cp94ymk0"; - }; - } - { - goPackagePath = "github.com/cpuguy83/go-md2man"; - fetch = { - type = "git"; - url = "https://github.com/cpuguy83/go-md2man"; - rev = "v1.0.10"; - sha256 = "1bqkf2bvy1dns9zd24k81mh2p1zxsx2nhq5cj8dz2vgkv1xkh60i"; - }; - } - { - goPackagePath = "github.com/davecgh/go-spew"; - fetch = { - type = "git"; - url = "https://github.com/davecgh/go-spew"; - rev = "v1.1.1"; - sha256 = "0hka6hmyvp701adzag2g26cxdj47g21x6jz4sc6jjz1mn59d474y"; - }; - } - { - goPackagePath = "github.com/disintegration/imaging"; - fetch = { - type = "git"; - url = "https://github.com/disintegration/imaging"; - rev = "v1.6.0"; - sha256 = "1as2r4z6303s528fhcfm6ybm1an8xhly9vr0fqk40y05x3x4h92x"; - }; - } - { - goPackagePath = "github.com/fatih/color"; - fetch = { - type = "git"; - url = "https://github.com/fatih/color"; - rev = "v1.7.0"; - sha256 = "0v8msvg38r8d1iiq2i5r4xyfx0invhc941kjrsg5gzwvagv55inv"; - }; - } - { - goPackagePath = "github.com/fsnotify/fsnotify"; - fetch = { - type = "git"; - url = "https://github.com/fsnotify/fsnotify"; - rev = "v1.4.7"; - sha256 = "07va9crci0ijlivbb7q57d2rz9h27zgn2fsm60spjsqpdbvyrx4g"; - }; - } - { - goPackagePath = "github.com/go-shiori/dom"; - fetch = { - type = "git"; - url = "https://github.com/go-shiori/dom"; - rev = "6867c1fcf154"; - sha256 = "10lhp58qy798vs5mazkhpxq4s5g42j2hps61y7c1npabp17k7zfm"; - }; - } - { - goPackagePath = "github.com/go-shiori/go-readability"; - fetch = { - type = "git"; - url = "https://github.com/go-shiori/go-readability"; - rev = "5413e9c4ec86"; - sha256 = "1bhr5chria90v0iwr4rwgvid7cr6aj5r458cmv9f6idpylx5dxl3"; - }; - } - { - goPackagePath = "github.com/go-shiori/warc"; - fetch = { - type = "git"; - url = "https://github.com/go-shiori/warc"; - rev = "7b3c5582fd83"; - sha256 = "0cgwfbiv83mswl1sxqrycn9fsrc3z8ms2q5rm6mvr7rsp3v1m6g4"; - }; - } - { - goPackagePath = "github.com/go-sql-driver/mysql"; - fetch = { - type = "git"; - url = "https://github.com/go-sql-driver/mysql"; - rev = "v1.4.1"; - sha256 = "1fvsvwc1v2i0gqn01mynvi1shp5xm0xaym6xng09fcbqb56lbjx1"; - }; - } - { - goPackagePath = "github.com/gofrs/uuid"; - fetch = { - type = "git"; - url = "https://github.com/gofrs/uuid"; - rev = "v3.2.0"; - sha256 = "1q63mp7bznhfgyw133c0wc0hpcj1cq9bcf7w1f8r6inkcrils1fz"; - }; - } - { - goPackagePath = "github.com/golang/protobuf"; - fetch = { - type = "git"; - url = "https://github.com/golang/protobuf"; - rev = "v1.3.1"; - sha256 = "15am4s4646qy6iv0g3kkqq52rzykqjhm4bf08dk0fy2r58knpsyl"; - }; - } - { - goPackagePath = "github.com/hashicorp/hcl"; - fetch = { - type = "git"; - url = "https://github.com/hashicorp/hcl"; - rev = "v1.0.0"; - sha256 = "0q6ml0qqs0yil76mpn4mdx4lp94id8vbv575qm60jzl1ijcl5i66"; - }; - } - { - goPackagePath = "github.com/inconshreveable/mousetrap"; - fetch = { - type = "git"; - url = "https://github.com/inconshreveable/mousetrap"; - rev = "v1.0.0"; - sha256 = "1mn0kg48xkd74brf48qf5hzp0bc6g8cf5a77w895rl3qnlpfw152"; - }; - } - { - goPackagePath = "github.com/jmoiron/sqlx"; - fetch = { - type = "git"; - url = "https://github.com/jmoiron/sqlx"; - rev = "v1.2.0"; - sha256 = "0pmi2asx157f5738g19fzyxb9g8yyfbpjyh2a2ykr9mafvp60rfd"; - }; - } - { - goPackagePath = "github.com/julienschmidt/httprouter"; - fetch = { - type = "git"; - url = "https://github.com/julienschmidt/httprouter"; - rev = "v1.2.0"; - sha256 = "1k8bylc9s4vpvf5xhqh9h246dl1snxrzzz0614zz88cdh8yzs666"; - }; - } - { - goPackagePath = "github.com/konsorten/go-windows-terminal-sequences"; - fetch = { - type = "git"; - url = "https://github.com/konsorten/go-windows-terminal-sequences"; - rev = "v1.0.2"; - sha256 = "09mn209ika7ciy87xf2x31dq5fnqw39jidgaljvmqxwk7ff1hnx7"; - }; - } - { - goPackagePath = "github.com/lib/pq"; - fetch = { - type = "git"; - url = "https://github.com/lib/pq"; - rev = "v1.1.1"; - sha256 = "0g64wlg1l1ybq4x44idksl4pgm055s58jxc6r6x4qhqm5q76h0km"; - }; - } - { - goPackagePath = "github.com/magiconair/properties"; - fetch = { - type = "git"; - url = "https://github.com/magiconair/properties"; - rev = "v1.8.0"; - sha256 = "1a10362wv8a8qwb818wygn2z48lgzch940hvpv81hv8gc747ajxn"; - }; - } - { - goPackagePath = "github.com/mattn/go-colorable"; - fetch = { - type = "git"; - url = "https://github.com/mattn/go-colorable"; - rev = "v0.1.1"; - sha256 = "0l640974j804c1yyjfgyxqlsivz0yrzmbql4mhcw2azryigkp08p"; - }; - } - { - goPackagePath = "github.com/mattn/go-isatty"; - fetch = { - type = "git"; - url = "https://github.com/mattn/go-isatty"; - rev = "v0.0.7"; - sha256 = "1i77aq4gf9as03m8fpfh8fq49n4z9j7548blrcsidm1xhslzk5xd"; - }; - } - { - goPackagePath = "github.com/mattn/go-sqlite3"; - fetch = { - type = "git"; - url = "https://github.com/mattn/go-sqlite3"; - rev = "v1.10.0"; - sha256 = "1zmz6asplixfihxhj11spgfs0v3xzb3nv0hlq6n6zsg781ni31xx"; - }; - } - { - goPackagePath = "github.com/mitchellh/go-homedir"; - fetch = { - type = "git"; - url = "https://github.com/mitchellh/go-homedir"; - rev = "v1.1.0"; - sha256 = "0ydzkipf28hwj2bfxqmwlww47khyk6d152xax4bnyh60f4lq3nx1"; - }; - } - { - goPackagePath = "github.com/mitchellh/mapstructure"; - fetch = { - type = "git"; - url = "https://github.com/mitchellh/mapstructure"; - rev = "v1.1.2"; - sha256 = "03bpv28jz9zhn4947saqwi328ydj7f6g6pf1m2d4m5zdh5jlfkrr"; - }; - } - { - goPackagePath = "github.com/muesli/go-app-paths"; - fetch = { - type = "git"; - url = "https://github.com/muesli/go-app-paths"; - rev = "913f7f7ac60f"; - sha256 = "0fwg2l5ypw7bm9fmgc4asb7hj5bhqq0lgw68nadm6xljh2vw594m"; - }; - } - { - goPackagePath = "github.com/patrickmn/go-cache"; - fetch = { - type = "git"; - url = "https://github.com/patrickmn/go-cache"; - rev = "v2.1.0"; - sha256 = "10020inkzrm931r4bixf8wqr9n39wcrb78vfyxmbvjavvw4zybgs"; - }; - } - { - goPackagePath = "github.com/pelletier/go-toml"; - fetch = { - type = "git"; - url = "https://github.com/pelletier/go-toml"; - rev = "v1.2.0"; - sha256 = "1fjzpcjng60mc3a4b2ql5a00d5gah84wj740dabv9kq67mpg8fxy"; - }; - } - { - goPackagePath = "github.com/pmezard/go-difflib"; - fetch = { - type = "git"; - url = "https://github.com/pmezard/go-difflib"; - rev = "v1.0.0"; - sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw"; - }; - } - { - goPackagePath = "github.com/russross/blackfriday"; - fetch = { - type = "git"; - url = "https://github.com/russross/blackfriday"; - rev = "v1.5.2"; - sha256 = "0jzbfzcywqcrnym4gxlz6nphmm1grg6wsl4f0r9x384rn83wkj7c"; - }; - } - { - goPackagePath = "github.com/sergi/go-diff"; - fetch = { - type = "git"; - url = "https://github.com/sergi/go-diff"; - rev = "v1.0.0"; - sha256 = "0swiazj8wphs2zmk1qgq75xza6m19snif94h2m6fi8dqkwqdl7c7"; - }; - } - { - goPackagePath = "github.com/shurcooL/httpfs"; - fetch = { - type = "git"; - url = "https://github.com/shurcooL/httpfs"; - rev = "74dc9339e414"; - sha256 = "19iyk75yfl83mlnvrr92s59n9j6968mpdrdg5cj78a81nfd08rv5"; - }; - } - { - goPackagePath = "github.com/shurcooL/vfsgen"; - fetch = { - type = "git"; - url = "https://github.com/shurcooL/vfsgen"; - rev = "6a9ea43bcacd"; - sha256 = "13i8wz234qr0fggsx71yhc76q0ka5lbslvira1xb71fpx2g97a50"; - }; - } - { - goPackagePath = "github.com/sirupsen/logrus"; - fetch = { - type = "git"; - url = "https://github.com/sirupsen/logrus"; - rev = "v1.4.2"; - sha256 = "087k2lxrr9p9dh68yw71d05h5g9p5v26zbwd6j7lghinjfaw334x"; - }; - } - { - goPackagePath = "github.com/spf13/afero"; - fetch = { - type = "git"; - url = "https://github.com/spf13/afero"; - rev = "v1.1.2"; - sha256 = "0miv4faf5ihjfifb1zv6aia6f6ik7h1s4954kcb8n6ixzhx9ck6k"; - }; - } - { - goPackagePath = "github.com/spf13/cast"; - fetch = { - type = "git"; - url = "https://github.com/spf13/cast"; - rev = "v1.3.0"; - sha256 = "0xq1ffqj8y8h7dcnm0m9lfrh0ga7pssnn2c1dnr09chqbpn4bdc5"; - }; - } - { - goPackagePath = "github.com/spf13/cobra"; - fetch = { - type = "git"; - url = "https://github.com/spf13/cobra"; - rev = "v0.0.5"; - sha256 = "0z4x8js65mhwg1gf6sa865pdxfgn45c3av9xlcc1l3xjvcnx32v2"; - }; - } - { - goPackagePath = "github.com/spf13/jwalterweatherman"; - fetch = { - type = "git"; - url = "https://github.com/spf13/jwalterweatherman"; - rev = "v1.0.0"; - sha256 = "093fmmvavv84pv4q84hav7ph3fmrq87bvspjj899q0qsx37yvdr8"; - }; - } - { - goPackagePath = "github.com/spf13/pflag"; - fetch = { - type = "git"; - url = "https://github.com/spf13/pflag"; - rev = "v1.0.3"; - sha256 = "1cj3cjm7d3zk0mf1xdybh0jywkbbw7a6yr3y22x9sis31scprswd"; - }; - } - { - goPackagePath = "github.com/spf13/viper"; - fetch = { - type = "git"; - url = "https://github.com/spf13/viper"; - rev = "v1.3.2"; - sha256 = "1829hvf805kda65l59r17wvid7y0vr390s23zfhf4w7vdb4wp3zh"; - }; - } - { - goPackagePath = "github.com/stretchr/objx"; - fetch = { - type = "git"; - url = "https://github.com/stretchr/objx"; - rev = "v0.1.1"; - sha256 = "0iph0qmpyqg4kwv8jsx6a56a7hhqq8swrazv40ycxk9rzr0s8yls"; - }; - } - { - goPackagePath = "github.com/stretchr/testify"; - fetch = { - type = "git"; - url = "https://github.com/stretchr/testify"; - rev = "v1.4.0"; - sha256 = "187i5g88sxfy4vxpm7dw1gwv29pa2qaq475lxrdh5livh69wqfjb"; - }; - } - { - goPackagePath = "github.com/tdewolff/parse"; - fetch = { - type = "git"; - url = "https://github.com/tdewolff/parse"; - rev = "v2.3.4"; - sha256 = "00hclphbjgc5vjrqgnclp72v8c45k35vmj84d2a0f7bw8cc88zcd"; - }; - } - { - goPackagePath = "github.com/tdewolff/test"; - fetch = { - type = "git"; - url = "https://github.com/tdewolff/test"; - rev = "v1.0.5"; - sha256 = "1f53nzfbs5gmn5bvqj3rzi15r9mxn8vq3f850rq3amwlfz927v9a"; - }; - } - { - goPackagePath = "github.com/ugorji/go"; - fetch = { - type = "git"; - url = "https://github.com/ugorji/go"; - rev = "d75b2dcb6bc8"; - sha256 = "0di1k35gpq9bp958ywranpbskx2vdwlb38s22vl9rybm3wa5g3ps"; - }; - } - { - goPackagePath = "github.com/xordataexchange/crypt"; - fetch = { - type = "git"; - url = "https://github.com/xordataexchange/crypt"; - rev = "b2862e3d0a77"; - sha256 = "04q3856anpzl4gdfgmg7pbp9cx231nkz3ymq2xp27rnmmwhfxr8y"; - }; - } - { - goPackagePath = "go.etcd.io/bbolt"; - fetch = { - type = "git"; - url = "https://github.com/etcd-io/bbolt"; - rev = "v1.3.3"; - sha256 = "0dn0zngks9xiz0rrrb3911f73ghl64z84jsmzai2yfmzqr7cdkqc"; - }; - } - { - goPackagePath = "golang.org/x/crypto"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/crypto"; - rev = "f99c8df09eb5"; - sha256 = "0jwi6c6366999mnpzwx3a2kr7hzvdx97qfwiphx0r7cy0mpf28hf"; - }; - } - { - goPackagePath = "golang.org/x/image"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/image"; - rev = "cff245a6509b"; - sha256 = "0hiznlkiaay30acwvvyq8g6bm32r7bc6gv47pygrcxqpapasbz84"; - }; - } - { - goPackagePath = "golang.org/x/net"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/net"; - rev = "d98b1b443823"; - sha256 = "1vzwpy56g056dsq304xga3d55jg2cxx89bijpfwjlhwyqyskybsz"; - }; - } - { - goPackagePath = "golang.org/x/sync"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/sync"; - rev = "112230192c58"; - sha256 = "05i2k43j2d0llq768hg5pf3hb2yhfzp9la1w5wp0rsnnzblr0lfn"; - }; - } - { - goPackagePath = "golang.org/x/sys"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/sys"; - rev = "c178f38b412c"; - sha256 = "1r6v8xnvb4z5vdckbj6vd08kn6h4ivr9hvdpgq4drj6l1mp79rf7"; - }; - } - { - goPackagePath = "golang.org/x/text"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/text"; - rev = "v0.3.2"; - sha256 = "0flv9idw0jm5nm8lx25xqanbkqgfiym6619w575p7nrdh0riqwqh"; - }; - } - { - goPackagePath = "golang.org/x/tools"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/tools"; - rev = "72853e10c5a3"; - sha256 = "06v42k857lcivcar3fq8yjc782hny0m5yf20sb7ij5jva0gab026"; - }; - } - { - goPackagePath = "golang.org/x/xerrors"; - fetch = { - type = "git"; - url = "https://go.googlesource.com/xerrors"; - rev = "a985d3407aa7"; - sha256 = "00wzr5w8aadipgc3rkk8f11i41znskfj9ix5nhhaxyg7isrslgcj"; - }; - } - { - goPackagePath = "google.golang.org/appengine"; - fetch = { - type = "git"; - url = "https://github.com/golang/appengine"; - rev = "v1.6.4"; - sha256 = "07r8zj9wk5w33bpmi808xgindqnfpvi4hf7glgcpimlg6n66lsrp"; - }; - } - { - goPackagePath = "gopkg.in/check.v1"; - fetch = { - type = "git"; - url = "https://gopkg.in/check.v1"; - rev = "20d25e280405"; - sha256 = "0k1m83ji9l1a7ng8a7v40psbymxasmssbrrhpdv2wl4rhs0nc3np"; - }; - } - { - goPackagePath = "gopkg.in/yaml.v2"; - fetch = { - type = "git"; - url = "https://gopkg.in/yaml.v2"; - rev = "v2.2.2"; - sha256 = "01wj12jzsdqlnidpyjssmj0r4yavlqy7dwrg7adqd8dicjc4ncsa"; - }; - } -] -- cgit v1.2.3 From c99460e5f739032d7011af5d533072e5189fd0c3 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 13 May 2023 20:57:16 +0200 Subject: ma tools/games: add steam-run --- makefu/2configs/tools/games.nix | 1 + 1 file changed, 1 insertion(+) (limited to 'makefu') diff --git a/makefu/2configs/tools/games.nix b/makefu/2configs/tools/games.nix index 507887cff..57a1dba1e 100644 --- a/makefu/2configs/tools/games.nix +++ b/makefu/2configs/tools/games.nix @@ -9,5 +9,6 @@ wine pkg2zip steam + steam-run ]; } -- cgit v1.2.3 From 0899a30efdbc6c2abe8afa2c0dea5980b33e8769 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 3 Jun 2023 15:17:03 +0200 Subject: ma snake.r: add sound hardware config --- makefu/1systems/snake/config.nix | 2 +- makefu/1systems/snake/hardware-config.nix | 3 ++ makefu/1systems/snake/sound.nix | 51 +++++++++++++++++++++++++++++++ makefu/1systems/snake/source.nix | 1 - makefu/1systems/snake/wifi.nix | 6 ++++ 5 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 makefu/1systems/snake/sound.nix create mode 100644 makefu/1systems/snake/wifi.nix (limited to 'makefu') diff --git a/makefu/1systems/snake/config.nix b/makefu/1systems/snake/config.nix index 1c6068e98..69e347d71 100644 --- a/makefu/1systems/snake/config.nix +++ b/makefu/1systems/snake/config.nix @@ -10,7 +10,7 @@ in { - + # ]; krebs = { enable = true; diff --git a/makefu/1systems/snake/hardware-config.nix b/makefu/1systems/snake/hardware-config.nix index 827c1d3eb..88124f659 100644 --- a/makefu/1systems/snake/hardware-config.nix +++ b/makefu/1systems/snake/hardware-config.nix @@ -2,6 +2,8 @@ { imports = [ + ./wifi.nix + ./sound.nix ]; boot.loader.grub.enable = true; boot.loader.grub.version = 2; @@ -18,4 +20,5 @@ boot.kernelParams = [ "net.ifnames=0" ]; networking.hostId = "0123AABB"; + } diff --git a/makefu/1systems/snake/sound.nix b/makefu/1systems/snake/sound.nix new file mode 100644 index 000000000..452f4b4b1 --- /dev/null +++ b/makefu/1systems/snake/sound.nix @@ -0,0 +1,51 @@ +{ lib, ... }: { + imports = [ + + ]; + nixpkgs.config.allowUnfree = true; + networking.networkmanager.enable = lib.mkForce false; + # sound.enable = true; + #hardware.pulseaudio = { + # enable = true; + # systemWide = true; + # tcp = { + # enable = true; + # anonymousClients.allowAll = true; + # }; + #}; + + #users.users.makefu = { + # extraGroups = [ "pipewire" "audio" ]; + #}; + + + #services.xserver = { + # enable = true; + # # desktopManager.xterm.enable = true; + # desktopManager.xfce = { + # enable = true; + # noDesktop = true; + # }; + + # displayManager.autoLogin = { + # enable = true; + # user = "makefu"; + # }; + #}; + hardware.pulseaudio.enable = lib.mkForce false; + security.rtkit.enable = true; + #services.pipewire = { + # enable = true; + # systemWide = true; + # socketActivation = false; + # alsa.enable = true; + # alsa.support32Bit = true; + # pulse.enable = true; + # config.pipewire-pulse = { + # "pulse.properties"."server.address" = [ "unix:native" "tcp:4713" ]; + # }; + + #}; + + +} diff --git a/makefu/1systems/snake/source.nix b/makefu/1systems/snake/source.nix index b9a32a2c4..8fc2fff2d 100644 --- a/makefu/1systems/snake/source.nix +++ b/makefu/1systems/snake/source.nix @@ -3,5 +3,4 @@ full = true; home-manager = true; hw = true; - disko = true; } diff --git a/makefu/1systems/snake/wifi.nix b/makefu/1systems/snake/wifi.nix new file mode 100644 index 000000000..7e1569010 --- /dev/null +++ b/makefu/1systems/snake/wifi.nix @@ -0,0 +1,6 @@ +{ + networking.wireless = { + enable = true; + networks = import ; + }; +} -- cgit v1.2.3 From bf8facca3679cc15b2ebb73e1c7016c205868f86 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 3 Jun 2023 15:17:54 +0200 Subject: ma cake.r: init config --- makefu/1systems/cake/config.nix | 8 +++++++- makefu/1systems/cake/hardware-config.nix | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'makefu') diff --git a/makefu/1systems/cake/config.nix b/makefu/1systems/cake/config.nix index 8b9812cf4..b9550cb2e 100644 --- a/makefu/1systems/cake/config.nix +++ b/makefu/1systems/cake/config.nix @@ -14,8 +14,15 @@ in { # # # + # # configure your hw: # + + # directly use the alsa device instead of attaching to pulse + + + + ]; krebs = { enable = true; @@ -28,5 +35,4 @@ in { documentation.info.enable = false; documentation.man.enable = false; documentation.nixos.enable = false; - sound.enable = false; } diff --git a/makefu/1systems/cake/hardware-config.nix b/makefu/1systems/cake/hardware-config.nix index a0cd4fac1..932aa1929 100644 --- a/makefu/1systems/cake/hardware-config.nix +++ b/makefu/1systems/cake/hardware-config.nix @@ -10,5 +10,6 @@ options = [ "noatime" ]; }; }; - #hardware.raspberry-pi."4".fkms-3d.enable = true; + hardware.raspberry-pi."4".fkms-3d.enable = true; + hardware.raspberry-pi."4".audio.enable = true; } -- cgit v1.2.3 From dd0a6294c8699640f47127f237104aac9d96c896 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 3 Jun 2023 15:27:17 +0200 Subject: ma x.r: migrate to gnome --- makefu/1systems/x/config.nix | 58 +++++++++++++++++++------------- makefu/1systems/x/x13/battery.nix | 6 ++++ makefu/1systems/x/x13/default.nix | 18 ++++++---- makefu/1systems/x/x13/disk.nix | 67 +++++++++++++++++++++++++++++++++++++ makefu/1systems/x/x13/input.nix | 44 ++++++++++++------------ makefu/2configs/gui/base.nix | 22 ++++++------ makefu/2configs/gui/gnome.nix | 22 ++++++++++++ makefu/2configs/gui/snake-kiosk.nix | 44 ++++++++++++++++++++++++ 8 files changed, 218 insertions(+), 63 deletions(-) create mode 100644 makefu/1systems/x/x13/battery.nix create mode 100644 makefu/1systems/x/x13/disk.nix create mode 100644 makefu/2configs/gui/gnome.nix create mode 100644 makefu/2configs/gui/snake-kiosk.nix (limited to 'makefu') diff --git a/makefu/1systems/x/config.nix b/makefu/1systems/x/config.nix index 3f9e071e6..784f9148f 100644 --- a/makefu/1systems/x/config.nix +++ b/makefu/1systems/x/config.nix @@ -48,6 +48,16 @@ { bits = 4096; path = (toString ); type = "rsa";} ]; } + #{ + # imports = [ + # + # ]; + # services.pipewire.config.pipewire-pulse = { + # "pulse.properties"."server.address" = [ "unix:native" "tcp:4713" ]; + # }; + # networking.firewall.allowedTCPPorts = [ 4713 ]; + + #} #{ # users.users.makefu.packages = with pkgs;[ mpc_cli ncmpcpp ]; @@ -130,7 +140,7 @@ # # # - + # # Krebs @@ -146,7 +156,7 @@ # - + # # Virtualization # @@ -179,6 +189,7 @@ # temporary # { services.redis.enable = true; } + # citadel exporter # { services.mongodb.enable = true; } # { services.elasticsearch.enable = true; } # @@ -189,27 +200,28 @@ # # # - - { - networking.wireguard.interfaces.wg0 = { - ips = [ "10.244.0.2/24" ]; - privateKeyFile = (toString ) + "/wireguard.key"; - allowedIPsAsRoutes = true; - peers = [ - { - # gum - endpoint = "${config.krebs.hosts.gum.nets.internet.ip4.addr}:51820"; - allowedIPs = [ "10.244.0.0/24" ]; - publicKey = "yAKvxTvcEVdn+MeKsmptZkR3XSEue+wSyLxwcjBYxxo="; - } - #{ - # # vbob - # allowedIPs = [ "10.244.0.3/32" ]; - # publicKey = "Lju7EsCu1OWXhkhdNR7c/uiN60nr0TUPHQ+s8ULPQTw="; - #} - ]; - }; - } + + +# { +# networking.wireguard.interfaces.wg0 = { +# ips = [ "10.244.0.2/24" ]; +# privateKeyFile = (toString ) + "/wireguard.key"; +# allowedIPsAsRoutes = true; +# peers = [ +# { +# # gum +# endpoint = "${config.krebs.hosts.gum.nets.internet.ip4.addr}:51820"; +# allowedIPs = [ "10.244.0.0/24" ]; +# publicKey = "yAKvxTvcEVdn+MeKsmptZkR3XSEue+wSyLxwcjBYxxo="; +# } +# #{ +# # # vbob +# # allowedIPs = [ "10.244.0.3/32" ]; +# # publicKey = "Lju7EsCu1OWXhkhdNR7c/uiN60nr0TUPHQ+s8ULPQTw="; +# #} +# ]; +# }; +# } ]; diff --git a/makefu/1systems/x/x13/battery.nix b/makefu/1systems/x/x13/battery.nix new file mode 100644 index 000000000..3e28292e3 --- /dev/null +++ b/makefu/1systems/x/x13/battery.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: +{ + powerManagement.powertop.enable = true; + services.power-profiles-daemon.enable = true; + users.users.makefu.packages = [ pkgs.gnome.gnome-power-manager ]; +} diff --git a/makefu/1systems/x/x13/default.nix b/makefu/1systems/x/x13/default.nix index d652229f9..27ea0c99c 100644 --- a/makefu/1systems/x/x13/default.nix +++ b/makefu/1systems/x/x13/default.nix @@ -4,6 +4,7 @@ imports = [ ./zfs.nix ./input.nix + ./battery.nix # close enough # @@ -17,23 +18,26 @@ # services.xserver.enable = lib.mkForce false; - services.xserver.videoDrivers = [ - "amdgpu" + services.xserver.videoDrivers = [ "amdgpu" ]; + boot.initrd.kernelModules = [ "amdgpu" ]; + hardware.opengl.driSupport = true; + hardware.opengl.extraPackages = [ pkgs.amdvlk pkgs.rocm-opencl-icd pkgs.rocm-opencl-runtime ]; + # For 32 bit applications + hardware.opengl.driSupport32Bit = true; + hardware.opengl.extraPackages32 = with pkgs; [ + driversi686Linux.amdvlk ]; - hardware.opengl.extraPackages = [ pkgs.amdvlk pkgs.rocm-opencl-icd ]; # is required for amd graphics support ( xorg wont boot otherwise ) #boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelPackages = lib.mkForce pkgs.linuxPackages; - environment.variables.VK_ICD_FILENAMES = - "/run/opengl-driver/share/vulkan/icd.d/amd_icd64.json"; - services.fwupd.enable = true; programs.light.enable = true; users.groups.video = {}; - users.users.makefu.extraGroups = [ "video" ]; + users.groups.render = {}; + users.users.makefu.extraGroups = [ "video" "render" ]; boot.extraModprobeConfig = '' options thinkpad_acpi fan_control=1 diff --git a/makefu/1systems/x/x13/disk.nix b/makefu/1systems/x/x13/disk.nix new file mode 100644 index 000000000..7ce77bdf5 --- /dev/null +++ b/makefu/1systems/x/x13/disk.nix @@ -0,0 +1,67 @@ +{ disk ? "/dev/sda", ... }: { + disko.devices = { + disk = { + nvme = { + type = "disk"; + device = disk; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + name = "ESP"; + start = "0"; + end = "512MiB"; + fs-type = "fat32"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + name = "zfs"; + start = "512MiB"; + end = "100%"; + content = { + type = "zfs"; + pool = "tank"; + }; + } + ]; + }; + }; + }; + zpool = { + tank = { + type = "zpool"; + rootFsOptions = { + compression = "lz4"; + #reservation = "5G"; + "com.sun:auto-snapshot" = "false"; + }; + mountpoint = null; + postCreateHook = "zfs snapshot tank@blank"; + + datasets = { + + root = { + type = "zfs_fs"; + mountpoint = "/"; + options = { + encryption = "aes-256-gcm"; + keyformat = "passphrase"; + "com.sun:auto-snapshot" = "true"; + }; + #keylocation = "file:///tmp/secret.key"; + }; + "root/home" = { + type = "zfs_fs"; + mountpoint = "/home"; + }; + }; + }; + }; + }; +} diff --git a/makefu/1systems/x/x13/input.nix b/makefu/1systems/x/x13/input.nix index 775e19303..93816ce84 100644 --- a/makefu/1systems/x/x13/input.nix +++ b/makefu/1systems/x/x13/input.nix @@ -4,14 +4,16 @@ # 1. for pressing insert hold shift+fn+Fin # scroll by holding middle mouse - services.xserver.displayManager.sessionCommands ='' - xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation" 8 1 - xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Button" 8 2 - xinput set-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5 - # configure timeout of pressing and holding middle button - # xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Timeout" 8 200 - xinput disable 'ETPS/2 Elantech Touchpad' - ''; + #services.xserver.displayManager.sessionCommands ='' + # xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation" 8 1 + # xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Button" 8 2 + # xinput set-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5 + # # configure timeout of pressing and holding middle button + # # xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Timeout" 8 200 + # xinput disable 'ETPS/2 Elantech Touchpad' + #''; + + services.xserver.libinput.enable = true; boot.kernelParams = [ #"psmouse.proto=imps" #"psmouse.proto=bare" @@ -27,20 +29,20 @@ { keys = [ 224 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -U 10"; } # fn - F6 # fn - 4 => suspend # fn - d => lcdshadow - { keys = [ 227 ]; events = [ "key" ]; command = builtins.toString ( # fn - F7 - pkgs.writers.writeDash "toggle_touchpad" '' - PATH=${lib.makeBinPath [ pkgs.xorg.xinput pkgs.gnugrep ]} - DISPLAY=:0 - export DISPLAY PATH + #{ keys = [ 227 ]; events = [ "key" ]; command = builtins.toString ( # fn - F7 + # pkgs.writers.writeDash "toggle_touchpad" '' + # PATH=${lib.makeBinPath [ pkgs.xorg.xinput pkgs.gnugrep ]} + # DISPLAY=:0 + # export DISPLAY PATH - device=$(xinput list --name-only | grep Touchpad) - if [ "$(xinput list-props "$device" | grep -P ".*Device Enabled.*\K.(?=$)" -o)" -eq 1 ];then - xinput disable "$device" - else - xinput enable "$device" - fi - ''); - } + # device=$(xinput list --name-only | grep Touchpad) + # if [ "$(xinput list-props "$device" | grep -P ".*Device Enabled.*\K.(?=$)" -o)" -eq 1 ];then + # xinput disable "$device" + # else + # xinput enable "$device" + # fi + # ''); + #} ]; }; } diff --git a/makefu/2configs/gui/base.nix b/makefu/2configs/gui/base.nix index b2192c7f9..b1b7c9913 100644 --- a/makefu/2configs/gui/base.nix +++ b/makefu/2configs/gui/base.nix @@ -18,30 +18,28 @@ in imports = [ ./urxvtd.nix ./pipewire.nix + ./gnome.nix ]; + # services.redshift.enable = true; services.xserver = { enable = true; layout = "us"; xkbVariant = "altgr-intl"; xkbOptions = "ctrl:nocaps, eurosign:e"; - windowManager = { - awesome.enable = true; - awesome.noArgb = true; - awesome.luaModules = [ pkgs.luaPackages.vicious ]; - }; - displayManager.defaultSession = lib.mkDefault "none+awesome"; - displayManager.autoLogin = { - enable = true; - user = mainUser; - }; +# windowManager = { +# awesome.enable = true; +# awesome.noArgb = true; +# awesome.luaModules = [ pkgs.luaPackages.vicious ]; +# }; +# displayManager.defaultSession = lib.mkDefault "none+awesome"; }; environment.systemPackages = [ pkgs.gnome.adwaita-icon-theme ]; # lid switch is handled via button presses - services.logind.lidSwitch = lib.mkDefault "ignore"; - makefu.awesome.enable = true; + # services.logind.lidSwitch = lib.mkDefault "ignore"; + #makefu.awesome.enable = true; console.font = "Lat2-Terminus16"; fonts = { diff --git a/makefu/2configs/gui/gnome.nix b/makefu/2configs/gui/gnome.nix new file mode 100644 index 000000000..e6eff29f4 --- /dev/null +++ b/makefu/2configs/gui/gnome.nix @@ -0,0 +1,22 @@ +{ config, lib, pkgs, ... }: + +let + mainUser = config.krebs.build.user.name; +in +{ + programs.gnome-terminal.enable = true; + services.xserver = { + desktopManager.gnome.enable = true; + displayManager.gdm.enable = true; + #displayManager.autoLogin = { + # enable = true; + # user = mainUser; + #}; + }; + home-manager.users.${mainUser}.services.gammastep = { + enable = true; + provider = "manual"; + latitude = config.location.latitude; + longitude = config.location.longitude; + }; +} diff --git a/makefu/2configs/gui/snake-kiosk.nix b/makefu/2configs/gui/snake-kiosk.nix new file mode 100644 index 000000000..838ac3a5c --- /dev/null +++ b/makefu/2configs/gui/snake-kiosk.nix @@ -0,0 +1,44 @@ +{ pkgs, lib, ... }: +{ + + imports = [ + ./base.nix + ]; + users.users.kiosk = { + # packages = [ pkgs.chromium pkgs.vscode ]; + group = "kiosk"; + isNormalUser = true; + uid = 1003; + extraGroups = [ "wheel" "audio" "pulse" "pipewire" ]; + }; + users.groups.kiosk.gid = 989 ; + services.xserver = { + enable = true; + + windowManager = lib.mkForce { awesome.enable = false; }; + displayManager.gdm.enable = true; + displayManager.gdm.autoSuspend = false; + displayManager.autoLogin = { + enable = true; + user = lib.mkForce "kiosk"; + }; + displayManager.defaultSession = "gnome"; + desktopManager.gnome.enable = true; + }; + + systemd.targets.sleep.enable = false; + systemd.targets.suspend.enable = false; + systemd.targets.hibernate.enable = false; + systemd.targets.hybrid-sleep.enable = false; + + + + environment.systemPackages = [ pkgs.gnomeExtensions.appindicator ]; + services.dbus.packages = with pkgs; [ gnome2.GConf gnome3.gnome-settings-daemon ]; + + services.pipewire.systemWide = lib.mkForce false; + services.pipewire.config.pipewire-pulse = { + "pulse.properties"."server.address" = [ "unix:native" "tcp:4713" ]; + }; + +} -- cgit v1.2.3 From be3284417942c0164c1b32c9cf34ba44bcfb86c3 Mon Sep 17 00:00:00 2001 From: makefu Date: Sat, 3 Jun 2023 15:27:46 +0200 Subject: ma home: deploy home-assistant via docker --- makefu/2configs/home/3dprint.nix | 6 +- .../2configs/home/ham/automation/light_buttons.nix | 28 +++- makefu/2configs/home/ham/automation/urlaub.nix | 6 +- makefu/2configs/home/ham/automation/welcome.txt.j2 | 2 +- makefu/2configs/home/ham/default.nix | 2 + makefu/2configs/home/ham/docker.nix | 30 ++++ makefu/2configs/home/ham/intents/default.nix | 35 +++++ .../2configs/home/ham/intents/music_chooser.txt.j2 | 13 ++ .../2configs/home/ham/intents/statusbericht.txt.j2 | 37 +++++ makefu/2configs/home/ham/lib/default.nix | 5 +- makefu/2configs/home/ham/light/wohnzimmer.nix | 27 +++- makefu/2configs/home/ham/media/firetv.nix | 22 +-- makefu/2configs/home/ham/mqtt.nix | 2 +- makefu/2configs/home/ham/multi/kurzzeitwecker.nix | 172 ++++++++------------- makefu/2configs/home/ham/sensor/outside.nix | 11 ++ makefu/2configs/home/jellyfin.nix | 72 +++------ makefu/2configs/home/music.nix | 3 +- makefu/2configs/home/photoprism.nix | 7 +- makefu/2configs/home/rhasspy/default.nix | 40 +++++ makefu/2configs/home/rhasspy/led-control.nix | 23 +++ makefu/2configs/home/zigbee2mqtt/default.nix | 4 + 21 files changed, 354 insertions(+), 193 deletions(-) create mode 100644 makefu/2configs/home/ham/docker.nix create mode 100644 makefu/2configs/home/ham/intents/default.nix create mode 100644 makefu/2configs/home/ham/intents/music_chooser.txt.j2 create mode 100644 makefu/2configs/home/ham/intents/statusbericht.txt.j2 create mode 100644 makefu/2configs/home/rhasspy/default.nix create mode 100644 makefu/2configs/home/rhasspy/led-control.nix (limited to 'makefu') diff --git a/makefu/2configs/home/3dprint.nix b/makefu/2configs/home/3dprint.nix index 09f2ce6fd..aac962787 100644 --- a/makefu/2configs/home/3dprint.nix +++ b/makefu/2configs/home/3dprint.nix @@ -1,8 +1,12 @@ { pkgs, ... }: +let + #dev = "/dev/web_cam"; + dev = "/dev/video0"; +in { services.mjpg-streamer = { enable = true; - inputPlugin = "input_uvc.so -d /dev/web_cam -r 1280x960"; + inputPlugin = "input_uvc.so -d ${dev} -r 1280x960"; }; users.users.octoprint.extraGroups = [ "video" ]; # allow octoprint to access /dev/vchiq diff --git a/makefu/2configs/home/ham/automation/light_buttons.nix b/makefu/2configs/home/ham/automation/light_buttons.nix index 1892917c4..460d48bc4 100644 --- a/makefu/2configs/home/ham/automation/light_buttons.nix +++ b/makefu/2configs/home/ham/automation/light_buttons.nix @@ -1,10 +1,12 @@ let inherit (import ../lib) btn_cycle_light; + schlafzimmer_komode = "light.schlafzimmer_komode_osram"; + schlafzimmer_button = "sensor.schlafzimmer_btn2_click"; in { services.home-assistant.config.automation = [ # (btn_cycle_light "light.arbeitszimmerbeleuchtung" "arbeitszimmer_btn1") - (btn_cycle_light "light.schlafzimmer_komode_osram" "schlafzimmer_btn2" 128) + { alias = "toggle keller"; trigger = { @@ -32,21 +34,35 @@ in { service = "light.toggle"; data = { entity_id = "light.keller_osram"; - brightness = 50; + brightness = 25; }; }; } # (btn_cycle_light "light.wohnzimmerbeleuchtung" "wohnzimmer_btn3") { - alias = "Turn of all lights via schlafzimmer_btn2 double click"; + alias = "Dim Toggle schlafzimmer komode"; trigger = { platform = "state"; - entity_id = "sensor.schlafzimmer_btn2_click"; + entity_id = schlafzimmer_button; + to = "single"; + }; + action = { + service = "light.toggle"; + entity_id = schlafzimmer_komode; + brightness = 1; + }; + } + { + alias = "Bright Toggle schlafzimmer komode"; + trigger = { + platform = "state"; + entity_id = schlafzimmer_button; to = "double"; }; action = { - service = "light.turn_off"; - entity_id = "all"; + service = "light.toggle"; + entity_id = schlafzimmer_komode; + brightness = 255; }; } ]; diff --git a/makefu/2configs/home/ham/automation/urlaub.nix b/makefu/2configs/home/ham/automation/urlaub.nix index 019e65d25..abfe5031d 100644 --- a/makefu/2configs/home/ham/automation/urlaub.nix +++ b/makefu/2configs/home/ham/automation/urlaub.nix @@ -6,7 +6,7 @@ let schranklicht = [ "light.wohnzimmer_schrank_osram" - "light.wohnzimmer_komode_osram" + # "light.wohnzimmer_komode_osram" ]; weihnachtslicht = "light.wohnzimmer_fenster_lichterkette_licht"; fernsehlicht = "light.wled"; @@ -31,8 +31,8 @@ in automation = [ (turn_on schranklicht "-00:30:00") - #(turn_on weihnachtslicht "-00:30:00") - (turn_on fernsehlicht "-00:00:00") + (turn_on weihnachtslicht "-00:00:00") + #(turn_on fernsehlicht "-00:00:00") { alias = "Always turn off the urlaub lights at ${final_off}"; trigger = [ diff --git a/makefu/2configs/home/ham/automation/welcome.txt.j2 b/makefu/2configs/home/ham/automation/welcome.txt.j2 index 76091b868..d2a2b573b 100644 --- a/makefu/2configs/home/ham/automation/welcome.txt.j2 +++ b/makefu/2configs/home/ham/automation/welcome.txt.j2 @@ -7,7 +7,7 @@ Heute ist {{ weekday }}, du solltest gar nicht arbeiten! {% else %} Willkommen auf Arbeit Felix. {% endif -%} -Das aktuell gewählte Projekt ist {{ states("sensor.felix_project") }}. +Dein Projekt ist {{ states("sensor.felix_project") }}. {% set inside = states("sensor.wohnzimmer_temp_temperature") | float | round(2) -%} {% set outside = states("sensor.dark_sky_temperature") | float | round(2) -%} diff --git a/makefu/2configs/home/ham/default.nix b/makefu/2configs/home/ham/default.nix index ca5fcd17c..98269959d 100644 --- a/makefu/2configs/home/ham/default.nix +++ b/makefu/2configs/home/ham/default.nix @@ -17,6 +17,7 @@ in { ./zigbee2mqtt.nix # ./multi/flurlicht.nix ./multi/kurzzeitwecker.nix + ./intents ./multi/the_playlist.nix ./multi/heizung.nix # ./multi/fliegen-couter.nix @@ -92,6 +93,7 @@ in { { type = "homeassistant"; } ]; }; + tasmota = {}; binary_sensor = [ { platform = "workday"; name = "Arbeitstag"; diff --git a/makefu/2configs/home/ham/docker.nix b/makefu/2configs/home/ham/docker.nix new file mode 100644 index 000000000..e8a47dbbb --- /dev/null +++ b/makefu/2configs/home/ham/docker.nix @@ -0,0 +1,30 @@ +{ config, pkgs, lib, ... }: +let + confdir = "/var/lib/homeassistant-docker"; +in { + imports = [ + ./nginx.nix + ./mqtt.nix + ./signal-rest + ./signal-rest/service.nix + ]; + + networking.firewall.allowedTCPPorts = [ 8123 ]; + state = [ "/var/lib/hass/known_devices.yaml" ]; + virtualisation.oci-containers.containers.hass = { + image = "homeassistant/home-assistant:latest"; + environment = { + TZ = "Europe/Berlin"; + UMASK = "007"; + }; + extraOptions = ["--net=host" ]; + volumes = [ + "${confdir}:/config" + #"/data/music:/config/media" + ]; + }; + systemd.tmpfiles.rules = [ + #"f ${confdir}/docker-run 0770 kiosk kiosk - -" + "d ${confdir} 0770 kiosk kiosk - -" + ]; +} diff --git a/makefu/2configs/home/ham/intents/default.nix b/makefu/2configs/home/ham/intents/default.nix new file mode 100644 index 000000000..24594b4a2 --- /dev/null +++ b/makefu/2configs/home/ham/intents/default.nix @@ -0,0 +1,35 @@ +{ + services.home-assistant.config = { + intent_script = { + GetTime.speech.text = '' + Es ist {{ now().hour }} Uhr {{ now().minute }} + ''; + GutenMorgen.speech.text = '' + Einen wunderschönen Guten Morgen wünsche ich dir + ''; + WieGehtEsDir.speech.text = '' + Mir geht es sehr gut, und dir? + ''; + Statusreport.speech.text = builtins.readFile ./statusbericht.txt.j2; + StartMusic = { + speech.text = "Spiele {{ music }} musik"; + action_async = [ + { + service = "media_player.play_media"; + data_template = { + entity_id = "media_player.{{ _intent.siteId }}"; + media_content_id = builtins.readFile ./music_chooser.txt.j2; + media_content_type = "music"; + }; + } + ]; + }; + GetWeather = { + #speech.text = '' + # {{ states('sensor.openweathermap_weather') }} bei {{ states('sensor.openweathermap_temperature') }} Grad + #''; + speech.text = "{{ states('sensor.swr_prognose') }}"; + }; + }; + }; +} diff --git a/makefu/2configs/home/ham/intents/music_chooser.txt.j2 b/makefu/2configs/home/ham/intents/music_chooser.txt.j2 new file mode 100644 index 000000000..b66ed2721 --- /dev/null +++ b/makefu/2configs/home/ham/intents/music_chooser.txt.j2 @@ -0,0 +1,13 @@ +{% if music == "lounge" -