mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-05-20 21:46:54 +02:00
feat: format via 'ls **/*.nix | each { |it| nixfmt $it.name }'
This commit is contained in:
@@ -2,7 +2,8 @@
|
|||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
services.dbus.apparmor = "enabled";
|
services.dbus.apparmor = "enabled";
|
||||||
security.apparmor = {
|
security.apparmor = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -10,7 +10,8 @@
|
|||||||
appimageTools,
|
appimageTools,
|
||||||
fetchurl,
|
fetchurl,
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
pname = "wechat";
|
pname = "wechat";
|
||||||
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/we/wechat/package.nix
|
# https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/by-name/we/wechat/package.nix
|
||||||
sources = {
|
sources = {
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
nixpak,
|
nixpak,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
callArgs = {
|
callArgs = {
|
||||||
mkNixPak = nixpak.lib.nixpak {
|
mkNixPak = nixpak.lib.nixpak {
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
@@ -14,7 +15,8 @@
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
wrapper = _pkgs: path: (_pkgs.callPackage path callArgs).config.script;
|
wrapper = _pkgs: path: (_pkgs.callPackage path callArgs).config.script;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# Add nixpaked Apps into nixpkgs, and reference them in home-manager or other nixos modules
|
# Add nixpaked Apps into nixpkgs, and reference them in home-manager or other nixos modules
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(_: super: {
|
(_: super: {
|
||||||
|
|||||||
@@ -10,11 +10,13 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
mkNixPak {
|
mkNixPak {
|
||||||
config = {
|
config =
|
||||||
|
{
|
||||||
config,
|
config,
|
||||||
sloth,
|
sloth,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
app = {
|
app = {
|
||||||
package = pkgs.firefox-wayland;
|
package = pkgs.firefox-wayland;
|
||||||
binPath = "bin/firefox";
|
binPath = "bin/firefox";
|
||||||
@@ -61,7 +63,10 @@ mkNixPak {
|
|||||||
];
|
];
|
||||||
bind.ro = [
|
bind.ro = [
|
||||||
"/sys/bus/pci"
|
"/sys/bus/pci"
|
||||||
["${config.app.package}/lib/firefox" "/app/etc/firefox"]
|
[
|
||||||
|
"${config.app.package}/lib/firefox"
|
||||||
|
"/app/etc/firefox"
|
||||||
|
]
|
||||||
|
|
||||||
# ================ for browserpass extension ===============================
|
# ================ for browserpass extension ===============================
|
||||||
"/etc/gnupg"
|
"/etc/gnupg"
|
||||||
|
|||||||
@@ -5,12 +5,14 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
sloth,
|
sloth,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
envSuffix = envKey: suffix: sloth.concat' (sloth.env envKey) suffix;
|
envSuffix = envKey: suffix: sloth.concat' (sloth.env envKey) suffix;
|
||||||
# cursor & icon's theme should be the same as the host's one.
|
# cursor & icon's theme should be the same as the host's one.
|
||||||
cursorTheme = pkgs.bibata-cursors;
|
cursorTheme = pkgs.bibata-cursors;
|
||||||
iconTheme = pkgs.papirus-icon-theme;
|
iconTheme = pkgs.papirus-icon-theme;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
config = {
|
config = {
|
||||||
dbus.policies = {
|
dbus.policies = {
|
||||||
"${config.flatpak.appId}" = "own";
|
"${config.flatpak.appId}" = "own";
|
||||||
@@ -89,15 +91,19 @@ in {
|
|||||||
];
|
];
|
||||||
|
|
||||||
env = {
|
env = {
|
||||||
XDG_DATA_DIRS = lib.mkForce (lib.makeSearchPath "share" [
|
XDG_DATA_DIRS = lib.mkForce (
|
||||||
|
lib.makeSearchPath "share" [
|
||||||
iconTheme
|
iconTheme
|
||||||
cursorTheme
|
cursorTheme
|
||||||
pkgs.shared-mime-info
|
pkgs.shared-mime-info
|
||||||
]);
|
]
|
||||||
XCURSOR_PATH = lib.mkForce (lib.concatStringsSep ":" [
|
);
|
||||||
|
XCURSOR_PATH = lib.mkForce (
|
||||||
|
lib.concatStringsSep ":" [
|
||||||
"${cursorTheme}/share/icons"
|
"${cursorTheme}/share/icons"
|
||||||
"${cursorTheme}/share/pixmaps"
|
"${cursorTheme}/share/pixmaps"
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,7 +10,9 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
mkNixPak {
|
mkNixPak {
|
||||||
config = {sloth, ...}: {
|
config =
|
||||||
|
{ sloth, ... }:
|
||||||
|
{
|
||||||
app = {
|
app = {
|
||||||
package = pkgs.qq.override {
|
package = pkgs.qq.override {
|
||||||
# fix fcitx5 input method
|
# fix fcitx5 input method
|
||||||
@@ -45,7 +47,12 @@ mkNixPak {
|
|||||||
bind.rw = [
|
bind.rw = [
|
||||||
# given the read write permission to the following directories.
|
# given the read write permission to the following directories.
|
||||||
# NOTE: sloth.mkdir is used to create the directory if it does not exist!
|
# NOTE: sloth.mkdir is used to create the directory if it does not exist!
|
||||||
(sloth.mkdir (sloth.concat [sloth.xdgConfigHome "/QQ"]))
|
(sloth.mkdir (
|
||||||
|
sloth.concat [
|
||||||
|
sloth.xdgConfigHome
|
||||||
|
"/QQ"
|
||||||
|
]
|
||||||
|
))
|
||||||
|
|
||||||
sloth.xdgDocumentsDir
|
sloth.xdgDocumentsDir
|
||||||
sloth.xdgDownloadDir
|
sloth.xdgDownloadDir
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{modulesPath, ...}: {
|
{ modulesPath, ... }:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/profiles/hardened.nix")
|
(modulesPath + "/profiles/hardened.nix")
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# Misc
|
# Misc
|
||||||
cowsay
|
cowsay
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
programs.helix = {
|
programs.helix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
programs = {
|
programs = {
|
||||||
neovim = {
|
neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -4,7 +4,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
myvars,
|
myvars,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# `programs.git` will generate the config file: ~/.config/git/config
|
# `programs.git` will generate the config file: ~/.config/git/config
|
||||||
# to make git use this config file, `~/.gitconfig` should not exist!
|
# to make git use this config file, `~/.gitconfig` should not exist!
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{config, ...}: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
# make `npm install -g <pkg>` happey
|
# make `npm install -g <pkg>` happey
|
||||||
#
|
#
|
||||||
# mainly used to install npm packages that updates frequently
|
# mainly used to install npm packages that updates frequently
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{config, ...}: let
|
{ config, ... }:
|
||||||
|
let
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
k = "kubectl";
|
k = "kubectl";
|
||||||
|
|
||||||
@@ -10,7 +11,8 @@
|
|||||||
goBin = "${config.home.homeDirectory}/go/bin";
|
goBin = "${config.home.homeDirectory}/go/bin";
|
||||||
rustBin = "${config.home.homeDirectory}/.cargo/bin";
|
rustBin = "${config.home.homeDirectory}/.cargo/bin";
|
||||||
npmBin = "${config.home.homeDirectory}/.npm/bin";
|
npmBin = "${config.home.homeDirectory}/.npm/bin";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{catppuccin, ...}: {
|
{ catppuccin, ... }:
|
||||||
|
{
|
||||||
# https://github.com/catppuccin/nix
|
# https://github.com/catppuccin/nix
|
||||||
imports = [
|
imports = [
|
||||||
catppuccin.homeModules.catppuccin
|
catppuccin.homeModules.catppuccin
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
# terminal file manager
|
# terminal file manager
|
||||||
programs.yazi = {
|
programs.yazi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ let
|
|||||||
shellAliases = {
|
shellAliases = {
|
||||||
"zj" = "zellij";
|
"zj" = "zellij";
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.zellij = {
|
programs.zellij = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
home.packages = with pkgs;
|
{
|
||||||
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
[
|
[
|
||||||
mitmproxy # http/https proxy tool
|
mitmproxy # http/https proxy tool
|
||||||
wireshark # network analyzer
|
wireshark # network analyzer
|
||||||
|
|||||||
@@ -52,10 +52,7 @@
|
|||||||
bold_italic = {
|
bold_italic = {
|
||||||
family = "Maple Mono NF CN";
|
family = "Maple Mono NF CN";
|
||||||
};
|
};
|
||||||
size =
|
size = if pkgs.stdenv.isDarwin then 14 else 13;
|
||||||
if pkgs.stdenv.isDarwin
|
|
||||||
then 14
|
|
||||||
else 13;
|
|
||||||
};
|
};
|
||||||
terminal = {
|
terminal = {
|
||||||
# Spawn a nushell in login mode via `bash`
|
# Spawn a nushell in login mode via `bash`
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
programs.foot = {
|
programs.foot = {
|
||||||
# foot is designed only for Linux
|
# foot is designed only for Linux
|
||||||
enable = pkgs.stdenv.isLinux;
|
enable = pkgs.stdenv.isLinux;
|
||||||
|
|||||||
@@ -12,9 +12,10 @@
|
|||||||
programs.ghostty = {
|
programs.ghostty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package =
|
package =
|
||||||
if pkgs.stdenv.isDarwin
|
if pkgs.stdenv.isDarwin then
|
||||||
then pkgs.hello # pkgs.ghostty is currently broken on darwin
|
pkgs.hello # pkgs.ghostty is currently broken on darwin
|
||||||
else pkgs.ghostty; # the stable version
|
else
|
||||||
|
pkgs.ghostty; # the stable version
|
||||||
# package = ghostty.packages.${pkgs.system}.default; # the latest version
|
# package = ghostty.packages.${pkgs.system}.default; # the latest version
|
||||||
enableBashIntegration = false;
|
enableBashIntegration = false;
|
||||||
installBatSyntax = false;
|
installBatSyntax = false;
|
||||||
|
|||||||
@@ -19,10 +19,7 @@
|
|||||||
font = {
|
font = {
|
||||||
name = "Maple Mono NF CN";
|
name = "Maple Mono NF CN";
|
||||||
# use different font size on macOS
|
# use different font size on macOS
|
||||||
size =
|
size = if pkgs.stdenv.isDarwin then 14 else 13;
|
||||||
if pkgs.stdenv.isDarwin
|
|
||||||
then 14
|
|
||||||
else 13;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# consistent with other terminal emulators
|
# consistent with other terminal emulators
|
||||||
|
|||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
{myvars, ...}: {
|
{ myvars, ... }:
|
||||||
|
{
|
||||||
# Home Manager needs a bit of information about you and the
|
# Home Manager needs a bit of information about you and the
|
||||||
# paths it should manage.
|
# paths it should manage.
|
||||||
home = {
|
home = {
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
lib,
|
lib,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# https://developer.hashicorp.com/terraform/cli/config/config-file
|
# https://developer.hashicorp.com/terraform/cli/config/config-file
|
||||||
home.file.".terraformrc".source = ./terraformrc;
|
home.file.".terraformrc".source = ./terraformrc;
|
||||||
|
|
||||||
@@ -30,9 +31,12 @@
|
|||||||
# digitalocean
|
# digitalocean
|
||||||
doctl
|
doctl
|
||||||
# google cloud
|
# google cloud
|
||||||
(google-cloud-sdk.withExtraComponents (with google-cloud-sdk.components; [
|
(google-cloud-sdk.withExtraComponents (
|
||||||
|
with google-cloud-sdk.components;
|
||||||
|
[
|
||||||
gke-gcloud-auth-plugin
|
gke-gcloud-auth-plugin
|
||||||
]))
|
]
|
||||||
|
))
|
||||||
|
|
||||||
# cloud tools that nix do not have cache for.
|
# cloud tools that nix do not have cache for.
|
||||||
terraform
|
terraform
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
nur-ryan4yin,
|
nur-ryan4yin,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
podman-compose
|
podman-compose
|
||||||
dive # explore docker layers
|
dive # explore docker layers
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
#############################################################
|
#############################################################
|
||||||
#
|
#
|
||||||
# Basic settings for development environment
|
# Basic settings for development environment
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
programs.helix = {
|
programs.helix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.helix;
|
package = pkgs.helix;
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ let
|
|||||||
# the path to nvim directory
|
# the path to nvim directory
|
||||||
# to make this symlink work, we need to git clone this repo to your home directory.
|
# to make this symlink work, we need to git clone this repo to your home directory.
|
||||||
configPath = "${config.home.homeDirectory}/nix-config/home/base/tui/editors/neovim/nvim";
|
configPath = "${config.home.homeDirectory}/nix-config/home/base/tui/editors/neovim/nvim";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink configPath;
|
xdg.configFile."nvim".source = config.lib.file.mkOutOfStoreSymlink configPath;
|
||||||
# Disable catppuccin to avoid conflict with my non-nix config.
|
# Disable catppuccin to avoid conflict with my non-nix config.
|
||||||
catppuccin.nvim.enable = false;
|
catppuccin.nvim.enable = false;
|
||||||
|
|||||||
@@ -2,8 +2,11 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
home.packages = with pkgs; (
|
{
|
||||||
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
|
(
|
||||||
# -*- Data & Configuration Languages -*-#
|
# -*- Data & Configuration Languages -*-#
|
||||||
[
|
[
|
||||||
#-- nix
|
#-- nix
|
||||||
@@ -64,8 +67,7 @@
|
|||||||
uv # python project package manager
|
uv # python project package manager
|
||||||
pyright # python language server
|
pyright # python language server
|
||||||
(python313.withPackages (
|
(python313.withPackages (
|
||||||
ps:
|
ps: with ps; [
|
||||||
with ps; [
|
|
||||||
ruff
|
ruff
|
||||||
black # python formatter
|
black # python formatter
|
||||||
# debugpy
|
# debugpy
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
age
|
age
|
||||||
sops
|
sops
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
config,
|
config,
|
||||||
mysecrets,
|
mysecrets,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
programs.gpg = {
|
programs.gpg = {
|
||||||
enable = true;
|
enable = true;
|
||||||
homedir = "${config.home.homeDirectory}/.gnupg";
|
homedir = "${config.home.homeDirectory}/.gnupg";
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
passwordStoreDir = "${config.xdg.dataHome}/password-store";
|
passwordStoreDir = "${config.xdg.dataHome}/password-store";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.password-store = {
|
programs.password-store = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.pass.withExtensions (exts: [
|
package = pkgs.pass.withExtensions (exts: [
|
||||||
|
|||||||
@@ -2,9 +2,11 @@
|
|||||||
config,
|
config,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
inherit (pkgs-unstable) nu_scripts;
|
inherit (pkgs-unstable) nu_scripts;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.nushell = {
|
programs.nushell = {
|
||||||
# load the alias file for work
|
# load the alias file for work
|
||||||
# the file must exist, otherwise nushell will complain about it!
|
# the file must exist, otherwise nushell will complain about it!
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
config,
|
config,
|
||||||
mysecrets,
|
mysecrets,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.file.".ssh/romantic.pub".source = "${mysecrets}/public/romantic.pub";
|
home.file.".ssh/romantic.pub".source = "${mysecrets}/public/romantic.pub";
|
||||||
|
|
||||||
programs.ssh = {
|
programs.ssh = {
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
{pkgs, ...}: let
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
"zj" = "zellij";
|
"zj" = "zellij";
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
programs.zellij = {
|
programs.zellij = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.zellij;
|
package = pkgs.zellij;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{config, ...}: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
home.file.".aerospace.toml".source =
|
home.file.".aerospace.toml".source =
|
||||||
config.lib.file.mkOutOfStoreSymlink
|
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/home/darwin/aerospace/aerospace.toml";
|
||||||
"${config.home.homeDirectory}/nix-config/home/darwin/aerospace/aerospace.toml";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,10 @@
|
|||||||
mylib,
|
mylib,
|
||||||
myvars,
|
myvars,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.homeDirectory = "/Users/${myvars.username}";
|
home.homeDirectory = "/Users/${myvars.username}";
|
||||||
imports =
|
imports = (mylib.scanPaths ./.) ++ [
|
||||||
(mylib.scanPaths ./.)
|
|
||||||
++ [
|
|
||||||
../base/core
|
../base/core
|
||||||
../base/tui
|
../base/tui
|
||||||
../base/gui
|
../base/gui
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
clash-meta
|
clash-meta
|
||||||
];
|
];
|
||||||
|
|
||||||
home.file.".proxychains/proxychains.conf".source =
|
home.file.".proxychains/proxychains.conf".source =
|
||||||
config.lib.file.mkOutOfStoreSymlink
|
config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/nix-config/home/darwin/proxy/proxychains.conf";
|
||||||
"${config.home.homeDirectory}/nix-config/home/darwin/proxy/proxychains.conf";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
# Squirrel Input Method
|
# Squirrel Input Method
|
||||||
home.file."Library/Rime" = {
|
home.file."Library/Rime" = {
|
||||||
# my custom squirrel data (flypy input method)
|
# my custom squirrel data (flypy input method)
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{lib, ...}: let
|
{ lib, ... }:
|
||||||
|
let
|
||||||
envExtra = ''
|
envExtra = ''
|
||||||
export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin"
|
export PATH="$PATH:/opt/homebrew/bin:/usr/local/bin"
|
||||||
'';
|
'';
|
||||||
@@ -20,7 +21,8 @@
|
|||||||
true
|
true
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# Homebrew's default install location:
|
# Homebrew's default install location:
|
||||||
# /opt/homebrew for Apple Silicon
|
# /opt/homebrew for Apple Silicon
|
||||||
# /usr/local for macOS Intel
|
# /usr/local for macOS Intel
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,13 @@
|
|||||||
config,
|
config,
|
||||||
myvars,
|
myvars,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
d = config.xdg.dataHome;
|
d = config.xdg.dataHome;
|
||||||
c = config.xdg.configHome;
|
c = config.xdg.configHome;
|
||||||
cache = config.xdg.cacheHome;
|
cache = config.xdg.cacheHome;
|
||||||
in rec {
|
in
|
||||||
|
rec {
|
||||||
home.homeDirectory = "/home/${myvars.username}";
|
home.homeDirectory = "/home/${myvars.username}";
|
||||||
|
|
||||||
# environment variables that always set at login
|
# environment variables that always set at login
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
# Linux Only Packages, not available on Darwin
|
# Linux Only Packages, not available on Darwin
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# misc
|
# misc
|
||||||
|
|||||||
@@ -6,8 +6,10 @@
|
|||||||
nur-ryan4yin,
|
nur-ryan4yin,
|
||||||
blender-bin,
|
blender-bin,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
home.packages = with pkgs;
|
{
|
||||||
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
[
|
[
|
||||||
# creative
|
# creative
|
||||||
# gimp # image editing, I prefer using figma in browser instead of this one
|
# gimp # image editing, I prefer using figma in browser instead of this one
|
||||||
@@ -41,7 +43,8 @@
|
|||||||
# live streaming
|
# live streaming
|
||||||
obs-studio = {
|
obs-studio = {
|
||||||
enable = pkgs.stdenv.isx86_64;
|
enable = pkgs.stdenv.isx86_64;
|
||||||
plugins = with pkgs.obs-studio-plugins;
|
plugins =
|
||||||
|
with pkgs.obs-studio-plugins;
|
||||||
[
|
[
|
||||||
# screen capture
|
# screen capture
|
||||||
wlrobs
|
wlrobs
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
android-tools
|
android-tools
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# Adjust the color temperature(& brightness) of your screen according to
|
# Adjust the color temperature(& brightness) of your screen according to
|
||||||
# your surroundings. This may help your eyes hurt less if you are
|
# your surroundings. This may help your eyes hurt less if you are
|
||||||
# working in front of the screen at night.
|
# working in front of the screen at night.
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
"fcitx5/profile" = {
|
"fcitx5/profile" = {
|
||||||
source = ./profile;
|
source = ./profile;
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
nix-gaming,
|
nix-gaming,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# nix-gaming.packages.${pkgs.system}.osu-laser-bin
|
# nix-gaming.packages.${pkgs.system}.osu-laser-bin
|
||||||
gamescope # SteamOS session compositing window manager
|
gamescope # SteamOS session compositing window manager
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# If your themes for mouse cursor, icons or windows don’t load correctly,
|
# If your themes for mouse cursor, icons or windows don’t load correctly,
|
||||||
# try setting them with home.pointerCursor and gtk.theme,
|
# try setting them with home.pointerCursor and gtk.theme,
|
||||||
# which enable a bunch of compatibility options that should make the themes load in all situations.
|
# which enable a bunch of compatibility options that should make the themes load in all situations.
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
# TODO not used yet, need to test it.
|
# TODO not used yet, need to test it.
|
||||||
#
|
#
|
||||||
##############################################################################################
|
##############################################################################################
|
||||||
with lib; let
|
with lib;
|
||||||
|
let
|
||||||
cfg = config.home.immutable-file;
|
cfg = config.home.immutable-file;
|
||||||
immutableFileOpts = _: {
|
immutableFileOpts = _: {
|
||||||
options = {
|
options = {
|
||||||
@@ -42,24 +43,25 @@ with lib; let
|
|||||||
sudo cp $2 $1
|
sudo cp $2 $1
|
||||||
sudo chattr +i $1
|
sudo chattr +i $1
|
||||||
'';
|
'';
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.home.immutable-file = mkOption {
|
options.home.immutable-file = mkOption {
|
||||||
type = with types; attrsOf (submodule immutableFileOpts);
|
type = with types; attrsOf (submodule immutableFileOpts);
|
||||||
default = { };
|
default = { };
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf (cfg != { }) {
|
config = mkIf (cfg != { }) {
|
||||||
home.activation =
|
home.activation = mapAttrs' (
|
||||||
mapAttrs'
|
name:
|
||||||
(name: {
|
{
|
||||||
src,
|
src,
|
||||||
dst,
|
dst,
|
||||||
}:
|
}:
|
||||||
nameValuePair
|
nameValuePair "make-immutable-${name}" (
|
||||||
"make-immutable-${name}"
|
lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||||
(lib.hm.dag.entryAfter ["writeBoundary"] ''
|
|
||||||
${mkImmutableFile} ${dst} ${src}
|
${mkImmutableFile} ${dst} ${src}
|
||||||
''))
|
''
|
||||||
cfg;
|
)
|
||||||
|
) cfg;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
}:
|
}:
|
||||||
# media - control and enjoy audio/video
|
# media - control and enjoy audio/video
|
||||||
{
|
{
|
||||||
home.packages = with pkgs;
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
[
|
[
|
||||||
# audio control
|
# audio control
|
||||||
pavucontrol
|
pavucontrol
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
pkgs-unstable,
|
pkgs-unstable,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# GUI apps
|
# GUI apps
|
||||||
# e-book viewer(.epub/.mobi/...)
|
# e-book viewer(.epub/.mobi/...)
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
home.packages = with pkgs; (lib.optionals pkgs.stdenv.isx86_64 [
|
{
|
||||||
|
home.packages =
|
||||||
|
with pkgs;
|
||||||
|
(lib.optionals pkgs.stdenv.isx86_64 [
|
||||||
# https://joplinapp.org/help/
|
# https://joplinapp.org/help/
|
||||||
joplin # joplin-cli
|
joplin # joplin-cli
|
||||||
joplin-desktop
|
joplin-desktop
|
||||||
|
|||||||
@@ -4,18 +4,28 @@
|
|||||||
lib,
|
lib,
|
||||||
wallpapers,
|
wallpapers,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
systemd.user.services.wallpaper = {
|
systemd.user.services.wallpaper = {
|
||||||
Unit = {
|
Unit = {
|
||||||
Description = "Wallpaper Switcher daemon";
|
Description = "Wallpaper Switcher daemon";
|
||||||
After = ["graphical-session-pre.target" "xdg-desktop-autostart.target"];
|
After = [
|
||||||
|
"graphical-session-pre.target"
|
||||||
|
"xdg-desktop-autostart.target"
|
||||||
|
];
|
||||||
Wants = [ "graphical-session-pre.target" ];
|
Wants = [ "graphical-session-pre.target" ];
|
||||||
};
|
};
|
||||||
Install.WantedBy = [ "graphical-session.target" ];
|
Install.WantedBy = [ "graphical-session.target" ];
|
||||||
Service = {
|
Service = {
|
||||||
ExecStart = lib.getExe (pkgs.writeShellApplication {
|
ExecStart = lib.getExe (
|
||||||
|
pkgs.writeShellApplication {
|
||||||
name = "wallpaper";
|
name = "wallpaper";
|
||||||
runtimeInputs = with pkgs; [procps feh swaybg python3];
|
runtimeInputs = with pkgs; [
|
||||||
|
procps
|
||||||
|
feh
|
||||||
|
swaybg
|
||||||
|
python3
|
||||||
|
];
|
||||||
text = ''
|
text = ''
|
||||||
export WALLPAPERS_DIR="${wallpapers}"
|
export WALLPAPERS_DIR="${wallpapers}"
|
||||||
export WALLPAPERS_STATE_FILEPATH="${config.xdg.stateHome}/wallpaper-switcher/switcher_state"
|
export WALLPAPERS_STATE_FILEPATH="${config.xdg.stateHome}/wallpaper-switcher/switcher_state"
|
||||||
@@ -23,7 +33,8 @@
|
|||||||
export WALLPAPER_WAIT_MAX=180
|
export WALLPAPER_WAIT_MAX=180
|
||||||
exec ${./wallpaper-switcher.py}
|
exec ${./wallpaper-switcher.py}
|
||||||
'';
|
'';
|
||||||
});
|
}
|
||||||
|
);
|
||||||
RestartSec = 3;
|
RestartSec = 3;
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
|
xdg-utils # provides cli tools such as `xdg-mime` `xdg-open`
|
||||||
xdg-user-dirs
|
xdg-user-dirs
|
||||||
@@ -31,10 +32,20 @@
|
|||||||
mimeApps = {
|
mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# let `xdg-open` to open the url with the correct application.
|
# let `xdg-open` to open the url with the correct application.
|
||||||
defaultApplications = let
|
defaultApplications =
|
||||||
browser = ["google-chrome.desktop" "firefox.desktop"];
|
let
|
||||||
editor = ["nvim.desktop" "Helix.desktop" "code.desktop" "code-insiders.desktop"];
|
browser = [
|
||||||
in {
|
"google-chrome.desktop"
|
||||||
|
"firefox.desktop"
|
||||||
|
];
|
||||||
|
editor = [
|
||||||
|
"nvim.desktop"
|
||||||
|
"Helix.desktop"
|
||||||
|
"code.desktop"
|
||||||
|
"code-insiders.desktop"
|
||||||
|
];
|
||||||
|
in
|
||||||
|
{
|
||||||
"application/json" = browser;
|
"application/json" = browser;
|
||||||
"application/pdf" = browser; # TODO: pdf viewer
|
"application/pdf" = browser; # TODO: pdf viewer
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
zed-editor
|
zed-editor
|
||||||
code-cursor
|
code-cursor
|
||||||
|
|||||||
@@ -5,9 +5,11 @@
|
|||||||
anyrun,
|
anyrun,
|
||||||
...
|
...
|
||||||
}@args:
|
}@args:
|
||||||
with lib; let
|
with lib;
|
||||||
|
let
|
||||||
cfg = config.modules.desktop.hyprland;
|
cfg = config.modules.desktop.hyprland;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
# anyrun.homeManagerModules.default # the module is already in hm now.
|
# anyrun.homeManagerModules.default # the module is already in hm now.
|
||||||
./options
|
./options
|
||||||
@@ -16,7 +18,9 @@ in {
|
|||||||
options.modules.desktop.hyprland = {
|
options.modules.desktop.hyprland = {
|
||||||
enable = mkEnableOption "hyprland compositor";
|
enable = mkEnableOption "hyprland compositor";
|
||||||
settings = lib.mkOption {
|
settings = lib.mkOption {
|
||||||
type = with lib.types; let
|
type =
|
||||||
|
with lib.types;
|
||||||
|
let
|
||||||
valueType =
|
valueType =
|
||||||
nullOr (oneOf [
|
nullOr (oneOf [
|
||||||
bool
|
bool
|
||||||
@@ -37,11 +41,13 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (
|
config = mkIf cfg.enable (
|
||||||
mkMerge ([
|
mkMerge (
|
||||||
|
[
|
||||||
{
|
{
|
||||||
wayland.windowManager.hyprland.settings = cfg.settings;
|
wayland.windowManager.hyprland.settings = cfg.settings;
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
++ (import ./values args))
|
++ (import ./values args)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib;
|
||||||
|
let
|
||||||
cfg = config.modules.desktop.hyprland;
|
cfg = config.modules.desktop.hyprland;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
options.modules.desktop.hyprland = {
|
options.modules.desktop.hyprland = {
|
||||||
nvidia = mkEnableOption "whether nvidia GPU is used";
|
nvidia = mkEnableOption "whether nvidia GPU is used";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
anyrun,
|
anyrun,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
programs.anyrun = {
|
programs.anyrun = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
|
|||||||
@@ -1,4 +1 @@
|
|||||||
{mylib, ...} @ args:
|
{ mylib, ... }@args: map (path: import path args) (mylib.scanPaths ./.)
|
||||||
map
|
|
||||||
(path: import path args)
|
|
||||||
(mylib.scanPaths ./.)
|
|
||||||
|
|||||||
@@ -2,13 +2,17 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
package = pkgs.hyprland;
|
package = pkgs.hyprland;
|
||||||
in {
|
in
|
||||||
xdg.configFile = let
|
{
|
||||||
|
xdg.configFile =
|
||||||
|
let
|
||||||
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
|
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
|
||||||
hyprPath = "${config.home.homeDirectory}/nix-config/home/linux/gui/hyprland/conf";
|
hyprPath = "${config.home.homeDirectory}/nix-config/home/linux/gui/hyprland/conf";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
"mako".source = mkSymlink "${hyprPath}/mako";
|
"mako".source = mkSymlink "${hyprPath}/mako";
|
||||||
"waybar".source = mkSymlink "${hyprPath}/waybar";
|
"waybar".source = mkSymlink "${hyprPath}/waybar";
|
||||||
"wlogout".source = mkSymlink "${hyprPath}/wlogout";
|
"wlogout".source = mkSymlink "${hyprPath}/wlogout";
|
||||||
@@ -46,9 +50,11 @@ in {
|
|||||||
inherit package;
|
inherit package;
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
source = let
|
source =
|
||||||
|
let
|
||||||
configPath = "${config.home.homeDirectory}/.config/hypr/configs";
|
configPath = "${config.home.homeDirectory}/.config/hypr/configs";
|
||||||
in [
|
in
|
||||||
|
[
|
||||||
"${configPath}/exec.conf"
|
"${configPath}/exec.conf"
|
||||||
"${configPath}/fcitx5.conf"
|
"${configPath}/fcitx5.conf"
|
||||||
"${configPath}/keybindings.conf"
|
"${configPath}/keybindings.conf"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
swaybg # the wallpaper
|
swaybg # the wallpaper
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# firefox-wayland
|
# firefox-wayland
|
||||||
nixpaks.firefox
|
nixpaks.firefox
|
||||||
@@ -31,9 +32,7 @@
|
|||||||
|
|
||||||
vscode = {
|
vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package =
|
package = pkgs.vscode.override {
|
||||||
pkgs.vscode.override
|
|
||||||
{
|
|
||||||
isInsiders = false;
|
isInsiders = false;
|
||||||
# https://wiki.archlinux.org/title/Wayland#Electron
|
# https://wiki.archlinux.org/title/Wayland#Electron
|
||||||
commandLineArgs = [
|
commandLineArgs = [
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
xdg.portal = {
|
xdg.portal = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ in
|
|||||||
boot.loader.efi.efiSysMountPoint = "/boot";
|
boot.loader.efi.efiSysMountPoint = "/boot";
|
||||||
|
|
||||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||||
boot.binfmt.emulatedSystems = ["x86_64-linux" "riscv64-linux"];
|
boot.binfmt.emulatedSystems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"riscv64-linux"
|
||||||
|
];
|
||||||
# supported file systems, so we can mount any removable disks with these filesystems
|
# supported file systems, so we can mount any removable disks with these filesystems
|
||||||
boot.supportedFilesystems = lib.mkForce [
|
boot.supportedFilesystems = lib.mkForce [
|
||||||
"ext4"
|
"ext4"
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ _:
|
|||||||
#############################################################
|
#############################################################
|
||||||
let
|
let
|
||||||
hostname = "fern";
|
hostname = "fern";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
networking.computerName = hostname;
|
networking.computerName = hostname;
|
||||||
system.defaults.smb.NetBIOSName = hostname;
|
system.defaults.smb.NetBIOSName = hostname;
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{config, ...}: let
|
{ config, ... }:
|
||||||
|
let
|
||||||
hostName = "fern";
|
hostName = "fern";
|
||||||
in {
|
in
|
||||||
programs.ssh.matchBlocks."github.com".identityFile = "${config.home.homeDirectory}/.ssh/${hostName}";
|
{
|
||||||
|
programs.ssh.matchBlocks."github.com".identityFile =
|
||||||
|
"${config.home.homeDirectory}/.ssh/${hostName}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ _:
|
|||||||
#############################################################
|
#############################################################
|
||||||
let
|
let
|
||||||
hostname = "frieren";
|
hostname = "frieren";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
networking.hostName = hostname;
|
networking.hostName = hostname;
|
||||||
networking.computerName = hostname;
|
networking.computerName = hostname;
|
||||||
system.defaults.smb.NetBIOSName = hostname;
|
system.defaults.smb.NetBIOSName = hostname;
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
{config, ...}: let
|
{ config, ... }:
|
||||||
|
let
|
||||||
hostName = "frieren";
|
hostName = "frieren";
|
||||||
in {
|
in
|
||||||
programs.ssh.matchBlocks."github.com".identityFile = "${config.home.homeDirectory}/.ssh/${hostName}";
|
{
|
||||||
|
programs.ssh.matchBlocks."github.com".identityFile =
|
||||||
|
"${config.home.homeDirectory}/.ssh/${hostName}";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,13 +2,15 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
nixpkgs-ollama,
|
nixpkgs-ollama,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
pkgs-ollama = import nixpkgs-ollama {
|
pkgs-ollama = import nixpkgs-ollama {
|
||||||
inherit (pkgs) system;
|
inherit (pkgs) system;
|
||||||
# To use cuda, we need to allow the installation of non-free software
|
# To use cuda, we need to allow the installation of non-free software
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
services.ollama = rec {
|
services.ollama = rec {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs-ollama.ollama;
|
package = pkgs-ollama.ollama;
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ let
|
|||||||
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4 ipv6;
|
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4 ipv6;
|
||||||
ipv4WithMask = "${ipv4}/24";
|
ipv4WithMask = "${ipv4}/24";
|
||||||
ipv6WithMask = "${ipv6}/64";
|
ipv6WithMask = "${ipv6}/64";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./netdev-mount.nix
|
./netdev-mount.nix
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
@@ -37,7 +38,10 @@ in {
|
|||||||
systemd.network.networks."10-${iface}" = {
|
systemd.network.networks."10-${iface}" = {
|
||||||
matchConfig.Name = [ iface ];
|
matchConfig.Name = [ iface ];
|
||||||
networkConfig = {
|
networkConfig = {
|
||||||
Address = [ipv4WithMask ipv6WithMask];
|
Address = [
|
||||||
|
ipv4WithMask
|
||||||
|
ipv6WithMask
|
||||||
|
];
|
||||||
DNS = nameservers;
|
DNS = nameservers;
|
||||||
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
|
DHCP = "ipv6"; # enable DHCPv6 only, so we can get a GUA.
|
||||||
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
|
IPv6AcceptRA = true; # for Stateless IPv6 Autoconfiguraton (SLAAC)
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
nix-gaming,
|
nix-gaming,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
programs = lib.makeBinPath [
|
programs = lib.makeBinPath [
|
||||||
config.programs.hyprland.package
|
config.programs.hyprland.package
|
||||||
pkgs.coreutils
|
pkgs.coreutils
|
||||||
@@ -25,7 +26,8 @@
|
|||||||
hyprctl --batch 'keyword decoration:blur 1 ; keyword animations:enabled 1 ; keyword misc:vfr 1'
|
hyprctl --batch 'keyword decoration:blur 1 ; keyword animations:enabled 1 ; keyword misc:vfr 1'
|
||||||
powerprofilesctl set power-saver
|
powerprofilesctl set power-saver
|
||||||
'';
|
'';
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# Optimise Linux system performance on demand
|
# Optimise Linux system performance on demand
|
||||||
# https://github.com/FeralInteractive/GameMode
|
# https://github.com/FeralInteractive/GameMode
|
||||||
# https://wiki.archlinux.org/title/Gamemode
|
# https://wiki.archlinux.org/title/Gamemode
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# https://github.com/fufexan/dotfiles/blob/483680e/system/programs/steam.nix
|
# https://github.com/fufexan/dotfiles/blob/483680e/system/programs/steam.nix
|
||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
# https://wiki.archlinux.org/title/steam
|
# https://wiki.archlinux.org/title/steam
|
||||||
# Games installed by Steam works fine on NixOS, no other configuration needed.
|
# Games installed by Steam works fine on NixOS, no other configuration needed.
|
||||||
programs.steam = {
|
programs.steam = {
|
||||||
@@ -15,8 +16,8 @@
|
|||||||
|
|
||||||
# fix gamescope inside steam
|
# fix gamescope inside steam
|
||||||
package = pkgs.steam.override {
|
package = pkgs.steam.override {
|
||||||
extraPkgs = pkgs:
|
extraPkgs =
|
||||||
with pkgs; [
|
pkgs: with pkgs; [
|
||||||
xorg.libXcursor
|
xorg.libXcursor
|
||||||
xorg.libXi
|
xorg.libXi
|
||||||
xorg.libXinerama
|
xorg.libXinerama
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
modulesPath,
|
modulesPath,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
@@ -21,7 +22,14 @@
|
|||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
# boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
|
# boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
boot.initrd.availableKernelModules = [
|
||||||
|
"xhci_pci"
|
||||||
|
"ahci"
|
||||||
|
"nvme"
|
||||||
|
"usbhid"
|
||||||
|
"usb_storage"
|
||||||
|
"sd_mod"
|
||||||
|
];
|
||||||
boot.initrd.kernelModules = [ ];
|
boot.initrd.kernelModules = [ ];
|
||||||
boot.kernelModules = [ "kvm-intel" ]; # kvm virtualization support
|
boot.kernelModules = [ "kvm-intel" ]; # kvm virtualization support
|
||||||
boot.extraModprobeConfig = "options kvm_intel nested=1"; # for intel cpu
|
boot.extraModprobeConfig = "options kvm_intel nested=1"; # for intel cpu
|
||||||
@@ -30,7 +38,10 @@
|
|||||||
boot.tmp.cleanOnBoot = true;
|
boot.tmp.cleanOnBoot = true;
|
||||||
|
|
||||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||||
boot.binfmt.emulatedSystems = ["aarch64-linux" "riscv64-linux"];
|
boot.binfmt.emulatedSystems = [
|
||||||
|
"aarch64-linux"
|
||||||
|
"riscv64-linux"
|
||||||
|
];
|
||||||
# supported file systems, so we can mount any removable disks with these filesystems
|
# supported file systems, so we can mount any removable disks with these filesystems
|
||||||
boot.supportedFilesystems = [
|
boot.supportedFilesystems = [
|
||||||
"ext4"
|
"ext4"
|
||||||
@@ -76,26 +87,40 @@
|
|||||||
fsType = "tmpfs";
|
fsType = "tmpfs";
|
||||||
# set mode to 755, otherwise systemd will set it to 777, which cause problems.
|
# set mode to 755, otherwise systemd will set it to 777, which cause problems.
|
||||||
# relatime: Update inode access times relative to modify or change time.
|
# relatime: Update inode access times relative to modify or change time.
|
||||||
options = ["relatime" "mode=755"];
|
options = [
|
||||||
|
"relatime"
|
||||||
|
"mode=755"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/nix" = {
|
fileSystems."/nix" = {
|
||||||
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@nix" "noatime" "compress-force=zstd:1"];
|
options = [
|
||||||
|
"subvol=@nix"
|
||||||
|
"noatime"
|
||||||
|
"compress-force=zstd:1"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# for guix store, which use `/gnu/store` as its store directory.
|
# for guix store, which use `/gnu/store` as its store directory.
|
||||||
fileSystems."/gnu" = {
|
fileSystems."/gnu" = {
|
||||||
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@guix" "noatime" "compress-force=zstd:1"];
|
options = [
|
||||||
|
"subvol=@guix"
|
||||||
|
"noatime"
|
||||||
|
"compress-force=zstd:1"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/persistent" = {
|
fileSystems."/persistent" = {
|
||||||
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@persistent" "compress-force=zstd:1"];
|
options = [
|
||||||
|
"subvol=@persistent"
|
||||||
|
"compress-force=zstd:1"
|
||||||
|
];
|
||||||
# preservation's data is required for booting.
|
# preservation's data is required for booting.
|
||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
};
|
};
|
||||||
@@ -103,20 +128,29 @@
|
|||||||
fileSystems."/snapshots" = {
|
fileSystems."/snapshots" = {
|
||||||
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@snapshots" "compress-force=zstd:1"];
|
options = [
|
||||||
|
"subvol=@snapshots"
|
||||||
|
"compress-force=zstd:1"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/tmp" = {
|
fileSystems."/tmp" = {
|
||||||
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@tmp" "compress-force=zstd:1"];
|
options = [
|
||||||
|
"subvol=@tmp"
|
||||||
|
"compress-force=zstd:1"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# mount swap subvolume in readonly mode.
|
# mount swap subvolume in readonly mode.
|
||||||
fileSystems."/swap" = {
|
fileSystems."/swap" = {
|
||||||
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
device = "/dev/disk/by-uuid/1167076c-dee1-486c-83c1-4b1af37555cd";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = ["subvol=@swap" "ro"];
|
options = [
|
||||||
|
"subvol=@swap"
|
||||||
|
"ro"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# remount swapfile in read-write mode
|
# remount swapfile in read-write mode
|
||||||
@@ -126,7 +160,10 @@
|
|||||||
|
|
||||||
device = "/swap/swapfile";
|
device = "/swap/swapfile";
|
||||||
fsType = "none";
|
fsType = "none";
|
||||||
options = ["bind" "rw"];
|
options = [
|
||||||
|
"bind"
|
||||||
|
"rw"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" = {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{config, ...}: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
modules.desktop = {
|
modules.desktop = {
|
||||||
hyprland = {
|
hyprland = {
|
||||||
nvidia = true;
|
nvidia = true;
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
config,
|
config,
|
||||||
myvars,
|
myvars,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# supported file systems, so we can mount any removable disks with these filesystems
|
# supported file systems, so we can mount any removable disks with these filesystems
|
||||||
boot.supportedFilesystems = [
|
boot.supportedFilesystems = [
|
||||||
# "cifs"
|
# "cifs"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{config, ...}: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
# ===============================================================================================
|
# ===============================================================================================
|
||||||
# for Nvidia GPU
|
# for Nvidia GPU
|
||||||
# https://wiki.nixos.org/wiki/NVIDIA
|
# https://wiki.nixos.org/wiki/NVIDIA
|
||||||
|
|||||||
@@ -3,9 +3,11 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
myvars,
|
myvars,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
inherit (myvars) username;
|
inherit (myvars) username;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
preservation.nixosModules.default
|
preservation.nixosModules.default
|
||||||
];
|
];
|
||||||
@@ -330,13 +332,15 @@ in {
|
|||||||
# Note that immediate parent directories of persisted files can also be
|
# Note that immediate parent directories of persisted files can also be
|
||||||
# configured with ownership and permissions from the `parent` settings if
|
# configured with ownership and permissions from the `parent` settings if
|
||||||
# `configureParent = true` is set for the file.
|
# `configureParent = true` is set for the file.
|
||||||
systemd.tmpfiles.settings.preservation = let
|
systemd.tmpfiles.settings.preservation =
|
||||||
|
let
|
||||||
permission = {
|
permission = {
|
||||||
user = username;
|
user = username;
|
||||||
group = "users";
|
group = "users";
|
||||||
mode = "0755";
|
mode = "0755";
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
"/home/${username}/.config".d = permission;
|
"/home/${username}/.config".d = permission;
|
||||||
"/home/${username}/.cache".d = permission;
|
"/home/${username}/.cache".d = permission;
|
||||||
"/home/${username}/.local".d = permission;
|
"/home/${username}/.local".d = permission;
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
lib,
|
lib,
|
||||||
lanzaboote,
|
lanzaboote,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# How to enter setup mode - msi motherboard
|
# How to enter setup mode - msi motherboard
|
||||||
## 1. enter BIOS via [Del] Key
|
## 1. enter BIOS via [Del] Key
|
||||||
## 2. <Advance mode> => <Settings> => <Security> => <Secure Boot>
|
## 2. <Advance mode> => <Settings> => <Security> => <Secure Boot>
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
config,
|
config,
|
||||||
wallpapers,
|
wallpapers,
|
||||||
...
|
...
|
||||||
}: let
|
}:
|
||||||
|
let
|
||||||
hostCommonConfig = ''
|
hostCommonConfig = ''
|
||||||
encode zstd gzip
|
encode zstd gzip
|
||||||
tls ${../../certs/ecc-server.crt} ${config.age.secrets."caddy-ecc-server.key".path} {
|
tls ${../../certs/ecc-server.crt} ${config.age.secrets."caddy-ecc-server.key".path} {
|
||||||
@@ -11,7 +12,8 @@
|
|||||||
curves x25519 secp384r1 secp521r1
|
curves x25519 secp384r1 secp521r1
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
services.caddy = {
|
services.caddy = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# Reload Caddy instead of restarting it when configuration file changes.
|
# Reload Caddy instead of restarting it when configuration file changes.
|
||||||
@@ -124,7 +126,10 @@ in {
|
|||||||
# reverse_proxy http://localhost:9090
|
# reverse_proxy http://localhost:9090
|
||||||
# '';
|
# '';
|
||||||
};
|
};
|
||||||
networking.firewall.allowedTCPPorts = [80 443];
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
80
|
||||||
|
443
|
||||||
|
];
|
||||||
|
|
||||||
# Create Directories
|
# Create Directories
|
||||||
# https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html#Type
|
# https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html#Type
|
||||||
|
|||||||
@@ -17,10 +17,9 @@ let
|
|||||||
inherit (myvars.networking) defaultGateway defaultGateway6 nameservers;
|
inherit (myvars.networking) defaultGateway defaultGateway6 nameservers;
|
||||||
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4;
|
inherit (myvars.networking.hostsAddr.${hostName}) iface ipv4;
|
||||||
ipv4WithMask = "${ipv4}/24";
|
ipv4WithMask = "${ipv4}/24";
|
||||||
in {
|
in
|
||||||
imports =
|
{
|
||||||
(mylib.scanPaths ./.)
|
imports = (mylib.scanPaths ./.) ++ [
|
||||||
++ [
|
|
||||||
disko.nixosModules.default
|
disko.nixosModules.default
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
let
|
let
|
||||||
cryptKeyFile = "/etc/agenix/hdd-luks-crypt-key";
|
cryptKeyFile = "/etc/agenix/hdd-luks-crypt-key";
|
||||||
unlockDisk = "data-encrypted";
|
unlockDisk = "data-encrypted";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
fileSystems."/data/fileshare/public".depends = [ "/data/fileshare" ];
|
fileSystems."/data/fileshare/public".depends = [ "/data/fileshare" ];
|
||||||
|
|
||||||
# By adding this crypttab entry, the disk will be unlocked by systemd-cryptsetup@xxx.service at boot time.
|
# By adding this crypttab entry, the disk will be unlocked by systemd-cryptsetup@xxx.service at boot time.
|
||||||
@@ -71,15 +72,27 @@ in {
|
|||||||
};
|
};
|
||||||
"@fileshare" = {
|
"@fileshare" = {
|
||||||
mountpoint = "/data/fileshare";
|
mountpoint = "/data/fileshare";
|
||||||
mountOptions = ["compress-force=zstd:1" "noatime" "nofail"];
|
mountOptions = [
|
||||||
|
"compress-force=zstd:1"
|
||||||
|
"noatime"
|
||||||
|
"nofail"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
"@backups" = {
|
"@backups" = {
|
||||||
mountpoint = "/data/backups";
|
mountpoint = "/data/backups";
|
||||||
mountOptions = ["compress-force=zstd:1" "noatime" "nofail"];
|
mountOptions = [
|
||||||
|
"compress-force=zstd:1"
|
||||||
|
"noatime"
|
||||||
|
"nofail"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
"@snapshots" = {
|
"@snapshots" = {
|
||||||
mountpoint = "/data/apps-snapshots";
|
mountpoint = "/data/apps-snapshots";
|
||||||
mountOptions = ["compress-force=zstd:1" "noatime" "nofail"];
|
mountOptions = [
|
||||||
|
"compress-force=zstd:1"
|
||||||
|
"noatime"
|
||||||
|
"nofail"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -101,7 +114,10 @@ in {
|
|||||||
subvolumes = {
|
subvolumes = {
|
||||||
"@persistent" = {
|
"@persistent" = {
|
||||||
mountpoint = "/data/fileshare/public";
|
mountpoint = "/data/fileshare/public";
|
||||||
mountOptions = ["compress-force=zstd:1" "nofail"];
|
mountOptions = [
|
||||||
|
"compress-force=zstd:1"
|
||||||
|
"nofail"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
# https://github.com/NixOS/nixpkgs/blob/nixos-25.05/nixos/modules/services/misc/gitea.nix
|
# https://github.com/NixOS/nixpkgs/blob/nixos-25.05/nixos/modules/services/misc/gitea.nix
|
||||||
services.gitea = {
|
services.gitea = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
config,
|
config,
|
||||||
myvars,
|
myvars,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
services.grafana = {
|
services.grafana = {
|
||||||
enable = true;
|
enable = true;
|
||||||
dataDir = "/data/apps/grafana";
|
dataDir = "/data/apps/grafana";
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
{config, ...}: let
|
{ config, ... }:
|
||||||
|
let
|
||||||
dataDir = [ "/data/apps/minio/data" ];
|
dataDir = [ "/data/apps/minio/data" ];
|
||||||
configDir = "/data/apps/minio/config";
|
configDir = "/data/apps/minio/config";
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# https://github.com/NixOS/nixpkgs/blob/nixos-25.05/nixos/modules/services/web-servers/minio.nix
|
# https://github.com/NixOS/nixpkgs/blob/nixos-25.05/nixos/modules/services/web-servers/minio.nix
|
||||||
services.minio = {
|
services.minio = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{config, ...}: {
|
{ config, ... }:
|
||||||
|
{
|
||||||
services.prometheus.alertmanager = {
|
services.prometheus.alertmanager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listenAddress = "127.0.0.1";
|
listenAddress = "127.0.0.1";
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{mylib, ...}: {
|
{ mylib, ... }:
|
||||||
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./victoriametrics.nix
|
./victoriametrics.nix
|
||||||
./alertmanager.nix
|
./alertmanager.nix
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
lib,
|
lib,
|
||||||
myvars,
|
myvars,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
# Since victoriametrics use DynamicUser, the user & group do not exists before the service starts.
|
# Since victoriametrics use DynamicUser, the user & group do not exists before the service starts.
|
||||||
# this group is used as a supplementary Unix group for the service to access our data dir(/data/apps/xxx)
|
# this group is used as a supplementary Unix group for the service to access our data dir(/data/apps/xxx)
|
||||||
users.groups.victoriametrics-data = { };
|
users.groups.victoriametrics-data = { };
|
||||||
@@ -36,8 +37,7 @@
|
|||||||
# specifies a set of targets and parameters describing how to scrape metrics from them.
|
# specifies a set of targets and parameters describing how to scrape metrics from them.
|
||||||
# https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config
|
# https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config
|
||||||
prometheusConfig = {
|
prometheusConfig = {
|
||||||
scrape_configs =
|
scrape_configs = [
|
||||||
[
|
|
||||||
# --- Homelab Applications --- #
|
# --- Homelab Applications --- #
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -95,9 +95,8 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
# --- Hosts --- #
|
# --- Hosts --- #
|
||||||
++ (
|
++ (lib.attrsets.foldlAttrs (
|
||||||
lib.attrsets.foldlAttrs
|
acc: hostname: addr:
|
||||||
(acc: hostname: addr:
|
|
||||||
acc
|
acc
|
||||||
++ [
|
++ [
|
||||||
{
|
{
|
||||||
@@ -113,10 +112,8 @@
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
])
|
]
|
||||||
[]
|
) [ ] myvars.networking.hostsAddr);
|
||||||
myvars.networking.hostsAddr
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
lib,
|
lib,
|
||||||
mylib,
|
mylib,
|
||||||
...
|
...
|
||||||
}: {
|
}:
|
||||||
|
{
|
||||||
imports = mylib.scanPaths ./.;
|
imports = mylib.scanPaths ./.;
|
||||||
|
|
||||||
virtualisation = {
|
virtualisation = {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user