Add flake.net to ad-hoc install dotfiles on nixos
This commit is contained in:
parent
28fff48c92
commit
1443064ca8
3 changed files with 133 additions and 7 deletions
|
@ -38,9 +38,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
})
|
})
|
||||||
|
|
||||||
require("mason").setup()
|
require("mason").setup()
|
||||||
require("mason-lspconfig").setup {
|
require("mason-lspconfig").setup({})
|
||||||
ensure_installed = { "rust_analyzer" },
|
|
||||||
}
|
|
||||||
|
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
local cmp_nvim_lsp = require('cmp_nvim_lsp')
|
local cmp_nvim_lsp = require('cmp_nvim_lsp')
|
||||||
|
|
9
_zshrc
9
_zshrc
|
@ -30,12 +30,13 @@ function zle-keymap-select {
|
||||||
}
|
}
|
||||||
zle -N zle-keymap-select
|
zle -N zle-keymap-select
|
||||||
|
|
||||||
|
[ -f "$HOME/./config/bashrc" ] && emulate sh -c "source $HOME/./config/bashrc"
|
||||||
[ -f "$HOME/.bashrc" ] && emulate sh -c "source $HOME/.bashrc"
|
[ -f "$HOME/.bashrc" ] && emulate sh -c "source $HOME/.bashrc"
|
||||||
|
|
||||||
source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
|
[ -f "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" ] && source "/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
||||||
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
|
[ -f "/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh" ] && source "/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
||||||
source /usr/share/fzf/key-bindings.zsh
|
[ -f "/usr/share/fzf/key-bindings.zsh" ] && source "/usr/share/fzf/key-bindings.zsh"
|
||||||
source /usr/share/fzf/completion.zsh
|
[ -f "/usr/share/fzf/completion.zsh" ] && source "/usr/share/fzf/completion.zsh"
|
||||||
|
|
||||||
setopt interactivecomments
|
setopt interactivecomments
|
||||||
setopt HIST_IGNORE_SPACE
|
setopt HIST_IGNORE_SPACE
|
||||||
|
|
127
flake.nix
Normal file
127
flake.nix
Normal file
|
@ -0,0 +1,127 @@
|
||||||
|
{
|
||||||
|
description = "OSHs dotfiles";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||||
|
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
||||||
|
home-manager.url = "github:nix-community/home-manager/release-24.05";
|
||||||
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, nixpkgs, home-manager, neovim-nightly-overlay, ... }:
|
||||||
|
let
|
||||||
|
system = builtins.currentSystem;
|
||||||
|
username = builtins.getEnv "USER";
|
||||||
|
homeDir = builtins.getEnv "HOME";
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
in {
|
||||||
|
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
neovim-nightly-overlay.overlays.default
|
||||||
|
];
|
||||||
|
|
||||||
|
home.username = username;
|
||||||
|
home.homeDirectory = homeDir;
|
||||||
|
# Only manage what you explicitly turn on below
|
||||||
|
# (this keeps you from overriding distro-level things)
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "Oshgnacknak";
|
||||||
|
userEmail = "osh@oshgnacknak.de";
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.neovim = {
|
||||||
|
enable = true;
|
||||||
|
package = neovim-nightly-overlay.packages.${pkgs.system}.default;
|
||||||
|
viAlias = true;
|
||||||
|
vimAlias = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
programs.zsh = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
enableCompletion = true;
|
||||||
|
autosuggestion.enable = true;
|
||||||
|
syntaxHighlighting.enable = true;
|
||||||
|
|
||||||
|
initExtra = ''
|
||||||
|
source ${pkgs.fzf}/share/fzf/key-bindings.zsh
|
||||||
|
source ${pkgs.fzf}/share/fzf/completion.zsh
|
||||||
|
source ${pkgs.fzf-zsh}/share/zsh/plugins/fzf-zsh/fzf-zsh.plugin.zsh
|
||||||
|
|
||||||
|
[ -f "$HOME/.config/zshrc" ] && source $HOME/.config/zshrc
|
||||||
|
'';
|
||||||
|
|
||||||
|
plugins = [
|
||||||
|
{
|
||||||
|
name = "manydots-magic";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "knu";
|
||||||
|
repo = "zsh-manydots-magic";
|
||||||
|
rev = "master";
|
||||||
|
sha256 = "sha256-lv7e7+KBR/nxC43H0uvphLcI7fALPvxPSGEmBn0g8HQ=";
|
||||||
|
};
|
||||||
|
file = "manydots-magic";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
zplug = {
|
||||||
|
enable = true;
|
||||||
|
plugins = [
|
||||||
|
{ name = "zsh-users/zsh-autosuggestions"; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.fzf = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Put extra packages in the *user* profile (not system)
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
ripgrep
|
||||||
|
fd
|
||||||
|
tmux
|
||||||
|
xsel
|
||||||
|
fzf
|
||||||
|
fzf-zsh
|
||||||
|
thefuck
|
||||||
|
rust-analyzer
|
||||||
|
];
|
||||||
|
|
||||||
|
# Link dotfiles without forcing overwrite (fails safely if a file already exists)
|
||||||
|
home.file.".tmux.conf".source = ./_tmux.conf;
|
||||||
|
home.file.".config/zshrc".source = ./_zshrc;
|
||||||
|
home.file.".config/bashrc".source = ./_bashrc;
|
||||||
|
|
||||||
|
home.file.".local/share/nvim/site/autoload/plug.vim".source = pkgs.fetchurl {
|
||||||
|
url = "https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim";
|
||||||
|
sha256 = "c2d8998469a049a51225a71128a12917b379822d16b639493e29ea02d8787306";
|
||||||
|
};
|
||||||
|
|
||||||
|
xdg.configFile."nvim" = {
|
||||||
|
source = ./_config/nvim;
|
||||||
|
recursive = true;
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Environment variables only for this user/session
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "nvim";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Good HM hygiene
|
||||||
|
xdg.enable = true;
|
||||||
|
home.stateVersion = "24.05";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue