From db80207267dd750d6e5fce0a4c15961aa324627b Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 16 Dec 2020 16:10:08 +0100 Subject: ma anon-sftp: init --- makefu/2configs/ham/light/groups.nix | 41 ------------------------------ makefu/2configs/ham/light/schlafzimmer.nix | 41 ++++++++++++++++++++++++++++++ makefu/2configs/share/anon-sftp.nix | 25 ++++++++++++++++++ 3 files changed, 66 insertions(+), 41 deletions(-) delete mode 100644 makefu/2configs/ham/light/groups.nix create mode 100644 makefu/2configs/ham/light/schlafzimmer.nix create mode 100644 makefu/2configs/share/anon-sftp.nix (limited to 'makefu') diff --git a/makefu/2configs/ham/light/groups.nix b/makefu/2configs/ham/light/groups.nix deleted file mode 100644 index 274fd60a..00000000 --- a/makefu/2configs/ham/light/groups.nix +++ /dev/null @@ -1,41 +0,0 @@ -let - arbeitszimmer_licht = [ - "light.led_wand" - "light.arbeitszimmer_led1_led_strip" # LED-Kreis in cube - "light.arbeitszimmer_flur_osram_light" - "light.arbeitszimmer_schrank_dimmer_light" - "light.arbeitszimmer_schrank_osram_light" - ]; - wohnzimmer_licht = [ - "light.wohnzimmer_fernseher_led_strip" # led um fernseher - "light.wohnzimmer_komode_osram_light" - "light.wohnzimmer_schrank_osram_light" - "light.wohnzimmer_stehlampe_osram_light" - ]; - schlafzimmer_licht = [ - "light.schlafzimmer_komode_osram_light" - ]; -in { - services.home-assistant.config.light = [ - { - platform = "group"; - name = "Arbeitszimmer Lichter"; - entities = arbeitszimmer_licht; - } - { - platform = "group"; - name = "Wohnzimmer Lichter"; - entities = wohnzimmer_licht; - } - { - platform = "group"; - name = "Schlafzimmer Lichter"; - entities = schlafzimmer_licht; - } - { - platform = "group"; - name = "Alle Lichter"; - entities = arbeitszimmer_licht ++ wohnzimmer_licht ++ schlafzimmer_licht; - } - ]; -} diff --git a/makefu/2configs/ham/light/schlafzimmer.nix b/makefu/2configs/ham/light/schlafzimmer.nix new file mode 100644 index 00000000..274fd60a --- /dev/null +++ b/makefu/2configs/ham/light/schlafzimmer.nix @@ -0,0 +1,41 @@ +let + arbeitszimmer_licht = [ + "light.led_wand" + "light.arbeitszimmer_led1_led_strip" # LED-Kreis in cube + "light.arbeitszimmer_flur_osram_light" + "light.arbeitszimmer_schrank_dimmer_light" + "light.arbeitszimmer_schrank_osram_light" + ]; + wohnzimmer_licht = [ + "light.wohnzimmer_fernseher_led_strip" # led um fernseher + "light.wohnzimmer_komode_osram_light" + "light.wohnzimmer_schrank_osram_light" + "light.wohnzimmer_stehlampe_osram_light" + ]; + schlafzimmer_licht = [ + "light.schlafzimmer_komode_osram_light" + ]; +in { + services.home-assistant.config.light = [ + { + platform = "group"; + name = "Arbeitszimmer Lichter"; + entities = arbeitszimmer_licht; + } + { + platform = "group"; + name = "Wohnzimmer Lichter"; + entities = wohnzimmer_licht; + } + { + platform = "group"; + name = "Schlafzimmer Lichter"; + entities = schlafzimmer_licht; + } + { + platform = "group"; + name = "Alle Lichter"; + entities = arbeitszimmer_licht ++ wohnzimmer_licht ++ schlafzimmer_licht; + } + ]; +} diff --git a/makefu/2configs/share/anon-sftp.nix b/makefu/2configs/share/anon-sftp.nix new file mode 100644 index 00000000..7cde9317 --- /dev/null +++ b/makefu/2configs/share/anon-sftp.nix @@ -0,0 +1,25 @@ +{ config, lib, pkgs, ... }: + +with import ; +{ + services.openssh = { + allowSFTP = true; + sftpFlags = [ "-l VERBOSE" ]; + extraConfig = '' + Match User anonymous + ForceCommand internal-sftp + AllowTcpForwarding no + X11Forwarding no + PasswordAuthentication no + ''; + }; + + users.users.anonymous = { + uid = genid "anonymous"; + useDefaultShell = false; + password = "anonymous"; + home = "/media/anon"; + createHome = true; + }; + +} -- cgit v1.2.3