feats: more programs to come with zsh

nix-components
pegasust 2022-11-06 22:22:09 +00:00
parent e57154bde3
commit 55eb996c42
8 changed files with 119 additions and 161 deletions

View File

@ -1,25 +0,0 @@
{
description = "A very basic flake";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs @ { self, flake-utils, nixpkgs, home-manager, ... }:
let
nixpkgsOfSys = system: import nixpkgs { inherit system; };
in flake-utils.lib.eachDefaultSystem (sys:
{
homeConfigurations.nixos = home-manager.lib.homeManagerConfiguration {
system = sys;
# configuration = import ./home.nix;
modules = [./home.nix];
pkgs = nixpkgs.legacyPackages.${sys};
};
}
);
}

View File

@ -1,49 +0,0 @@
# Helpful website to search for configurations:
# https://mipmip.github.io/home-manager-option-search/
{ config, pkgs,... }:
{
home.username = "nixos";
home.homeDirectory = "/home/nixos";
home.stateVersion = "22.05";
home.packages = [pkgs.htop pkgs.wget pkgs.ripgrep];
# allow unfree stuffs to be installed
nixpkgs.config.allowUnfree = true;
# define paths
xdg.enable = true;
programs.home-manager.enable = true;
programs.fzf.enable = true;
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
# I use vim-plug, so I probably don't require packaging
extraConfig = builtins.readFile ../neovim/init.lua;
};
programs.zsh = {
enable = true;
shellAliases = {
ll = "ls -l";
nix-rebuild = "sudo nixos-rebuild switch";
};
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";
};
};
programs.git = {
enable = true;
lfs.enable = true;
aliases = {
a="add"; c="commit"; ca="commit --ammend"; cm="commit-m";
lol="log --graph --decorate --pretty=oneline --abbrev-commit";
lola="log --grpah --decorate --pretty-oneline --abbrev-commit --all";
};
extraConfig = {
merge = {tool="vimdiff"; conflictstyle="diff3";};
};
# Why is this no longer valid?
# pull = { rebase=true; };
};
}

View File

@ -1,80 +0,0 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1667708081,
"narHash": "sha256-FChEy05x4ed/pttjfTeKxjPCnHknMYrUtDyBiYbreT4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "1ef0da321217c6c19b7a30509631c080a19321e5",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1667629849,
"narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "3bacde6273b09a21a8ccfba15586fb165078fb62",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

View File

@ -3,10 +3,34 @@
home.username = "nixos"; home.username = "nixos";
home.homeDirectory = "/home/nixos"; home.homeDirectory = "/home/nixos";
home.packages = [pkgs.htop pkgs.ripgrep]; home.packages = [
pkgs.htop pkgs.ripgrep pkgs.gcc pkgs.fd pkgs.zk
];
home.stateVersion = "22.05"; home.stateVersion = "22.05";
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
## Configs ##
xdg.configFile."nvim/init.lua".text = builtins.readFile ../neovim/init.lua;
xdg.configFile."starship.toml".text = builtins.readFile ../starship/starship.toml;
## Programs ##
programs.zoxide = {
enable = true;
enableZshIntegration = true;
};
programs.tmux = {
enable = true;
shell = "zsh";
extraConfig = builtins.readFile ../tmux/.tmux.conf;
};
programs.exa = {
enable = true;
enableAliases = true;
};
programs.starship = {
enable = true;
enableZshIntegration = true;
};
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.fzf.enable = true; programs.fzf.enable = true;
programs.neovim = { programs.neovim = {
@ -18,14 +42,13 @@
# https://github.com/nix-community/home-manager/pull/3287 # https://github.com/nix-community/home-manager/pull/3287
# extraConfig = builtins.readFile ../neovim/init.lua; # extraConfig = builtins.readFile ../neovim/init.lua;
}; };
xdg.configFile."nvim/init.lua".text = builtins.readFile ../neovim/init.lua;
programs.zsh = { programs.zsh = {
enable = true; enable = true;
enableCompletion = true; enableCompletion = true;
enableAutosuggestions = true; enableAutosuggestions = true;
shellAliases = { shellAliases = {
ll = "ls -l";
nix-rebuild = "sudo nixos-rebuild switch"; nix-rebuild = "sudo nixos-rebuild switch";
hm-switch = "home-manager switch --flake";
}; };
history = { history = {
size = 10000; size = 10000;
@ -42,7 +65,7 @@
aliases = { aliases = {
a="add"; c="commit"; ca="commit --ammend"; cm="commit -m"; a="add"; c="commit"; ca="commit --ammend"; cm="commit -m";
lol="log --graph --decorate --pretty=oneline --abbrev-commit"; lol="log --graph --decorate --pretty=oneline --abbrev-commit";
lola="log --grpah --decorate --pretty-oneline --abbrev-commit --all"; lola="log --graph --decorate --pretty=oneline --abbrev-commit --all";
}; };
extraConfig = { extraConfig = {
merge = {tool="vimdiff"; conflictstyle="diff3";}; merge = {tool="vimdiff"; conflictstyle="diff3";};

View File

@ -281,7 +281,7 @@ require('nvim-treesitter.configs').setup {
ensure_installed = { ensure_installed = {
'tsx', 'toml', 'lua', 'typescript', 'rust', 'go', 'yaml', 'json', 'php', 'css', 'tsx', 'toml', 'lua', 'typescript', 'rust', 'go', 'yaml', 'json', 'php', 'css',
'python', 'prisma', 'html', "dockerfile", "c", "cpp", "hcl", "svelte", "astro", 'python', 'prisma', 'html', "dockerfile", "c", "cpp", "hcl", "svelte", "astro",
"clojure", "fennel", "bash" "clojure", "fennel", "bash", "nix"
}, },
sync_install = false, sync_install = false,
highlight = { enable = true }, highlight = { enable = true },

89
starship/starship.toml Normal file
View File

@ -0,0 +1,89 @@
# ~/.config/starship.toml
[aws]
symbol = " "
[conda]
symbol = " "
[dart]
symbol = " "
format = "via [$symbol]($style)"
[directory]
read_only = " "
truncation_length = 1
[docker_context]
symbol = " "
[elixir]
symbol = " "
format = 'via [$symbol]($style)'
[elm]
symbol = " "
[git_branch]
symbol = " "
[golang]
symbol = " "
format = 'via [$symbol]($style)'
[hg_branch]
symbol = " "
[java]
symbol = " "
format = 'via [$symbol]($style)'
[julia]
symbol = " "
[memory_usage]
symbol = " "
[nim]
symbol = " "
[nix_shell]
symbol = " "
[nodejs]
symbol = " "
format = 'via [$symbol]($style)'
[package]
symbol = " "
[perl]
symbol = " "
[php]
symbol = " "
[python]
symbol = " "
format = 'via [$symbol]($style)'
[ruby]
symbol = " "
[rust]
format = 'via [$symbol]($style)'
[scala]
symbol = " "
[shlvl]
symbol = " "
[swift]
symbol = "ﯣ "
format = 'via [$symbol]($style)'
[git_status]
disabled = true