From 9bbed49c8f1d810653c5759429f66cd5954b1aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Gro=C3=9Fmann?= Date: Tue, 14 Feb 2023 01:33:38 +0100 Subject: [PATCH] feat: added smb mounts --- configuration.nix | 1 + flake.lock | 18 ++++++++-------- modules/smb-mounts.nix | 31 +++++++++++++++++++++++++++ secrets/smb.cred.age | 11 ++++++++++ users/common/default.nix | 1 + users/common/programs/thunderbird.nix | 5 ----- users/common/shells/fish.nix | 17 ++++++++------- users/patrick.nix | 1 - 8 files changed, 62 insertions(+), 23 deletions(-) create mode 100644 modules/smb-mounts.nix create mode 100644 secrets/smb.cred.age delete mode 100644 users/common/programs/thunderbird.nix diff --git a/configuration.nix b/configuration.nix index 2538347..3d896a9 100644 --- a/configuration.nix +++ b/configuration.nix @@ -17,6 +17,7 @@ ./modules/rekey.nix ./modules/nvidia.nix ./modules/wireguard.nix + ./modules/smb-mounts.nix ]; # Use the systemd-boot EFI boot loader. diff --git a/flake.lock b/flake.lock index b1050be..76cd738 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ ] }, "locked": { - "lastModified": 1675176355, - "narHash": "sha256-Qjxh5cmN56siY97mzmBLI1+cdjXSPqmfPVsKxBvHmwI=", + "lastModified": 1676153903, + "narHash": "sha256-uetRyjgMiZCs6srmZ10M764Vn7F53M9mVuqnzHmyBqU=", "owner": "ryantm", "repo": "agenix", - "rev": "b7ffcfe77f817d9ee992640ba1f270718d197f28", + "rev": "ea17cc71b4e1bc5b2601f210a1c85db9453ad723", "type": "github" }, "original": { @@ -103,11 +103,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1675888750, - "narHash": "sha256-w3T9UiRN6SaKMYI62+Ic3ka1Tyr9zaBcclhh3e4RCUk=", + "lastModified": 1675935446, + "narHash": "sha256-WajulTn7QdwC7QuXRBavrANuIXE5z+08EdxdRw1qsNs=", "owner": "nix-community", "repo": "home-manager", - "rev": "1232d0e13305f462a5a7c29584f50eb232cc4ba0", + "rev": "2dce7f1a55e785a22d61668516df62899278c9e4", "type": "github" }, "original": { @@ -118,11 +118,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1675763311, - "narHash": "sha256-bz0Q2H3mxsF1CUfk26Sl9Uzi8/HFjGFD/moZHz1HebU=", + "lastModified": 1676110339, + "narHash": "sha256-kOS/L8OOL2odpCOM11IevfHxcUeE0vnZUQ74EOiwXcs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fab09085df1b60d6a0870c8a89ce26d5a4a708c2", + "rev": "e5530aba13caff5a4f41713f1265b754dc2abfd8", "type": "github" }, "original": { diff --git a/modules/smb-mounts.nix b/modules/smb-mounts.nix new file mode 100644 index 0000000..a949cf3 --- /dev/null +++ b/modules/smb-mounts.nix @@ -0,0 +1,31 @@ +{ + pkgs, + lib, + config, + ... +}: let + options = [ + "noauto" + "x-systemd.idle-timeout=60" + "x-systemd.device-timeout=5s" + "x-systemd.mount-timeout=5s" + "credentials=${config.rekey.secrets.smb-creds.path}" + "uid=${builtins.toString config.users.users.patrick.uid}" + "gid=${builtins.toString config.users.groups.patrick.gid}" + ]; +in { + environment.systemPackages = [pkgs.cifs-utils]; + rekey.secrets.smb-creds.file = ../secrets/smb.cred.age; + fileSystems = { + "/mnt/smb/patri-data" = { + device = "//10.0.0.1/patri-data"; + fsType = "cifs"; + inherit options; + }; + "/mnt/smb/patri-paperless" = { + device = "//10.0.0.1/patri-paperless"; + fsType = "cifs"; + inherit options; + }; + }; +} diff --git a/secrets/smb.cred.age b/secrets/smb.cred.age new file mode 100644 index 0000000..8a1120b --- /dev/null +++ b/secrets/smb.cred.age @@ -0,0 +1,11 @@ +age-encryption.org/v1 +-> X25519 3VPtgGs+YkYHBe63OyhOuUVL/fVX//XSizOdLHR3wDI +I/a7lYzVFGXLuBGtvn9hbsq6Tb5NMjgb6C0x44AW9hc +-> piv-p256 XTQkUA A8ttYGbQD9jY7zA2X3SDynQy6WCOsp9qUenalQ0KtbPx +ssWdY0MKCJ33cVLLxR8Kv1wLbEz6F6MrV/yRcZK5fuk +-> piv-p256 ZFgiIw Aqe9ZNtlViD+o+pMDP0F1FtUGFw35KmHyhjnFB4XVPRK ++I0y5TtoxGBla/46dk0tEzBEakHdb//m9ts92QCm7XA +-> --grease S[|%w\&o t$efh*] jl8~ cB\tOaM +DpG7+qrkZLPtzRtZ38GatDO2rthpFyT93E/pqizz69QK0OXgv4ZAjA +--- f7oAB4l0kZpBDfwwwUwH/g76YX7GhbSIw2WCTNcg6dc +Ó§1øvz´z¾N9Òxt!ÿCr_‡˜ºý·DG³Ø˜Vcrù*Áý[PÇRít…é¶CÅ ï­MR%oïXî@Þá™sf!!b&Î1>±] \ No newline at end of file diff --git a/users/common/default.nix b/users/common/default.nix index 0b42583..e54e835 100644 --- a/users/common/default.nix +++ b/users/common/default.nix @@ -15,6 +15,7 @@ bat ripgrep killall + fd ]; # has to be enabled to support zsh reverse search diff --git a/users/common/programs/thunderbird.nix b/users/common/programs/thunderbird.nix deleted file mode 100644 index c34966f..0000000 --- a/users/common/programs/thunderbird.nix +++ /dev/null @@ -1,5 +0,0 @@ -{pkgs, ...}: { - programs.thunderbird = { - enable = true; - }; -} diff --git a/users/common/shells/fish.nix b/users/common/shells/fish.nix index 92518f2..6a14518 100644 --- a/users/common/shells/fish.nix +++ b/users/common/shells/fish.nix @@ -109,10 +109,11 @@ enable = true; interactiveShellInit = lib.mkMerge [ (lib.mkBefore '' - set -g ATUIN_NOBIND true - set -g fish_greeting - set -g fish_autosuggestion_enabled 0 - set -g FZF_COMPLETE 2 + set -g ATUIN_NOBIND true + set -g fish_greeting + set -g fish_autosuggestion_enabled 0 + set -g FZF_COMPLETE 2 + set -g FZF_COMPLETE_OPTS "--bind=ctrl-space:select --multi" '') (lib.mkAfter '' bind \cr _atuin_search @@ -127,10 +128,10 @@ { name = "fzf"; src = pkgs.fetchFromGitHub { - owner = "jethrokuan"; - repo = "fzf"; - rev = "479fa67d7439b23095e01b64987ae79a91a4e283"; - sha256 = "0k6l21j192hrhy95092dm8029p52aakvzis7jiw48wnbckyidi6v"; + owner = "oddlama"; + repo = "fzf.fish"; + rev = "63c8f8e65761295da51029c5b6c9e601571837a1"; + sha256 = "036n50zr9kyg6ad408zn7wq2vpfwhmnfwab465km4dk60ywmrlcb"; }; } ]; diff --git a/users/patrick.nix b/users/patrick.nix index 7dd12f5..3f423e6 100644 --- a/users/patrick.nix +++ b/users/patrick.nix @@ -10,7 +10,6 @@ common/programs/polybar.nix common/programs/rofi.nix common/touchscreen.nix - #common/programs/thunderbird.nix #common/touchegg.nix ];