Compare commits

...

2 Commits

14 changed files with 52 additions and 23 deletions

View File

@@ -5,6 +5,7 @@
inherit (nixpkgs) lib;
username = "alex";
useremail = "reizero@live.com";
sourcepath = "/home/${username}/.nix";
libs = import ./libs;
in
rec {
@@ -19,7 +20,7 @@
(profile: {
name = profile;
value = import ./profiles/${profile} {
inherit self inputs outputs libs username useremail;
inherit self inputs outputs libs sourcepath username useremail;
};
})
(attrNames (readDir ./profiles))

View File

@@ -5,7 +5,4 @@ in
{
# 导出mkNixosSystem函数
inherit (mkNixosSystemLib) mkNixosSystem;
# 转换相对路径到绝对路径
absolutePath = path: "${builtins.path { name = "path"; path = path; }}";
}

18
libs/home-libs.nix Normal file
View File

@@ -0,0 +1,18 @@
{ lib, config, sourcepath, ... }: # 声明你可能需要的参数
{
options = {
# 使用一个独特的顶层选项名,如 myLib
home-libs = lib.mkOption {
type = lib.types.attrsOf lib.types.anything;
default = { };
description = "Home manager custom utility functions.";
};
};
config.home-libs = {
# path 参数目前无法通过内置函数的方式获取
# 需要是相对于 flake 的相对路径,直接由目录开始不需要加 `./`。
mkOutOfStoreSymlink = path:
config.home-libs.mkOutOfStoreSymlink "${sourcepath}/${path}";
};
}

View File

@@ -17,7 +17,7 @@ $filemanager = dolphin
################################################
# Main actions
################################################
bind = $mainMod, Q, exec, ~/.config/hypr/scripts/dontkillsteam.sh # killactive, # kill the window on focus
bind = $mainMod, C, exec, ~/.config/hypr/scripts/dontkillsteam.sh # killactive, # kill the window on focus
bind = $mainMod CTRL, delete, exit, # kill hyperland session
bind = $mainMod, F, togglefloating, # toggle the window on focus to float
bind = $mainMod CTRL, L, exec, swaylock # lock screen

View File

@@ -22,6 +22,9 @@ windowrulev2 = center,class:^(.*)$,title:^(Save [Ff]ile)
windowrulev2 = float,class:^(.*)$,title:^(Save [Aa]s)
windowrulev2 = center,class:^(.*)$,title:^(Save [Aa]s)
windowrulev2 = float,class:^(wechat)$,title:^(预览)$
windowrulev2 = center,class:^(wechat)$,title:^(预览)$
windowrulev2 = center,class:^(.*)$,title:^(Location)$
windowrulev2 = center,class:^(Code)$

View File

@@ -66,13 +66,17 @@
"format-window-separator": " ",
"window-rewrite-default": "",
"window-rewrite": {
"fcitx": "󰌌",
"code": "󰨞",
"Cursor": "󰅪",
"jetbrains-idea-ce": "",
"dbeaver": "",
"class<microsoft-edge>": "",
"class<chromium-browser>": "",
"title<.*youtube.*>": "",
"rofi": "󱓞",
"kitty": "",
"code": "󰨞",
"Cursor": "󰅪",
"org.gnome.Nautilus": "󰪶",
"wechat": "",
"wps": "󰈬",
@@ -129,14 +133,14 @@
},
"cpu": {
"interval": 10,
"interval": 5,
"format": "󰍛 {usage}%",
"format-alt": "{icon0}{icon1}{icon2}{icon3}",
"format-icons": ["▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"]
},
"temperature": {
"interval": 10,
"interval": 5,
"hwmon-path": "/sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input",
"format": " {temperatureC}°C"
},
@@ -151,14 +155,14 @@
},
"network": {
"interval": 5,
// "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi": "󰤨 {essid}",
"format-ethernet": "󱘖 Wired",
"tooltip-format": "󱘖 {ipaddr}  {bandwidthUpBytes}  {bandwidthDownBytes}",
"format-linked": "󱘖 {ifname} (No IP)",
"format-disconnected": " Disconnected",
"format-alt": "󰤨 {signalStrength}%",
"interval": 5
"format-alt": "󰤨 {signalStrength}%"
},
"bluetooth": {

View File

@@ -1,7 +1,7 @@
{ config, libs, pkgs, ... }:
let
conf = [ "hypr" "waybar" "rofi" "kitty" "mako" "wlogout" ];
confPath = "${config.home.homeDirectory}/.nix/modules/home/hyprland/conf";
confPath = "modules/home/hyprland/conf";
in
{
imports = [
@@ -52,7 +52,7 @@ in
(name: {
inherit name;
value = {
source = config.lib.file.mkOutOfStoreSymlink "${confPath}/${name}";
source = config.home-libs.mkOutOfStoreSymlink "${confPath}/${name}";
};
})
conf

View File

@@ -24,10 +24,10 @@
xdg.configFile = {
"Code/User/keybindings.json" = {
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.nix/modules/home/vscode/keybindings.json";
source = config.home-libs.mkOutOfStoreSymlink "modules/home/vscode/keybindings.json";
};
"Code/User/settings.json" = {
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.nix/modules/home/vscode/settings.json";
source = config.home-libs.mkOutOfStoreSymlink "modules/home/vscode/settings.json";
};
};
}

View File

@@ -75,8 +75,8 @@
download = config.home.homeDirectory + "/tmp";
videos = config.home.homeDirectory + "/tmp";
pictures = config.home.homeDirectory + "/tmp";
templates = config.home.homeDirectory + "/tmp";
publicShare = config.home.homeDirectory + "/tmp";
# templates = config.home.homeDirectory + "/tmp";
# publicShare = config.home.homeDirectory + "/tmp";
extraConfig = {
XDG_SCREENSHOTS_DIR = config.home.homeDirectory + "/tmp/Screenshots";
};

View File

@@ -17,7 +17,7 @@
history.size = 10000;
history.ignoreAllDups = true;
history.path = "$HOME/.zsh_history";
history.ignorePatterns = [ "rm *" "pkill *" "cp *" ];
# history.ignorePatterns = [ "rm *" "pkill *" "cp *" ];
oh-my-zsh = {
enable = true;

View File

@@ -20,11 +20,12 @@ args@{ self, pkgs, home-manager, username, sysversion, ... }: {
# home-manager.useUserPackages = true;
home-manager = {
extraSpecialArgs = {
inherit (args) self inputs outputs libs hostname username useremail sysversion;
inherit (args) self inputs outputs libs sourcepath hostname username useremail sysversion;
};
users."${username}" = { ... }: {
imports = [
./hm
"${self}/libs/home-libs.nix"
"${self}/home/desktop.nix"
"${self}/modules/home/develop.nix"
];

View File

@@ -1,6 +1,10 @@
{ ... }: {
{ pkgs, ... }: {
imports = [
./ssh
./hyprland.nix
];
home.packages = with pkgs; [
nextcloud-client
];
}

View File

@@ -5,7 +5,8 @@
sessionVariables = {
# for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/
# 启用注释部分会导致NVIDIA下无法启动hyprland
WLR_DRM_DEVICES = "/dev/dri/card1:/dev/dri/card0";
WLR_DRM_DEVICES = "/dev/dri/card1";
AQ_DRM_DEVICES = "/dev/dri/card1";
};
};
}

View File

@@ -1,9 +1,9 @@
{ config, ... }: {
{ config, flakesPath, ... }: {
programs.ssh = {
enable = true;
};
home.file.".ssh/config" = {
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.nix/profiles/apollo/hm/ssh/config";
source = config.home-libs.mkOutOfStoreSymlink "profiles/apollo/hm/ssh/config";
};
}