init nix-os configuraion files

This commit is contained in:
2023-10-06 12:11:50 +08:00
commit adc025c7d9
164 changed files with 7520 additions and 0 deletions

110
home/core.nix Normal file
View File

@@ -0,0 +1,110 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{ inputs, outputs, lib, config, pkgs, username, useremail, ... }: {
home = {
inherit username;
homeDirectory = "/home/${username}";
# Add stuff for your user as you see fit:
packages = with pkgs; [
nixpkgs-fmt
];
};
# Enable home-manager and git
programs = {
# home-manager.enable = true;
# git.enable = true;
git = {
enable = true;
userName = username;
userEmail = useremail;
includes = [
{
# use diffrent email & name for work
path = "~/work/.gitconfig";
condition = "gitdir:~/work/";
}
];
extraConfig = {
init.defaultBranch = "master";
push.autoSetupRemote = true;
pull.rebase = true;
# replace https with ssh
# url = {
# "ssh://git@github.com/" = {
# insteadOf = "https://github.com/";
# };
# "ssh://git@gitlab.com/" = {
# insteadOf = "https://gitlab.com/";
# };
# "ssh://git@bitbucket.com/" = {
# insteadOf = "https://bitbucket.com/";
# };
# };
};
};
bash = {
enable = true;
enableCompletion = true;
bashrcExtra = "";
shellAliases = { };
};
vim = {
enable = true;
plugins = with pkgs.vimPlugins; [ vim-airline ];
settings = { ignorecase = true; };
extraConfig = ''
set mouse=a
set expandtab
set tabstop=2
set softtabstop=2
set shiftwidth=2
'';
};
};
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
# You can also add overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
# Or define it inline, for example:
# (final: prev: {
# hi = final.hello.overrideAttrs (oldAttrs: {
# patches = [ ./change-hello-to-hi.patch ];
# });
# })
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
# Workaround for https://github.com/nix-community/home-manager/issues/2942
allowUnfreePredicate = (_: true);
};
};
# Nicely reload system units when changing configs
systemd.user.startServices = "sd-switch";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
home.stateVersion = "23.05";
}

88
home/desktop.nix Normal file
View File

@@ -0,0 +1,88 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{ inputs, outputs, lib, config, pkgs, username, useremail, hyprland, ... }:
{
# You can import other home-manager modules here
imports = [
# If you want to use modules your own flake exports (from modules/home-manager):
# outputs.homeManagerModules.example
# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
./core.nix
../modules/home/hyprland
../modules/home/vscode
../modules/home/v2ray
../modules/home/xdg.nix
../modules/home/theme.nix
];
home = {
# Add stuff for your user as you see fit:
packages = with pkgs; [
bc # GNU software calculator
vlc
imv
motrix
microsoft-edge
telegram-desktop
# firefox
# chromium
zip
unzip
lsof
pciutils # lspci etc.
steam-run
frp
obsidian
wpsoffice-cn
xorg.xhost
dbeaver
postman
# jdk
nodejs
yarn
flutter
oraclejdk
jetbrains.idea-community
# nur.repos.linyinfeng.wemeet
];
sessionVariables = {
JAVA_HOME = "${pkgs.oraclejdk}";
XIM = "fcitx";
XIM_PROGRAM = "fcitx";
XMODIFIERS = "@im=fcitx";
};
};
programs = {
bash = {
initExtra = ''
export XIM="fcitx"
export XIM_PROGRAM="fcitx"
export XMODIFIERS="@im=fcitx"
'';
};
};
i18n.inputMethod = {
enabled = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-chinese-addons
];
};
# Enable home-manager and git
programs = {
home-manager.enable = true;
# git.enable = true;
};
}

26
home/server.nix Normal file
View File

@@ -0,0 +1,26 @@
# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{ inputs, outputs, lib, config, pkgs, username, useremail, hyprland, ... }: {
# You can import other home-manager modules here
imports = [
# If you want to use modules your own flake exports (from modules/home-manager):
# outputs.homeManagerModules.example
# Or modules exported from other flakes (such as nix-colors):
# inputs.nix-colors.homeManagerModules.default
# You can also split up your configuration and import pieces of it here:
# ./nvim.nix
./core.nix
];
home = {
# Add stuff for your user as you see fit:
packages = with pkgs; [
];
};
# Enable home-manager and git
programs = { };
}