From 0df4d5654f237b808a2bc804dbee95314f4fdac4 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Sun, 27 Jun 2021 00:11:23 +0200 Subject: [PATCH] Finish modularising config There are still some things I want to change, but at least there aren't two systems now. --- configurations/adb.nix | 6 - configurations/base-x.nix | 25 - configurations/calibre.nix | 11 - configurations/citrix.nix | 11 - configurations/deluge.nix | 11 - configurations/dropbox.nix | 31 - configurations/firefox.nix | 18 - configurations/fonts.nix | 25 - configurations/hledger.nix | 25 - configurations/i3.nix | 43 -- configurations/kitty.nix | 45 -- configurations/locale.nix | 15 - configurations/mime.nix | 25 - configurations/mounts.nix | 59 -- configurations/mumble.nix | 10 - configurations/networkmanager.nix | 25 - configurations/openbox.nix | 14 - configurations/openbox/rc.xml | 723 ------------------ configurations/pass.nix | 15 - configurations/sound.nix | 15 - configurations/syncthing.nix | 11 - configurations/teams.nix | 14 - configurations/themes.nix | 48 -- configurations/xdg-dirs.nix | 32 - flake.lock | 12 +- machines/kharbranth/default.nix | 12 +- machines/kholinar/default.nix | 31 +- machines/lasting-integrity/default.nix | 1 + machines/urithiru/default.nix | 1 + machines/urithiru/secret.nix | Bin 2509 -> 1035 bytes modules/android.nix | 14 + modules/calibre.nix | 17 + modules/default.nix | 37 +- modules/deluge-client.nix | 18 + modules/deluge-server.nix | 66 ++ modules/dropbox.nix | 44 ++ modules/eid.nix | 5 + modules/firefox.nix | 19 + {configurations => modules}/gnupg.nix | 23 +- modules/graphical.nix | 50 ++ modules/hledger.nix | 32 + .../mail.nix => modules/mail-client.nix | 14 +- modules/mumble.nix | 19 + modules/networkmanager.nix | 23 + modules/nginx.nix | 2 +- modules/obs.nix | 27 + modules/pass.nix | 25 + modules/sound.nix | 29 + modules/sshd.nix | 4 +- .../sway/color-picker.nix | 0 .../sway.nix => modules/sway/default.nix | 40 +- {configurations => modules}/sway/launcher.nix | 0 {configurations => modules}/sway/launcher.zsh | 0 .../sway/screenshot.nix | 0 .../sway/status-configuration.nix | 0 modules/syncthing-client.nix | 18 + modules/terminal.nix | 52 ++ modules/theming.nix | 77 ++ modules/ugent/citrix.nix | 20 + modules/ugent/default.nix | 24 + modules/ugent/mounts.nix | 66 ++ modules/ugent/teams.nix | 21 + modules/ugent/vpn.nix | 38 + modules/ugent/vpn.secret.nix | Bin 0 -> 529 bytes modules/vpn.nix | 38 - modules/vpn/secret.nix | Bin 537 -> 0 bytes modules/xdg.nix | 58 ++ profiles/graphical.nix | 67 -- 68 files changed, 860 insertions(+), 1441 deletions(-) delete mode 100644 configurations/adb.nix delete mode 100644 configurations/base-x.nix delete mode 100644 configurations/calibre.nix delete mode 100644 configurations/citrix.nix delete mode 100644 configurations/deluge.nix delete mode 100644 configurations/dropbox.nix delete mode 100644 configurations/firefox.nix delete mode 100644 configurations/fonts.nix delete mode 100644 configurations/hledger.nix delete mode 100644 configurations/i3.nix delete mode 100644 configurations/kitty.nix delete mode 100644 configurations/locale.nix delete mode 100644 configurations/mime.nix delete mode 100644 configurations/mounts.nix delete mode 100644 configurations/mumble.nix delete mode 100644 configurations/networkmanager.nix delete mode 100644 configurations/openbox.nix delete mode 100644 configurations/openbox/rc.xml delete mode 100644 configurations/pass.nix delete mode 100644 configurations/sound.nix delete mode 100644 configurations/syncthing.nix delete mode 100644 configurations/teams.nix delete mode 100644 configurations/themes.nix delete mode 100644 configurations/xdg-dirs.nix create mode 100644 modules/android.nix create mode 100644 modules/calibre.nix create mode 100644 modules/deluge-client.nix create mode 100644 modules/deluge-server.nix create mode 100644 modules/dropbox.nix create mode 100644 modules/firefox.nix rename {configurations => modules}/gnupg.nix (67%) create mode 100644 modules/graphical.nix create mode 100644 modules/hledger.nix rename configurations/mail.nix => modules/mail-client.nix (97%) create mode 100644 modules/mumble.nix create mode 100644 modules/networkmanager.nix create mode 100644 modules/obs.nix create mode 100644 modules/pass.nix create mode 100644 modules/sound.nix rename {configurations => modules}/sway/color-picker.nix (100%) rename configurations/sway.nix => modules/sway/default.nix (88%) rename {configurations => modules}/sway/launcher.nix (100%) rename {configurations => modules}/sway/launcher.zsh (100%) rename {configurations => modules}/sway/screenshot.nix (100%) rename {configurations => modules}/sway/status-configuration.nix (100%) create mode 100644 modules/syncthing-client.nix create mode 100644 modules/terminal.nix create mode 100644 modules/theming.nix create mode 100644 modules/ugent/citrix.nix create mode 100644 modules/ugent/default.nix create mode 100644 modules/ugent/mounts.nix create mode 100644 modules/ugent/teams.nix create mode 100644 modules/ugent/vpn.nix create mode 100644 modules/ugent/vpn.secret.nix delete mode 100644 modules/vpn.nix delete mode 100644 modules/vpn/secret.nix create mode 100644 modules/xdg.nix delete mode 100644 profiles/graphical.nix diff --git a/configurations/adb.nix b/configurations/adb.nix deleted file mode 100644 index d7a8462f..00000000 --- a/configurations/adb.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ ... }: - -{ - programs.adb.enable = true; - users.users.charlotte.extraGroups = [ "adbusers" ]; -} diff --git a/configurations/base-x.nix b/configurations/base-x.nix deleted file mode 100644 index c45efcd3..00000000 --- a/configurations/base-x.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ ... }: -{ - services.xserver = { - enable = true; - displayManager.startx.enable = true; - libinput = { - enable = true; - touchpad = { - disableWhileTyping = true; - scrollMethod = "twofinger"; - tapping = true; - tappingDragLock = true; - }; - }; - xkbVariant = "altgr-intl"; - }; - home-manager.users.charlotte = { pkgs, ... }: { - home.file.".xinitrc".text = "source ~/.xsession"; - xsession = { - enable = true; - numlock.enable = true; - - }; - }; -} diff --git a/configurations/calibre.nix b/configurations/calibre.nix deleted file mode 100644 index 053b517a..00000000 --- a/configurations/calibre.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: - -{ - chvp.zfs.homeLinks = [ - { path = ".config/calibre"; type = "cache"; } - ]; - - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = [ pkgs.calibre ]; - }; -} diff --git a/configurations/citrix.nix b/configurations/citrix.nix deleted file mode 100644 index 2fb8c5c6..00000000 --- a/configurations/citrix.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: { - chvp = { - nix.unfreePackages = [ "citrix-workspace" ]; - zfs.homeLinks = [ - { path = ".ICAClient"; type = "data"; } - ]; - }; - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = with pkgs; [ citrix_workspace ]; - }; -} diff --git a/configurations/deluge.nix b/configurations/deluge.nix deleted file mode 100644 index d1151c99..00000000 --- a/configurations/deluge.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: - -{ - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = with pkgs; [ deluge ]; - }; - - chvp.zfs.homeLinks = [ - { path = ".config/deluge"; type = "data"; } - ]; -} diff --git a/configurations/dropbox.nix b/configurations/dropbox.nix deleted file mode 100644 index 4069634c..00000000 --- a/configurations/dropbox.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ ... }: - -{ - chvp.zfs.homeLinks = [ - { path = ".dropbox"; type = "cache"; } - { path = "Dropbox"; type = "data"; } - ]; - home-manager.users.charlotte = { pkgs, ... }: { - systemd.user.services = { - dropbox = { - Unit = { - Description = "Dropbox"; - }; - Service = { - Environment = "QT_PLUGIN_PATH=\"/run/current-system/sw/${pkgs.qt5.qtbase.qtPluginPrefix}\" QML2_IMPORT_PATH=\"/run/current-system/sw/${pkgs.qt5.qtbase.qtQmlPrefix}\""; - ExecStart = "${pkgs.dropbox.out}/bin/dropbox"; - ExecReload = "${pkgs.coreutils.out}/bin/kill -HUP $MAINPID"; - KillMode = "control-group"; - Restart = "on-failure"; - PrivateTmp = true; - ProtectSystem = "full"; - Nice = 10; - }; - Install = { - WantedBy = [ "graphical-session.target" ]; - }; - }; - }; - }; - chvp.nix.unfreePackages = [ "dropbox" ]; -} diff --git a/configurations/firefox.nix b/configurations/firefox.nix deleted file mode 100644 index 28a01c6b..00000000 --- a/configurations/firefox.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ ... }: { - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = with pkgs; [ firefox ]; - }; - - nixpkgs.overlays = [ - (self: super: { - firefox = super.firefox.override { extraNativeMessagingHosts = [ self.passff-host ]; pkcs11Modules = [ self.eid-mw ]; }; - # Avoids a double firefox install, see https://github.com/NixOS/nixpkgs/pull/31772 - firefox-bin = self.firefox; - }) - ]; - - chvp.zfs.homeLinks = [ - { path = ".cache/mozilla"; type = "cache"; } - { path = ".mozilla"; type = "data"; } - ]; -} diff --git a/configurations/fonts.nix b/configurations/fonts.nix deleted file mode 100644 index 8e0ef410..00000000 --- a/configurations/fonts.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, ... }: - -{ - fonts = { - fontDir.enable = true; - fontconfig = { - enable = true; - defaultFonts = { - emoji = [ "Noto Color Emoji" ]; - monospace = [ "Fira Code" ]; - sansSerif = [ "Noto Sans" ]; - serif = [ "Noto Serif" ]; - }; - }; - fonts = with pkgs; [ - fira-code - fira-code-symbols - font-awesome_4 - noto-fonts - noto-fonts-cjk - noto-fonts-emoji - noto-fonts-extra - ]; - }; -} diff --git a/configurations/hledger.nix b/configurations/hledger.nix deleted file mode 100644 index e6793781..00000000 --- a/configurations/hledger.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, ... }: - -let - hledger-repo = pkgs.fetchFromGitHub { - owner = "chvp"; - repo = "hledger"; - rev = "feature/gain-reports"; - sha256 = "07qsrq71pnkys11q6k2zc20xc9l3yp8dhzp1ar5bnkgcwbm69rcx"; - }; -in -{ - nixpkgs.overlays = [ - (self: super: { - haskellPackages = super.haskellPackages.override { - overrides = hself: hsuper: rec { - hledger = hsuper.callCabal2nixWithOptions "hledger" hledger-repo "--subpath hledger" { }; - hledger-lib = hsuper.callCabal2nixWithOptions "hledger-lib" hledger-repo "--subpath hledger-lib" { }; - }; - }; - }) - ]; - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = [ pkgs.hledger ]; - }; -} diff --git a/configurations/i3.nix b/configurations/i3.nix deleted file mode 100644 index 5939140c..00000000 --- a/configurations/i3.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ config, pkgs, ... }: -let - launcher = import ./sway/launcher.nix { inherit pkgs; stdenv = pkgs.stdenv; }; - status-configuration = import ./sway/status-configuration.nix { inherit pkgs config; }; -in -{ - imports = [ ./base-x.nix ]; - - config = { - home-manager.users.charlotte = { pkgs, ... }: { - xsession = { - windowManager.i3 = { - enable = true; - config = { - bars = [ - { - colors = { - background = "#fbffff"; - statusline = "#535c65"; - focusedWorkspace = { background = "#2b7ab2"; border = "#2b7ab2"; text = "#fbffff"; }; - activeWorkspace = { background = "#6d7782"; border = "#6d7782"; text = "#fbffff"; }; - inactiveWorkspace = { background = "#fbffff"; border = "#fbffff"; text = "535c65"; }; - urgentWorkspace = { background = "#ae5865"; border = "#ae5865"; text = "#fbffff"; }; - }; - fonts = { names = [ "Fira Code" ]; size = 9.0; style = "Normal"; }; - position = "top"; - statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${status-configuration}"; - } - ]; - floating.criteria = [{ class = "launcher"; } { class = "accentor.Main"; }]; - fonts = { names = [ "Fira Code" ]; size = 9.0; style = "Normal"; }; - menu = "${pkgs.kitty}/bin/kitty --class launcher -e ${launcher}/bin/launcher"; - modifier = "Mod4"; - terminal = "${pkgs.kitty}/bin/kitty"; - }; - extraConfig = '' - default_border pixel - ''; - }; - }; - }; - }; -} diff --git a/configurations/kitty.nix b/configurations/kitty.nix deleted file mode 100644 index 1059e6d0..00000000 --- a/configurations/kitty.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.charlotte = { pkgs, ... }: { - programs.kitty = { - enable = true; - settings = { - font_family = "Fira Code"; - font_size = 9; - disable_ligatures = "cursor"; - background = "#ffffff"; - foreground = "#000000"; - cursor = "#777777"; - url_color = "#0031a9"; - # black - color0 = "#282828"; - color8 = "#000000"; - # red - color1 = "#a60000"; - color9 = "#972500"; - # green - color2 = "#005e00"; - color10 = "#315b00"; - # yellow - color3 = "#813e00"; - color11 = "#70480f"; - # blue - color4 = "#0031a9"; - color12 = "#2544bb"; - # magenta - color5 = "#721045"; - color13 = "#8f0075"; - # cyan - color6 = "#00538b"; - color14 = "#30517f"; - # white - color7 = "#f8f8f8"; - color15 = "#ffffff"; - enable_audio_bell = false; - visual_bell_duration = "0.25"; - remember_window_size = false; - }; - }; - }; -} diff --git a/configurations/locale.nix b/configurations/locale.nix deleted file mode 100644 index d0e3e0d8..00000000 --- a/configurations/locale.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ ... }: - -{ - i18n = { - defaultLocale = "en_IE.UTF-8"; - extraLocaleSettings = { - LC_TIME = "en_GB.UTF-8"; - }; - }; - - console = { - font = "Lat2-Terminus16"; - keyMap = "us"; - }; -} diff --git a/configurations/mime.nix b/configurations/mime.nix deleted file mode 100644 index c18ebfdd..00000000 --- a/configurations/mime.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ ... }: - -{ - home-manager.users.charlotte = { pkgs, ... }: { - # Some applications overwrite mimeapps.list with an identical file - xdg.configFile."mimeapps.list".force = true; - xdg.mimeApps = { - enable = true; - defaultApplications = { - "image/png" = [ "org.kde.okular.desktop" ]; - "image/jpg" = [ "org.kde.okular.desktop" ]; - "image/jpeg" = [ "org.kde.okular.desktop" ]; - "application/pdf" = [ "org.kde.okular.desktop" ]; - - "text/html" = [ "firefox.desktop" ]; - "x-scheme-handler/about" = [ "firefox.desktop" ]; - "x-scheme-handler/http" = [ "firefox.desktop" ]; - "x-scheme-handler/https" = [ "firefox.desktop" ]; - "x-scheme-handler/unknown" = [ "firefox.desktop" ]; - - "x-scheme-handler/msteams" = [ "teams.desktop" ]; - }; - }; - }; -} diff --git a/configurations/mounts.nix b/configurations/mounts.nix deleted file mode 100644 index 37a2e125..00000000 --- a/configurations/mounts.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ pkgs, ... }: - -let - automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; -in -{ - fileSystems = { - "/mnt/ugent/files" = { - device = "//files.ugent.be/ecvpeteg"; - fsType = "cifs"; - options = [ "credentials=/run/secrets/passwords/ugent-mount-credentials,${automount_opts},users,vers=3.0,noperm,domain=UGENT,sec=ntlmv2i" ]; - noCheck = true; - }; - "/mnt/ugent/webhost" = { - device = "//webhost.ugent.be/ecvpeteg"; - fsType = "cifs"; - options = [ "credentials=/run/secrets/passwords/ugent-mount-credentials,${automount_opts},users,vers=3.0" ]; - noCheck = true; - }; - }; - - age.secrets."passwords/ugent-mount-credentials".file = ../secrets/passwords/ugent-mount-credentials.age; - - environment.systemPackages = [ pkgs.keyutils ]; - # Remove this once https://github.com/NixOS/nixpkgs/issues/34638 is resolved - # The TL;DR is: the kernel calls out to the hard-coded path of - # /sbin/request-key as part of its CIFS auth process, which of course does - # not exist on NixOS due to the usage of Nix store paths. - system.activationScripts.symlink-requestkey = '' - if [ ! -d /sbin ]; then - mkdir /sbin - fi - ln -sfn /run/current-system/sw/bin/request-key /sbin/request-key - ''; - # request-key expects a configuration file under /etc - environment.etc."request-key.conf" = { - text = - let - upcall = "${pkgs.cifs-utils}/bin/cifs.upcall"; - keyctl = "${pkgs.keyutils}/bin/keyctl"; - in - '' - #OP TYPE DESCRIPTION CALLOUT_INFO PROGRAM - # -t is required for DFS share servers... - create cifs.spnego * * ${upcall} -t %k - create dns_resolver * * ${upcall} %k - # Everything below this point is essentially the default configuration, - # modified minimally to work under NixOS. Notably, it provides debug - # logging. - create user debug:* negate ${keyctl} negate %k 30 %S - create user debug:* rejected ${keyctl} reject %k 30 %c %S - create user debug:* expired ${keyctl} reject %k 30 %c %S - create user debug:* revoked ${keyctl} reject %k 30 %c %S - create user debug:loop:* * |${pkgs.coreutils}/bin/cat - create user debug:* * ${pkgs.keyutils}/share/keyutils/request-key-debug.sh %k %d %c %S - negate * * * ${keyctl} negate %k 30 %S - ''; - }; -} diff --git a/configurations/mumble.nix b/configurations/mumble.nix deleted file mode 100644 index 28de1457..00000000 --- a/configurations/mumble.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: { - chvp.zfs.homeLinks = [ - { path = ".config/Mumble"; type = "data"; } - { path = ".local/share/Mumble"; type = "data"; } - ]; - - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = with pkgs; [ mumble ]; - }; -} diff --git a/configurations/networkmanager.nix b/configurations/networkmanager.nix deleted file mode 100644 index 932134ca..00000000 --- a/configurations/networkmanager.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, ... }: - -{ - chvp.zfs.systemLinks = [ - { path = "/etc/NetworkManager/system-connections"; type = "data"; } - ]; - - networking = { - hosts = { "127.0.0.1" = [ "dodona.localhost" "sandbox.localhost" ]; }; - networkmanager = { - enable = true; - packages = [ pkgs.networkmanager-vpnc ]; - wifi.macAddress = "random"; - }; - }; - - users.users.charlotte.extraGroups = [ - "networkmanager" - ]; - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = with pkgs; [ - networkmanagerapplet - ]; - }; -} diff --git a/configurations/openbox.nix b/configurations/openbox.nix deleted file mode 100644 index 3e4fe54b..00000000 --- a/configurations/openbox.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ ... }: - -{ - imports = [ ./base-x.nix ]; - home-manager.users.charlotte = { pkgs, ... }: { - xdg.configFile."openbox/rc.xml".source = ./openbox/rc.xml; - xsession = { - windowManager.command = "${pkgs.openbox}/bin/openbox"; - initExtra = '' - ${pkgs.tint2}/bin/tint2 & - ''; - }; - }; -} diff --git a/configurations/openbox/rc.xml b/configurations/openbox/rc.xml deleted file mode 100644 index a3e5c095..00000000 --- a/configurations/openbox/rc.xml +++ /dev/null @@ -1,723 +0,0 @@ - - - - - - - - 10 - 20 - - - - yes - - no - - yes - - no - - 200 - - no - - - - - Smart - -
yes
- - Primary - - 1 - -
- - - Clearlooks - NLIMC - - yes - yes - - sans - 8 - - bold - - normal - - - - sans - 8 - - bold - - normal - - - - sans - 9 - - normal - - normal - - - - sans - 9 - - normal - - normal - - - - sans - 9 - - bold - - normal - - - - sans - 9 - - bold - - normal - - - - - - - 4 - 1 - - - - 875 - - - - - yes - Nonpixel - - Center - - - - - 10 - - 10 - - - - - - - 0 - 0 - 0 - 0 - - - - TopLeft - - 0 - 0 - no - Above - - Vertical - - no - 300 - - 300 - - Middle - - - - - C-g - - - - leftno - - - rightno - - - upno - - - downno - - - leftno - - - rightno - - - upno - - - downno - - - 1 - - - 2 - - - 3 - - - 4 - - - - - - - - - - - - - - - - client-menu - - - - - - - - - - - - - - - - - - - - - - - - - yesyes - - - - - - - - - - - - right - - - - - left - - - - - up - - - - - down - - - - - - - - true - Kitty - - kitty - - - - - - 1 - - 500 - - 400 - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - previous - - - next - - - previous - - - next - - - previous - - - next - - - - - - - - - - - - - - no - - - - - - - - - - - yes - - - - - - - - - - - - - - - - - - - - - - - - - client-menu - - - - - - top - - - - - - left - - - - - - right - - - - - - bottom - - - - - - client-menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - client-menu - - - - - client-menu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - vertical - - - horizontal - - - - - - - - - - - - - - - - - previous - - - next - - - - previous - - - next - - - previous - - - next - - - - - - - - - - - - - - - - client-list-combined-menu - - - root-menu - - - - - - previous - - - next - - - previous - - - next - - - - - - - - - menu.xml - 200 - - no - - 100 - - 400 - - yes - - yes - - - - - - - -
diff --git a/configurations/pass.nix b/configurations/pass.nix deleted file mode 100644 index ad47605f..00000000 --- a/configurations/pass.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ lib, ... }: { - nixpkgs.overlays = [ - (self: super: { - pass = (super.pass.override { pass = super.pass-wayland; }).withExtensions (ext: [ ext.pass-otp ]); - }) - ]; - - home-manager.users.charlotte = { pkgs, ... }: { - programs.password-store = { - enable = true; - settings = { PASSWORD_STORE_DIR = "/home/charlotte/repos/passwords"; }; - }; - services.password-store-sync.enable = true; - }; -} diff --git a/configurations/sound.nix b/configurations/sound.nix deleted file mode 100644 index e1f0db07..00000000 --- a/configurations/sound.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, lib, ... }: - -{ - chvp.zfs.homeLinks = [ - { path = ".config/pipewire"; type = "cache"; } - ]; - - sound.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - jack.enable = true; - pulse.enable = true; - }; -} diff --git a/configurations/syncthing.nix b/configurations/syncthing.nix deleted file mode 100644 index c9d450bd..00000000 --- a/configurations/syncthing.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ ... }: - -{ - chvp.zfs.homeLinks = [ - { path = ".config/syncthing"; type = "data"; } - { path = "sync"; type = "cache"; } - ]; - home-manager.users.charlotte = { pkgs, ... }: { - services.syncthing.enable = true; - }; -} diff --git a/configurations/teams.nix b/configurations/teams.nix deleted file mode 100644 index cfc3466b..00000000 --- a/configurations/teams.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ ... }: - -{ - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = with pkgs; [ teams ]; - }; - - chvp = { - nix.unfreePackages = [ "teams" ]; - zfs.homeLinks = [ - { path = ".config/Microsoft"; type = "data"; } - ]; - }; -} diff --git a/configurations/themes.nix b/configurations/themes.nix deleted file mode 100644 index 08769bb1..00000000 --- a/configurations/themes.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ ... }: - -{ - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = [ pkgs.vanilla-dmz ]; - home.file = { - ".icons/default/index.theme".text = '' - [Icon Theme] - Name=Default - Comment=Default Cursor Theme - Inherits=Vanilla-DMZ - ''; - }; - dconf.settings."org/gnome/desktop/interface" = { - gtk-theme = "Arc"; - icon-theme = "Arc"; - cursor-theme = "Vanilla-DMZ"; - }; - gtk = { - enable = true; - font = { - package = pkgs.noto-fonts; - name = "Noto Sans"; - size = 10; - }; - gtk2.extraConfig = '' - gtk-cursor-theme-name = "Vanilla-DMZ" - gtk-cursor-theme-size = 0 - ''; - gtk3.extraConfig = { - gtk-cursor-theme-name = "Vanilla-DMZ"; - gtk-cursor-theme-size = 0; - }; - iconTheme = { - package = pkgs.arc-icon-theme; - name = "Arc"; - }; - theme = { - package = pkgs.arc-theme; - name = "Arc"; - }; - }; - qt = { - enable = true; - platformTheme = "gtk"; - }; - }; -} diff --git a/configurations/xdg-dirs.nix b/configurations/xdg-dirs.nix deleted file mode 100644 index 94c56a5e..00000000 --- a/configurations/xdg-dirs.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ ... }: - -{ - chvp.zfs.homeLinks = [ - { path = "desktop"; type = "data"; } - { path = "documents"; type = "data"; } - { path = "downloads"; type = "cache"; } - { path = "music"; type = "data"; } - { path = "pictures"; type = "cache"; } - { path = "repos"; type = "cache"; } - { path = "templates"; type = "data"; } - { path = "videos"; type = "data"; } - ]; - - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = with pkgs; [ xdg-user-dirs ]; - xdg = { - enable = true; - userDirs = { - enable = true; - desktop = "\$HOME/desktop"; - documents = "\$HOME/documents"; - download = "\$HOME/downloads"; - music = "\$HOME/music"; - pictures = "\$HOME/pictures"; - publicShare = "\$HOME/desktop"; - templates = "\$HOME/templates"; - videos = "\$HOME/videos"; - }; - }; - }; -} diff --git a/flake.lock b/flake.lock index ec50c9e1..b36ef854 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ }, "emacs-overlay": { "locked": { - "lastModified": 1624698592, - "narHash": "sha256-or3VxpmerZHAMuhpoA++cj51yopYaRe72triC+4Nq1k=", + "lastModified": 1624727938, + "narHash": "sha256-w6vdESHOlSVaa+ts7HB2Yi7zxZepjHnXArdTiauk/2o=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "67fe74d6e73e3c8a983b09a76d809acc730ad911", + "rev": "d756e841ef2d30dcb9d831f47c2f2bc9b7eaaabf", "type": "github" }, "original": { @@ -58,11 +58,11 @@ ] }, "locked": { - "lastModified": 1624612706, - "narHash": "sha256-HfuNvpN/T8TZrOTyjbLCjI4GqbYuQ5oAWZO/4T2Mj34=", + "lastModified": 1624742990, + "narHash": "sha256-Bl+3y9bn/217kDV8HkyCA3ldfry5hUGXpUrgiWFb4ag=", "owner": "nix-community", "repo": "home-manager", - "rev": "0ada50fc9c620f7ad9f7c6ff70bf40514f4400a9", + "rev": "8eee5f5272ac21df2f2db4b51eed28820c499930", "type": "github" }, "original": { diff --git a/machines/kharbranth/default.nix b/machines/kharbranth/default.nix index dfe154ee..856210a9 100644 --- a/machines/kharbranth/default.nix +++ b/machines/kharbranth/default.nix @@ -1,25 +1,18 @@ { config, pkgs, ... }: { - imports = [ - ./hardware.nix - ../../profiles/graphical.nix - ]; + imports = [ ./hardware.nix ]; networking.hostId = "e718389d"; time.timeZone = "Europe/Brussels"; - # Machine-specific application settings + # Machine-specific module settings chvp = { stateVersion = "20.09"; graphical = true; bluetooth.enable = true; - docker.enable = true; - eid.enable = true; git.email = "charlotte.vanpetegem@ugent.be"; - sshd.enable = true; - vpn.ugent.enable = true; zfs = { enable = true; encrypted = true; @@ -33,6 +26,5 @@ ]; rootDataset = "rpool/local/root"; }; - zotero.enable = true; }; } diff --git a/machines/kholinar/default.nix b/machines/kholinar/default.nix index 0756fea6..ce7fb8c2 100644 --- a/machines/kholinar/default.nix +++ b/machines/kholinar/default.nix @@ -1,42 +1,24 @@ { pkgs, lib, ... }: { - imports = [ - ./hardware.nix - ../../profiles/graphical.nix - ]; - - boot.kernelModules = [ "v4l2loopback" ]; - boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ]; - boot.extraModprobeConfig = '' - options v4l2loopback video_nr=9 card_label="obs" - ''; - - home-manager.users.charlotte = { pkgs, ... }: { - programs.obs-studio = { - enable = true; - package = pkgs.wrapOBS { - plugins = [ pkgs.obs-studio-plugins.wlrobs ]; - }; - }; - }; + imports = [ ./hardware.nix ]; networking.hostId = "3cc1a4b2"; time.timeZone = "Europe/Brussels"; - # Machine-specific settings + # Machine-specific module settings chvp = { stateVersion = "20.09"; graphical = true; + android.enable = true; bluetooth.enable = true; - docker.enable = true; - eid.enable = true; + dropbox.enable = true; git.email = "charlotte@vanpetegem.me"; minecraft.client = true; - sshd.enable = true; + mumble.enable = true; + obs.enable = true; steam.enable = true; - vpn.ugent.enable = true; zeroad.enable = true; zfs = { enable = true; @@ -51,6 +33,5 @@ ]; rootDataset = "rpool/local/root"; }; - zotero.enable = true; }; } diff --git a/machines/lasting-integrity/default.nix b/machines/lasting-integrity/default.nix index 9d5bd330..54811401 100644 --- a/machines/lasting-integrity/default.nix +++ b/machines/lasting-integrity/default.nix @@ -10,6 +10,7 @@ networking.hostId = "b352adfe"; + # Machine-specific module settings chvp = { stateVersion = "20.09"; docker.enable = true; diff --git a/machines/urithiru/default.nix b/machines/urithiru/default.nix index 1c375c6a..104e0789 100644 --- a/machines/urithiru/default.nix +++ b/machines/urithiru/default.nix @@ -14,6 +14,7 @@ environment.etc = lib.mapAttrs' (n: v: { name = "pinned-hosts/${n}"; value = { source = v.config.system.build.toplevel.outPath; }; }) (lib.filterAttrs (n: _: n != "urithiru") nixosConfigurations); + # Machine-specific module settings chvp = { stateVersion = "20.09"; accentor.enable = true; diff --git a/machines/urithiru/secret.nix b/machines/urithiru/secret.nix index ee162c1cafb6263624b0a3cecb53d54ad7b36086..6d533b95c47dd6ef382461055ad47f94e3212ab3 100644 GIT binary patch literal 1035 zcmZQ@_Y83kiVO&0kWXYbpBlWAlQHL@i;KFlQ)pRu(X!&{;+N)YwH>+YA!E1J{PN{i z#s3w#m%YnQ)yjP-arfWsF+J_?wy2V91GbOT8`TzUbJa*nbXPT2FpuI&+7sHuvU*Xj zo4V_soL`sQi`72OR8*F@a>n-cvrSJMFVzaJZC(2CmCC*^3CHKkzR=QJJ5?k$^Wf{2 zOO3)Qe~fHzALy-ozRhxm6V*T(tjE|n3|r$irb-rlMv_%Z&ecgunzr3{~+M$1yAe;d9HZAgebZ@&4~ z^fk$gr7B~W7`4B7Eq!H@+>dY`=NaOT=jYCwskBkrbYMM0l`mNcY z*`vXANnfpambu z&iWm@t@)Noa(!T|JS)pt;FjOU*6^wIS#g2zubPOMAY;8{1rN^2FyHZ1UM|P=2>?vE B^M(Kb literal 2509 zcmZQ@_Y83kiVO&0aI1~-j2G!ON(sFgVq(keE&k^I%nNDS8i#LG%@e4KExkK`$r2OC z3%t+mFN$os5HD(-cx>|q4{I5F&nJbSD&{@=S@vzws^Uv5S9X2aQOLjOR*Pxt+k*xx z0`)FWIqLdRs@_;;4yO_Csa@A9=f|Ep7I`-)VOQIS`Hzk54KEyh;eR`xRb0V2K|%itXVoasto~H>-#g<2*ZOsr^h_eBF-e>AFVkDKs3yYjt$x63(cHt|^WQFW z|1`Nn;ZNzAxw1JAqT_Tn@hd*%Pi9&4LRxTM?Y^&Z%N}~(emLtMqh0T4%-WR2{#^IaPl}KDb#(OscO< zDpk1~-Fa5eLuX2Ps%@d=z5;&V*{0Gbcim*Ycl}irL-zGOA_tQe@8j#wbXum{@ch}F z&vWlT@iEJb`o`w-Fvw@K>aJ-CyB5bE4lMj|npv9DwU9w1xAX0t_x7LS9VZ{$kk>YI ze%O?}wRazIeN36GGR<3;?bYHJZx*wh`>^4hS9xIL&Yhx+aSTbx3L%s3OrG-2fxUHQ zll-42K2C~j?`o=Cpn8%n9D(tR5!A#(nMVC`w#r1_= zJDbnvzd3$x%m20Fd3RDvr-|;2KK^k1-ZughJ{q-nsI7S0IQg^V*9FVOm37!owg!ez zbvH5MOl0M9Z25L4J!jdgzbkatIDcJMIaz7x*?-+EQ}wN%S3O)e;Xr@sr>Nd{Q$PL8 zJ-P2e?B3aZTMy2Te;3eSX1y|eriG6?`+JdHl9QC!70j}wbxbP02W;53<6FZ14Poi- zN&aP~LFrvnEP8hQopkyDwA#$2%I>?)9r@0DvDxb6bHx+Z zPw!6=*s|U+S?a>PiVrtVEMm@ITK71+%h+pA$b9xh$&l?$A_44gW~QE)mLy!amnAuS zpZ%9jlM?x!H#BX_R#7&|*16d&wY{=h_FCGJB(9Vl=Vw2%E#zB0wavEr@5bHJ=hyFH zm1C|u@aw~#+w0n%c7{FePh&A@3t1p8^~!nb_2WyG_x{~}$S@;e|Mjc~B~dlsl6GYO zX}j5cyw*LhAu)^9@(80Y!vYqON!3%+74q|@)!hp&$=~;tgX`$kc)4%(o^^R$B^?v4 zESU7}+0FpHt+(~Uxi~LWnVq>R`~UX3*Ydk|i8W=HeBmf~*k15l;!od^MfFa7lSIm7 zXG^U2wm00q^w6}K6W7?)-@cs~zCLk+t%kzcjT-gx&yC&uwjaLb`6K+)rY~P|7G>9n zS+@%O_2{$jmCxY1*mA)+%uN0|SBmD*qc=puCziWh&e*n}=SxA*-4hYqXM|)H8Xmfx z8+XHcW81Ee%o#mDUgp-mJ#wLaJHz9RE9Zaox4U`w@Xt7dt(yEBpU<49 z+pcrDkE@eA`DibpkHLL%9KE9HB?#gmi4*hPWhWUTrI;Q_~-|Uoj zw6scSaPRG`4#k}Wt`JjN8;d0rmxHH$iqN=a{cbdj3`S3{1 zwG~ePU+L`F^_p|}=aQ{A7EJlTe#Or!X-k^*wtFWh&SaB0m-V|b)8$=F=27V_pABdI z`n~CG&!4x9BJbOp7M!(MQ+Q^Th}bpznuXVT&nR&}cDgg+z^C^Ui&}CgHZ?2dTrH4y z<Yy!ovKcGGPU2M zQrh<`S9nJN155Q$@!To$e_z*?EY>@4bdkoH9hc;JUwldpfAcToc6+^TWb3lSMTsKc z7hIORntkH?Yf)=;t#1ko=jbqXMJk6G7wljy+}N>_?esO(H|r&o7KZCixY(6*vxHkU zq~2a!>YrnA=%L`l>JqPhOyJDW@Z~$aN`k-o1pcE`zK{K@2tp4k=5OB zYN~r;oT9ycP~(F`Q-n9T=U!JlSgz@Cz<^g%f#sH7E<=2z==Xb?StSi#Uh?w{@=EV_ z{fTZYh+4jUUU}L%&&!1=n|9dL?{c^hn5OmO!tL&+pn&Lv=NnQ!H3l`Ty!oz_=l5Tw zT(7<2k6M;SFdk6uYMP_;OpSBKW&_7FsxqdH;^_tF9)-1j;@f=NN6JY>HuQGH8u9wT z1r>WYHH)3@*?v21mRR@8(;`pf?tN&S|M~d++v$>GeAoIM*3T>`OpZBq_*Uv$|N5wY zkMx&*FZma3es;2UdNx;;#MZl)7QU~4m$UT#MDHly8QWC9gj_tz`=d}ne@&S3c}A;! zvzJT%b)CAEeV%;ihs5WZzh&l6eLSn*&}~|>@{2o5&go5wWLx@3&FyDL(uXN}w(A7e zRTZY{`lyvy+H~{zn@`oXU1;|>by0Dp(lJLRqm^ME)9P^B{cdCQBc0&iA7?(TpLgQ;S!+St&wnTAb)@WJ zRXpN+R*sKJGt+d^|El0c2Ul)hov~!Ac&a0xyV@tGB)xjixHXRd4qmms@hC9*m2I}- zC27uv?o3N#DvWmKR1b3i8bbEYN#;31G=Cy`CJOKb}kKXhE diff --git a/modules/android.nix b/modules/android.nix new file mode 100644 index 00000000..16eb9eed --- /dev/null +++ b/modules/android.nix @@ -0,0 +1,14 @@ +{ config, lib, ... }: + +{ + options.chvp.android.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.android.enable { + chvp.zfs.homeLinks = [{ path = ".android"; type = "cache"; }]; + programs.adb.enable = true; + users.users.charlotte.extraGroups = [ "adbusers" ]; + }; +} diff --git a/modules/calibre.nix b/modules/calibre.nix new file mode 100644 index 00000000..6185d6be --- /dev/null +++ b/modules/calibre.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.calibre.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.calibre.enable { + chvp.zfs.homeLinks = [ + { path = ".config/calibre"; type = "cache"; } + ]; + home-manager.users.charlotte = { ... }: { + home.packages = [ pkgs.calibre ]; + }; + }; +} diff --git a/modules/default.nix b/modules/default.nix index b78f67e9..a9173561 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,26 +3,46 @@ { imports = [ ./accentor.nix + ./android.nix ./bluetooth.nix + ./calibre.nix ./docker.nix + ./deluge-client.nix + ./deluge-server.nix + ./dropbox.nix ./eid.nix ./emacs.nix + ./firefox.nix ./git.nix ./global-mailer.nix + ./gnupg.nix + ./graphical.nix + ./hledger.nix + ./mail-client.nix ./minecraft.nix + ./mumble.nix + ./networkmanager.nix ./nextcloud.nix ./nix.nix ./nginx.nix + ./obs.nix ./ovh.nix + ./pass.nix ./smartd.nix + ./sound.nix ./ssh.nix ./sshd.nix ./steam.nix + ./sway + ./syncthing-client.nix ./syncthing-server.nix ./teeworlds.nix + ./terminal.nix ./tetris.nix + ./theming.nix ./tmux.nix - ./vpn.nix + ./ugent + ./xdg.nix ./zeroad.nix ./zfs.nix ./zotero.nix @@ -44,11 +64,6 @@ example = "/cache"; }; - graphical = lib.mkOption { - default = false; - example = true; - }; - hasContainers = lib.mkOption { default = false; example = true; @@ -68,11 +83,7 @@ }; }; - environment.systemPackages = with pkgs; [ - htop - ncdu - ripgrep - ]; + environment.systemPackages = with pkgs; [ htop moreutils ncdu ripgrep sshfs unzip ]; console = { colors = [ @@ -124,6 +135,8 @@ ]; }; + services.fwupd.enable = true; + users = { mutableUsers = false; defaultUserShell = pkgs.zsh; @@ -132,7 +145,7 @@ isNormalUser = true; home = "/home/charlotte"; description = "Charlotte Van Petegem"; - extraGroups = [ "systemd-journal" ] ++ lib.optionals config.chvp.graphical [ "input" "video" ]; + extraGroups = [ "systemd-journal" ]; passwordFile = config.age.secrets."passwords/users/charlotte".path; }; root.passwordFile = config.age.secrets."passwords/users/root".path; diff --git a/modules/deluge-client.nix b/modules/deluge-client.nix new file mode 100644 index 00000000..bd60207b --- /dev/null +++ b/modules/deluge-client.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.deluge-client.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.deluge-client.enable { + home-manager.users.charlotte = { pkgs, ... }: { + home.packages = with pkgs; [ deluge ]; + }; + + chvp.zfs.homeLinks = [ + { path = ".config/deluge"; type = "data"; } + ]; + }; +} diff --git a/modules/deluge-server.nix b/modules/deluge-server.nix new file mode 100644 index 00000000..f55541c9 --- /dev/null +++ b/modules/deluge-server.nix @@ -0,0 +1,66 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.deluge-server = { + enable = lib.mkOption { + default = false; + example = true; + }; + count = lib.mkOption { + default = 1; + example = 6; + }; + }; + + config = lib.mkIf config.chvp.deluge-server.enable { + chvp.nginx.hosts = builtins.genList + (n: { + fqdn = "del${toString (n + 1)}.vanpetegem.me"; + basicProxy = "http://localhost:${toString (8112 + n)}"; + }) + config.chvp.deluge-server.count; + + networking.firewall = { + allowedTCPPortRanges = [ + { from = 60000; to = 60000 + config.chvp.deluge-server.count - 1; } + { from = 58846; to = 58846 + config.chvp.deluge-server.count - 1; } + ]; + }; + + systemd.services = builtins.foldl' (x: y: x // y) { } (builtins.genList + (n: + let num = toString (n + 1); in + { + "del${num}" = { + after = [ "network.target" ]; + description = "Deluge daemon ${num}"; + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.deluge ]; + serviceConfig = { + ExecStart = '' + ${pkgs.deluge}/bin/deluged --do-not-daemonize --config /data/var/lib/deluge/del${toString (n + 1)} + ''; + Restart = "on-success"; + User = "charlotte"; + Group = "users"; + UMask = "022"; + }; + }; + "del${num}-web" = { + after = [ "network.target" "del${num}.service" ]; + requires = [ "del${num}.service" ]; + description = "Deluge Web UI for daemon ${num}"; + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.deluge ]; + serviceConfig = { + ExecStart = '' + ${pkgs.deluge}/bin/deluge-web --do-not-daemonize --config /data/var/lib/deluge/del${toString (n + 1)} --port ${toString (8112 + n)} + ''; + User = "charlotte"; + Group = "users"; + }; + }; + }) + config.chvp.deluge-server.count); + }; +} diff --git a/modules/dropbox.nix b/modules/dropbox.nix new file mode 100644 index 00000000..c999c9dc --- /dev/null +++ b/modules/dropbox.nix @@ -0,0 +1,44 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.dropbox.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.dropbox.enable { + chvp = { + nix.unfreePackages = [ "dropbox" ]; + zfs.homeLinks = [ + { path = ".dropbox"; type = "cache"; } + { path = "Dropbox"; type = "data"; } + ]; + }; + + # Avoids a double firefox install, see https://github.com/NixOS/nixpkgs/pull/31772 + nixpkgs.overlays = [ (self: super: { firefox-bin = self.firefox; }) ]; + + home-manager.users.charlotte = { pkgs, ... }: { + systemd.user.services = { + dropbox = { + Unit = { + Description = "Dropbox"; + }; + Service = { + Environment = "QT_PLUGIN_PATH=\"/run/current-system/sw/${pkgs.qt5.qtbase.qtPluginPrefix}\" QML2_IMPORT_PATH=\"/run/current-system/sw/${pkgs.qt5.qtbase.qtQmlPrefix}\""; + ExecStart = "${pkgs.dropbox.out}/bin/dropbox"; + ExecReload = "${pkgs.coreutils.out}/bin/kill -HUP $MAINPID"; + KillMode = "control-group"; + Restart = "on-failure"; + PrivateTmp = true; + ProtectSystem = "full"; + Nice = 10; + }; + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + }; + }; + }; + }; +} diff --git a/modules/eid.nix b/modules/eid.nix index 10bf4892..07bc7f18 100644 --- a/modules/eid.nix +++ b/modules/eid.nix @@ -8,6 +8,11 @@ config = lib.mkIf config.chvp.eid.enable { environment.systemPackages = [ pkgs.eid-mw ]; + nixpkgs.overlays = [ + (self: super: { + firefox = super.firefox.override { pkcs11Modules = [ self.eid-mw ]; }; + }) + ]; services.pcscd = { enable = true; plugins = [ pkgs.ccid ]; diff --git a/modules/firefox.nix b/modules/firefox.nix new file mode 100644 index 00000000..46ee1610 --- /dev/null +++ b/modules/firefox.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.firefox.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.firefox.enable { + chvp.zfs.homeLinks = [ + { path = ".cache/mozilla"; type = "cache"; } + { path = ".mozilla"; type = "data"; } + ]; + + home-manager.users.charlotte = { ... }: { + home.packages = with pkgs; [ firefox ]; + }; + }; +} diff --git a/configurations/gnupg.nix b/modules/gnupg.nix similarity index 67% rename from configurations/gnupg.nix rename to modules/gnupg.nix index 44309b8e..0421b2ed 100644 --- a/configurations/gnupg.nix +++ b/modules/gnupg.nix @@ -1,16 +1,22 @@ { config, lib, ... }: { - options.chvp.gnupg.pinentryFlavor = lib.mkOption { - type = lib.types.str; - default = "curses"; - example = "qt"; - description = '' - Pinentry flavor for gnupg. - ''; + options.chvp.gnupg = { + enable = lib.mkOption { + default = false; + example = true; + }; + pinentryFlavor = lib.mkOption { + type = lib.types.str; + default = "curses"; + example = "qt"; + description = '' + Pinentry flavor for gnupg. + ''; + }; }; - config = { + config = lib.mkIf config.chvp.gnupg.enable { chvp.zfs.homeLinks = [ { path = ".gnupg/crls.d"; type = "data"; } { path = ".gnupg/private-keys-v1.d"; type = "data"; } @@ -19,6 +25,7 @@ ]; programs.gnupg.agent = { enable = true; + pinentryFlavor = config.chvp.gnupg.pinentryFlavor; }; home-manager.users.charlotte = { lib, ... }: { home.activation.fixPermissionsCommands = lib.hm.dag.entryAfter [ "writeBoundary" ] '' diff --git a/modules/graphical.nix b/modules/graphical.nix new file mode 100644 index 00000000..59c13761 --- /dev/null +++ b/modules/graphical.nix @@ -0,0 +1,50 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.graphical = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.graphical { + users.users.charlotte.extraGroups = [ "input" "video" ]; + chvp = { + calibre.enable = lib.mkDefault true; + deluge-client.enable = lib.mkDefault true; + docker.enable = lib.mkDefault true; + eid.enable = lib.mkDefault true; + firefox.enable = lib.mkDefault true; + mail-client.enable = lib.mkDefault true; + gnupg = { + enable = lib.mkDefault true; + pinentryFlavor = lib.mkDefault "qt"; + }; + hledger.enable = lib.mkDefault true; + networkmanager.enable = lib.mkDefault true; + nix.unfreePackages = [ "google-chrome" ]; + pass.enable = lib.mkDefault true; + sound.enable = lib.mkDefault true; + syncthing-client.enable = lib.mkDefault true; + sway.enable = lib.mkDefault true; + terminal.enable = lib.mkDefault true; + theming.enable = lib.mkDefault true; + ugent.enable = lib.mkDefault true; + xdg.enable = lib.mkDefault true; + zotero.enable = lib.mkDefault true; + }; + + home-manager.users.charlotte = { ... }: { + home.packages = with pkgs; [ + google-chrome + libreoffice-fresh + mpv + okular + pandoc + ranger + texlive.combined.scheme-small + ungoogled-chromium + youtube-dl + ]; + }; + }; +} diff --git a/modules/hledger.nix b/modules/hledger.nix new file mode 100644 index 00000000..5331b5f5 --- /dev/null +++ b/modules/hledger.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, ... }: + +let + hledger-repo = pkgs.fetchFromGitHub { + owner = "chvp"; + repo = "hledger"; + rev = "feature/gain-reports"; + sha256 = "07qsrq71pnkys11q6k2zc20xc9l3yp8dhzp1ar5bnkgcwbm69rcx"; + }; +in +{ + options.chvp.hledger.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.hledger.enable { + nixpkgs.overlays = [ + (self: super: { + haskellPackages = super.haskellPackages.override { + overrides = hself: hsuper: rec { + hledger = hsuper.callCabal2nixWithOptions "hledger" hledger-repo "--subpath hledger" { }; + hledger-lib = hsuper.callCabal2nixWithOptions "hledger-lib" hledger-repo "--subpath hledger-lib" { }; + }; + }; + }) + ]; + home-manager.users.charlotte = { ... }: { + home.packages = [ pkgs.hledger ]; + }; + }; +} diff --git a/configurations/mail.nix b/modules/mail-client.nix similarity index 97% rename from configurations/mail.nix rename to modules/mail-client.nix index 79226beb..a15a32e4 100644 --- a/configurations/mail.nix +++ b/modules/mail-client.nix @@ -1,7 +1,8 @@ -{ config, pkgs, lib, ... }: +{ config, lib, pkgs, ... }: + let passwordScript = pkgs.writeShellScript "get_mail_password" ''${pkgs.pass}/bin/pass show "$@" | head -n1 | tr -d "\n"''; - notifyScript = name: pkgs.writeShellScript "notify_${name}_mail" '' + notifyScript = name: pkgs.writeShellScript "notify_${name}_mail" (if config.chvp.graphical then '' unseen_count=$(${pkgs.mblaze}/bin/mlist -N ~/mail/*/INBOX | wc -l) if [ "$unseen_count" = "1" ] @@ -11,7 +12,7 @@ let then ${pkgs.libnotify}/bin/notify-send -t 5000 'New ${name} mail arrived' "$unseen_count unseen mails" fi - ''; + '' else ''true''); makeAccount = { name, address, host ? "", imapHost ? host, smtpHost ? host, useStartTls ? false, passFile, extraConfig ? { } }: (lib.recursiveUpdate { inherit address; @@ -75,7 +76,12 @@ let toRecursiveINIBase 1; in { - config = { + options.chvp.mail-client.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.mail-client.enable { chvp.zfs.homeLinks = [ { path = "mail"; type = "data"; } { path = ".cache/mu"; type = "cache"; } diff --git a/modules/mumble.nix b/modules/mumble.nix new file mode 100644 index 00000000..426c9c51 --- /dev/null +++ b/modules/mumble.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.mumble.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.mumble.enable { + chvp.zfs.homeLinks = [ + { path = ".config/Mumble"; type = "data"; } + { path = ".local/share/Mumble"; type = "data"; } + ]; + + home-manager.users.charlotte = { ... }: { + home.packages = with pkgs; [ mumble ]; + }; + }; +} diff --git a/modules/networkmanager.nix b/modules/networkmanager.nix new file mode 100644 index 00000000..98defd84 --- /dev/null +++ b/modules/networkmanager.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.networkmanager.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.networkmanager.enable { + chvp.zfs.systemLinks = [ + { path = "/etc/NetworkManager/system-connections"; type = "data"; } + ]; + networking.networkmanager = { + enable = true; + wifi.macAddress = "random"; + }; + + users.users.charlotte.extraGroups = [ "networkmanager" ]; + home-manager.users.charlotte = { ... }: { + home.packages = with pkgs; [ networkmanagerapplet ]; + }; + }; +} diff --git a/modules/nginx.nix b/modules/nginx.nix index b3bc336d..eb18ac75 100644 --- a/modules/nginx.nix +++ b/modules/nginx.nix @@ -46,7 +46,7 @@ security.acme = { certs."vanpetegem.me" = { dnsProvider = "cloudflare"; - credentialsFile = config.age.secrets."passwords/services/acme".path; + credentialsFile = config.age.secrets."passwords/services/acme".path; extraDomainNames = [ "*.vanpetegem.me" "cvpetegem.be" diff --git a/modules/obs.nix b/modules/obs.nix new file mode 100644 index 00000000..db98bbdb --- /dev/null +++ b/modules/obs.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.obs.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.obs.enable { + boot.kernelModules = [ "v4l2loopback" ]; + boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ]; + boot.extraModprobeConfig = '' + options v4l2loopback video_nr=9 card_label="obs" + ''; + + chvp.zfs.homeLinks = [ + { path = ".config/obs-studio"; type = "data"; } + ]; + + home-manager.users.charlotte = { pkgs, ... }: { + programs.obs-studio = { + enable = true; + plugins = [ pkgs.obs-studio-plugins.wlrobs ]; + }; + }; + }; +} diff --git a/modules/pass.nix b/modules/pass.nix new file mode 100644 index 00000000..0d61e196 --- /dev/null +++ b/modules/pass.nix @@ -0,0 +1,25 @@ +{ config, lib, ... }: + +{ + options.chvp.pass.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.pass.enable { + nixpkgs.overlays = [ + (self: super: { + firefox = super.firefox.override { extraNativeMessagingHosts = [ self.passff-host ]; }; + pass = (super.pass.override { pass = super.pass-wayland; }).withExtensions (ext: [ ext.pass-otp ]); + }) + ]; + + home-manager.users.charlotte = { ... }: { + programs.password-store = { + enable = true; + settings = { PASSWORD_STORE_DIR = "/home/charlotte/repos/passwords"; }; + }; + services.password-store-sync.enable = true; + }; + }; +} diff --git a/modules/sound.nix b/modules/sound.nix new file mode 100644 index 00000000..fa682da5 --- /dev/null +++ b/modules/sound.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.sound.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.sound.enable { + chvp.zfs.homeLinks = [ + { path = ".config/pipewire"; type = "cache"; } + ]; + + home-manager.users.charlotte = { ... }: { + home.packages = with pkgs; [ + pavucontrol + qjackctl + ]; + }; + + sound.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + jack.enable = true; + pulse.enable = true; + }; + }; +} diff --git a/modules/sshd.nix b/modules/sshd.nix index f27c46fd..3816e205 100644 --- a/modules/sshd.nix +++ b/modules/sshd.nix @@ -2,8 +2,8 @@ { options.chvp.sshd.enable = lib.mkOption { - default = false; - example = true; + default = true; + example = false; }; config = lib.mkIf config.chvp.sshd.enable { diff --git a/configurations/sway/color-picker.nix b/modules/sway/color-picker.nix similarity index 100% rename from configurations/sway/color-picker.nix rename to modules/sway/color-picker.nix diff --git a/configurations/sway.nix b/modules/sway/default.nix similarity index 88% rename from configurations/sway.nix rename to modules/sway/default.nix index a88d2b6a..1fe455d0 100644 --- a/configurations/sway.nix +++ b/modules/sway/default.nix @@ -1,12 +1,18 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: + let - launcher = import ./sway/launcher.nix { inherit pkgs; stdenv = pkgs.stdenv; }; - color-picker = import ./sway/color-picker.nix { inherit pkgs; }; - screenshot = import ./sway/screenshot.nix { inherit pkgs; }; - status-configuration = import ./sway/status-configuration.nix { inherit pkgs config; }; + launcher = import ./launcher.nix { inherit pkgs; stdenv = pkgs.stdenv; }; + color-picker = import ./color-picker.nix { inherit pkgs; }; + screenshot = import ./screenshot.nix { inherit pkgs; }; + status-configuration = import ./status-configuration.nix { inherit pkgs config; }; in { - config = { + options.chvp.sway.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.sway.enable { services.dbus.packages = with pkgs; [ gnome3.dconf ]; security.pam.services.swaylock = { }; xdg.portal = { @@ -14,11 +20,23 @@ in gtkUsePortal = true; extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ]; }; - home-manager.users.charlotte = { pkgs, lib, ... }: { - home.packages = [ color-picker screenshot ]; - programs.mako = { - enable = true; - font = "Fira Code Normal 9"; + home-manager.users.charlotte = { pkgs, ... }: { + home.packages = with pkgs; [ + color-picker + screenshot + wf-recorder + wl-clipboard + ]; + programs = { + mako = { + enable = true; + font = "Fira Code Normal 9"; + }; + zsh.loginExtra = '' + if [[ -z "$DISPLAY" ]] && [[ $(tty) = "/dev/tty1" ]]; then + exec sway + fi + ''; }; services.kanshi = { enable = true; diff --git a/configurations/sway/launcher.nix b/modules/sway/launcher.nix similarity index 100% rename from configurations/sway/launcher.nix rename to modules/sway/launcher.nix diff --git a/configurations/sway/launcher.zsh b/modules/sway/launcher.zsh similarity index 100% rename from configurations/sway/launcher.zsh rename to modules/sway/launcher.zsh diff --git a/configurations/sway/screenshot.nix b/modules/sway/screenshot.nix similarity index 100% rename from configurations/sway/screenshot.nix rename to modules/sway/screenshot.nix diff --git a/configurations/sway/status-configuration.nix b/modules/sway/status-configuration.nix similarity index 100% rename from configurations/sway/status-configuration.nix rename to modules/sway/status-configuration.nix diff --git a/modules/syncthing-client.nix b/modules/syncthing-client.nix new file mode 100644 index 00000000..01bb4876 --- /dev/null +++ b/modules/syncthing-client.nix @@ -0,0 +1,18 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.syncthing-client.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.syncthing-client.enable { + chvp.zfs.homeLinks = [ + { path = ".config/syncthing"; type = "data"; } + { path = "sync"; type = "cache"; } + ]; + home-manager.users.charlotte = { pkgs, ... }: { + services.syncthing.enable = true; + }; + }; +} diff --git a/modules/terminal.nix b/modules/terminal.nix new file mode 100644 index 00000000..7b22c70f --- /dev/null +++ b/modules/terminal.nix @@ -0,0 +1,52 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.terminal.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.terminal.enable { + home-manager.users.charlotte = { pkgs, ... }: { + programs.kitty = { + enable = true; + settings = { + font_family = "Fira Code"; + font_size = 9; + disable_ligatures = "cursor"; + background = "#ffffff"; + foreground = "#000000"; + cursor = "#777777"; + url_color = "#0031a9"; + # black + color0 = "#282828"; + color8 = "#000000"; + # red + color1 = "#a60000"; + color9 = "#972500"; + # green + color2 = "#005e00"; + color10 = "#315b00"; + # yellow + color3 = "#813e00"; + color11 = "#70480f"; + # blue + color4 = "#0031a9"; + color12 = "#2544bb"; + # magenta + color5 = "#721045"; + color13 = "#8f0075"; + # cyan + color6 = "#00538b"; + color14 = "#30517f"; + # white + color7 = "#f8f8f8"; + color15 = "#ffffff"; + enable_audio_bell = false; + visual_bell_duration = "0.25"; + remember_window_size = false; + }; + }; + }; + }; +} diff --git a/modules/theming.nix b/modules/theming.nix new file mode 100644 index 00000000..23a07f1d --- /dev/null +++ b/modules/theming.nix @@ -0,0 +1,77 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.theming.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.theming.enable { + fonts = { + fontDir.enable = true; + fontconfig = { + enable = true; + defaultFonts = { + emoji = [ "Noto Color Emoji" ]; + monospace = [ "Fira Code" ]; + sansSerif = [ "Noto Sans" ]; + serif = [ "Noto Serif" ]; + }; + }; + fonts = with pkgs; [ + fira-code + fira-code-symbols + font-awesome_4 + noto-fonts + noto-fonts-cjk + noto-fonts-emoji + noto-fonts-extra + ]; + }; + + home-manager.users.charlotte = { pkgs, ... }: { + home.packages = [ pkgs.vanilla-dmz ]; + home.file = { + ".icons/default/index.theme".text = '' + [Icon Theme] + Name=Default + Comment=Default Cursor Theme + Inherits=Vanilla-DMZ + ''; + }; + dconf.settings."org/gnome/desktop/interface" = { + gtk-theme = "Arc"; + icon-theme = "Arc"; + cursor-theme = "Vanilla-DMZ"; + }; + gtk = { + enable = true; + font = { + package = pkgs.noto-fonts; + name = "Noto Sans"; + size = 10; + }; + gtk2.extraConfig = '' + gtk-cursor-theme-name = "Vanilla-DMZ" + gtk-cursor-theme-size = 0 + ''; + gtk3.extraConfig = { + gtk-cursor-theme-name = "Vanilla-DMZ"; + gtk-cursor-theme-size = 0; + }; + iconTheme = { + package = pkgs.arc-icon-theme; + name = "Arc"; + }; + theme = { + package = pkgs.arc-theme; + name = "Arc"; + }; + }; + qt = { + enable = true; + platformTheme = "gtk"; + }; + }; + }; +} diff --git a/modules/ugent/citrix.nix b/modules/ugent/citrix.nix new file mode 100644 index 00000000..06e7179a --- /dev/null +++ b/modules/ugent/citrix.nix @@ -0,0 +1,20 @@ +{ config, lib, ... }: + +{ + options.chvp.ugent.citrix.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.ugent.citrix.enable { + chvp = { + nix.unfreePackages = [ "citrix-workspace" ]; + zfs.homeLinks = [ + { path = ".ICAClient"; type = "data"; } + ]; + }; + home-manager.users.charlotte = { pkgs, ... }: { + home.packages = with pkgs; [ citrix_workspace ]; + }; + }; +} diff --git a/modules/ugent/default.nix b/modules/ugent/default.nix new file mode 100644 index 00000000..2a72c95a --- /dev/null +++ b/modules/ugent/default.nix @@ -0,0 +1,24 @@ +{ config, lib, ... }: + +{ + imports = [ + ./vpn.nix + ./citrix.nix + ./mounts.nix + ./teams.nix + ]; + + options.chvp.ugent.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.ugent.enable { + chvp.ugent = { + citrix.enable = lib.mkDefault true; + vpn.enable = lib.mkDefault true; + mounts.enable = lib.mkDefault true; + teams.enable = lib.mkDefault true; + }; + }; +} diff --git a/modules/ugent/mounts.nix b/modules/ugent/mounts.nix new file mode 100644 index 00000000..087e4a28 --- /dev/null +++ b/modules/ugent/mounts.nix @@ -0,0 +1,66 @@ +{ config, lib, pkgs, ... }: + +let + automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"; +in +{ + options.chvp.ugent.mounts.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.ugent.mounts.enable { + fileSystems = { + "/mnt/ugent/files" = { + device = "//files.ugent.be/ecvpeteg"; + fsType = "cifs"; + options = [ "credentials=/run/secrets/passwords/ugent-mount-credentials,${automount_opts},users,vers=3.0,noperm,domain=UGENT,sec=ntlmv2i" ]; + noCheck = true; + }; + "/mnt/ugent/webhost" = { + device = "//webhost.ugent.be/ecvpeteg"; + fsType = "cifs"; + options = [ "credentials=/run/secrets/passwords/ugent-mount-credentials,${automount_opts},users,vers=3.0" ]; + noCheck = true; + }; + }; + + age.secrets."passwords/ugent-mount-credentials".file = ../../secrets/passwords/ugent-mount-credentials.age; + + environment.systemPackages = [ pkgs.keyutils ]; + # Remove this once https://github.com/NixOS/nixpkgs/issues/34638 is resolved + # The TL;DR is: the kernel calls out to the hard-coded path of + # /sbin/request-key as part of its CIFS auth process, which of course does + # not exist on NixOS due to the usage of Nix store paths. + system.activationScripts.symlink-requestkey = '' + if [ ! -d /sbin ]; then + mkdir /sbin + fi + ln -sfn /run/current-system/sw/bin/request-key /sbin/request-key + ''; + # request-key expects a configuration file under /etc + environment.etc."request-key.conf" = { + text = + let + upcall = "${pkgs.cifs-utils}/bin/cifs.upcall"; + keyctl = "${pkgs.keyutils}/bin/keyctl"; + in + '' + #OP TYPE DESCRIPTION CALLOUT_INFO PROGRAM + # -t is required for DFS share servers... + create cifs.spnego * * ${upcall} -t %k + create dns_resolver * * ${upcall} %k + # Everything below this point is essentially the default configuration, + # modified minimally to work under NixOS. Notably, it provides debug + # logging. + create user debug:* negate ${keyctl} negate %k 30 %S + create user debug:* rejected ${keyctl} reject %k 30 %c %S + create user debug:* expired ${keyctl} reject %k 30 %c %S + create user debug:* revoked ${keyctl} reject %k 30 %c %S + create user debug:loop:* * |${pkgs.coreutils}/bin/cat + create user debug:* * ${pkgs.keyutils}/share/keyutils/request-key-debug.sh %k %d %c %S + negate * * * ${keyctl} negate %k 30 %S + ''; + }; + }; +} diff --git a/modules/ugent/teams.nix b/modules/ugent/teams.nix new file mode 100644 index 00000000..9be2a1cc --- /dev/null +++ b/modules/ugent/teams.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.ugent.teams.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.ugent.teams.enable { + chvp = { + nix.unfreePackages = [ "teams" ]; + zfs.homeLinks = [ + { path = ".config/Microsoft"; type = "data"; } + ]; + }; + + home-manager.users.charlotte = { pkgs, ... }: { + home.packages = with pkgs; [ teams ]; + }; + }; +} diff --git a/modules/ugent/vpn.nix b/modules/ugent/vpn.nix new file mode 100644 index 00000000..4e15d7cc --- /dev/null +++ b/modules/ugent/vpn.nix @@ -0,0 +1,38 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./vpn.secret.nix + ]; + + options = { + chvp.ugent.vpn.enable = lib.mkOption { + default = false; + example = true; + }; + }; + + config = lib.mkIf config.chvp.ugent.vpn.enable { + systemd.services = { + ugent-global-vpn = { + after = [ "network.target" ]; + conflicts = [ "ugent-local-vpn.service" ]; + }; + ugent-local-vpn = { + after = [ "network.target" ]; + conflicts = [ "ugent-global-vpn.service" ]; + }; + }; + security.polkit.extraConfig = '' + polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.systemd1.manage-units" && action.lookup("unit") == "ugent-global-vpn.service") { + return polkit.Result.YES; + } + if (action.id == "org.freedesktop.systemd1.manage-units" && action.lookup("unit") == "ugent-local-vpn.service") { + return polkit.Result.YES; + } + }); + ''; + age.secrets."passwords/ugent-vpn".file = ../../secrets/passwords/ugent-vpn.age; + }; +} diff --git a/modules/ugent/vpn.secret.nix b/modules/ugent/vpn.secret.nix new file mode 100644 index 0000000000000000000000000000000000000000..337004aa6da53f68737d0b9ef03b61d31998d465 GIT binary patch literal 529 zcmZQ@_Y83kiVO&0Sgm+)$Lmjmda9w7PiN?-Zmidt=6id=+k2(?=gyl>b@=@8=T_E9 zoM#p64z~xKk@K!N!fCSSN>!$E{*ss9P12^eeSLHIDD$_=V%wive7wNpcYrDL-@)pJ z_vd^P)c0@cob0vwpMTrIL;8o=Zj{c5pYKtk@HegK#8igvrv56%>aPbG^S2uO&pq;x zgZslR2fnTuHto@qw|%zA5zSi16yvsRjljbHAODDZ{(XEmOY|X+VCkbLDKmL1g-_1@ z?ymjat$GrRjhFE&!~dVxzPxlQNuhAPx8)a>Fv0cq^LS_K9<;SnUFz=1JH1odY|j%J z;n#UWtM>kSHlwsWN%GvYQ+;+))g^3E@6C$LmdQ<-o$;am@BHfB0pbdQ3U>NT3*KjV zY;22c@!w^bUHIYG!+5sV`nm-zT7532XTln$|L)hm<9v75vR_N*t6W~`5K()*clH^h z4cGNgtXjM5=G?tPKd-lyx3^ySYu_)dwY|`YWuDHJ-lHF57CYxfrG&B9y}9~v3GbO1 z4PkvRHP5V?B`P-a*Us~Y&(^Q^uUb9BRwwJt!pS^YJ@N(f6+EZ3dM_}m{K-|XVy`~R(MbOFeCCRU#}-{vxwPL#3jl0`2=D*^ literal 0 HcmV?d00001 diff --git a/modules/vpn.nix b/modules/vpn.nix deleted file mode 100644 index fd656c7c..00000000 --- a/modules/vpn.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - imports = [ - ./vpn/secret.nix - ]; - - options = { - chvp.vpn.ugent.enable = lib.mkOption { - default = false; - example = true; - }; - }; - - config = lib.mkIf config.chvp.vpn.ugent.enable { - systemd.services = { - ugent-global-vpn = { - after = [ "network.target" ]; - conflicts = [ "ugent-local-vpn.service" ]; - }; - ugent-local-vpn = { - after = [ "network.target" ]; - conflicts = [ "ugent-global-vpn.service" ]; - }; - }; - security.polkit.extraConfig = '' - polkit.addRule(function(action, subject) { - if (action.id == "org.freedesktop.systemd1.manage-units" && action.lookup("unit") == "ugent-global-vpn.service") { - return polkit.Result.YES; - } - if (action.id == "org.freedesktop.systemd1.manage-units" && action.lookup("unit") == "ugent-local-vpn.service") { - return polkit.Result.YES; - } - }); - ''; - age.secrets."passwords/ugent-vpn".file = ../secrets/passwords/ugent-vpn.age; - }; -} diff --git a/modules/vpn/secret.nix b/modules/vpn/secret.nix deleted file mode 100644 index 58d67171e0b119ad358408856c7afd92583e4967..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 537 zcmZQ@_Y83kiVO&0SQf_P6d0ej+x?^0_K(?R=l87qZpcxVa@ytBEtmY$dNAK~w(ri|eM$-KF~8=mT#{XIe`Ro* zUFEkH@dGDJPIDd8D7(3iZASZ)pd8b9vk%iZ-Z8FCYWw!C+IlX##@ULngul<;c8Giw z_&@LQmtCt0O-+vGEj3zpO5@p&by2dfDzZJ-uVQ%LV(k~;(=<~@y=|Y=N+bN273 zx9AVNbSMz5)ydA$k^GVM<7Gyp-?bhD{ zLCa@%Tw;apo37p&`_6EN$%BvKo>Gx|Eqbg$42qkiRabv`y7+hM`Q5uFCT_@cRS$dd zlC4&=F?N~H+M9A7ESu~X7*sdv{MvP%JNHSPwz$L=WASHor%YL*r^el%Q@&94d_d~y z_Zhc-yvQv|TlhMtW96$af?^S~rXF9jqO^?f^4-IKHAA)M2Pnpg6;0Pj4BK`d0Ael( A&j0`b diff --git a/modules/xdg.nix b/modules/xdg.nix new file mode 100644 index 00000000..a5001581 --- /dev/null +++ b/modules/xdg.nix @@ -0,0 +1,58 @@ +{ config, lib, pkgs, ... }: + +{ + options.chvp.xdg.enable = lib.mkOption { + default = false; + example = true; + }; + + config = lib.mkIf config.chvp.xdg.enable { + chvp.zfs.homeLinks = [ + { path = "desktop"; type = "data"; } + { path = "documents"; type = "data"; } + { path = "downloads"; type = "cache"; } + { path = "music"; type = "data"; } + { path = "pictures"; type = "cache"; } + { path = "repos"; type = "cache"; } + { path = "templates"; type = "data"; } + { path = "videos"; type = "data"; } + ]; + + home-manager.users.charlotte = { pkgs, ... }: { + home.packages = with pkgs; [ xdg-user-dirs ]; + xdg = { + enable = true; + # Some applications overwrite mimeapps.list with an identical file + configFile."mimeapps.list".force = true; + mimeApps = { + enable = true; + defaultApplications = { + "image/png" = [ "org.kde.okular.desktop" ]; + "image/jpg" = [ "org.kde.okular.desktop" ]; + "image/jpeg" = [ "org.kde.okular.desktop" ]; + "application/pdf" = [ "org.kde.okular.desktop" ]; + + "text/html" = [ "firefox.desktop" ]; + "x-scheme-handler/about" = [ "firefox.desktop" ]; + "x-scheme-handler/http" = [ "firefox.desktop" ]; + "x-scheme-handler/https" = [ "firefox.desktop" ]; + "x-scheme-handler/unknown" = [ "firefox.desktop" ]; + + "x-scheme-handler/msteams" = [ "teams.desktop" ]; + }; + }; + userDirs = { + enable = true; + desktop = "\$HOME/desktop"; + documents = "\$HOME/documents"; + download = "\$HOME/downloads"; + music = "\$HOME/music"; + pictures = "\$HOME/pictures"; + publicShare = "\$HOME/desktop"; + templates = "\$HOME/templates"; + videos = "\$HOME/videos"; + }; + }; + }; + }; +} diff --git a/profiles/graphical.nix b/profiles/graphical.nix deleted file mode 100644 index 1618e609..00000000 --- a/profiles/graphical.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ - ../configurations/adb.nix - ../configurations/calibre.nix - ../configurations/citrix.nix - ../configurations/deluge.nix - ../configurations/dropbox.nix - ../configurations/firefox.nix - ../configurations/fonts.nix - ../configurations/gnupg.nix - ../configurations/hledger.nix - ../configurations/i3.nix - ../configurations/kitty.nix - ../configurations/mail.nix - ../configurations/mime.nix - ../configurations/mounts.nix - ../configurations/mumble.nix - ../configurations/networkmanager.nix - ../configurations/pass.nix - ../configurations/sound.nix - ../configurations/sway.nix - ../configurations/syncthing.nix - ../configurations/teams.nix - ../configurations/themes.nix - ../configurations/xdg-dirs.nix - ]; - - home-manager.users.charlotte = { pkgs, ... }: { - home.packages = with pkgs; [ - google-chrome - libreoffice-fresh - moreutils - mpv - okular - pandoc - pavucontrol - qjackctl - ranger - slurp - sshfs - texlive.combined.scheme-small - ungoogled-chromium - unzip - wf-recorder - wl-clipboard - youtube-dl - ]; - programs.zsh.loginExtra = '' - if [[ -z "$DISPLAY" ]] && [[ $(tty) = "/dev/tty1" ]]; then - exec sway - fi - - if [[ -z "$DISPLAY" ]] && [[ $(tty) = "/dev/tty2" ]]; then - exec startx - fi - ''; - }; - - services.fwupd.enable = true; - - chvp = { - gnupg.pinentryFlavor = "qt"; - nix.unfreePackages = [ "google-chrome" ]; - }; -}