mirror of
https://github.com/smg1024/nix-darwin.git
synced 2026-05-22 20:32:59 +09:00
feat: home-manager config files implemented
build not tested
This commit is contained in:
parent
248170c877
commit
54297f94fd
44 changed files with 852 additions and 60 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
.DS_Store
|
||||
86
Justfile
Normal file
86
Justfile
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
# just is a command runner, Justfile is very similar to Makefile, but simpler.
|
||||
|
||||
# TODO update hostname here!
|
||||
hostname := "fenrir"
|
||||
|
||||
# List all the just commands
|
||||
default:
|
||||
@just --list
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# Darwin related commands
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# TODO Feel free to remove this target if you don't need a proxy to speed up the build process
|
||||
[group('desktop')]
|
||||
darwin-set-proxy:
|
||||
sudo python3 scripts/darwin_set_proxy.py
|
||||
|
||||
[group('desktop')]
|
||||
darwin: darwin-set-proxy
|
||||
nix build .#darwinConfigurations.{{hostname}}.system \
|
||||
--extra-experimental-features 'nix-command flakes'
|
||||
|
||||
sudo -E ./result/sw/bin/darwin-rebuild switch --flake .#{{hostname}}
|
||||
|
||||
[group('desktop')]
|
||||
darwin-debug: darwin-set-proxy
|
||||
nix build .#darwinConfigurations.{{hostname}}.system --show-trace --verbose \
|
||||
--extra-experimental-features 'nix-command flakes'
|
||||
|
||||
sudo -E ./result/sw/bin/darwin-rebuild switch --flake .#{{hostname}} --show-trace --verbose
|
||||
|
||||
############################################################################
|
||||
#
|
||||
# nix related commands
|
||||
#
|
||||
############################################################################
|
||||
|
||||
# Update all the flake inputs
|
||||
[group('nix')]
|
||||
up:
|
||||
nix flake update
|
||||
|
||||
# Update specific input
|
||||
# Usage: just upp nixpkgs
|
||||
[group('nix')]
|
||||
upp input:
|
||||
nix flake update {{input}}
|
||||
|
||||
# List all generations of the system profile
|
||||
[group('nix')]
|
||||
history:
|
||||
nix profile history --profile /nix/var/nix/profiles/system
|
||||
|
||||
# Open a nix shell with the flake
|
||||
[group('nix')]
|
||||
repl:
|
||||
nix repl -f flake:nixpkgs
|
||||
|
||||
# remove all generations older than 7 days
|
||||
# on darwin, you may need to switch to root user to run this command
|
||||
[group('nix')]
|
||||
clean:
|
||||
sudo nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d
|
||||
|
||||
# Garbage collect all unused nix store entries
|
||||
[group('nix')]
|
||||
gc:
|
||||
# garbage collect all unused nix store entries(system-wide)
|
||||
sudo nix-collect-garbage --delete-older-than 7d
|
||||
# garbage collect all unused nix store entries(for the user - home-manager)
|
||||
# https://github.com/NixOS/nix/issues/8508
|
||||
nix-collect-garbage --delete-older-than 7d
|
||||
|
||||
[group('nix')]
|
||||
fmt:
|
||||
# format the nix files in this repo
|
||||
nix fmt
|
||||
|
||||
# Show all the auto gc roots in the nix store
|
||||
[group('nix')]
|
||||
gcroot:
|
||||
ls -al /nix/var/nix/gcroots/auto/
|
||||
|
||||
33
flake.nix
33
flake.nix
|
|
@ -2,34 +2,47 @@
|
|||
description = "Nix for Poby's MacOS";
|
||||
|
||||
nixConfig = {
|
||||
substituters = [ "https://cache.nixos.org" ];
|
||||
substituters = ["https://cache.nixos.org"];
|
||||
};
|
||||
|
||||
inputs = let
|
||||
stableVersion = "25.11"; # FIXME to bump to latest stable version
|
||||
stableVersion = "25.11"; # FIXME to bump to latest stable version
|
||||
in {
|
||||
# nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-unstable"; # comment out for unstable version
|
||||
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-${stableVersion}-darwin";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-25.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
||||
};
|
||||
darwin = {
|
||||
url = "github:lnl7/nix-darwin/nix-darwin-${stableVersion}";
|
||||
inputs.nixpkgs.follows = "nixpkgs-darwin";
|
||||
};
|
||||
|
||||
# NVF for neovim
|
||||
nvf = {
|
||||
url = "github:notashelf/nvf";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
darwin,
|
||||
home-manager,
|
||||
nvf,
|
||||
...
|
||||
}: let
|
||||
username = "poby";
|
||||
system = "aarch64-darwin";
|
||||
hostname = "fenrir"; # TODO break down to multiple hosts
|
||||
username = "poby";
|
||||
useremail = "smg981024@gmail.com";
|
||||
hostname = "fenrir"; # TODO break down to multiple hosts
|
||||
|
||||
specialArgs =
|
||||
inputs
|
||||
// {
|
||||
inherit username hostname;
|
||||
inherit username useremail hostname;
|
||||
};
|
||||
in {
|
||||
darwinConfigurations."${hostname}" = darwin.lib.darwinSystem {
|
||||
|
|
@ -39,6 +52,16 @@
|
|||
./modules/system.nix
|
||||
./modules/apps.nix
|
||||
./modules/host-users.nix
|
||||
|
||||
nvf.darwinModules.default
|
||||
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
home-manager.users.${username} = import ./home;
|
||||
}
|
||||
];
|
||||
};
|
||||
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;
|
||||
|
|
|
|||
58
home/core.nix
Normal file
58
home/core.nix
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
# archives
|
||||
zip
|
||||
xz
|
||||
unzip
|
||||
p7zip
|
||||
(pkgs.writeShellApplication {
|
||||
name = "ns";
|
||||
runtimeInputs = with pkgs; [
|
||||
fzf
|
||||
nix-search-tv
|
||||
];
|
||||
text = builtins.readFile "${pkgs.nix-search-tv.src}/nixpkgs.sh";
|
||||
})
|
||||
# utils
|
||||
|
||||
aria2 # A lightweight multi-protocol & multi-source command-line download utility
|
||||
socat # replacement of openbsd-netcat
|
||||
nmap # A utility for network discovery and security auditing
|
||||
|
||||
# misc
|
||||
cowsay
|
||||
file
|
||||
which
|
||||
tree
|
||||
gnused
|
||||
gnutar
|
||||
gawk
|
||||
zstd
|
||||
caddy
|
||||
gnupg
|
||||
|
||||
# productivity
|
||||
glow # markdown previewer in terminal
|
||||
];
|
||||
|
||||
programs = {
|
||||
# terminal file manager
|
||||
yazi = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
settings = {
|
||||
manager = {
|
||||
show_hidden = true;
|
||||
sort_dir_first = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# skim provides a single executable: sk.
|
||||
# Basically anywhere you would want to use grep, try sk instead.
|
||||
skim = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
41
home/default.nix
Executable file
41
home/default.nix
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
pkgs,
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./fd.nix
|
||||
./fzf.nix
|
||||
./gh.nix
|
||||
./git.nix
|
||||
./nvf
|
||||
./ripgrep.nix
|
||||
./starship.nix
|
||||
./zoxide.nix
|
||||
./zsh.nix
|
||||
./eza.nix
|
||||
./jq.nix
|
||||
];
|
||||
|
||||
home = {
|
||||
username = username;
|
||||
homeDirectory = "/Users/${username}";
|
||||
stateVersion = "25.11";
|
||||
|
||||
packages = with pkgs; [
|
||||
tree
|
||||
yq-go
|
||||
# nix-search-tv
|
||||
(writeShellApplication {
|
||||
name = "ns";
|
||||
runtimeInputs = with pkgs; [
|
||||
fzf
|
||||
nix-search-tv
|
||||
];
|
||||
text = builtins.readFile "${pkgs.nix-search-tv.src}/nixpkgs.sh";
|
||||
})
|
||||
];
|
||||
};
|
||||
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
10
home/eza.nix
Normal file
10
home/eza.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
color = "auto";
|
||||
git = true;
|
||||
icons = "auto";
|
||||
enableZshIntegration = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
}
|
||||
7
home/fd.nix
Executable file
7
home/fd.nix
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
programs.fd = {
|
||||
enable = true;
|
||||
ignores = [ ".git/" ];
|
||||
hidden = true;
|
||||
};
|
||||
}
|
||||
7
home/fzf.nix
Executable file
7
home/fzf.nix
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
}
|
||||
3
home/gh.nix
Executable file
3
home/gh.nix
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.gh.enable = true;
|
||||
}
|
||||
15
home/git.nix
Executable file
15
home/git.nix
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
settings = {
|
||||
user = {
|
||||
name = "Poby";
|
||||
email = "87608318+smg1024@users.noreply.github.com";
|
||||
};
|
||||
init.defaultBranch = "master";
|
||||
push = {
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
3
home/jq.nix
Normal file
3
home/jq.nix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.jq.enable = true;
|
||||
}
|
||||
6
home/nvf/appearance/theme.nix
Executable file
6
home/nvf/appearance/theme.nix
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
# theme
|
||||
enable = true;
|
||||
name = "tokyonight";
|
||||
style = "night";
|
||||
}
|
||||
11
home/nvf/core/augroups.nix
Executable file
11
home/nvf/core/augroups.nix
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
[
|
||||
# augroups
|
||||
{
|
||||
enable = true;
|
||||
name = "LastCursorGroup";
|
||||
}
|
||||
{
|
||||
enable = true;
|
||||
name = "HighlightYank";
|
||||
}
|
||||
]
|
||||
33
home/nvf/core/autocmds.nix
Executable file
33
home/nvf/core/autocmds.nix
Executable file
|
|
@ -0,0 +1,33 @@
|
|||
{lib, ...}: [
|
||||
# autocmds
|
||||
{
|
||||
enable = true;
|
||||
event = ["BufReadPost"];
|
||||
desc = "Return to last cursor position";
|
||||
group = "LastCursorGroup";
|
||||
callback = lib.generators.mkLuaInline ''
|
||||
function()
|
||||
local mark = vim.api.nvim_buf_get_mark(0, '"')
|
||||
local line_count = vim.api.nvim_buf_line_count(0)
|
||||
if mark[1] > 0 and mark[1] <= line_count then
|
||||
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end
|
||||
'';
|
||||
}
|
||||
{
|
||||
enable = true;
|
||||
event = ["TextYankPost"];
|
||||
desc = "Highlight yanks on copy";
|
||||
group = "HighlightYank";
|
||||
pattern = ["*"];
|
||||
callback = lib.generators.mkLuaInline ''
|
||||
function()
|
||||
vim.hl.on_yank({
|
||||
higroup = "IncSearch",
|
||||
timeout = 250,
|
||||
})
|
||||
end
|
||||
'';
|
||||
}
|
||||
]
|
||||
8
home/nvf/core/clipboard.nix
Executable file
8
home/nvf/core/clipboard.nix
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
# clipboard
|
||||
enable = true;
|
||||
registers = "unnamedplus";
|
||||
providers = {
|
||||
wl-copy.enable = true;
|
||||
};
|
||||
}
|
||||
81
home/nvf/core/keymaps.nix
Executable file
81
home/nvf/core/keymaps.nix
Executable file
|
|
@ -0,0 +1,81 @@
|
|||
[
|
||||
# Keymaps
|
||||
{
|
||||
key = "<leader>ff";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua files<CR>";
|
||||
desc = "[F]ind files";
|
||||
}
|
||||
{
|
||||
key = "<leader>fg";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua live_grep_native<CR>";
|
||||
desc = "Live [G]rep";
|
||||
}
|
||||
{
|
||||
key = "<leader><leader>";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua buffers<CR>";
|
||||
desc = "Buffers";
|
||||
}
|
||||
{
|
||||
key = "<leader>fh";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua help_tags<CR>";
|
||||
desc = "[H]elp Tags";
|
||||
}
|
||||
{
|
||||
key = "<leader>fx";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua diagnostics_document<CR>";
|
||||
desc = "Diagnostics Document";
|
||||
}
|
||||
{
|
||||
key = "<leader>fX";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua diagnostics_workspace<CR>";
|
||||
desc = "Diagnostics Workspace";
|
||||
}
|
||||
{
|
||||
key = "<leader>fs";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua lsp_document_symbols<CR>";
|
||||
desc = "Document [S]ymbols";
|
||||
}
|
||||
{
|
||||
key = "<leader>fS";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua lsp_workspace_symbols<CR>";
|
||||
desc = "Workspace [S]ymbols";
|
||||
}
|
||||
{
|
||||
key = "<leader>fk";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua keymaps<CR>";
|
||||
desc = "[K]eymaps";
|
||||
}
|
||||
{
|
||||
key = "<leader>fb";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua builtin<CR>";
|
||||
desc = "[B]uiltin FZF";
|
||||
}
|
||||
{
|
||||
key = "<leader>fr";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua resume<CR>";
|
||||
desc = "[R]esume";
|
||||
}
|
||||
{
|
||||
key = "<leader>fo";
|
||||
mode = "n";
|
||||
action = "<Cmd>FzfLua oldfiles<CR>";
|
||||
desc = "[O]ld Files";
|
||||
}
|
||||
{
|
||||
key = "<leader>-";
|
||||
mode = "n";
|
||||
action = "<Cmd>Oil --float<CR>";
|
||||
desc = "Open Current Directory";
|
||||
}
|
||||
]
|
||||
12
home/nvf/core/options.nix
Executable file
12
home/nvf/core/options.nix
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
# options
|
||||
cursorlineopt = "line";
|
||||
wrap = false;
|
||||
cmdheight = 1;
|
||||
tabstop = 2;
|
||||
shiftwidth = 2;
|
||||
autoindent = true;
|
||||
termguicolors = true;
|
||||
splitbelow = true;
|
||||
splitright = true;
|
||||
}
|
||||
5
home/nvf/core/spellcheck.nix
Executable file
5
home/nvf/core/spellcheck.nix
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
# spellcheck
|
||||
enable = true;
|
||||
languages = [ "en" ];
|
||||
}
|
||||
4
home/nvf/core/undoFile.nix
Executable file
4
home/nvf/core/undoFile.nix
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
# undoFile
|
||||
enable = true;
|
||||
}
|
||||
43
home/nvf/default.nix
Executable file
43
home/nvf/default.nix
Executable file
|
|
@ -0,0 +1,43 @@
|
|||
{lib, ...}: let
|
||||
options = import ./core/options.nix;
|
||||
autocmds = import ./core/autocmds.nix {inherit lib;};
|
||||
augroups = import ./core/augroups.nix;
|
||||
keymaps = import ./core/keymaps.nix;
|
||||
fzf-lua = import ./plugins/fzf-lua.nix;
|
||||
mini = import ./plugins/mini.nix;
|
||||
utility = import ./plugins/utility.nix;
|
||||
binds = import ./plugins/binds.nix;
|
||||
terminal = import ./plugins/terminal.nix;
|
||||
theme = import ./appearance/theme.nix;
|
||||
lsp = import ./lsp/lsp.nix;
|
||||
treesitter = import ./lsp/treesitter.nix;
|
||||
autocomplete = import ./lsp/autocomplete.nix;
|
||||
languages = import ./lsp/languages;
|
||||
in {
|
||||
programs.nvf = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
vim = {
|
||||
inherit
|
||||
options
|
||||
autocmds
|
||||
augroups
|
||||
keymaps
|
||||
fzf-lua
|
||||
mini
|
||||
utility
|
||||
binds
|
||||
terminal
|
||||
theme
|
||||
lsp
|
||||
treesitter
|
||||
autocomplete
|
||||
languages
|
||||
;
|
||||
searchCase = "smart";
|
||||
hideSearchHighlight = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
22
home/nvf/lsp/autocomplete.nix
Executable file
22
home/nvf/lsp/autocomplete.nix
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
# autocomplete
|
||||
blink-cmp = {
|
||||
enable = true;
|
||||
friendly-snippets.enable = true;
|
||||
setupOpts = {
|
||||
keymap.preset = "default";
|
||||
cmdline = {
|
||||
keymap.preset = "default";
|
||||
};
|
||||
completion = {
|
||||
documentation = {
|
||||
auto_show = true;
|
||||
auto_show_delay_ms = 1000;
|
||||
};
|
||||
};
|
||||
};
|
||||
sourcePlugins = {
|
||||
emoji.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
17
home/nvf/lsp/languages/bash.nix
Executable file
17
home/nvf/lsp/languages/bash.nix
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
# bash
|
||||
enable = true;
|
||||
extraDiagnostics = {
|
||||
enable = true;
|
||||
types = ["shellcheck"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["shfmt"];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["bash-ls"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
19
home/nvf/lsp/languages/default.nix
Executable file
19
home/nvf/lsp/languages/default.nix
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
let
|
||||
nix = import ./nix.nix;
|
||||
python = import ./python.nix;
|
||||
lua = import ./lua.nix;
|
||||
bash = import ./bash.nix;
|
||||
markdown = import ./markdown.nix;
|
||||
html = import ./html.nix;
|
||||
yaml = import ./yaml.nix;
|
||||
in {
|
||||
inherit
|
||||
nix
|
||||
python
|
||||
lua
|
||||
bash
|
||||
markdown
|
||||
html
|
||||
yaml
|
||||
;
|
||||
}
|
||||
23
home/nvf/lsp/languages/html.nix
Executable file
23
home/nvf/lsp/languages/html.nix
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
# html
|
||||
enable = true;
|
||||
extraDiagnostics = {
|
||||
enable = true;
|
||||
types = ["htmlhint"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = [
|
||||
"superhtml"
|
||||
"prettierd"
|
||||
];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["superhtml"];
|
||||
};
|
||||
treesitter = {
|
||||
enable = true;
|
||||
autotagHtml = true;
|
||||
};
|
||||
}
|
||||
17
home/nvf/lsp/languages/lua.nix
Executable file
17
home/nvf/lsp/languages/lua.nix
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
# lua
|
||||
enable = true;
|
||||
extraDiagnostics = {
|
||||
enable = true;
|
||||
types = ["luacheck"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["stylua"];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["lua-language-server"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
30
home/nvf/lsp/languages/markdown.nix
Executable file
30
home/nvf/lsp/languages/markdown.nix
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
# markdown
|
||||
enable = true;
|
||||
extensions = {
|
||||
render-markdown-nvim = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
checkbox = {
|
||||
checked.scope_highlight = "@markup.strikethrough";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
extraDiagnostics = {
|
||||
enable = true;
|
||||
types = ["markdownlint-cli2"];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = [
|
||||
"prettierd"
|
||||
"deno_fmt"
|
||||
];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["marksman"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
23
home/nvf/lsp/languages/nix.nix
Executable file
23
home/nvf/lsp/languages/nix.nix
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
# nix
|
||||
enable = true;
|
||||
extraDiagnostics = {
|
||||
enable = true;
|
||||
types = [
|
||||
"deadnix"
|
||||
"statix"
|
||||
];
|
||||
};
|
||||
format = {
|
||||
enable = true;
|
||||
type = [
|
||||
"alejandra"
|
||||
"nixfmt"
|
||||
];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["nil"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
13
home/nvf/lsp/languages/python.nix
Executable file
13
home/nvf/lsp/languages/python.nix
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
# python
|
||||
enable = true;
|
||||
format = {
|
||||
enable = true;
|
||||
type = ["ruff"];
|
||||
};
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["pyright"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
9
home/nvf/lsp/languages/yaml.nix
Executable file
9
home/nvf/lsp/languages/yaml.nix
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
# yaml
|
||||
enable = true;
|
||||
lsp = {
|
||||
enable = true;
|
||||
servers = ["yaml-language-server"];
|
||||
};
|
||||
treesitter.enable = true;
|
||||
}
|
||||
7
home/nvf/lsp/lsp.nix
Executable file
7
home/nvf/lsp/lsp.nix
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
# lsp
|
||||
enable = true;
|
||||
inlayHints.enable = true;
|
||||
lspconfig.enable = true;
|
||||
formatOnSave = true;
|
||||
}
|
||||
9
home/nvf/lsp/treesitter.nix
Executable file
9
home/nvf/lsp/treesitter.nix
Executable file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
# treesitter
|
||||
enable = true;
|
||||
fold = true;
|
||||
highlight = {
|
||||
enable = true;
|
||||
};
|
||||
indent.enable = true;
|
||||
}
|
||||
10
home/nvf/plugins/binds.nix
Executable file
10
home/nvf/plugins/binds.nix
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
# binds
|
||||
whichKey = {
|
||||
enable = true;
|
||||
register = {
|
||||
"<leader>f" = "+FZF";
|
||||
"<leader>l" = "+Language";
|
||||
};
|
||||
};
|
||||
}
|
||||
6
home/nvf/plugins/fzf-lua.nix
Executable file
6
home/nvf/plugins/fzf-lua.nix
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
# fzf-lua
|
||||
enable = true;
|
||||
profile = "default";
|
||||
setupOpts = {};
|
||||
}
|
||||
14
home/nvf/plugins/mini.nix
Executable file
14
home/nvf/plugins/mini.nix
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
# mini
|
||||
statusline.enable = true;
|
||||
ai.enable = true;
|
||||
bufremove.enable = true;
|
||||
comment.enable = true;
|
||||
pairs.enable = true;
|
||||
cursorword.enable = true;
|
||||
icons.enable = true;
|
||||
move.enable = true;
|
||||
surround.enable = true;
|
||||
indentscope.enable = true;
|
||||
trailspace.enable = true;
|
||||
}
|
||||
21
home/nvf/plugins/terminal.nix
Executable file
21
home/nvf/plugins/terminal.nix
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
# terminal
|
||||
toggleterm = {
|
||||
enable = true;
|
||||
setupOpts = {
|
||||
direction = "horizontal";
|
||||
size = 6;
|
||||
};
|
||||
mappings = {
|
||||
open = "<leader>tt";
|
||||
};
|
||||
|
||||
# lazygit
|
||||
lazygit = {
|
||||
enable = true;
|
||||
mappings = {
|
||||
open = "<leader>gg";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
11
home/nvf/plugins/utility.nix
Executable file
11
home/nvf/plugins/utility.nix
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
# utility
|
||||
oil-nvim = {
|
||||
enable = true;
|
||||
gitStatus.enable = true;
|
||||
setupOpts = {
|
||||
view_options.show_hidden = true;
|
||||
};
|
||||
};
|
||||
sleuth.enable = true;
|
||||
}
|
||||
3
home/ripgrep.nix
Executable file
3
home/ripgrep.nix
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.ripgrep.enable = true;
|
||||
}
|
||||
14
home/starship.nix
Executable file
14
home/starship.nix
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
enableBashIntegration = true;
|
||||
|
||||
settings = {
|
||||
character = {
|
||||
success_symbol = "[›](bold green)";
|
||||
error_symbol = "[›](bold red)";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
8
home/zoxide.nix
Executable file
8
home/zoxide.nix
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
enableBashIntegration = true;
|
||||
options = ["--cmd j"];
|
||||
};
|
||||
}
|
||||
36
home/zsh.nix
Executable file
36
home/zsh.nix
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
|
||||
enableCompletion = true;
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting.enable = true;
|
||||
|
||||
history = {
|
||||
size = 10000;
|
||||
save = 10000;
|
||||
};
|
||||
|
||||
shellAliases = {
|
||||
poby = "echo my name is poby";
|
||||
nrs = "sudo nixos-rebuild switch --flake ~/nixos#$(hostname)";
|
||||
nrt = "sudo nixos-rebuild test --flake ~/nixos#$(hostname)";
|
||||
hms = "home-manager switch -b backup --flake ~/nixos#$(whoami)";
|
||||
};
|
||||
|
||||
sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
theme = "robbyrussell";
|
||||
plugins = [
|
||||
"git"
|
||||
"history"
|
||||
"zoxide"
|
||||
"eza"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -1,11 +1,12 @@
|
|||
{ pkgs, ... }: {
|
||||
{pkgs, ...}: {
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
neovim
|
||||
just # use Justfile to simplify nix-darwin's commands
|
||||
vim
|
||||
curl
|
||||
];
|
||||
environment.variables.EDITOR = "nvim";
|
||||
|
||||
homebrew = {
|
||||
enable = true;
|
||||
|
|
@ -22,7 +23,7 @@
|
|||
Bitwarden = 1352778147;
|
||||
};
|
||||
|
||||
taps = [ ];
|
||||
taps = [];
|
||||
|
||||
# WARNING only include those not in nixpkgs
|
||||
brews = [
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
{ username, hostname, ... }:
|
||||
{
|
||||
username,
|
||||
hostname,
|
||||
...
|
||||
}: {
|
||||
networking.hostName = hostname;
|
||||
networking.computerName = hostname;
|
||||
|
||||
|
|
@ -8,5 +11,5 @@
|
|||
description = username;
|
||||
};
|
||||
|
||||
nix.settings.trusted-users = [ username ];
|
||||
nix.settings.trusted-users = [username];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,20 @@
|
|||
{ pkgs, lib, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
nix = {
|
||||
enable = true;
|
||||
package = pkgs.nix;
|
||||
|
||||
settings = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
substituters = [ "https://nix-community.cachix.org" ];
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
substituters = ["https://nix-community.cachix.org"];
|
||||
trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
builders-user-substitutes = true;
|
||||
auto-optimise-store = false; # issue https://github.com/NixOS/nix/issues/7273
|
||||
auto-optimise-store = false; # issue https://github.com/NixOS/nix/issues/7273
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
{ pkgs, config, username, hostname, ... }:
|
||||
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
username,
|
||||
hostname,
|
||||
...
|
||||
}: {
|
||||
time.timeZone = "Asia/Seoul";
|
||||
|
||||
system = {
|
||||
primaryUser = username;
|
||||
stateVersion = 6;
|
||||
|
|
@ -32,7 +38,6 @@
|
|||
'';
|
||||
|
||||
defaults = {
|
||||
|
||||
loginwindow = {
|
||||
GuestEnabled = false;
|
||||
};
|
||||
|
|
@ -86,12 +91,12 @@
|
|||
|
||||
trackpad = {
|
||||
Clicking = true;
|
||||
TrackpadRightClick = true; # two finger right click
|
||||
TrackpadRightClick = true; # two finger right click
|
||||
TrackpadThreeFingerDrag = true;
|
||||
TrackpadFourFingerHorizSwipeGesture = 2; # swipe between full-screen applications
|
||||
TrackpadFourFingerHorizSwipeGesture = 2; # swipe between full-screen applications
|
||||
TrackpadFourFingerVertSwipeGesture = 2; # down for Mission Control, up for App Expose
|
||||
TrackpadPinch = true;
|
||||
TrackpadThreeFingerHorizSwipGesture = 0; # disable for three finger drag
|
||||
TrackpadThreeFingerHorizSwipGesture = 0; # disable for three finger drag
|
||||
TrackpadThreeFingerVertSwipeGesture = 0; # disable for three finger drag
|
||||
TrackpadTwoFingerDoubleTapGesture = true; # smart zoom
|
||||
TrackpadTwoFingerFromRightEdgeSwipeGesture = 0;
|
||||
|
|
@ -142,6 +147,7 @@
|
|||
NSTableViewDefaultSizeMode = 2;
|
||||
|
||||
"com.apple.keyboard.fnState" = true;
|
||||
"com.apple.sound.beep.feedback" = 0;
|
||||
};
|
||||
|
||||
# Customize settings that not supported by nix-darwin directly
|
||||
|
|
@ -164,7 +170,7 @@
|
|||
};
|
||||
|
||||
keyboard = {
|
||||
enableKeyMapping = true; # enable key mapping so that we can use `option` as `control`
|
||||
enableKeyMapping = true; # enable key mapping so that we can use `option` as `control`
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -175,50 +181,60 @@
|
|||
# this is required if you want to use darwin's default shell - zsh
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
enableAutosuggestions = true;
|
||||
enableFastSyntaxHighlighting = true;
|
||||
enableFzfCompletion = true;
|
||||
enableFzfGit = true;
|
||||
enableFzfHistory = true;
|
||||
promptInit = ''
|
||||
source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme
|
||||
source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
|
||||
'';
|
||||
# enableCompletion = true;
|
||||
# enableAutosuggestions = true;
|
||||
# enableFastSyntaxHighlighting = true;
|
||||
# enableFzfCompletion = true;
|
||||
# enableFzfGit = true;
|
||||
# enableFzfHistory = true;
|
||||
# promptInit = ''
|
||||
# source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme
|
||||
# source ${pkgs.zsh-fzf-tab}/share/fzf-tab/fzf-tab.plugin.zsh
|
||||
# '';
|
||||
};
|
||||
|
||||
environment = {
|
||||
shells = [
|
||||
pkgs.zsh
|
||||
];
|
||||
shellAliases = {
|
||||
ls = "lsd --color=auto";
|
||||
l = "lsd -lhG";
|
||||
lt = "l --tree";
|
||||
ll = "lsd -alhG";
|
||||
lh = "lsd -dl .*";
|
||||
lsd = "lsd --group-directories-first";
|
||||
filecount="find . -type f | wc -l";
|
||||
cat = "bat --color=always";
|
||||
man = "tldr";
|
||||
nixrebuild = "sudo darwin-rebuild switch --flake ~/.config/nix-darwin";
|
||||
nixupgrade = "cd ~/.config/nix-darwin && nix flake update";
|
||||
nixconfig = "nvim ~/.config/nix-darwin";
|
||||
sshconfig = "nvim ~/.ssh/config";
|
||||
|
||||
# git
|
||||
g = "git";
|
||||
gaa = "git add --all";
|
||||
gcm = "git commit -m";
|
||||
gca = "git commit --amend";
|
||||
gst = "git status";
|
||||
gco = "git checkout";
|
||||
gl = "git pull";
|
||||
gp = "git push";
|
||||
glg = "git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short";
|
||||
};
|
||||
# shellAliases = {
|
||||
# ls = "lsd --color=auto";
|
||||
# l = "lsd -lhG";
|
||||
# lt = "l --tree";
|
||||
# ll = "lsd -alhG";
|
||||
# lh = "lsd -dl .*";
|
||||
# lsd = "lsd --group-directories-first";
|
||||
# filecount = "find . -type f | wc -l";
|
||||
# cat = "bat --color=always";
|
||||
# man = "tldr";
|
||||
# nixrebuild = "sudo darwin-rebuild switch --flake ~/.config/nix-darwin";
|
||||
# nixupgrade = "cd ~/.config/nix-darwin && nix flake update";
|
||||
# nixconfig = "nvim ~/.config/nix-darwin";
|
||||
# sshconfig = "nvim ~/.ssh/config";
|
||||
#
|
||||
# # git
|
||||
# g = "git";
|
||||
# gaa = "git add --all";
|
||||
# gcm = "git commit -m";
|
||||
# gca = "git commit --amend";
|
||||
# gst = "git status";
|
||||
# gco = "git checkout";
|
||||
# gl = "git pull";
|
||||
# gp = "git push";
|
||||
# glg = "git log --graph --pretty='%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%ad) %C(bold blue)<%an>%Creset' --date=short";
|
||||
# };
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Asia/Seoul";
|
||||
fonts = {
|
||||
packages = with pkgs; [
|
||||
material-design-icons
|
||||
font-awesome
|
||||
pretendard
|
||||
nerd-fonts.symbols-only
|
||||
nerd-fonts.jetbrains-mono
|
||||
nerd-fonts.d2coding
|
||||
nerd-fonts.iosevka
|
||||
nerd-fonts.meslo-lg
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue