Skip to content

Commit

Permalink
edit for personal
Browse files Browse the repository at this point in the history
  • Loading branch information
qixyuan committed May 14, 2024
1 parent f13d2be commit 2fa7b95
Show file tree
Hide file tree
Showing 25 changed files with 428 additions and 227 deletions.
Empty file removed a.log
Empty file.
Binary file added dump.rdb
Binary file not shown.
362 changes: 319 additions & 43 deletions flake.lock

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.11";

nur.url = "github:nix-community/NUR";


# for macos
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.11-darwin";
Expand Down Expand Up @@ -101,10 +104,10 @@
};

# add git hooks to format nix code before commit
# pre-commit-hooks = {
# url = "github:cachix/pre-commit-hooks.nix";
# inputs.nixpkgs.follows = "nixpkgs";
# };
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};

nuenv.url = "github:DeterminateSystems/nuenv";

Expand Down Expand Up @@ -160,5 +163,10 @@

# aarch64 SBCs
nixos-rk3588.url = "github:ryan4yin/nixos-rk3588";

nvimdots = {
url = "github:ayamir/nvimdots";
inputs.nixpkgs.follows = "nixpkgs";
};
};
}
4 changes: 2 additions & 2 deletions home/base/core/git.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@

# replace https with ssh
url = {
"ssh://[email protected]/ryan4yin" = {
insteadOf = "https://github.com/ryan4yin";
"ssh://[email protected]/QixYuanmeng" = {
insteadOf = "https://github.com/QixYuanmeng";
};
# "ssh://[email protected]/" = {
# insteadOf = "https://gitlab.com/";
Expand Down
1 change: 1 addition & 0 deletions home/base/tui/dev-tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#############################################################

home.packages = with pkgs; [

colmena # nixos's remote deployment tool
# db related
mycli
Expand Down
1 change: 1 addition & 0 deletions home/base/tui/editors/neovim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ let
vdiff = "nvim -d";
};
in {

home.activation.installAstroNvim = lib.hm.dag.entryAfter ["writeBoundary"] ''
${pkgs.rsync}/bin/rsync -avz --chmod=D2755,F744 ${./nvim}/ ${config.xdg.configHome}/nvim/
'';
Expand Down
1 change: 1 addition & 0 deletions home/base/tui/editors/neovim/nvim/lua/plugins/astrolsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ return {
"terraformls", -- terraform hcl
"nushell", -- nushell language server
"scheme_langserver", -- scheme language server
"slint_lsp",
},
-- customize language server configuration options passed to `lspconfig`
---@diagnostic disable: missing-fields
Expand Down
1 change: 1 addition & 0 deletions home/base/tui/editors/neovim/nvim/lua/plugins/copilot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ return {
opts.filetypes = {
yaml = true,
markdown = true,
rust = true,
}
end,
}
4 changes: 4 additions & 0 deletions home/base/tui/editors/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
setuptools
paramiko
rapidfuzz
devtools
]
))

Expand All @@ -50,6 +51,9 @@
cargo # rust package manager
rustfmt

#-- slint
slint-lsp

#-- nix
nil
# rnix-lsp
Expand Down
4 changes: 2 additions & 2 deletions home/base/tui/zellij/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ in {
enable = true;
};
# auto start zellij in nushell
/*

programs.nushell.extraConfig = ''
# auto start zellij
# except when in emacs or zellij itself
Expand All @@ -25,7 +25,7 @@ in {
}
}
'';
*/

# only works in bash/zsh, not nushell
home.shellAliases = shellAliases;
programs.nushell.shellAliases = shellAliases;
Expand Down
4 changes: 4 additions & 0 deletions home/linux/base/shell.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
config,
myvars,
pkgs,
...
}: let
d = config.xdg.dataHome;
Expand All @@ -26,5 +27,8 @@ in rec {

# enable scrolling in git diff
DELTA_PAGER = "less -R";

#:w
#VK_DRIVER_FILES = "/run/opengl-driver/share/vulkan/icd.d/intel_icd.x86_64.json;/run/opengl-driver/share/vulkan/icd.d/nvidia_icd.x86_64.json;";
};
}
1 change: 0 additions & 1 deletion home/linux/base/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# misc
libnotify
wireguard-tools # manage wireguard vpn manually, via wg-quick
clash-verge-rev
ventoy # create bootable usb
virt-viewer # vnc connect to VM, used by kubevirt
];
Expand Down
4 changes: 4 additions & 0 deletions home/linux/gui/base/misc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
# misc
flameshot
ventoy # multi-boot usb creator

pkgs.nur.repos.linyinfeng.wemeet

wpsoffice-cn
];

# GitHub CLI tool
Expand Down
10 changes: 10 additions & 0 deletions home/linux/gui/base/wine.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
pkgs,
pkgs-unstable,
...
}: {
home.packages = with pkgs; [
# native wayland support (unstable)
wineWowPackages.waylandFull
];
}
2 changes: 1 addition & 1 deletion home/linux/gui/base/xdg.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
enable = true;
# let `xdg-open` to open the url with the correct application.
defaultApplications = let
browser = ["google-chrome-stable.desktop"];
browser = ["google-chrome.desktop"];
editor = ["nvim.desktop" "Helix.desktop" "code.desktop" "code-insiders.desktop"];
in {
"application/json" = browser;
Expand Down
6 changes: 6 additions & 0 deletions hosts/idols-ai/impermanence.nix
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,24 @@
".local/share"
".local/state"

".cache/JetBrains"

# language package managers
".npm"
".conda" # generated by `conda-shell`
"go"


".config/QQ"

# neovim plugins(wakatime & copilot)
".wakatime"
".config/github-copilot"
];
files = [
".wakatime.cfg"
".config/nushell/history.txt"
".cache/rofi.druncache"
];
};
};
Expand Down
5 changes: 4 additions & 1 deletion lib/nixosSystem.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ in
nixpkgs.lib.nixosSystem {
inherit system specialArgs;
modules =
[
{ nixpkgs.overlays = [ inputs.nur.overlay ]; }
inputs.nur.nixosModules.nur
] ++
nixos-modules
++ [
nixos-generators.nixosModules.all-formats
Expand All @@ -25,7 +29,6 @@ in
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;

home-manager.extraSpecialArgs = specialArgs;
home-manager.users."${myvars.username}".imports = home-modules;
}
Expand Down
12 changes: 12 additions & 0 deletions modules/nixos/base/db.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{ pkgs, config, inputs, lib, ... }:{

services.mysql = {
enable = true;
package = pkgs.mysql80;
};


services.redis.servers."redis" = {
enable = true;
};
}
4 changes: 4 additions & 0 deletions modules/nixos/base/nix.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
}: {
# to install chrome, you need to enable unfree packages
nixpkgs.config.allowUnfree = lib.mkForce true;
nixpkgs.config.permittedInsecurePackages = [
"openssl-1.1.1w"
];

# do garbage collection weekly to keep disk usage low
nix.gc = {
Expand All @@ -16,6 +19,7 @@
# Manual optimise storage: nix-store --optimise
# https://nixos.org/manual/nix/stable/command-ref/conf-file.html#conf-auto-optimise-store
nix.settings.auto-optimise-store = true;
programs.nix-ld.enable = true;

nix.channel.enable = false; # remove nix-channel related tools & configs, we use flakes instead.
}
3 changes: 3 additions & 0 deletions modules/nixos/base/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
hdparm # for disk performance, command
dmidecode # a tool that reads information about your system's hardware from the BIOS according to the SMBIOS/DMI standard
parted
pkg-config
mysql2pgsql
unrar
];

# replace default editor with neovim
Expand Down
2 changes: 2 additions & 0 deletions modules/nixos/base/user-group.nix
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"wireshark"
"adbusers"
"libvirtd"
"mysql"
"redis"
];
};

Expand Down
2 changes: 1 addition & 1 deletion nix-secrets
Submodule nix-secrets updated from 859b53 to 75d1cd
67 changes: 34 additions & 33 deletions outputs/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
self,
nixpkgs,
pre-commit-hooks,
...
} @ inputs: let
inherit (inputs.nixpkgs) lib;
Expand Down Expand Up @@ -89,36 +90,36 @@ in {
# Eval Tests for all NixOS & darwin systems.
# evalTests = lib.lists.all (it: it.evalTests == {}) allSystemValues;

# checks = forAllSystems (
# system: {
# # eval-tests per system
# eval-tests = allSystems.${system}.evalTests == {};
checks = forAllSystems (
system: {
# eval-tests per system
eval-tests = allSystems.${system}.evalTests == {};

# pre-commit-check = pre-commit-hooks.lib.${system}.run {
# src = mylib.relativeToRoot ".";
# hooks = {
# alejandra.enable = true; # formatter
# # Source code spell checker
# typos = {
# enable = true;
# settings = {
# write = true; # Automatically fix typos
# configPath = "./.typos.toml"; # relative to the flake root
# };
# };
# prettier = {
# enable = true;
# settings = {
# write = true; # Automatically format files
# configPath = "./.prettierrc.yaml"; # relative to the flake root
# };
# };
# # deadnix.enable = true; # detect unused variable bindings in `*.nix`
# # statix.enable = true; # lints and suggestions for Nix code(auto suggestions)
# };
# };
# }
# );
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = mylib.relativeToRoot ".";
hooks = {
alejandra.enable = true; # formatter
# Source code spell checker
typos = {
enable = true;
settings = {
write = true; # Automatically fix typos
configPath = "./.typos.toml"; # relative to the flake root
};
};
prettier = {
enable = true;
settings = {
write = true; # Automatically format files
configPath = "./.prettierrc.yaml"; # relative to the flake root
};
};
deadnix.enable = true; # detect unused variable bindings in `*.nix`
statix.enable = true; # lints and suggestions for Nix code(auto suggestions)
};
};
}
);

# Development Shells
devShells = forAllSystems (
Expand Down Expand Up @@ -149,8 +150,8 @@ in {
);

# Format the nix code in this flake
# formatter = forAllSystems (
# # alejandra is a nix formatter with a beautiful output
# system: nixpkgs.legacyPackages.${system}.alejandra
# );
formatter = forAllSystems (
# alejandra is a nix formatter with a beautiful output
system: nixpkgs.legacyPackages.${system}.alejandra
);
}
Loading

0 comments on commit 2fa7b95

Please sign in to comment.