feat: simplify flake.nix

This commit is contained in:
Ryan Yin
2023-07-26 20:07:42 +08:00
parent eebbb9f5e6
commit 204cb03922
70 changed files with 1183 additions and 1165 deletions
+74 -71
View File
@@ -1,9 +1,8 @@
{ pkgs, ... }:
{pkgs, ...}:
###########################################################
#
# Alacritty Configuration
#
#
# Useful Hot Keys for macOS:
# 1. Multi-Window: `command + N`
# 2. Increase Font Size: `command + =` | `command + +`
@@ -18,80 +17,84 @@
# Note: Alacritty do not have support for Tabs, and any graphic protocol.
#
###########################################################
{
programs.alacritty = {
enable = true;
};
xdg.configFile."alacritty/alacritty.yml".text = ''
import:
# all alacritty themes can be found at
# https://github.com/alacritty/alacritty-theme
- ~/.config/alacritty/theme_catppuccino.yml
window:
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
opacity: 0.95
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
startup_mode: Windowed
# Allow terminal applications to change Alacritty's window title.
dynamic_title: true
# Make `Option` key behave as `Alt` (macOS only):
# - OnlyLeft
# - OnlyRight
# - Both
# - None (default)
option_as_alt: Both
scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
bold:
family: JetBrainsMono Nerd Font
italic:
family: JetBrainsMono Nerd Font
normal:
family: JetBrainsMono Nerd Font
bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: JetBrainsMono Nerd Font
'' + (if pkgs.stdenv.isDarwin then ''
# Point size
size: 14
shell: # force nushell as default shell on macOS
program: /run/current-system/sw/bin/nu
'' else ''
# holder identation
# Point size
size: 13
'');
xdg.configFile."alacritty/alacritty.yml".text =
''
import:
# all alacritty themes can be found at
# https://github.com/alacritty/alacritty-theme
- ~/.config/alacritty/theme_catppuccino.yml
window:
# Background opacity
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
opacity: 0.95
# Startup Mode (changes require restart)
#
# Values for `startup_mode`:
# - Windowed
# - Maximized
# - Fullscreen
#
# Values for `startup_mode` (macOS only):
# - SimpleFullscreen
startup_mode: Windowed
# Allow terminal applications to change Alacritty's window title.
dynamic_title: true
# Make `Option` key behave as `Alt` (macOS only):
# - OnlyLeft
# - OnlyRight
# - Both
# - None (default)
option_as_alt: Both
scrolling:
# Maximum number of lines in the scrollback buffer.
# Specifying '0' will disable scrolling.
history: 10000
# Scrolling distance multiplier.
#multiplier: 3
# Font configuration
font:
# Normal (roman) font face
bold:
family: JetBrainsMono Nerd Font
italic:
family: JetBrainsMono Nerd Font
normal:
family: JetBrainsMono Nerd Font
bold_italic:
# Font family
#
# If the bold italic family is not specified, it will fall back to the
# value specified for the normal font.
family: JetBrainsMono Nerd Font
''
+ (
if pkgs.stdenv.isDarwin
then ''
# Point size
size: 14
shell: # force nushell as default shell on macOS
program: /run/current-system/sw/bin/nu
''
else ''
# holder identation
# Point size
size: 13
''
);
xdg.configFile."alacritty/theme_catppuccino.yml".source = ./theme_catppuccino.yml;
}
+2 -4
View File
@@ -1,14 +1,12 @@
{ ... }:
{
{...}: {
imports = [
./alacritty
../server
./neovim
./development.nix
./kitty.nix
./media.nix
./shell.nix
];
}
+13 -10
View File
@@ -1,10 +1,12 @@
{ pkgs, pkgs-unstable, ... }:
{
pkgs,
pkgs-unstable,
...
}: {
#############################################################
#
# Basic settings for development environment
#
#
# Please avoid to install language specific packages here(globally),
# instead, install them independently using dev-templates:
# https://github.com/the-nix-way/dev-templates
@@ -36,13 +38,14 @@
gnumake # used by this repo, to simplify the deployment
# python
(python311.withPackages (ps: with ps; [
ipython
pandas
requests
pyquery
pyyaml
]))
(python311.withPackages (ps:
with ps; [
ipython
pandas
requests
pyquery
pyyaml
]))
# db related
dbeaver
+26 -14
View File
@@ -1,9 +1,12 @@
{ lib, pkgs, ... }:
{
lib,
pkgs,
...
}:
###########################################################
#
# Kitty Configuration
#
#
# Useful Hot Keys for macOS:
# 1. New Tab: `command + t`
# 2. Close Tab: `command + w`
@@ -28,20 +31,29 @@
font = {
name = "JetBrainsMono Nerd Font";
# use different font size on macOS
size = if pkgs.stdenv.isDarwin then 14 else 13;
size =
if pkgs.stdenv.isDarwin
then 14
else 13;
};
settings = {
background_opacity = "0.95";
macos_option_as_alt = true; # Option key acts as Alt on macOS
scrollback_lines = 10000;
enable_audio_bell = false;
} // (if pkgs.stdenv.isDarwin then {
# macOS specific settings, force kitty to use nushell as default shell
shell = "/run/current-system/sw/bin/nu";
} else {});
settings =
{
background_opacity = "0.95";
macos_option_as_alt = true; # Option key acts as Alt on macOS
scrollback_lines = 10000;
enable_audio_bell = false;
}
// (
if pkgs.stdenv.isDarwin
then {
# macOS specific settings, force kitty to use nushell as default shell
shell = "/run/current-system/sw/bin/nu";
}
else {}
);
# macOS specific settings
darwinLaunchOptions = [ "--start-as=fullscreen" ];
darwinLaunchOptions = ["--start-as=fullscreen"];
};
}
+5 -4
View File
@@ -1,6 +1,7 @@
{ pkgs
, config
, ...
{
pkgs,
config,
...
}:
# processing audio/video
{
@@ -8,7 +9,7 @@
ffmpeg-full
# images
viu # Terminal image viewer with native support for iTerm and Kitty
viu # Terminal image viewer with native support for iTerm and Kitty
imagemagick
graphviz
];
+34 -33
View File
@@ -1,5 +1,8 @@
{ pkgs, astronvim, ... }:
{
pkgs,
astronvim,
...
}:
###############################################################################
#
# AstroNvim's configuration and all its dependencies
@@ -70,7 +73,7 @@
#
# Joining a Selection of Lines With Space: `:join`
# Joining without spaces: `:join!`
#
#
# Toggle text's case: `~`
# Convert to uppercase: `U`
# Convert to lowercase: `u`
@@ -93,7 +96,7 @@
"nvim" = {
# update AstroNvim
onChange = "${pkgs.neovim}/bin/nvim --headless +quitall";
source = astronvim;
source = astronvim;
};
# my cusotom astronvim config, astronvim will load it after base config
# https://github.com/AstroNvim/AstroNvim/blob/v3.32.0/lua/astronvim/bootstrap.lua#L15-L16
@@ -117,16 +120,15 @@
viAlias = false;
vimAlias = true;
withPython3 = true;
withNodeJs = true;
extraPackages = [];
# currently we use lazy.nvim as neovim's package manager, so comment this one.
plugins = with pkgs.vimPlugins;[
plugins = with pkgs.vimPlugins; [
# search all the plugins using https://search.nixos.org/packages
luasnip
];
};
};
@@ -144,14 +146,14 @@
#-- python
nodePackages.pyright # python language server
python311Packages.black # python formatter
python311Packages.black # python formatter
python311Packages.ruff-lsp
#-- rust
rust-analyzer
cargo # rust package manager
cargo # rust package manager
rustfmt
#-- zig
zls
@@ -159,18 +161,18 @@
nil
rnix-lsp
# nixd
statix # Lints and suggestions for the nix programming language
deadnix # Find and remove unused code in .nix source files
alejandra # Nix Code Formatter
statix # Lints and suggestions for the nix programming language
deadnix # Find and remove unused code in .nix source files
alejandra # Nix Code Formatter
#-- golang
go
gomodifytags
iferr # generate error handling code for go
impl # generate function implementation for go
gotools # contains tools like: godoc, goimports, etc.
gopls # go language server
delve # go debugger
iferr # generate error handling code for go
impl # generate function implementation for go
gotools # contains tools like: godoc, goimports, etc.
gopls # go language server
delve # go debugger
#-- lua
stylua
@@ -180,7 +182,7 @@
nodePackages.bash-language-server
shellcheck
shfmt
#-- javascript/typescript --#
nodePackages.typescript
nodePackages.typescript-language-server
@@ -194,26 +196,25 @@
terraform-ls
jsonnet
jsonnet-language-server
hadolint # Dockerfile linter
hadolint # Dockerfile linter
#-- Others
taplo # TOML language server / formatter / validator
taplo # TOML language server / formatter / validator
nodePackages.yaml-language-server
sqlfluff # SQL linter
actionlint # GitHub Actions linter
buf # protoc plugin for linting and formatting
proselint # English prose linter
sqlfluff # SQL linter
actionlint # GitHub Actions linter
buf # protoc plugin for linting and formatting
proselint # English prose linter
#-- Misc
tree-sitter # common language parser/highlighter
nodePackages.prettier # common code formatter
marksman # language server for markdown
glow # markdown previewer
tree-sitter # common language parser/highlighter
nodePackages.prettier # common code formatter
marksman # language server for markdown
glow # markdown previewer
#-- Optional Requirements:
gdu # disk usage analyzer, required by AstroNvim
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
gdu # disk usage analyzer, required by AstroNvim
ripgrep # fast search tool, required by AstroNvim's '<leader>fw'(<leader> is space key)
];
};
}
+1 -3
View File
@@ -1,5 +1,4 @@
{ ... }: {
{...}: {
programs.bash = {
# load the alias file for work
bashrcExtra = ''
@@ -22,5 +21,4 @@
source /etc/agenix/alias-for-work.nushell
'';
};
}
+1 -1
View File
@@ -1,4 +1,4 @@
{ ... }: {
{...}: {
programs.bash = {
enable = true;
enableCompletion = true;
+2 -5
View File
@@ -1,6 +1,5 @@
{ ... }:
{
# a cat(1) clone with syntax highlighting and Git integration.
{...}: {
# a cat(1) clone with syntax highlighting and Git integration.
programs.bat = {
enable = true;
config = {
@@ -12,6 +11,4 @@
Catppuccin-mocha = builtins.readFile ./Catppuccin-mocha.tmTheme;
};
};
}
+4 -6
View File
@@ -1,6 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home.packages = with pkgs; [
neofetch
nnn # terminal file manager
@@ -20,12 +18,12 @@
# networking tools
mtr # A network diagnostic tool
iperf3
dnsutils # `dig` + `nslookup`
dnsutils # `dig` + `nslookup`
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
nmap # A utility for network discovery and security auditing
ipcalc # it is a calculator for the IPv4/v6 addresses
ipcalc # it is a calculator for the IPv4/v6 addresses
# misc
cowsay
@@ -40,7 +38,7 @@
gnupg
# nix related
#
#
# it provides the command `nom` works just like `nix
# with more details log output
nix-output-monitor
+1 -3
View File
@@ -1,5 +1,4 @@
{ ... }:
{
{...}: {
imports = [
./bat
./nushell
@@ -11,5 +10,4 @@
./git.nix
./starship.nix
];
}
+6 -5
View File
@@ -1,13 +1,14 @@
{ config
, lib
, pkgs
, ...
{
config,
lib,
pkgs,
...
}: {
# `programs.git` will generate the config file: ~/.config/git/config
# to make git use this config file, `~/.gitconfig` should not exist!
#
# https://git-scm.com/docs/git-config#Documentation/git-config.txt---global
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
home.activation.removeExistingGitconfig = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
rm -f ~/.gitconfig
'';
+2 -2
View File
@@ -1,11 +1,11 @@
{ ... }: {
{...}: {
programs.nushell = {
enable = true;
configFile.source = ./config.nu;
# home-manager will merge the cotent in `environmentVariables` with the `envFile.source`
# but basically, I set all environment variables via the shell-independent way, so I don't need to use those two options
#
#
# envFile.source = ./env.nu;
# environmentVariables = { FOO="bar"; };
+1 -1
View File
@@ -1,4 +1,4 @@
{ ... }: {
{...}: {
programs.starship = {
enable = true;
+5 -8
View File
@@ -1,16 +1,13 @@
{ pkgs, ... }:
let
{pkgs, ...}: let
buildTmuxPlugin = pkgs.tmuxPlugins.mkTmuxPlugin;
in
{
in {
draculaTheme = buildTmuxPlugin {
pluginName = "dracula";
version = "v2.2.0";
src = builtins.fetchTarball {
name = "dracula-tmux-v2.2.0";
url = "https://github.com/dracula/tmux/archive/refs/tags/v2.2.0.tar.gz";
name = "dracula-tmux-v2.2.0";
url = "https://github.com/dracula/tmux/archive/refs/tags/v2.2.0.tar.gz";
sha256 = "sha256:0v2k994yy4xx2iw8qxg7qphw46gq2qmg496i3a3h9b6jgwxqm7zn";
};
};
}
}
+12 -11
View File
@@ -1,24 +1,25 @@
{ config, pkgs, ... }:
let
plugins = pkgs.tmuxPlugins // pkgs.callPackage ./custom-plugins.nix {};
in
{
config,
pkgs,
...
}: let
plugins = pkgs.tmuxPlugins // pkgs.callPackage ./custom-plugins.nix {};
in {
programs.tmux = {
enable = true;
shell = "${pkgs.nushell}/bin/nu";
# Resize the window to the size of the smallest session for which it is the current window.
#
#
aggressiveResize = true;
# https://github.com/tmux-plugins/tmux-sensible
# tmux-sensible overwrites default tmux shortcuts, makes them more sane.
sensibleOnTop = true;
# extraConfig = builtins.readFile ./tmux.conf;
# keyMode = "vi"; # default is emacs
baseIndex = 1; # start index from 1
escapeTime = 0; # do not wait for escape key
terminal = "xterm-256color";
@@ -31,8 +32,8 @@ in
plugin = continuum;
extraConfig = ''
set -g @continuum-save-interval '15'
# Option to display current status of tmux continuum in tmux status line.
# Option to display current status of tmux continuum in tmux status line.
set -g status-right 'Continuum status: #{continuum_status}'
'';
}
@@ -41,7 +42,7 @@ in
# Manually persists tmux environment across system restarts.
# prefix + Ctrl-s - save
# prefix + Ctrl-r - restore
#
#
plugin = resurrect;
# Restore Neovim sessions
extraConfig = "set -g @resurrect-strategy-nvim 'session'";
+1 -3
View File
@@ -1,6 +1,4 @@
{ ... }:
{
{...}: {
programs.zellij = {
enable = true;
};
+2 -4
View File
@@ -1,8 +1,6 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
##########################################################################
#
#
# MacOS specific home configuration
#
##########################################################################
+4 -6
View File
@@ -1,9 +1,7 @@
{ ... }:
{
{ username, ... }: {
imports = [
../base/desktop
./core.nix
./nushell.nix
./rime-squirrel.nix
@@ -12,9 +10,9 @@
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = {
username = "ryan";
username = username;
# set homeDirectory make build fail
homeDirectory = "/Users/ryan";
homeDirectory = "/Users/${username}";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
+2 -2
View File
@@ -1,4 +1,4 @@
{ config, ... }: {
{config, ...}: {
# nix-darwin do not set PATH for nushell! so we need to do it manually
# this is a workaround to add nix's PATH to nushell
programs.nushell.extraConfig = ''
@@ -15,4 +15,4 @@
($env.PATH | split row (char esep))
] | flatten)
'';
}
}
+5 -3
View File
@@ -1,8 +1,10 @@
{ lib, pkgs, ... }:
{
lib,
pkgs,
...
}: {
# remove existing rime data (squirrel)
home.activation.removeExistingRimeData = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
home.activation.removeExistingRimeData = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
rm -rf "~/Library/Rime/build/flypy.prism.bin"
'';
+2 -5
View File
@@ -1,11 +1,8 @@
{ config, ... }:
let
{config, ...}: let
d = config.xdg.dataHome;
c = config.xdg.configHome;
cache = config.xdg.cacheHome;
in
rec {
in rec {
# add environment variables
systemd.user.sessionVariables = {
# clean up ~
+3 -7
View File
@@ -1,7 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
# Linux Only Packages, not available on Darwin
home.packages = with pkgs; [
btop # replacement of htop/nmon
@@ -13,7 +10,7 @@
# misc
libnotify
wireguard-tools # manage wireguard vpn manually, via wg-quick
# need to run `conda-install` before using it
# need to run `conda-shell` before using command `conda`
# conda is not available for MacOS
@@ -30,7 +27,7 @@
ethtool
pciutils # lspci
usbutils # lsusb
hdparm # for disk performance, command
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
];
@@ -42,5 +39,4 @@
services = {
# syncthing.enable = true;
};
}
+4 -9
View File
@@ -1,6 +1,4 @@
{ ... }:
{
{ username, ... }: {
imports = [
../base/desktop
@@ -13,12 +11,9 @@
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = let
name = "ryan";
in
{
username = name;
homeDirectory = "/home/${name}";
home = {
username = username;
homeDirectory = "/home/${username}";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
+5 -10
View File
@@ -1,6 +1,4 @@
{ ... }:
{
{ username, ... }: {
imports = [
../base/desktop
@@ -9,16 +7,13 @@
./desktop
./i3
];
];
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = let
name = "ryan";
in
{
username = name;
homeDirectory = "/home/${name}";
home = {
username = username;
homeDirectory = "/home/${username}";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
+1 -2
View File
@@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
home.packages = with pkgs; [
# creative
# blender # 3d modeling
+2 -3
View File
@@ -1,5 +1,4 @@
{ pkgs, ... }:
{
{pkgs, ...}: {
imports = [
./creative.nix
./immutable-file.nix
@@ -10,7 +9,7 @@
home.packages = with pkgs; [
# GUI apps
insomnia # REST client
insomnia # REST client
wireshark # network analyzer
# e-book viewer(.epub/.mobi/...)
+24 -23
View File
@@ -1,26 +1,24 @@
{ config
, lib
, pkgs
, ...
{
config,
lib,
pkgs,
...
}:
##############################################################################################
#
# Provide a option `home.immutable-file`, it works like `home.file` but make the generated file immutable.
#
# Copy from https://github.com/iosmanthus/nixos-config/blob/349917b/modules/immutable-file.nix
#
# this module use the `chattr +i` to make the file immutable, `i` indicates `immutable`,
# this module use the `chattr +i` to make the file immutable, `i` indicates `immutable`,
# it's a i-node flags only works on Linux.
#
#
# TODO not used yet, need to test it.
#
#
##############################################################################################
with lib;
let
with lib; let
cfg = config.home.immutable-file;
immutableFileOpts = { ... }: {
immutableFileOpts = {...}: {
options = {
src = mkOption {
type = types.path;
@@ -44,21 +42,24 @@ let
sudo cp $2 $1
sudo chattr +i $1
'';
in
{
in {
options.home.immutable-file = mkOption {
type = with types; attrsOf (submodule immutableFileOpts);
default = { };
default = {};
};
config = mkIf (cfg != { }) {
home.activation = mapAttrs'
(name: { src, dst }:
config = mkIf (cfg != {}) {
home.activation =
mapAttrs'
(name: {
src,
dst,
}:
nameValuePair
"make-immutable-${name}"
(lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${mkImmutableFile} ${dst} ${src}
''))
"make-immutable-${name}"
(lib.hm.dag.entryAfter ["writeBoundary"] ''
${mkImmutableFile} ${dst} ${src}
''))
cfg;
};
}
}
+6 -5
View File
@@ -1,6 +1,7 @@
{ pkgs
, config
, ...
{
pkgs,
config,
...
}:
# media - control and enjoy audio/video
{
@@ -23,8 +24,8 @@
programs = {
mpv = {
enable = true;
defaultProfiles = [ "gpu-hq" ];
scripts = [ pkgs.mpvScripts.mpris ];
defaultProfiles = ["gpu-hq"];
scripts = [pkgs.mpvScripts.mpris];
};
};
+2 -4
View File
@@ -1,6 +1,4 @@
{ pkgs
, ...
}: {
{pkgs, ...}: {
programs.ssh = {
enable = true;
@@ -35,7 +33,7 @@
Host gtr5
HostName 192.168.5.172
Port 22
Host um560
HostName 192.168.5.173
Port 22
+54 -55
View File
@@ -1,9 +1,12 @@
# 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:
# 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, ... }:
{
config,
pkgs,
...
}: {
home.packages = with pkgs; [
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
xdg-user-dirs
@@ -15,68 +18,64 @@
# manage $XDG_CONFIG_HOME/mimeapps.list
# xdg search all desktop entries from $XDG_DATA_DIRS, check it by command:
# echo $XDG_DATA_DIRS
# echo $XDG_DATA_DIRS
# the system-level desktop entries can be list by command:
# ls -l /run/current-system/sw/share/applications/
# the user-level desktop entries can be list by command(user ryan):
# ls /etc/profiles/per-user/ryan/share/applications/
mimeApps = {
enable = true;
defaultApplications =
let
browser = [ "firefox.desktop" ];
in
{
"application/json" = browser;
"application/pdf" = browser; # TODO: pdf viewer
defaultApplications = let
browser = ["firefox.desktop"];
in {
"application/json" = browser;
"application/pdf" = browser; # TODO: pdf viewer
"text/html" = browser;
"text/xml" = browser;
"application/xml" = browser;
"application/xhtml+xml" = browser;
"application/xhtml_xml" = browser;
"application/rdf+xml" = browser;
"application/rss+xml" = browser;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xht" = browser;
"application/x-extension-xhtml" = browser;
"text/html" = browser;
"text/xml" = browser;
"application/xml" = browser;
"application/xhtml+xml" = browser;
"application/xhtml_xml" = browser;
"application/rdf+xml" = browser;
"application/rss+xml" = browser;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/x-extension-xht" = browser;
"application/x-extension-xhtml" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/unknown" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/unknown" = browser;
"x-scheme-handler/discord" = [ "discord.desktop" ];
"x-scheme-handler/tg" = [ "telegramdesktop.desktop" ];
"x-scheme-handler/discord" = ["discord.desktop"];
"x-scheme-handler/tg" = ["telegramdesktop.desktop"];
"audio/*" = [ "mpv.desktop" ];
"video/*" = [ "mpv.dekstop" ];
"image/*" = [ "imv.desktop" ];
};
"audio/*" = ["mpv.desktop"];
"video/*" = ["mpv.dekstop"];
"image/*" = ["imv.desktop"];
};
associations.removed =
let
browser = [ "google-chrome.desktop" ];
in
{
"text/html" = browser;
"text/xml" = browser;
"application/xml" = browser;
"application/xhtml+xml" = browser;
"application/xhtml_xml" = browser;
"application/rdf+xml" = browser;
"application/rss+xml" = browser;
"image/gif" = browser;
"image/jpeg" = browser;
"image/png" = browser;
"image/webp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"application/pdf" = browser;
};
associations.removed = let
browser = ["google-chrome.desktop"];
in {
"text/html" = browser;
"text/xml" = browser;
"application/xml" = browser;
"application/xhtml+xml" = browser;
"application/xhtml_xml" = browser;
"application/rdf+xml" = browser;
"application/rss+xml" = browser;
"image/gif" = browser;
"image/jpeg" = browser;
"image/png" = browser;
"image/webp" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"application/pdf" = browser;
};
};
userDirs = {
+8 -4
View File
@@ -1,12 +1,16 @@
{ pkgs, config, lib, ... }: {
{
pkgs,
config,
lib,
...
}: {
home.file.".config/fcitx5/profile".source = ./profile;
home.file.".config/fcitx5/profile-bak".source = ./profile; # used for backup
# every time fcitx5 switch input method, it will modify ~/.config/fcitx5/profile file,
# every time fcitx5 switch input method, it will modify ~/.config/fcitx5/profile file,
# which will override my config managed by home-manager
# so we need to remove it before everytime we rebuild the config
home.activation.removeExistingFcitx5Profile = lib.hm.dag.entryBefore [ "checkLinkTargets" ] ''
home.activation.removeExistingFcitx5Profile = lib.hm.dag.entryBefore ["checkLinkTargets"] ''
rm -f "${config.xdg.configHome}/fcitx5/profile"
'';
+1 -4
View File
@@ -1,5 +1,4 @@
{ pkgs, ...}:
{
{pkgs, ...}: {
imports = [
./wayland-apps.nix
];
@@ -22,7 +21,6 @@
home.file.".gtkrc-2.0".source = ./gtkrc-2.0;
home.file.".config/hypr/wallpapers/wallpaper.png".source = ../wallpapers/wallpaper.png;
# music player - mpd
home.file.".config/mpd" = {
source = ./mpd;
@@ -58,5 +56,4 @@
package = pkgs.qogir-theme;
size = 64;
};
}
+2 -7
View File
@@ -1,18 +1,13 @@
{ pkgs
, ...
}:
{
{pkgs, ...}: {
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
programs = {
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
google-chrome = {
enable = true;
commandLineArgs = [
# make it use GTK_IM_MODULE if it runs with Gtk4, so fcitx5 can work with it.
# (only supported by chromium/chrome at this time, not electron)
# (only supported by chromium/chrome at this time, not electron)
"--gtk-version=4"
# make it use text-input-v1, which works for kwin 5.27 and weston
# "--enable-wayland-ime"
+1 -2
View File
@@ -1,5 +1,4 @@
{ pkgs, ...}:
{
{pkgs, ...}: {
# i3 window manager's config, based on https://github.com/endeavouros-team/endeavouros-i3wm-setup
imports = [
+2 -6
View File
@@ -1,15 +1,11 @@
{ pkgs
, ...
}: {
{pkgs, ...}: {
home.packages = with pkgs; [
firefox
xsel # for clipboard support in x11, required by tmux's clipboard support
xsel # for clipboard support in x11, required by tmux's clipboard support
];
# TODO vscode & chrome both have wayland support, but they don't work with fcitx5, need to fix it.
programs = {
# source code: https://github.com/nix-community/home-manager/blob/master/modules/programs/chromium.nix
google-chrome = {
enable = true;
+4 -9
View File
@@ -1,6 +1,4 @@
{ ... }:
{
{ username, ... }: {
imports = [
../base/server
@@ -9,12 +7,9 @@
# Home Manager needs a bit of information about you and the
# paths it should manage.
home = let
name = "ryan";
in
{
username = name;
homeDirectory = "/home/${name}";
home = {
username = username;
homeDirectory = "/home/${username}";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage