feat: redesign the project structure
18
flake.lock
generated
@@ -240,11 +240,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1685019994,
|
||||
"narHash": "sha256-81o6SKZPALvib21hIOMx2lIhFSs0mRy0PfPvg0zsfTk=",
|
||||
"lastModified": 1684596126,
|
||||
"narHash": "sha256-4RZZmygeEXpuBqEXGs38ZAcWjWKGwu13Iqbxub6wuJk=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "d1f04b0f365a34896a37d9015637796537ec88a3",
|
||||
"rev": "27ef11f0218d9018ebb2948d40133df2b1de622d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -534,11 +534,11 @@
|
||||
"nixpkgs": "nixpkgs_7"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1685045766,
|
||||
"narHash": "sha256-MK128KJnrf0PqfdnL40KN57ZSpHPtru19TH+Ok0A0TU=",
|
||||
"lastModified": 1685121294,
|
||||
"narHash": "sha256-ddWsZ2JGWgD/xfE2XZhfVibRTacU0hWYVrAovNZNb2M=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs-wayland",
|
||||
"rev": "38c86d9ff0a4cff1e229214031f7eaaab34e10f1",
|
||||
"rev": "e49f4358e371c5f6486a95e90dfb1754817acdae",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -645,11 +645,11 @@
|
||||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1685061478,
|
||||
"narHash": "sha256-fNCFmOOfTmtWCV4WEoAnwwyjjB4NRAzucTKdt0w5zvg=",
|
||||
"lastModified": 1685156120,
|
||||
"narHash": "sha256-XnfGRNvRgqdNyiTm1B2VvzeuLFcENOXIir2jIE7BQ3A=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "82f3aa5c5a85a9f2a1e72eaf0eec30c8ab8fdf2c",
|
||||
"rev": "d71033acca2e80c8a2341a6dcd81fc9a677b1c4f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
87
flake.nix
@@ -1,12 +1,6 @@
|
||||
{
|
||||
description = "NixOS configuration of Ryan Yin";
|
||||
|
||||
# flake 为了确保够纯,它不依赖系统自身的 /etc/nix/nix.conf,而是在 flake.nix 中通过 nixConfig 设置
|
||||
# 但是为了确保安全性,flake 默认仅允许直接设置少数 nixConfig 参数,其他参数都需要在执行 nix 命令时指定 `--accept-flake-config`,否则会被忽略
|
||||
# <https://nixos.org/manual/nix/stable/command-ref/conf-file.html>
|
||||
# 如果有些包国内镜像下载不到,它仍然会走国外,这时候就得靠旁路由来解决了。
|
||||
# 临时修改默认网关为旁路由: sudo ip route add default via 192.168.5.201
|
||||
# sudo ip route del default via 192.168.5.201
|
||||
nixConfig = {
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
@@ -31,13 +25,17 @@
|
||||
];
|
||||
};
|
||||
|
||||
# 这是 flake.nix 的标准格式,inputs 是 flake 的依赖,outputs 是 flake 的输出
|
||||
# inputs 中的每一项都被拉取、构建后,被作为参数传递给 outputs 函数
|
||||
inputs = {
|
||||
# flake inputs 有很多种引用方式,应用最广泛的是 github 的引用方式
|
||||
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; # 使用 nixos-unstable 分支 for nix flakes
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.05"; # unstable branch may be broken sometimes, use stable branch when necessary
|
||||
# This is the standard format for flake.nix. `inputs` are the dependencies of the flake,
|
||||
# and `outputs` function will return all the build results of the flake.
|
||||
# Each item in `inputs` will be passed as a parameter to the `outputs` function after being pulled and built.
|
||||
inputs = {
|
||||
# There are many ways to reference flake inputs. The most widely used is github:owner/name/reference,
|
||||
# which represents the GitHub repository URL + branch/commit-id/tag.
|
||||
|
||||
# Official NixOS package source, using nixos-unstable branch here
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||
|
||||
# for macos
|
||||
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.05-darwin";
|
||||
@@ -51,10 +49,14 @@
|
||||
# e.g. wechat-uos/qqmusic/dingtalk
|
||||
nur.url = "github:nix-community/NUR";
|
||||
|
||||
home-manager.url = "github:nix-community/home-manager";
|
||||
# follows 是 inputs 中的继承语法
|
||||
# 这里使 home-manager 的 nixpkgs 这个 inputs 与当前 flake 的 inputs.nixpkgs 保持一致,避免依赖的 nixpkgs 版本不一致导致问题
|
||||
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||
# home-manager, used for managing user configuration
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
# The `follows` keyword in inputs is used for inheritance.
|
||||
# Here, `inputs.nixpkgs` of home-manager is kept consistent with the `inputs.nixpkgs` of the current flake,
|
||||
# to avoid problems caused by different versions of nixpkgs dependencies.
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# modern window compositor
|
||||
hyprland.url = "github:hyprwm/Hyprland/v0.25.0";
|
||||
@@ -77,9 +79,11 @@
|
||||
nil.url = "github:oxalica/nil/2023-05-09";
|
||||
};
|
||||
|
||||
# outputs 的参数都是 inputs 中定义的依赖项,可以通过它们的名称来引用。
|
||||
# 不过 self 是个例外,这个特殊参数指向 outputs 自身(自引用),以及 flake 根目录
|
||||
# 这里的 @ 语法将函数的参数 attribute set 取了个别名,方便在内部使用
|
||||
# `outputs` are all the build result of the flake.
|
||||
# A flake can have many use cases and different types of outputs.
|
||||
# parameters in `outputs` are defined in `inputs` and can be referenced by their names.
|
||||
# However, `self` is an exception, This special parameter points to the `outputs` itself (self-reference)
|
||||
# The `@` syntax here is used to alias the attribute set of the inputs's parameter, making it convenient to use inside the function.
|
||||
outputs = inputs@{
|
||||
self,
|
||||
nixpkgs,
|
||||
@@ -88,49 +92,67 @@
|
||||
...
|
||||
}: {
|
||||
nixosConfigurations = {
|
||||
# By default, NixOS will try to refer the nixosConfiguration with its hostname.
|
||||
# so the system named `msi-rtx4090` will use this configuration.
|
||||
# However, the configuration name can also be specified using `sudo nixos-rebuild switch --flake /path/to/flakes/directory#<name>`.
|
||||
# The `nixpkgs.lib.nixosSystem` function is used to build this configuration, the following attribute set is its parameter.
|
||||
# Run `sudo nixos-rebuild switch --flake .#msi-rtx4090` in the flake's directory to deploy this configuration on any NixOS system
|
||||
msi-rtx4090 = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
|
||||
specialArgs = inputs;
|
||||
# The Nix module system can modularize configurations, improving the maintainability of configurations.
|
||||
#
|
||||
# Each parameter in the `modules` is a Nix Module, and there is a partial introduction to it in the nixpkgs manual:
|
||||
# <https://nixos.org/manual/nixpkgs/unstable/#module-system-introduction>
|
||||
# It is said to be partial because the documentation is not complete, only some simple introductions
|
||||
# (such is the current state of Nix documentation...)
|
||||
# A Nix Module can be an attribute set, or a function that returns an attribute set.
|
||||
# If a Module is a function, according to the Nix Wiki description, this function can have up to four parameters:
|
||||
#
|
||||
# config: The configuration of the entire system
|
||||
# options: All option declarations refined with all definition and declaration references.
|
||||
# pkgs: The attribute set extracted from the Nix package collection and enhanced with the nixpkgs.config option.
|
||||
# modulesPath: The location of the module directory of Nix.
|
||||
#
|
||||
# Only these four parameters can be passed by default.
|
||||
# If you need to pass other parameters, you must use `specialArgs` by uncomment the following line
|
||||
specialArgs = inputs; # pass all inputs into all sub modules.
|
||||
modules = [
|
||||
./hosts/msi-rtx4090
|
||||
|
||||
# home-manager 作为 nixos 的一个 module
|
||||
# 这样在 nixos-rebuild switch 时,home-manager 也会被自动部署,不需要额外执行 home-manager switch 命令
|
||||
# make home-manager as a module of nixos
|
||||
# so that home-manager configuration will be deployed automatically when executing `nixos-rebuild switch`
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
# 使用 home-manager.extraSpecialArgs 自定义传递给 ./home 的参数
|
||||
# pass all inputs into home manager's all sub modules
|
||||
home-manager.extraSpecialArgs = inputs;
|
||||
home-manager.users.ryan = import ./home/home-x11.nix;
|
||||
home-manager.users.ryan = import ./home/linux/x11.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
nixos-test = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = inputs;
|
||||
modules = [
|
||||
./hosts/nixos-test
|
||||
|
||||
# home-manager 作为 nixos 的一个 module
|
||||
# 这样在 nixos-rebuild switch 时,home-manager 也会被自动部署,不需要额外执行 home-manager switch 命令
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
# 使用 home-manager.extraSpecialArgs 自定义传递给 ./home 的参数
|
||||
home-manager.extraSpecialArgs = inputs;
|
||||
home-manager.users.ryan = import ./home/home-wayland.nix;
|
||||
home-manager.users.ryan = import ./home/linux/wayland.nix;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# configurations for MacOS
|
||||
darwinConfigurations."harmonica" = darwin.lib.darwinSystem {
|
||||
system = "x86_64-darwin";
|
||||
|
||||
@@ -138,16 +160,13 @@
|
||||
modules = [
|
||||
./hosts/harmonica
|
||||
|
||||
# home-manager 作为 nixos 的一个 module
|
||||
# 这样在 nixos-rebuild switch 时,home-manager 也会被自动部署,不需要额外执行 home-manager switch 命令
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
# 使用 home-manager.extraSpecialArgs 自定义传递给 ./home 的参数
|
||||
|
||||
home-manager.extraSpecialArgs = inputs;
|
||||
home-manager.users.admin = import ./home/home-darwin.nix;
|
||||
home-manager.users.admin = import ./home/darwin;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
117
home/common/core.nix
Normal file
@@ -0,0 +1,117 @@
|
||||
{config, pkgs, ...}: let
|
||||
d = config.xdg.dataHome;
|
||||
c = config.xdg.configHome;
|
||||
cache = config.xdg.cacheHome;
|
||||
in rec {
|
||||
home.packages = with pkgs; [
|
||||
neofetch
|
||||
nnn # terminal file manager
|
||||
|
||||
# archives
|
||||
zip
|
||||
xz
|
||||
unzip
|
||||
p7zip
|
||||
|
||||
# utils
|
||||
ripgrep # recursively searches directories for a regex pattern
|
||||
jq # A lightweight and flexible command-line JSON processor
|
||||
yq-go # yaml processer https://github.com/mikefarah/yq
|
||||
exa # A modern replacement for ‘ls’
|
||||
|
||||
# networking tools
|
||||
mtr # A network diagnostic tool
|
||||
iperf3
|
||||
nmap
|
||||
socat
|
||||
ldns # replacement of dig, it provide the command `drill`
|
||||
aria2 # A lightweight multi-protocol & multi-source command-line download utility
|
||||
socat # replacement of openbsd-netcat
|
||||
|
||||
# misc
|
||||
file
|
||||
which
|
||||
tree
|
||||
gnused
|
||||
gnutar
|
||||
gawk
|
||||
p7zip
|
||||
xz
|
||||
zstd
|
||||
|
||||
# productivity
|
||||
hugo
|
||||
];
|
||||
|
||||
programs = {
|
||||
# A terminal multiplexer
|
||||
tmux = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# a cat(1) clone with syntax highlighting and Git integration.
|
||||
bat = {
|
||||
enable = true;
|
||||
config = {
|
||||
pager = "less -FR";
|
||||
theme = "Catppuccin-mocha";
|
||||
};
|
||||
themes = {
|
||||
Catppuccin-mocha = builtins.readFile (pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/catppuccin/bat/main/Catppuccin-mocha.tmTheme";
|
||||
hash = "sha256-qMQNJGZImmjrqzy7IiEkY5IhvPAMZpq0W6skLLsng/w=";
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
# skim provides a single executable: sk.
|
||||
# Basically anywhere you would want to use grep, try sk instead.
|
||||
skim = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
# syncthing.enable = true;
|
||||
};
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
bashrcExtra = ''
|
||||
export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin"
|
||||
'';
|
||||
};
|
||||
|
||||
# add environment variables
|
||||
systemd.user.sessionVariables = {
|
||||
# clean up ~
|
||||
LESSHISTFILE = cache + "/less/history";
|
||||
LESSKEY = c + "/less/lesskey";
|
||||
WINEPREFIX = d + "/wine";
|
||||
|
||||
# set this variable make i3 failed to start
|
||||
# related issue:
|
||||
# https://github.com/sddm/sddm/issues/871
|
||||
# XAUTHORITY = "$XDG_RUNTIME_DIR/Xauthority";
|
||||
|
||||
# set default applications
|
||||
BROWSER = "firefox";
|
||||
TERMINAL = "alacritty";
|
||||
|
||||
# enable scrolling in git diff
|
||||
DELTA_PAGER = "less -R";
|
||||
|
||||
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
|
||||
};
|
||||
|
||||
home.sessionVariables = systemd.user.sessionVariables;
|
||||
|
||||
home.shellAliases = {
|
||||
k = "kubectl";
|
||||
|
||||
urldecode = "python3 -c 'import sys, urllib.parse as ul; print(ul.unquote_plus(sys.stdin.read()))'";
|
||||
urlencode = "python3 -c 'import sys, urllib.parse as ul; print(ul.quote_plus(sys.stdin.read()))'";
|
||||
};
|
||||
}
|
||||
17
home/common/default.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{config, pkgs, ...}: let
|
||||
d = config.xdg.dataHome;
|
||||
c = config.xdg.configHome;
|
||||
cache = config.xdg.cacheHome;
|
||||
in rec {
|
||||
imports = [
|
||||
./nushell
|
||||
|
||||
./alacritty.nix
|
||||
./core.nix
|
||||
./development.nix
|
||||
./git.nix
|
||||
./media.nix
|
||||
./starship.nix
|
||||
];
|
||||
|
||||
}
|
||||
97
home/common/development.nix
Normal file
@@ -0,0 +1,97 @@
|
||||
{config, pkgs, nil, ...}:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
nil.packages."${pkgs.system}".default # nix language server
|
||||
|
||||
# IDE
|
||||
insomnia
|
||||
jetbrains.pycharm-community
|
||||
# jetbrains.idea-community
|
||||
|
||||
# cloud native
|
||||
docker-compose
|
||||
kubectl
|
||||
kubernetes-helm
|
||||
terraform
|
||||
pulumi
|
||||
|
||||
# cloud provider
|
||||
awscli
|
||||
|
||||
# DO NOT install build tools for C/C++, set it per project by devShell instead
|
||||
gnumake # used by this repo, to simplify the deployment
|
||||
clang-tools
|
||||
clang-analyzer
|
||||
# lldb
|
||||
# cmake
|
||||
# autoconf
|
||||
# automake
|
||||
# bison
|
||||
# cppcheck
|
||||
# fakeroot
|
||||
# flex
|
||||
# gettext
|
||||
# groff
|
||||
# libtool
|
||||
# m4
|
||||
# patch
|
||||
# pkgconf
|
||||
# texinfo
|
||||
# binutils
|
||||
|
||||
# Golang
|
||||
delve
|
||||
go
|
||||
go-outline
|
||||
go-tools
|
||||
go2nix
|
||||
gomodifytags
|
||||
gopls
|
||||
gotests
|
||||
impl
|
||||
|
||||
# Rust
|
||||
rustup
|
||||
|
||||
# python
|
||||
(python3.withPackages(ps: with ps; [
|
||||
ipython
|
||||
pandas
|
||||
requests
|
||||
pyquery
|
||||
]))
|
||||
# need to run `conda-install` before using it
|
||||
# need to run `conda-shell` before using command `conda`
|
||||
conda
|
||||
|
||||
# db related
|
||||
dbeaver
|
||||
mycli
|
||||
pgcli
|
||||
|
||||
# embedded development
|
||||
minicom
|
||||
];
|
||||
|
||||
programs = {
|
||||
# modern vim
|
||||
neovim = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
set number relativenumber
|
||||
'';
|
||||
};
|
||||
|
||||
direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
};
|
||||
|
||||
# GitHub CLI tool
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
30
home/common/git.nix
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
|
||||
userName = "Ryan Yin";
|
||||
userEmail = "xiaoyin_c@qq.com";
|
||||
|
||||
extraConfig = {
|
||||
pull = {
|
||||
rebase = true;
|
||||
};
|
||||
};
|
||||
|
||||
# signing = {
|
||||
# key = "xxx";
|
||||
# signByDefault = true;
|
||||
# };
|
||||
|
||||
delta = {
|
||||
enable = true;
|
||||
options = {
|
||||
features = "side-by-side";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
17
home/common/media.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
# processing audio/video
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
ffmpeg-full
|
||||
|
||||
# images
|
||||
viu # terminal image viewer
|
||||
imv # simple image viewer
|
||||
imagemagick
|
||||
graphviz
|
||||
];
|
||||
}
|
||||
44
home/darwin/core.nix
Normal file
@@ -0,0 +1,44 @@
|
||||
|
||||
{pkgs, ...}:
|
||||
{
|
||||
# MacOS specific configuration
|
||||
home.packages = with pkgs; [
|
||||
|
||||
];
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
|
||||
# all my ssh private key are generated by `ssh-keygen -t ed25519 -C "ryan@nickname"`
|
||||
# the config's format:
|
||||
# Host — given the pattern used to match against the host name given on the command line.
|
||||
# HostName — specify nickname or abbreviation for host
|
||||
# IdentityFile — the location of your SSH key authentication file for the account.
|
||||
# format in details:
|
||||
# https://www.ssh.com/academy/ssh/config
|
||||
extraConfig = ''
|
||||
Host 192.168.*
|
||||
# allow to securely use local SSH agent to authenticate on the remote machine.
|
||||
# It has the same effect as adding cli option `ssh -A user@host`
|
||||
ForwardAgent yes
|
||||
# romantic holds my homelab~
|
||||
IdentityFile ~/.ssh/romantic
|
||||
# Specifies that ssh should only use the identity file explicitly configured above
|
||||
# required to prevent sending default identity files first.
|
||||
IdentitiesOnly yes
|
||||
|
||||
Host github.com
|
||||
Hostname github.com
|
||||
# github is controlled by gluttony~
|
||||
IdentityFile ~/.ssh/harmonica
|
||||
# Specifies that ssh should only use the identity file explicitly configured above
|
||||
# required to prevent sending default identity files first.
|
||||
IdentitiesOnly yes
|
||||
'';
|
||||
|
||||
# use ssh-agent so we only need to input passphrase once
|
||||
# run `ssh-add /path/to/key` for every identity file
|
||||
# check imported keys by `ssh-add -l`
|
||||
# TODO `ssh-add` can only add keys temporary, use gnome-keyring to unlock all keys after login.
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,33 @@
|
||||
{pkgs, ...}:
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
docker-compose
|
||||
kubectl
|
||||
kubernetes-helm
|
||||
terraform
|
||||
pulumi
|
||||
imports = [
|
||||
../common/core.nix
|
||||
../common/alacritty.nix
|
||||
../common/git.nix
|
||||
../common/starship.nix
|
||||
|
||||
./core.nix
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home = {
|
||||
username = "admin";
|
||||
# set homeDirectory make build fail
|
||||
# homeDirectory = "/Users/admin";
|
||||
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
# when a new Home Manager release introduces backwards
|
||||
# incompatible changes.
|
||||
#
|
||||
# You can update Home Manager without changing this value. See
|
||||
# the Home Manager release notes for a list of state version
|
||||
# changes in each release.
|
||||
stateVersion = "22.11";
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./darwin
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the
|
||||
# paths it should manage.
|
||||
home = {
|
||||
username = "admin";
|
||||
# set homeDirectory make build fail
|
||||
# homeDirectory = "/Users/admin";
|
||||
|
||||
# This value determines the Home Manager release that your
|
||||
# configuration is compatible with. This helps avoid breakage
|
||||
# when a new Home Manager release introduces backwards
|
||||
# incompatible changes.
|
||||
#
|
||||
# You can update Home Manager without changing this value. See
|
||||
# the Home Manager release notes for a list of state version
|
||||
# changes in each release.
|
||||
stateVersion = "22.11";
|
||||
};
|
||||
|
||||
# Let Home Manager install and manage itself.
|
||||
programs.home-manager.enable = true;
|
||||
}
|
||||
@@ -2,9 +2,6 @@
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# home.packages = [
|
||||
# ];
|
||||
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
|
||||
@@ -39,35 +36,4 @@
|
||||
# check imported keys by `ssh-add -l`
|
||||
# TODO `ssh-add` can only add keys temporary, use gnome-keyring to unlock all keys after login.
|
||||
};
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
|
||||
userName = "Ryan Yin";
|
||||
userEmail = "xiaoyin_c@qq.com";
|
||||
|
||||
extraConfig = {
|
||||
pull = {
|
||||
rebase = true;
|
||||
};
|
||||
};
|
||||
|
||||
# signing = {
|
||||
# key = "xxx";
|
||||
# signByDefault = true;
|
||||
# };
|
||||
|
||||
delta = {
|
||||
enable = true;
|
||||
options = {
|
||||
features = "side-by-side";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# GitHub CLI tool
|
||||
programs.gh = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
39
home/linux/common/system-tools.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{pkgs, config, ...}:
|
||||
|
||||
|
||||
{
|
||||
# Linux Only Packages, not available on Darwin
|
||||
home.packages = with pkgs; [
|
||||
btop # replacement of htop/nmon
|
||||
htop
|
||||
iotop
|
||||
nmon
|
||||
|
||||
## networking tools
|
||||
wireguard-tools # manage wireguard vpn manually, via wg-quick
|
||||
iftop
|
||||
|
||||
# misc
|
||||
libnotify
|
||||
|
||||
# system call monitoring
|
||||
strace
|
||||
ltrace # library call monitoring
|
||||
lsof
|
||||
|
||||
# system tools
|
||||
ethtool
|
||||
sysstat
|
||||
lm_sensors # for `sensors` command
|
||||
cifs-utils # for mounting windows shares
|
||||
];
|
||||
|
||||
# auto mount usb drives
|
||||
services = {
|
||||
udiskie.enable = true;
|
||||
};
|
||||
|
||||
services = {
|
||||
playerctld.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
# XDG stands for "Cross-Desktop Group", with X used to mean "cross".
|
||||
# It's a bunch of specifications from freedesktop.org intended to standardize desktops and
|
||||
# other GUI applications on various systems (primarily Unix-like) to be interoperable:
|
||||
# https://www.freedesktop.org/wiki/Specifications/
|
||||
{config, pkgs, ...}: let
|
||||
browser = ["firefox.desktop"];
|
||||
|
||||
@@ -25,6 +29,11 @@
|
||||
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
|
||||
};
|
||||
in {
|
||||
home.packages = with pkgs; [
|
||||
xdg-utils
|
||||
xdg-user-dirs
|
||||
];
|
||||
|
||||
xdg = {
|
||||
enable = true;
|
||||
cacheHome = config.home.homeDirectory + "/.local/cache";
|
||||
21
home/linux/desktop/creative.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
# creative
|
||||
# blender # 3d modeling
|
||||
# gimp # image editing, I prefer using figma in browser instead of this one
|
||||
inkscape # vector graphics
|
||||
krita # digital painting
|
||||
kicad # 3d printing, eletrical engineering
|
||||
musescore # music notation
|
||||
reaper # audio production
|
||||
];
|
||||
|
||||
programs = {
|
||||
obs-studio.enable = true;
|
||||
};
|
||||
}
|
||||
21
home/linux/desktop/default.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
./creative.nix
|
||||
./media.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# networking
|
||||
wireshark
|
||||
|
||||
# instant messaging
|
||||
telegram-desktop
|
||||
discord
|
||||
qq # https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/networking/instant-messengers/qq
|
||||
|
||||
# remote desktop(rdp connect)
|
||||
remmina
|
||||
freerdp # required by remmina
|
||||
];
|
||||
}
|
||||
32
home/linux/desktop/media.nix
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
# media - control and enjoy audio/video
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
# audio control
|
||||
pavucontrol
|
||||
playerctl
|
||||
pulsemixer
|
||||
|
||||
nvtop
|
||||
|
||||
# video/audio tools
|
||||
libva-utils
|
||||
vdpauinfo
|
||||
vulkan-tools
|
||||
glxinfo
|
||||
];
|
||||
|
||||
programs = {
|
||||
mpv = {
|
||||
enable = true;
|
||||
defaultProfiles = ["gpu-hq"];
|
||||
scripts = [pkgs.mpvScripts.mpris];
|
||||
};
|
||||
|
||||
obs-studio.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -29,6 +29,5 @@
|
||||
XMODIFIERS = "@im=fcitx";
|
||||
INPUT_METHOD = "fcitx";
|
||||
IMSETTINGS_MODULE = "fcitx";
|
||||
|
||||
};
|
||||
}
|
||||
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 7.0 KiB After Width: | Height: | Size: 7.0 KiB |
@@ -23,6 +23,13 @@
|
||||
executable = true; # make all scripts executable
|
||||
};
|
||||
|
||||
# rofi is a application launcher and dmenu replacement
|
||||
home.file.".config/rofi" = {
|
||||
source = ./rofi-conf;
|
||||
# copy the scripts directory recursively
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
# allow fontconfig to discover fonts and configurations installed through home.packages
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||