From 1b180a8a25ce5c7e5b844dbfde99986e1330f3fd Mon Sep 17 00:00:00 2001 From: prescientmoon Date: Tue, 27 Aug 2024 13:30:17 +0200 Subject: [PATCH] Improve custom iso --- home/features/neovim/default.nix | 12 ++++++------ home/iso.nix | 22 ++++++++++++++++++++++ hosts/nixos/common/global/persistence.nix | 19 +++++++++++++------ hosts/nixos/iso/default.nix | 22 ++++++++++++++++------ 4 files changed, 57 insertions(+), 18 deletions(-) create mode 100644 home/iso.nix diff --git a/home/features/neovim/default.nix b/home/features/neovim/default.nix index fd5f8a1..6652f79 100644 --- a/home/features/neovim/default.nix +++ b/home/features/neovim/default.nix @@ -10,14 +10,14 @@ let # Toggles for including tooling related to a given language packedTargets = { elm = false; - latex = true; - lua = true; + latex = !config.satellite.toggles.neovim-minimal.enable; + lua = !config.satellite.toggles.neovim-minimal.enable; nix = true; purescript = false; python = false; rust = false; - typst = true; - web = true; + typst = !config.satellite.toggles.neovim-minimal.enable; + web = !config.satellite.toggles.neovim-minimal.enable; csharp = false; }; @@ -1699,6 +1699,7 @@ in # {{{ Basic config # We want other modules to know that we are using neovim! satellite.toggles.neovim.enable = true; + satellite.toggles.neovim-minimal.enable = lib.mkDefault false; # Link files in the appropriate places xdg.configFile.nvim.source = config.satellite.dev.path "home/features/neovim/config"; @@ -1708,9 +1709,8 @@ in # Install packages home.packages = [ neovim - neovide pkgs.vimclip - ]; + ] ++ lib.lists.optional (!config.satellite.toggles.neovim-minimal.enable) neovide; # }}} # {{{ Persistence satellite.persistence.at.state.apps.neovim.directories = [ diff --git a/home/iso.nix b/home/iso.nix new file mode 100644 index 0000000..4ec41fc --- /dev/null +++ b/home/iso.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + imports = [ + ./global.nix + + ./features/desktop/foot.nix + ./features/desktop/firefox + ./features/cli/lazygit.nix + ./features/wayland/hyprland + ./features/neovim + ]; + + # Arbitrary extra packages + home.packages = with pkgs; [ + sops # Secret editing + ]; + + home.username = "moon"; + home.stateVersion = "24.05"; + + satellite.toggles.neovim-minimal.enable = true; +} diff --git a/hosts/nixos/common/global/persistence.nix b/hosts/nixos/common/global/persistence.nix index d5954df..e5b4058 100644 --- a/hosts/nixos/common/global/persistence.nix +++ b/hosts/nixos/common/global/persistence.nix @@ -3,7 +3,13 @@ # users' home persist dir exists and has the right permissions # # It works even if / is tmpfs, btrfs snapshot, or even not ephemeral at all. -{ lib, inputs, config, ... }: { +{ + lib, + inputs, + config, + ... +}: +{ imports = [ inputs.impermanence.nixosModules.impermanence ]; environment.persistence."/persist/state".directories = [ @@ -19,11 +25,13 @@ # {{{ Create home directories systemd.tmpfiles.rules = let - users = lib.filter (v: v != null && v.isNormalUser) - (lib.mapAttrsToList (_: u: u) config.users.users); + users = lib.filter (v: v != null && v.isNormalUser) ( + lib.mapAttrsToList (_: u: u) config.users.users + ); - mkHomePersistFor = location: lib.forEach users - (user: "Q ${location}${user.home} ${user.homeMode} ${user.name} ${user.group} -"); + mkHomePersistFor = + location: + lib.forEach users (user: "d ${location}${user.home} ${user.homeMode} ${user.name} ${user.group} -"); in lib.flatten [ (mkHomePersistFor "/persist/data") @@ -32,4 +40,3 @@ ]; # }}} } - diff --git a/hosts/nixos/iso/default.nix b/hosts/nixos/iso/default.nix index 3d805d7..a19095a 100644 --- a/hosts/nixos/iso/default.nix +++ b/hosts/nixos/iso/default.nix @@ -1,13 +1,23 @@ -{ modulesPath, pkgs, ... }: +{ modulesPath, ... }: { imports = [ "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix" - ../common/global/services/openssh.nix - ../common/global/locale.nix - ../common/global/cli/fish.nix - ../common/global/nix.nix + ../common/global + ../common/optional/wayland/hyprland.nix ]; - environment.systemPackages = [ pkgs.neovim ]; + # Tell sops-nix to use the hermes keys for decrypting secrets + sops.age.sshKeyPaths = [ "/hermes/secrets/hermes/ssh_host_ed25519_key" ]; + + # {{{ Automount hermes + fileSystems."/hermes" = { + device = "/dev/disk/by-uuid/7FE7-CA68"; + neededForBoot = true; + options = [ + "nofail" + "x-systemd.automount" + ]; + }; + # }}} }