From 0984026c06c97e36186d45b0ed17d66713c46245 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Wed, 25 May 2022 09:58:20 +0200 Subject: [PATCH] many changes --- capibara.nix | 14 +++++ flake.lock | 6 +-- home/neovim/common.nix | 9 +++- home/nixos-common.nix | 120 ++++++++++++++++++++++------------------- nixos/common.nix | 40 +++++++------- 5 files changed, 110 insertions(+), 79 deletions(-) diff --git a/capibara.nix b/capibara.nix index 7ce0fbf..82f9997 100644 --- a/capibara.nix +++ b/capibara.nix @@ -23,6 +23,20 @@ in { neededForBoot = true; }; + "/logs" = { + device = "/dev/mapper/root"; + fsType = "btrfs"; + options = [ "subvol=logs" "compress=zstd" ]; + neededForBoot = true; + }; + + "/data" = { + device = "/dev/mapper/root"; + fsType = "btrfs"; + options = [ "subvol=data" "compress=zstd" ]; + neededForBoot = true; + }; + "/nix" = { device = "/dev/mapper/root"; fsType = "btrfs"; diff --git a/flake.lock b/flake.lock index 7802b6d..c6f84fc 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1653153149, - "narHash": "sha256-8B/tWWZziFq4DqnAm9uO7M4Z4PNfllYg5+teX1e5yDQ=", + "lastModified": 1653340164, + "narHash": "sha256-t6BPApyasx6FOv2cEVyFBXvkEDrknyUe7bngMbNSBkA=", "owner": "nix-community", "repo": "home-manager", - "rev": "94780dd888881bf35165dfdd334a57ef6b14ead8", + "rev": "e66f0ff69a6c0698b35034b842c4b68814440778", "type": "github" }, "original": { diff --git a/home/neovim/common.nix b/home/neovim/common.nix index f99b8bb..a92f8ee 100644 --- a/home/neovim/common.nix +++ b/home/neovim/common.nix @@ -1,7 +1,14 @@ { config, pkgs, ... }: { - home.packages = with pkgs; [ black jq sqlfluff nixfmt shfmt hlint ]; + home.packages = with pkgs; [ + black + jq + # sqlfluff + nixfmt + shfmt + hlint + ]; programs.neovim = { enable = true; viAlias = true; diff --git a/home/nixos-common.nix b/home/nixos-common.nix index 6f4e168..c00bf3c 100644 --- a/home/nixos-common.nix +++ b/home/nixos-common.nix @@ -42,62 +42,70 @@ ./zsh ]; - home.persistence."/persist/${config.home.homeDirectory}" = { - directories = [ - ".Slic3r" - ".abook" - ".bitmonero" - ".cache" - ".config/Element" - ".config/Nextcloud" - ".config/Signal" - ".config/SuperCollider" - ".config/ardour6" - ".config/chromium" - ".config/kdeconnect" - ".config/kicad" - ".config/whatsapp-for-linux" - ".gnupg/private-keys-v1.d" - ".hydrogen" - ".librewolf" - ".local/share/Bisq" - ".local/share/SuperCollider" - ".local/share/TelegramDesktop" - ".local/share/dino" - ".local/share/keyrings" - ".local/share/mpd" - ".local/share/webkitgtk" - ".local/state/wireplumber" - ".mozilla" - ".newsboat" - ".password-store" - ".vagrant.d" - ".vdirsyncer" - ".walletwasabi" - ".wine" - "Audio" - "Calendars" - "Contacts" - "Documents" - "Downloads" - "Images" - "Maildir" - "Monero" - "Nextcloud" - "code" - "configs" - "misc" - "workspace" - ]; - files = [ - ".gnupg/pubring.kbx" - ".gnupg/trustdb.gpg" - ".mailsynclastrun" - ".ssh/known_hosts" - ".zsh_history" - ".lmmsrc.xml" - ]; - allowOther = true; + home.persistence = { + "/data/${config.home.homeDirectory}" = { + directories = [ + "Audio" + "Calendars" + "Contacts" + "Documents" + "Downloads" + "Images" + "Maildir" + "Monero" + "Nextcloud" + "code" + "configs" + "misc" + "workspace" + ]; + allowOther = true; + }; + + "/persist/${config.home.homeDirectory}" = { + directories = [ + ".Slic3r" + ".abook" + ".bitmonero" + ".cache" + ".config/Element" + ".config/Nextcloud" + ".config/Signal" + ".config/SuperCollider" + ".config/ardour6" + ".config/chromium" + ".config/kdeconnect" + ".config/kicad" + ".config/whatsapp-for-linux" + ".gnupg/private-keys-v1.d" + ".hydrogen" + ".librewolf" + ".local/share/Bisq" + ".local/share/SuperCollider" + ".local/share/TelegramDesktop" + ".local/share/dino" + ".local/share/keyrings" + ".local/share/mpd" + ".local/share/webkitgtk" + ".local/state/wireplumber" + ".mozilla" + ".newsboat" + ".password-store" + ".vagrant.d" + ".vdirsyncer" + ".walletwasabi" + ".wine" + ]; + files = [ + ".gnupg/pubring.kbx" + ".gnupg/trustdb.gpg" + ".mailsynclastrun" + ".ssh/known_hosts" + ".zsh_history" + ".lmmsrc.xml" + ]; + allowOther = true; + }; }; home.sessionVariables = { diff --git a/nixos/common.nix b/nixos/common.nix index da92c7e..fe0f5eb 100644 --- a/nixos/common.nix +++ b/nixos/common.nix @@ -230,29 +230,31 @@ fsType = "tmpfs"; options = [ "defaults" "size=2G" "mode=755" ]; }; - }; swapDevices = [{ device = "/swap/swapfile"; }]; - environment.persistence."/persist" = { - directories = [ - "/etc/NetworkManager/system-connections" - "/etc/nixos" - "/etc/wireguard" - "/var/lib/bluetooth" - "/var/lib/docker" - "/var/lib/libvirt" - "/var/lib/systemd/coredump" - "/var/log" - ]; - files = [ - "/etc/machine-id" - "/etc/ssh/ssh_host_ed25519_key" - "/etc/ssh/ssh_host_ed25519_key.pub" - "/etc/ssh/ssh_host_rsa_key" - "/etc/ssh/ssh_host_rsa_key.pub" - ]; + environment.persistence = { + "/persist" = { + directories = [ + "/etc/NetworkManager/system-connections" + "/etc/nixos" + "/etc/wireguard" + "/var/lib/bluetooth" + "/var/lib/docker" + "/var/lib/libvirt" + "/var/lib/systemd/coredump" + ]; + files = [ + "/etc/machine-id" + "/etc/ssh/ssh_host_ed25519_key" + "/etc/ssh/ssh_host_ed25519_key.pub" + "/etc/ssh/ssh_host_rsa_key" + "/etc/ssh/ssh_host_rsa_key.pub" + ]; + }; + + "/logs" = { directories = [ "/var/log" ]; }; }; # Open ports in the firewall.