From 084e832039191d026871174a4d190b8f5caa8226 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sun, 16 Oct 2022 14:20:50 +0000 Subject: [PATCH] wsl fixes --- hosts/common.nix | 46 +++++++++++++++++-------------- hosts/desktop/default.nix | 1 + hosts/macbook/default.nix | 1 + hosts/wsl/default.nix | 1 + modules/mail/himalaya.nix | 9 +++--- modules/neovim/lua/packer/lsp.lua | 3 +- modules/services/secrets.nix | 6 ---- 7 files changed, 33 insertions(+), 34 deletions(-) diff --git a/hosts/common.nix b/hosts/common.nix index 2217f62..2beb87b 100644 --- a/hosts/common.nix +++ b/hosts/common.nix @@ -21,6 +21,11 @@ if pkgs.stdenv.isDarwin then "$HOME/Downloads" else "$HOME/downloads"; }; }; + identityFile = lib.mkOption { + type = lib.types.str; + description = "Path to existing identity file."; + default = "/etc/ssh/ssh_host_ed25519_key"; + }; gui = { enable = mkEnableOption { description = "Enable graphics"; @@ -39,6 +44,7 @@ else "/home/${config.user}"); }; + dotfilesPath = mkOption { type = types.path; description = "Path of dotfiles repository."; @@ -55,33 +61,31 @@ }; }; - config = - let stateVersion = "22.11"; - in - { + config = let stateVersion = "22.11"; + in { - # Enable features in Nix commands - nix.extraOptions = "experimental-features = nix-command flakes"; + # Enable features in Nix commands + nix.extraOptions = "experimental-features = nix-command flakes"; - # Basic common system packages for all devices - environment.systemPackages = with pkgs; [ git vim wget curl ]; + # Basic common system packages for all devices + environment.systemPackages = with pkgs; [ git vim wget curl ]; - # Use the system-level nixpkgs instead of Home Manager's - home-manager.useGlobalPkgs = true; + # Use the system-level nixpkgs instead of Home Manager's + home-manager.useGlobalPkgs = true; - # Install packages to /etc/profiles instead of ~/.nix-profile, useful when - # using multiple profiles for one user - home-manager.useUserPackages = true; + # Install packages to /etc/profiles instead of ~/.nix-profile, useful when + # using multiple profiles for one user + home-manager.useUserPackages = true; - # Allow specified unfree packages (identified elsewhere) - # Retrieves package object based on string name - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) config.unfreePackages; + # Allow specified unfree packages (identified elsewhere) + # Retrieves package object based on string name + nixpkgs.config.allowUnfreePredicate = pkg: + builtins.elem (lib.getName pkg) config.unfreePackages; - # Pin a state version to prevent warnings - home-manager.users.${config.user}.home.stateVersion = stateVersion; - home-manager.users.root.home.stateVersion = stateVersion; + # Pin a state version to prevent warnings + home-manager.users.${config.user}.home.stateVersion = stateVersion; + home-manager.users.root.home.stateVersion = stateVersion; - }; + }; } diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index 35d821a..ace5cad 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -12,6 +12,7 @@ nixpkgs.lib.nixosSystem { nixpkgs.overlays = [ nur.overlay ]; # Set registry to flake packages, used for nix X commands nix.registry.nixpkgs.flake = nixpkgs; + identityFile = "/home/${globals.user}/.ssh/id_ed25519"; gaming.steam = true; gaming.leagueoflegends = true; gaming.legendary = true; diff --git a/hosts/macbook/default.nix b/hosts/macbook/default.nix index 8d58f1e..8d3dcf4 100644 --- a/hosts/macbook/default.nix +++ b/hosts/macbook/default.nix @@ -12,6 +12,7 @@ darwin.lib.darwinSystem { }) home-manager.darwinModules.home-manager { + identityFile = "/home/${globals.user}/.ssh/id_ed25519"; gui.enable = true; colorscheme = (import ../../modules/colorscheme/gruvbox); mailUser = globals.user; diff --git a/hosts/wsl/default.nix b/hosts/wsl/default.nix index a2e37a5..95cc9f3 100644 --- a/hosts/wsl/default.nix +++ b/hosts/wsl/default.nix @@ -12,6 +12,7 @@ nixpkgs.lib.nixosSystem { networking.hostName = "wsl"; # Set registry to flake packages, used for nix X commands nix.registry.nixpkgs.flake = nixpkgs; + identityFile = "/home/${globals.user}/.ssh/id_ed25519"; gui.enable = false; colorscheme = (import ../../modules/colorscheme/gruvbox); passwordHash = diff --git a/modules/mail/himalaya.nix b/modules/mail/himalaya.nix index 7e7363b..bca7cbf 100644 --- a/modules/mail/himalaya.nix +++ b/modules/mail/himalaya.nix @@ -75,11 +75,10 @@ }; mu.enable = false; notmuch.enable = false; - passwordCommand = '' - ${pkgs.age}/bin/age --decrypt \ - --identity ${config.identityFile} \ - ${builtins.toString ../../private/mailpass.age} - ''; + passwordCommand = + "${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${ + builtins.toString ../../private/mailpass.age + }"; smtp = { host = "smtp.purelymail.com"; port = 465; diff --git a/modules/neovim/lua/packer/lsp.lua b/modules/neovim/lua/packer/lsp.lua index 991f2bd..9316d49 100644 --- a/modules/neovim/lua/packer/lsp.lua +++ b/modules/neovim/lua/packer/lsp.lua @@ -14,8 +14,7 @@ M.packer = function(use) return vim.fn.executable(program) == 1 end - local capabilities = - require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) + local capabilities = require("cmp_nvim_lsp").default_capabilities() if on_path("lua-language-server") then require("lspconfig").sumneko_lua.setup({ capabilities = capabilities, diff --git a/modules/services/secrets.nix b/modules/services/secrets.nix index 2583c65..d596c70 100644 --- a/modules/services/secrets.nix +++ b/modules/services/secrets.nix @@ -7,12 +7,6 @@ options = { - identityFile = lib.mkOption { - type = lib.types.str; - description = "Path to existing identity file."; - default = "/etc/ssh/ssh_host_ed25519_key"; - }; - secretsDirectory = lib.mkOption { type = lib.types.str; description = "Default path to place secrets.";