ctucx.git: nixfiles

ctucx' nixfiles

commit 74b04b7e67cbf1e7e783a987f96c5d317ed4f159
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sat, 9 Oct 2021 15:03:34 +0200

init
37 files changed, 1300 insertions(+), 0 deletions(-)
A
configuration.nix
|
1
+
A
configurations/common.nix
|
86
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
configurations/desktop-sway.nix
|
61
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
configurations/fonts.nix
|
18
++++++++++++++++++
A
configurations/gtk.nix
|
29
+++++++++++++++++++++++++++++
A
configurations/mobile-device.nix
|
47
+++++++++++++++++++++++++++++++++++++++++++++++
A
configurations/programs/alacritty.nix
|
54
++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
configurations/programs/archbox.nix
|
32
++++++++++++++++++++++++++++++++
A
configurations/programs/cli/bash.nix
|
35
+++++++++++++++++++++++++++++++++++
A
configurations/programs/cli/git.nix
|
27
+++++++++++++++++++++++++++
A
configurations/programs/cli/micro.nix
|
18
++++++++++++++++++
A
configurations/programs/cli/password-store.nix
|
9
+++++++++
A
configurations/programs/cli/ssh.nix
|
17
+++++++++++++++++
A
configurations/programs/cli/starship.nix
|
15
+++++++++++++++
A
configurations/programs/cli/tmux.nix
|
12
++++++++++++
A
configurations/programs/cli/utilities.nix
|
38
++++++++++++++++++++++++++++++++++++++
A
configurations/programs/firefox.nix
|
23
+++++++++++++++++++++++
A
configurations/programs/gammastep.nix
|
17
+++++++++++++++++
A
configurations/programs/gvfs.nix
|
7
+++++++
A
configurations/programs/mako.nix
|
27
+++++++++++++++++++++++++++
A
configurations/programs/physlock.nix
|
7
+++++++
A
configurations/programs/pipewire.nix
|
18
++++++++++++++++++
A
configurations/programs/sway.nix
|
205
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
configurations/programs/syncthing.nix
|
9
+++++++++
A
configurations/programs/thunar.nix
|
17
+++++++++++++++++
A
configurations/programs/thunderbird.nix
|
9
+++++++++
A
configurations/programs/usbmuxd.nix
|
9
+++++++++
A
configurations/programs/utilities.nix
|
9
+++++++++
A
configurations/programs/waybar/default.nix
|
134
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
configurations/programs/waybar/style.css
|
58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
configurations/programs/wofi/config
|
6
++++++
A
configurations/programs/wofi/style.css
|
46
++++++++++++++++++++++++++++++++++++++++++++++
A
configurations/qt.nix
|
10
++++++++++
A
configurations/xdg.nix
|
54
++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
configurations/yubikey.nix
|
47
+++++++++++++++++++++++++++++++++++++++++++++++
A
machines/briefkasten/configuration.nix
|
58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
machines/briefkasten/hardware-configuration.nix
|
31
+++++++++++++++++++++++++++++++
diff --git a/configuration.nix b/configuration.nix
@@ -0,0 +1 @@
+with (import <nixpkgs> {}).lib; import "${toString ./.}/machines/${fileContents /etc/hostname}/configuration.nix"
diff --git a/configurations/common.nix b/configurations/common.nix
@@ -0,0 +1,86 @@
+{ config, pkgs, lib, ... }:
+
+{
+  imports = [
+    <home-manager/nixos>
+    ./programs/cli/bash.nix
+    ./programs/cli/git.nix
+    ./programs/cli/micro.nix
+    ./programs/cli/ssh.nix
+    ./programs/cli/tmux.nix
+    ./programs/cli/utilities.nix
+  ];
+
+  home-manager.useGlobalPkgs = true;
+
+  nix = {
+    trustedUsers      = [ "@wheel" ];
+    autoOptimiseStore = true;
+    optimise     = {
+      automatic = true;
+    };
+    gc           = {
+      automatic = true;
+      options   = "--delete-older-than 3d";
+    };
+  };
+
+  i18n.defaultLocale  = "en_US.UTF-8";
+  time.timeZone       = "Europe/Berlin";
+
+  services = {
+    timesyncd.enable = true;
+    vnstat.enable    = true;
+    fstrim.enable    = true;
+
+    journald.extraConfig = "SystemMaxUse=1G";
+
+    nginx = {
+      recommendedGzipSettings  = true;
+      recommendedOptimisation  = true;
+      recommendedProxySettings = true;
+      recommendedTlsSettings   = true;
+      appendHttpConfig = ''
+        server_names_hash_bucket_size 64;
+      '';
+    };
+
+    openssh = {
+      enable                          = true;
+      ports                           = [ 22 ];
+      passwordAuthentication          = true;
+      challengeResponseAuthentication = false;
+      permitRootLogin                 = "without-password";
+    };
+  };
+
+  security = {
+    acme.acceptTerms = true;
+    acme.email       = "letsencrypt@ctu.cx";
+  };
+
+  environment.systemPackages = with pkgs; [
+    alacritty.terminfo
+ ];
+
+  users.users = {
+    leah = {
+      isNormalUser                  = true;
+      initialPassword               = "foobar123";
+      openssh.authorizedKeys.keys   = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCw/G6x8H3ojvHx3NsTswBMMmOhp48F3rea0GUniKSvRLMRIti5b7Q4P4FXnkQEtuNSR3u7gE5r4EacaLaIx7Az9SgHRoE+hdzSo4mPAwKTx/E3HZgIjdZhTDL8PAn4SZZT6RBqr/uGb+x9fdIjY0FbdNBLjq0MNnG3T+qd1joUL8JXoS7F//ac52RhHlsA5qJXFDOhpqR/7hRMwOFNH0GKaLN1xQKcOjhpIcdswpOf8kRDVpT7xOYwfXCFF4MaY2M8047WKarvEnGdADIIw6bvWsdJINehtOQmYEFRaMuaWp1d9bglZXZKPQKNubv5lqneMP4AI7ImDYjgW6eNLIT1 cardno:000603502829" ];
+      extraGroups                   = [ "wheel" ]; # Enable ‘sudo’ for the user.
+    };
+  };
+
+  home-manager.users.leah = {
+    home = {
+      language = {
+        "base"     = "en_US.UTF-8";
+        "time"     = "de_DE.utf8";
+        "address"  = "de_DE.utf8";
+        "monetary" = "de_DE.utf8";
+        "paper"    = "de_DE.utf8";
+      };
+    };
+  };
+}
diff --git a/configurations/desktop-sway.nix b/configurations/desktop-sway.nix
@@ -0,0 +1,61 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  nixpkgs.config.allowUnfree = true;
+  environment.noXlibs        = false;
+
+  hardware = {
+    opengl = {
+      enable     = true;
+      driSupport = true;
+    };
+
+    trackpoint = {
+      enable       = true;
+      emulateWheel = true;
+#      speed        = 80;
+#      sensitivity  = 100;
+    };
+  };
+
+  services = {
+    nscd.enable         = true;
+    getty.autologinUser = "leah";
+  };
+
+  users.users.leah.extraGroups = [ "dialout" ];
+
+  home-manager.users.leah = {
+    manual.html.enable = true;
+  };
+
+  imports = [
+    ./fonts.nix
+    ./gtk.nix
+    ./qt.nix
+    ./xdg.nix
+
+    ./yubikey.nix
+
+    ./programs/cli/password-store.nix
+
+    ./programs/pipewire.nix
+    ./programs/physlock.nix
+    ./programs/usbmuxd.nix
+
+    ./programs/gammastep.nix
+
+    ./programs/sway.nix
+    ./programs/waybar
+    ./programs/mako.nix
+    ./programs/alacritty.nix
+
+	./programs/firefox.nix
+	./programs/thunderbird.nix
+
+	./programs/thunar.nix
+	./programs/utilities.nix
+
+    ./programs/syncthing.nix
+  ];
+}
diff --git a/configurations/fonts.nix b/configurations/fonts.nix
@@ -0,0 +1,18 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  fonts = {
+    fontconfig.enable      = true;
+    fontDir.enable         = true;
+    enableGhostscriptFonts = true;
+    enableDefaultFonts     = true;
+    fonts = with pkgs; [
+      dejavu_fonts
+      liberation_ttf
+      noto-fonts
+      noto-fonts-emoji
+      font-awesome_4
+      fira-code
+    ];
+  };
+}
diff --git a/configurations/gtk.nix b/configurations/gtk.nix
@@ -0,0 +1,29 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  services.dbus.packages = with pkgs; [ gnome3.dconf ];
+  home-manager.users.leah = {
+
+    gtk = {
+      enable = true;
+
+      iconTheme = {
+        name    = "Adwaita";
+        package = pkgs.gnome3.adwaita-icon-theme;
+      };
+
+      font   = {
+        name    = "Dejavu Sans";
+        package = pkgs.dejavu_fonts;
+      };
+
+      gtk3 = {
+        #bookmarks
+        extraConfig  = {
+          gtk-application-prefer-dark-theme = true;
+        };
+      };
+    };
+
+  };
+}
diff --git a/configurations/mobile-device.nix b/configurations/mobile-device.nix
@@ -0,0 +1,47 @@
+{ config, lib, pkgs, ... }:
+
+{
+  powerManagement = {
+    enable          = true;
+    cpuFreqGovernor = lib.mkDefault "powersave";
+  };
+
+  services = {
+    tlp = {
+      enable = true;
+      settings = {
+        CPU_SCALING_GOVERNOR_ON_AC   = "performance";
+        CPU_SCALING_GOVERNOR_ON_BAT  = "powersave";
+
+        START_CHARGE_THRESH_BAT0     = 95;
+        STOP_CHARGE_THRESH_BAT0      = 100;
+
+
+        CPU_SCALING_MIN_FREQ_ON_AC   = 800000;
+        CPU_SCALING_MAX_FREQ_ON_AC   = 3500000;
+        CPU_SCALING_MIN_FREQ_ON_BAT  = 800000;
+        CPU_SCALING_MAX_FREQ_ON_BAT  = 2000000;
+
+        SOUND_POWER_SAVE_ON_AC       = 0;
+        SOUND_POWER_SAVE_ON_BAT      = 1;
+
+        RUNTIME_PM_ON_AC             = "on";
+        RUNTIME_PM_ON_BAT            = "auto";
+
+        NATACPI_ENABLE               = 1;
+        TPACPI_ENABLE                = 1;
+        TPSMAPI_ENABLE               = 1;
+      };
+    };
+
+    upower.enable                 = true;
+
+    logind.lidSwitch              = "lock";
+    logind.lidSwitchExternalPower = "ignore";
+    logind.extraConfig = ''
+       HandlePowerKey=suspend
+    '';
+
+    throttled.enable              = true;
+  };
+}
diff --git a/configurations/programs/alacritty.nix b/configurations/programs/alacritty.nix
@@ -0,0 +1,54 @@
+{ lib, config, pkgs, ... }:
+
+{
+  home-manager.users.leah = {
+    home = {
+      sessionVariables = {
+        TERMINAL      = "alacritty";
+      };
+    };
+
+    programs = {
+      alacritty = {
+        enable = true;
+        settings = {
+          background_opacity = 0.9;
+
+          font.normal = {
+            family = "DejaVu Sans Mono";
+            size = 9.0;
+          };
+
+          colors = {
+            primary = {
+              background = "0x000000";
+              foreground = "0xeaeaea";
+            };
+
+            normal = {
+              black =   "0x6c6c6c";
+              red =     "0xe9897c";
+              green =   "0xb6e77d";
+              yellow =  "0xecebbe";
+              blue =    "0xa9cdeb";
+              magenta = "0xea96eb";
+              cyan =    "0xc9caec";
+              white =   "0xf2f2f2";
+            };
+
+            bright = {
+              black =   "0x747474";
+              red =     "0xf99286";
+              green =   "0xc3f786";
+              yellow =  "0xfcfbcc";
+              blue =    "0xb6defb";
+              magenta = "0xfba1fb";
+              cyan =    "0xd7d9fc";
+              white =   "0xe2e2e2";
+            };
+          };
+        };
+      };
+    };
+  };
+}
diff --git a/configurations/programs/archbox.nix b/configurations/programs/archbox.nix
@@ -0,0 +1,32 @@
+{ config, pkgs, ... }:
+
+let
+    archbox = pkgs.stdenv.mkDerivation rec {
+        name = "archbox";
+        src = pkgs.fetchFromGitHub {
+            owner = "lemniskett";
+            repo = "archbox";
+            rev = "6ab44021605ff7592692562871aa654eec1ed6bb";
+            sha256 = "0qgar6w2q1wsglx3zyj02mygypxs6bplrj43k61bkwz9g9d31yw5";
+        };
+        sourceRoot = ".";
+        installPhase = ''
+            mkdir -p $out
+            cd source
+            export FORCE_INSTALL_CONFIG=1
+            export ETC_DIR=$out/etc
+            export PREFIX=$out
+            export ARCHBOX_USER=your_user_here
+            export MOUNT_RUN=no
+            ${pkgs.bash}/bin/bash install.sh
+        '';
+    };
+in
+{
+    home-manager.users.leah.home.packages = [ archbox ];
+    environment.etc = {
+        "archbox.conf" = {
+            source = "${archbox}/etc/archbox.conf";
+        };
+    };
+}
diff --git a/configurations/programs/cli/bash.nix b/configurations/programs/cli/bash.nix
@@ -0,0 +1,35 @@
+{ config, pkgs, lib, ... }:
+
+{
+  imports = [
+    ./starship.nix
+  ];
+
+  home-manager.users.leah = {
+    programs = {
+      bash = {
+        enable          = true;
+        historyFileSize = 999999;
+        shellAliases    = {
+          ".."      = "cd ..";
+          "..."     = "cd ../..";
+          ls        = "exa";
+          ll        = "ls -l";
+          la        = "ls -la";
+
+          zzz       = "systemctl suspend";
+
+          cat       = "bat -p";
+          grep      = "rg";
+          find      = "fd";
+          nano      = "micro";
+          gotop     = "ytop";
+
+          reinitgit = "rm -rf .git && git init && git add -A && git commit -m 'init'";
+
+          use       = "nix-shell -p ";
+        };
+      };
+    };
+  };
+}
diff --git a/configurations/programs/cli/git.nix b/configurations/programs/cli/git.nix
@@ -0,0 +1,27 @@
+{ config, pkgs, lib, ... }:
+
+{
+  home-manager.users.leah = {
+    home = {
+      packages = [ pkgs.lazygit ];
+    };
+
+    programs = {
+      git = {
+        enable    = true;
+
+        package = pkgs.gitFull;
+
+        userName  = "Leah (ctucx)";
+        userEmail = "leah@ctu.cx";
+
+        delta.enable = true;
+
+        aliases = {
+          log-gpg = "log --show-signature";
+          pfusch  = "push";
+        };
+      };
+    };
+  };
+}
diff --git a/configurations/programs/cli/micro.nix b/configurations/programs/cli/micro.nix
@@ -0,0 +1,18 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+let
+  microNoDesktop = pkgs.micro.overrideAttrs(oldAttrs: {
+    postInstall = '' '';
+  });
+
+in {
+  home-manager.users.leah = {
+    home = {
+      packages = [ microNoDesktop ];
+
+      sessionVariables = {
+        EDITOR        = "micro";
+      };
+    };
+  };
+}
diff --git a/configurations/programs/cli/password-store.nix b/configurations/programs/cli/password-store.nix
@@ -0,0 +1,9 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  home-manager.users.leah = {
+    programs = {
+      password-store.enable = true;
+    };
+  };
+}
diff --git a/configurations/programs/cli/ssh.nix b/configurations/programs/cli/ssh.nix
@@ -0,0 +1,17 @@
+{ config, pkgs, lib, ... }:
+
+{
+  home-manager.users.leah = {
+    programs = {
+      ssh = {
+        enable      = true;
+        matchBlocks = {
+          "*.petabyte.dev" = {
+            user     = "leah";
+            port     = 62954;
+          };
+        };
+      };
+    };
+  };
+}
diff --git a/configurations/programs/cli/starship.nix b/configurations/programs/cli/starship.nix
@@ -0,0 +1,15 @@
+{ config, pkgs, lib, ... }:
+
+{
+  home-manager.users.leah = {
+    programs = {
+      starship= {
+        enable                = true;
+        enableBashIntegration = true;
+        settings = {
+          add_newline = false;
+        };
+      };
+    };
+  };
+}
diff --git a/configurations/programs/cli/tmux.nix b/configurations/programs/cli/tmux.nix
@@ -0,0 +1,12 @@
+{ config, pkgs, lib, ... }:
+
+{
+  home-manager.users.leah = {
+    programs = {
+      tmux = {
+        enable     = true;
+        terminal   = "xterm-256color";
+      };
+    };
+  };
+}
diff --git a/configurations/programs/cli/utilities.nix b/configurations/programs/cli/utilities.nix
@@ -0,0 +1,38 @@
+{ config, pkgs, lib, ... }:
+
+let
+  htopNoDesktop = pkgs.htop.overrideAttrs(oldAttrs: {
+    postInstall = ''
+      rm $out/share/applications/htop.desktop
+    '';
+  });
+
+in {
+  home-manager.users.leah = {
+    home = {
+      packages = with pkgs; [
+        wget
+        curl
+        rsync
+
+        ripgrep
+        exa
+        fd
+
+        htopNoDesktop
+
+        dnsutils
+
+        usbutils
+      ];
+    };
+
+    programs = {
+#      htop.enable     = true;
+
+      bat.enable      = true;
+
+      jq.enable       = true;
+    };
+  };
+}
diff --git a/configurations/programs/firefox.nix b/configurations/programs/firefox.nix
@@ -0,0 +1,23 @@
+{ lib, config, pkgs, ... }:
+
+{
+  home-manager.users.leah = {
+    home = {
+      sessionVariables = {
+        BROWSER = "firefox";
+      };
+    };
+
+    programs = {
+      firefox = {
+        enable = true;
+        package = pkgs.firefox-esr-91-unwrapped;
+      };
+
+      browserpass = {
+        enable   = true;
+        browsers = [ "firefox" ];
+      };
+    };
+  };
+}
diff --git a/configurations/programs/gammastep.nix b/configurations/programs/gammastep.nix
@@ -0,0 +1,17 @@
+{ config, lib, pkgs, ... }:
+
+{
+  home-manager.users.leah = {
+
+    services.gammastep = {
+      enable      = true;
+      latitude    = "8.26";
+      longitude   = "49.01";
+      temperature = {
+        night = 3000;
+        day   = 4500;
+      };
+    };
+
+  };
+}
diff --git a/configurations/programs/gvfs.nix b/configurations/programs/gvfs.nix
@@ -0,0 +1,7 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  services = {
+    gvfs.enable         = true;
+  };
+}
diff --git a/configurations/programs/mako.nix b/configurations/programs/mako.nix
@@ -0,0 +1,27 @@
+{ config, lib, pkgs, ... }:
+
+{
+  systemd.user.services.mako = {
+    serviceConfig.ExecStart = "${pkgs.mako}/bin/mako";
+    restartTriggers = [
+      config.home-manager.users.leah.xdg.configFile."mako/config".source
+    ];
+  };
+
+  home-manager.users.leah = {
+    programs.mako = {
+      enable          = true;
+
+      defaultTimeout  = 20000;
+
+      borderColor     = "#002028";
+      borderSize      = 2;
+
+      backgroundColor = "#002b36AA";
+
+      textColor       = "#fdf6e3";
+      font            = "Fira Code 11";
+      format          = "<b>%s</b> <span color=\"#93a1a1\">(%a)</span>\\n%b";
+    };
+  };
+}
diff --git a/configurations/programs/physlock.nix b/configurations/programs/physlock.nix
@@ -0,0 +1,7 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  services = {
+    physlock.enable     = true;
+  };
+}
diff --git a/configurations/programs/pipewire.nix b/configurations/programs/pipewire.nix
@@ -0,0 +1,18 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  security.rtkit.enable = true;
+  services = {
+    pipewire = {
+      enable = true;
+      socketActivation = true;
+
+      media-session.enable = true;
+      alsa.enable          = true;
+
+      pulse = {
+        enable = true;
+      };
+    };
+  };
+}
diff --git a/configurations/programs/sway.nix b/configurations/programs/sway.nix
@@ -0,0 +1,205 @@
+	{ config, lib, pkgs, home-manager, ... }:
+
+{
+  environment.noXlibs = false;
+
+  home-manager.users.leah = {
+
+    home.packages = with pkgs; [
+      qt5.qtwayland
+    ];
+
+    programs.bash.initExtra = ''
+      if [ "$(tty)" = "/dev/tty1" ]; then
+        exec sway
+      fi
+    '';
+
+    wayland.windowManager.sway = let
+      cfg         = config.home-manager.users.leah.wayland.windowManager.sway;
+      lockCommand = "swaylock -i $HOME/Pictures/Backgrounds/1.jpg";
+      modifier    = cfg.config.modifier;
+      terminal    = cfg.config.terminal;
+      wofi-style  = ./wofi/style.css;
+      wofi-config = ./wofi/config;
+
+   in {
+      enable              = true;
+      xwayland            = false;
+      wrapperFeatures.gtk = true;
+
+      extraSessionCommands = ''
+        export QT_QPA_PLATFORM=wayland
+        export QT_WAYLAND_FORCE_DPI=physical
+        export QT_WAYLAND_DISABLE_WINDOWDECORATION=1
+
+        export _JAVA_AWT_WM_NONREPARENTING=1
+
+        # be careful with those, they *will* break some applications
+        export SDL_VIDEODRIVER=wayland
+        export GDK_BACKEND=wayland
+      '';
+
+      extraConfig = ''
+        exec firefox
+        exec thunderbrid
+
+        exec swaymsg 'workspace 3: Term; exec ${terminal}; exec ${terminal};'
+        exec swaymsg 'workspace 6: Files; exec thunar;'
+        exec swaymsg 'workspace 1: Web;'
+
+        exec_always 'systemctl --user restart mako'
+        exec_always 'systemctl --user restart waybar'
+        exec_always 'systemctl --user restart gpg-agent'
+      '';
+
+      config = {
+        fonts = {
+          names = [ "Noto Sans Mono" "FontAwesome5Free" ];
+          style = "";
+          size  = 11.0;
+        };
+
+        colors = {
+          focused = {
+            background  = "#317148";
+            border      = "#317148";
+            childBorder = "#317148";
+            text        = "#eceff4";
+            indicator   = "#8fbcbb";
+          };
+        };
+
+        window = {
+          titlebar        = false;
+          hideEdgeBorders = "smart";
+          border          = 5;
+        };
+
+        input = {
+          "*" = {
+            xkb_layout  = "us,de";
+            xkb_variant = "mac,qwerty";
+            xkb_options = "grp:alt_shift_toggle";
+          };
+        };
+
+		assigns = {
+		  "1: Web"  = [{ app_id = "firefox"; }];
+		  "2: Mail" = [{ app_id = "thunderbird"; }];
+		  "4: Code" = [{ app_id = "subl"; }];
+		};
+
+        bars = [];
+
+        terminal = "${pkgs.alacritty}/bin/alacritty";
+        menu     = "${pkgs.wofi}/bin/wofi --style ${wofi-style} --conf ${wofi-config} --show drun";
+
+        modifier = "Mod4";
+        left     = "";
+        right    = "";
+
+        workspaceAutoBackAndForth = true;
+
+        keybindings = {
+          "${modifier}+Delete"        = "exec true";
+
+          "${modifier}+Return"        = "exec ${cfg.config.terminal}";
+          "${modifier}+Space"         = "exec ${cfg.config.menu}";
+          "${modifier}+l"             = "exec systemctl suspend";
+
+          "Shift+Print"               = "exec ${pkgs.grim}/bin/grim ~/Pictures/Screenshots/$(date +\"%Y-%m-%d_%H:%m:%S\").png";
+          "${modifier}+Shift+Print"   = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" ~/Pictures/Screenshots/$(date +\"%Y-%m-%d_%H:%m:%S\").png";
+          "Print"                     = "exec ${pkgs.grim}/bin/grim - | ${pkgs.wl-clipboard}/bin/wl-copy";
+          "${modifier}+Print"         = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy";
+
+          "XF86MonBrightnessUp"       = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +5%";
+          "XF86MonBrightnessDown"     = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 5%-";
+
+          "XF86AudioRaiseVolume"      = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
+          "XF86AudioLowerVolume"      = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
+          "XF86AudioMute"             = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle";
+          "XF86AudioMicMute"          = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle";
+
+          "XF86AudioPlay"             = "exec ${pkgs.playerctl}/bin/playerctl play-pause";
+          "XF86AudioNext"             = "exec ${pkgs.playerctl}/bin/playerctl next";
+          "XF86AudioPrev"             = "exec ${pkgs.playerctl}/bin/playerctl previous";         
+
+          "${modifier}+Shift+e"       = "exec swaynag -t warning -m 'Do you really want to exit sway?' -b 'Yep' 'swaymsg exit'";
+
+          "${modifier}+Shift+q"       = "kill";
+          "Alt+F4"                    = "kill";
+
+          "${modifier}+Shift+c"       = "reload";
+
+          "${modifier}+Left"          = "focus left";
+          "${modifier}+Down"          = "focus down";
+          "${modifier}+Up"            = "focus up";
+          "${modifier}+Right"         = "focus right";
+          "${modifier}+a"             = "focus parent";
+
+
+          "${modifier}+Shift+Left"    = "move left";
+          "${modifier}+Shift+Down"    = "move down";
+          "${modifier}+Shift+Up"      = "move up";
+          "${modifier}+Shift+Right"   = "move right";
+
+          "${modifier}+1"             = "workspace 1: Web";
+          "${modifier}+2"             = "workspace 2: Mail";
+          "${modifier}+3"             = "workspace 3: Term; layout tabbed";
+          "${modifier}+4"             = "workspace 4: Code";
+          "${modifier}+5"             = "workspace number 5";
+          "${modifier}+6"             = "workspace 6: Files";
+          "${modifier}+7"             = "workspace number 7";
+          "${modifier}+8"             = "workspace number 8";
+          "${modifier}+9"             = "workspace number 9";
+          "${modifier}+0"             = "workspace number 10";
+
+          "${modifier}+Shift+1"       = "move container to workspace 1: Web";
+          "${modifier}+Shift+2"       = "move container to workspace 2: Mail";
+          "${modifier}+Shift+3"       = "move container to workspace 3: Term";
+          "${modifier}+Shift+4"       = "move container to workspace 4: Code";
+          "${modifier}+Shift+5"       = "move container to workspace number 5";
+          "${modifier}+Shift+6"       = "move container to workspace 6: Files";
+          "${modifier}+Shift+7"       = "move container to workspace number 7";
+          "${modifier}+Shift+8"       = "move container to workspace number 8";
+          "${modifier}+Shift+9"       = "move container to workspace number 9";
+          "${modifier}+Shift+0"       = "move container to workspace number 10";
+
+          "${modifier}+s"             = "layout stacking";
+          "${modifier}+w"             = "layout tabbed";
+          "${modifier}+e"             = "layout toggle split";
+
+          "${modifier}+f"             = "fullscreen";
+
+          "${modifier}+r"             = "mode \"resize\"";
+          "${modifier}+b"             = "mode \"waybar\"";
+
+          "${modifier}+Shift+space"   = "floating toggle";
+        };
+
+        modes = {
+          "resize" = {
+            "Right"         = "resize shrink width 10px";
+            "Left"          = "resize grow width 10px";
+            "Down"          = "resize shrink height 10px";
+            "Up"            = "resize grow height 10px";
+
+            "Return"        = "mode \"default\"";
+            "Escape"        = "mode \"default\"";
+            "${modifier}+r" = "mode \"default\"";
+          };
+
+          "waybar" = {
+            "space"         = "exec pkill -SIGUSR1 waybar";
+            "r"             = "exec pkill -SIGUSR2 waybar";
+
+            "Return"        = "mode \"default\"";
+            "Escape"        = "mode \"default\"";
+            "${modifier}+r" = "mode \"default\"";
+          };
+        };
+      };
+    };
+  };
+}
diff --git a/configurations/programs/syncthing.nix b/configurations/programs/syncthing.nix
@@ -0,0 +1,9 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  home-manager.users.leah = {
+    services = {
+      syncthing.enable = true;
+    };
+  };
+}
diff --git a/configurations/programs/thunar.nix b/configurations/programs/thunar.nix
@@ -0,0 +1,17 @@
+{ lib, config, pkgs, ... }:
+
+{
+  imports = [
+    ./gvfs.nix
+  ];
+
+  services = {
+    tumbler.enable = true;
+  };
+
+  home-manager.users.leah = {
+    home.packages = with pkgs; [
+      xfce.thunar
+    ];
+  };
+}
diff --git a/configurations/programs/thunderbird.nix b/configurations/programs/thunderbird.nix
@@ -0,0 +1,9 @@
+{ lib, config, pkgs, ... }:
+
+{
+  home-manager.users.leah = {
+    home.packages = with pkgs; [
+      thunderbird
+    ];
+  };
+}
diff --git a/configurations/programs/usbmuxd.nix b/configurations/programs/usbmuxd.nix
@@ -0,0 +1,9 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  services = {
+    usbmuxd.enable      = true;
+  };
+
+  users.users.leah.extraGroups = [ "usbmux" ];
+}
diff --git a/configurations/programs/utilities.nix b/configurations/programs/utilities.nix
@@ -0,0 +1,9 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  home-manager.users.leah = {
+    home.packages = with pkgs; [
+      pavucontrol
+    ];
+  };
+}
diff --git a/configurations/programs/waybar/default.nix b/configurations/programs/waybar/default.nix
@@ -0,0 +1,134 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  home-manager.users.leah = {
+    programs = {
+      waybar = {
+        enable        = true;
+        systemd.enable = true;
+
+        style = builtins.readFile ./style.css;
+
+        settings = [{
+          layer    = "top";
+          position = "top";
+
+          height   = 40;
+
+          modules-left   = [ "sway/workspaces" "sway/mode" ];
+          modules-center = [ "clock" ];
+          modules-right  = [ "tray" "disk" "memory" "cpu" "idle_inhibitor" "network#wifi" "battery" "pulseaudio" ];
+
+          modules = {
+            "sway/workspaces" = {
+              disable-scroll = true;
+            };
+
+            "sway/mode" = {
+              tooltip = false;
+              format  = "<span style=\"italic\">{}</span>";
+            };
+
+            "sway/window" = {
+              tooltip = false;
+            };
+
+            clock = {
+              interval       = 1;
+              format         = "{:%H:%M:%S}";
+              format-alt     = "{:%Y-%m-%d}";
+              tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>";
+            };
+
+            tray = {
+              tooltip   = false;
+#             icon-size = 21;
+              spacing   = 10;
+            };
+
+            disk = {
+              format         = "  {}%";
+              tooltip-format = "SSD: {used} / {total} used";
+            };
+
+            memory = {
+              format         = "  {}%";
+              tooltip-format = "RAM: {used:0.1f}G / {total:0.1f}G used";
+            };
+
+            cpu = {
+              format  = "  {usage}%";
+              tooltip = false;
+            };
+
+            battery = {
+              bat       = "BAT0";
+              adapter   = "AC";
+              interval  = 10;
+              full-at   = 99;
+              states    = {
+                full     = 100;
+                good     = 99;
+                warning  = 40;
+                critical = 15;
+              };
+
+              format          = "{icon}  <span color='white'>{capacity}%</span>";
+              format-charging = "  <span color='white'>{capacity}%</span>";
+              format-plugged  = "  <span color='white'>{capacity}%</span>";
+              format-empty    = "";
+              format-full     = "";
+              format-icons    = ["" "" "" "" ""];
+            };
+
+            "network#ethernet" = {
+              interface           = "eno1";
+              tooltip-format      = "{ifname}: {ipaddr}/{cidr}";
+
+              format-ethernet     = "";
+              format-linked       = "";
+              format-disconnected = "";
+            };
+
+            "network#wifi" = {
+              interface           = "wlan0*";
+              tooltip-format      = "{ifname}: {ipaddr}/{cidr}";
+
+              format-ethernet     = "";
+              format-wifi         = "  {essid} ({signalStrength}%)";
+              format-linked       = "";
+              format-disconnected = "";
+            };
+
+            pulseaudio = {
+              scroll-step = 1;
+              on-click    = "${pkgs.pavucontrol}/bin/pavucontrol";
+
+              format                 = "{format_source} {icon}  {volume}%";
+              format-bluetooth       = "{format_source} {icon} {volume}%";
+              format-bluetooth-muted = "{format_source}  ";
+              format-muted           = "{format_source} ";
+              format-source          = "";
+              format-source-muted    = "";
+              format-icons = {
+                headphone = "";
+                phone     = "";
+                portable  = "";
+                car       = "";
+                default   = ["" "" ""];
+              };
+            };
+
+            idle_inhibitor = {
+              format = "{icon}";
+              format-icons = {
+                activated = "";
+                deactivated = "";
+              };
+            };
+          };
+        }];
+      };
+    };
+  };
+}
diff --git a/configurations/programs/waybar/style.css b/configurations/programs/waybar/style.css
@@ -0,0 +1,58 @@
+@keyframes blink {
+    to {
+        background: transparent;
+        color: #fff;
+    }
+}
+
+* {
+    font-family: 'Noto Sans';
+    font-size: 15px;
+    border: none;
+    border-radius: 0;
+    min-height: 0;
+    transition: none;
+    box-shadow: none;
+}
+
+window#waybar {
+    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0));
+    /* background: rgba(0, 0, 0, 0.5); */
+    color: white;
+}
+
+#workspaces button.focused {
+    background-color: rgba(255, 255, 255, 0.1);
+    border-bottom: 2px solid #4aa96c;
+}
+
+#clock {
+    font-size: 16px;
+    font-family: 'Noto MMonoono', monospace;
+}
+
+#disk, #memory, #cpu, #idle_inhibitor, #battery, #pulseaudio, #network {
+    padding: 0px 15px;
+}
+
+#battery {
+    color: #a3be8c;
+}
+
+#battery.charging {
+    color: #a3be8c;
+}
+
+#battery.critical:not(.charging) {
+    background: rgba(245, 60, 60, 0.4);
+    color: #fff;
+
+    border-radius: 15px;
+    margin: 6px;
+
+    animation-name: blink;
+    animation-duration: 1s;
+    animation-timing-function: linear;
+    animation-iteration-count: infinite;
+    animation-direction: alternate;
+}
diff --git a/configurations/programs/wofi/config b/configurations/programs/wofi/config
@@ -0,0 +1,6 @@
+show=drun
+prompt=search
+insensitive=true
+allow_images=true
+image_size=20
+term=alacritty
diff --git a/configurations/programs/wofi/style.css b/configurations/programs/wofi/style.css
@@ -0,0 +1,46 @@
+* {
+    font-family: 'Noto Sans';
+    font-size: 14px;
+}
+
+window {
+    background: rgba(0, 0, 0, 0);
+
+}
+
+arrow {
+    margin: -10px;
+    color: transparent;
+}
+
+#outer-box {
+    background: rgba(0, 0, 0, 0.5);
+    padding: 5px;
+    border: 2px solid #383838;
+    border-radius: 7px;
+    font-size: 14px;
+}
+
+#inner-box {
+    margin: 10px;
+}
+
+#input {
+    background: rgba(0, 0, 0, 0.2);
+    margin: 5px;
+    border: 1px solid #383838;
+    color: #eceff4;
+}
+
+#entry {
+    background: none;
+}
+
+#text {
+    margin: 6px;
+}
+
+#text:selected {
+    font-weight: bold;
+    font-size: 15px;
+}
diff --git a/configurations/qt.nix b/configurations/qt.nix
@@ -0,0 +1,10 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  home-manager.users.leah = {
+    qt = {
+      enable        = true;
+      platformTheme = "gtk";
+    };
+  };
+}
diff --git a/configurations/xdg.nix b/configurations/xdg.nix
@@ -0,0 +1,54 @@
+{ config, lib, pkgs, home-manager, ... }:
+
+{
+  home-manager.users.leah = {
+    home = {
+      activation."mimeapps-remove" = {
+        before = [ "linkGeneration" ];
+        after  = [ ];
+        data   = "rm -f /home/leah/.config/mimeapps.list";
+      };
+    };
+
+    xdg = {
+      enable          = true;
+      mime.enable     = true;
+
+#      desktopEntries = {
+#        htop = {
+#          settings = {
+#            NoDisplay = "true";
+#          };
+#        };
+#      };
+
+      mimeApps = {
+        enable              = true;
+        defaultApplications = {
+          "x-scheme-handler/http"       = "firefox.desktop";
+          "x-scheme-handler/https"      = "firefox.desktop";
+          "x-scheme-handler/chrome"     = "firefox.desktop";
+
+          "x-scheme-handler/mailto"     = "thunderbird.desktop";
+
+          "image/svg+xml"               = "firefox.desktop";
+
+          "text/html"                   = "firefox.desktop";
+          "text/xml"                    = "firefox.desktop";
+        };
+      };
+
+      userDirs = {
+        enable      = true;
+        desktop     = "\$HOME/Desktop";
+        documents   = "\$HOME/Documents";
+        download    = "\$HOME/Downloads";
+        videos      = "\$HOME/Videos";
+        music       = "\$HOME/Music";
+        pictures    = "\$HOME/Pictures";
+        publicShare = "\$HOME/Public";
+        templates   = "\$HOME/Templates";
+      };
+    };
+  };
+}
diff --git a/configurations/yubikey.nix b/configurations/yubikey.nix
@@ -0,0 +1,47 @@
+{ config, pkgs, ... }:
+
+{
+  services.pcscd.enable  = true;
+  services.udev.packages = with pkgs; [ libu2f-host yubikey-personalization ];
+
+  home-manager.users.leah = {
+    home = {
+      sessionVariables = {
+        SSH_AUTH_SOCK = "/run/user/1000/gnupg/S.gpg-agent.ssh";
+      };
+    };
+
+    programs = {
+      gpg = {
+        enable   = true;
+        settings = {
+          keyserver = "hkps://keyserver.ubuntu.com:443";
+        };
+      };
+
+      git = {
+        signing = {
+          key           = "725B65F21DB1C2C4";
+          signByDefault = true;
+        };
+      };
+	};
+
+    services = {
+      gpg-agent = {
+        enable             = true;
+        enableSshSupport   = true;
+        enableExtraSocket  = true;
+
+        pinentryFlavor     = "qt";
+
+        defaultCacheTtl    = 600;
+        defaultCacheTtlSsh = 600;
+
+        sshKeys = [
+          "8C11B9BF8B535049F6C87A9CF0C595421E6B8798"
+        ];
+      };
+    };
+  };
+}
diff --git a/machines/briefkasten/configuration.nix b/machines/briefkasten/configuration.nix
@@ -0,0 +1,58 @@
+{ config, pkgs, lib, ... }:
+
+{
+  imports = [
+    ./hardware-configuration.nix
+    ../../configurations/mobile-device.nix
+    ../../configurations/common.nix
+    ../../configurations/desktop-sway.nix
+  ];
+
+  hardware.cpu.intel.updateMicrocode = true;
+
+  boot = {
+    loader = {
+      systemd-boot.enable = true;
+      efi.canTouchEfiVariables = true;
+    };
+
+    consoleLogLevel               = 3;
+    kernel.sysctl."vm.swappiness" = 0;
+    kernel.sysctl."kernel/sysrq"  = 1;
+    kernelModules                 = [ "tpm-rng" ];
+    kernelParams = [
+      "quiet"
+      "scsi_mod.use_blk_mq=1"
+      "modeset"
+      "nofb"
+      "rd.systemd.show_status=auto"
+      "rd.udev.log_priority=3"
+      "pti=off"
+      "spectre_v2=off"
+    ];
+
+    extraModprobeConfig = lib.mkMerge [
+      "options ec_sys write_support=1"
+      "options iwlwifi power_save=0 uapsd_disable=1"
+    ];
+
+    initrd.availableKernelModules = [ "i915" ];
+  };
+
+  networking = {
+    hostName                       = "briefkasten";
+#   domain                         = "ctu.cx";
+    useDHCP                        = true;
+
+    wireless = {
+      iwd.enable = true;
+    };
+
+    firewall = {
+      enable = true;
+      allowedTCPPorts = [ 22 ];
+    };
+  };
+
+  system.stateVersion = "21.05"; # Did you read the comment?
+}
diff --git a/machines/briefkasten/hardware-configuration.nix b/machines/briefkasten/hardware-configuration.nix
@@ -0,0 +1,31 @@
+# Do not modify this file!  It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations.  Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+  imports =
+    [ (modulesPath + "/installer/scan/not-detected.nix")
+    ];
+
+  boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
+  boot.initrd.kernelModules = [ ];
+  boot.kernelModules = [ "kvm-intel" ];
+  boot.extraModulePackages = [ ];
+
+  fileSystems."/" =
+    { device = "/dev/disk/by-uuid/2ee191ed-3aa8-4906-92dd-78a51763177e";
+      fsType = "ext4";
+    };
+
+  boot.initrd.luks.devices."root".device = "/dev/disk/by-uuid/e72d3d95-48ce-4c6a-ae85-42bf97e64c88";
+
+  fileSystems."/boot" =
+    { device = "/dev/disk/by-uuid/BAA8-C5F6";
+      fsType = "vfat";
+    };
+
+  swapDevices = [ ];
+
+  powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
+}