mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-15 17:13:21 +02:00
feat: nix fmt
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
{pkgs, ...}: {
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
# general tools
|
||||
pulumi
|
||||
pulumictl
|
||||
@@ -17,9 +15,14 @@
|
||||
|
||||
# aliyun
|
||||
aliyun-cli
|
||||
] ++ (if pkgs.stdenv.isLinux then [
|
||||
]
|
||||
++ (
|
||||
if pkgs.stdenv.isLinux
|
||||
then [
|
||||
# cloud tools that nix do not have cache for.
|
||||
terraform
|
||||
terraformer # generate terraform configs from existing cloud resources
|
||||
] else []);
|
||||
]
|
||||
else []
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ ... }: {
|
||||
{...}: {
|
||||
imports = [
|
||||
./container.nix
|
||||
./kubernetes.nix
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
programs = {
|
||||
k9s = {
|
||||
enable = true;
|
||||
skin =
|
||||
let
|
||||
skin = let
|
||||
skin_file = "${cattppuccin-k9s}/dist/mocha.yml"; # theme - cattppuccin mocha
|
||||
skin_attr = builtins.fromJSON (builtins.readFile
|
||||
skin_attr = builtins.fromJSON (
|
||||
builtins.readFile
|
||||
# replace 'base: &base "#1e1e2e"' with 'base: &base "default"'
|
||||
# to make fg/bg color transparent. "default" means transparent in k9s skin.
|
||||
(pkgs.runCommandNoCC "get-skin-json" {} ''
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
#
|
||||
#############################################################
|
||||
|
||||
home.packages = with pkgs; [
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
(python3.withPackages (
|
||||
ps:
|
||||
with ps; [
|
||||
@@ -53,7 +54,10 @@
|
||||
bfg-repo-cleaner # remove large files from git history
|
||||
k6 # load testing tool
|
||||
protobuf # protocol buffer compiler
|
||||
] ++ (if pkgs.stdenv.isLinux then [
|
||||
]
|
||||
++ (
|
||||
if pkgs.stdenv.isLinux
|
||||
then [
|
||||
# Automatically trims your branches whose tracking remote refs are merged or gone
|
||||
# It's really useful when you work on a project for a long time.
|
||||
git-trim
|
||||
@@ -66,7 +70,9 @@
|
||||
mitmproxy # http/https proxy tool
|
||||
insomnia # REST client
|
||||
wireshark # network analyzer
|
||||
] else []);
|
||||
]
|
||||
else []
|
||||
);
|
||||
|
||||
programs = {
|
||||
direnv = {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{ pkgs, catppuccin-helix, ... }:
|
||||
|
||||
{
|
||||
pkgs,
|
||||
catppuccin-helix,
|
||||
...
|
||||
}: {
|
||||
# https://github.com/catppuccin/helix
|
||||
xdg.configFile."helix/themes".source = "${catppuccin-helix}/themes/default";
|
||||
|
||||
@@ -25,7 +27,7 @@
|
||||
space.space = "file_picker";
|
||||
space.w = ":w";
|
||||
space.q = ":q";
|
||||
esc = [ "collapse_selection" "keep_primary_selection" ];
|
||||
esc = ["collapse_selection" "keep_primary_selection"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ nushell-scripts, ...}: {
|
||||
{nushell-scripts, ...}: {
|
||||
programs.bash = {
|
||||
# load the alias file for work
|
||||
bashrcExtra = ''
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{pkgs, catppuccin-alacritty, ...}:
|
||||
{
|
||||
pkgs,
|
||||
catppuccin-alacritty,
|
||||
...
|
||||
}:
|
||||
###########################################################
|
||||
#
|
||||
# Alacritty Configuration
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
if pkgs.stdenv.isDarwin
|
||||
then "14.0"
|
||||
else "13.0";
|
||||
in
|
||||
''
|
||||
in ''
|
||||
-- Pull in the wezterm API
|
||||
local wezterm = require 'wezterm'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ catppuccin-bat, ...}: {
|
||||
{catppuccin-bat, ...}: {
|
||||
# a cat(1) clone with syntax highlighting and Git integration.
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ catppuccin-btop, ... }:
|
||||
|
||||
{
|
||||
{catppuccin-btop, ...}: {
|
||||
# https://github.com/catppuccin/btop/blob/main/themes/catppuccin_mocha.theme
|
||||
home.file.".config/btop/themes".source = "${catppuccin-btop}/themes";
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
nmap # A utility for network discovery and security auditing
|
||||
ipcalc # it is a calculator for the IPv4/v6 addresses
|
||||
|
||||
|
||||
# Text Processing
|
||||
# Docs: https://github.com/learnbyexample/Command-line-text-processing
|
||||
gnugrep # GNU grep, provides `grep`/`egrep`/`fgrep`
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
|
||||
userfullname,
|
||||
useremail,
|
||||
...
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ config, ...}: {
|
||||
{config, ...}: {
|
||||
programs.nushell = {
|
||||
enable = true;
|
||||
configFile.source = ./config.nu;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ catppuccin-starship, ...}: {
|
||||
{catppuccin-starship, ...}: {
|
||||
programs.starship = {
|
||||
enable = true;
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
enableZshIntegration = true;
|
||||
enableNushellIntegration = true;
|
||||
|
||||
settings = {
|
||||
settings =
|
||||
{
|
||||
character = {
|
||||
success_symbol = "[›](bold green)";
|
||||
error_symbol = "[›](bold red)";
|
||||
@@ -22,6 +23,7 @@
|
||||
};
|
||||
|
||||
palette = "catppuccin_mocha";
|
||||
} // builtins.fromTOML (builtins.readFile "${catppuccin-starship}/palettes/mocha.toml");
|
||||
}
|
||||
// builtins.fromTOML (builtins.readFile "${catppuccin-starship}/palettes/mocha.toml");
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... }: {
|
||||
{username, ...}: {
|
||||
imports = [
|
||||
../base/desktop
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{config, nushell-scripts, ...}: let
|
||||
{
|
||||
config,
|
||||
nushell-scripts,
|
||||
...
|
||||
}: let
|
||||
d = config.xdg.dataHome;
|
||||
c = config.xdg.configHome;
|
||||
cache = config.xdg.cacheHome;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... }: {
|
||||
{username, ...}: {
|
||||
imports = [
|
||||
../base/desktop
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... }: {
|
||||
{username, ...}: {
|
||||
imports = [
|
||||
../base/desktop
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{ pkgs, lib, ... }: {
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
# Adjust the color temperature(& brightness) of your screen according to
|
||||
# your surroundings. This may help your eyes hurt less if you are
|
||||
# working in front of the screen at night.
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
name = "Catppuccin-Macchiato-Compact-Pink-dark";
|
||||
package = pkgs.catppuccin-gtk.override {
|
||||
# https://github.com/NixOS/nixpkgs/blob/nixos-23.05/pkgs/data/themes/catppuccin-gtk/default.nix
|
||||
accents = [ "pink" ];
|
||||
accents = ["pink"];
|
||||
size = "compact";
|
||||
variant = "mocha";
|
||||
};
|
||||
|
||||
@@ -24,9 +24,11 @@
|
||||
];
|
||||
|
||||
# https://github.com/catppuccin/cava
|
||||
home.file.".config/cava/config".text = ''
|
||||
home.file.".config/cava/config".text =
|
||||
''
|
||||
# custom cava config
|
||||
'' + builtins.readFile "${catppuccin-cava}/mocha.cava";
|
||||
''
|
||||
+ builtins.readFile "${catppuccin-cava}/mocha.cava";
|
||||
|
||||
programs = {
|
||||
mpv = {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ wallpapers, ... }:
|
||||
|
||||
{
|
||||
{wallpapers, ...}: {
|
||||
# https://github.com/ryan4yin/wallpapers
|
||||
home.file.".config/wallpapers".source = wallpapers;
|
||||
home.file.".local/bin/wallpaper_random" = {
|
||||
|
||||
@@ -62,8 +62,7 @@
|
||||
"image/webp" = ["imv.desktop"];
|
||||
};
|
||||
|
||||
associations.removed =
|
||||
{
|
||||
associations.removed = {
|
||||
# ......
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{ pkgs, anyrun, ... }:
|
||||
|
||||
{
|
||||
pkgs,
|
||||
anyrun,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
anyrun.homeManagerModules.default
|
||||
];
|
||||
@@ -83,5 +85,4 @@
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ pkgs, ...}: {
|
||||
{pkgs, ...}: {
|
||||
# i3 window manager's config, based on https://github.com/endeavouros-team/endeavouros-i3wm-setup
|
||||
|
||||
imports = [
|
||||
@@ -43,5 +43,4 @@
|
||||
"GBM_BACKEND" = "nvidia-drm";
|
||||
"__GLX_VENDOR_LIBRARY_NAME" = "nvidia";
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... }: {
|
||||
{username, ...}: {
|
||||
imports = [
|
||||
];
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... }: {
|
||||
{username, ...}: {
|
||||
imports = [
|
||||
../base/server
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ username, ... } @ args:
|
||||
{username, ...} @ args:
|
||||
#############################################################
|
||||
#
|
||||
# Harmonica - my MacBook Pro 2020 13-inch, mainly for business.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
|
||||
@@ -18,14 +18,13 @@
|
||||
boot.loader.efi.efiSysMountPoint = "/boot";
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
|
||||
# boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
boot.kernelPackages = pkgs.linuxPackages_xanmod_latest;
|
||||
|
||||
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"];
|
||||
boot.initrd.kernelModules = [];
|
||||
boot.kernelModules = ["kvm-intel"];
|
||||
boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
|
||||
boot.kernelParams = ["nvidia.NVreg_PreserveVideoMemoryAllocations=1"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
# Enable binfmt emulation of aarch64-linux, this is required for cross compilation.
|
||||
@@ -41,7 +40,6 @@
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
|
||||
boot.initrd = {
|
||||
# unlocked luks devices via a keyfile or prompt a passphrase.
|
||||
luks.devices."crypted-nixos" = {
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#
|
||||
# See also https://grahamc.com/blog/erase-your-darlings/
|
||||
|
||||
|
||||
# NOTE: impermanence only mounts the directory/file list below to /persistent
|
||||
# If the directory/file already exists in the root filesystem, you should
|
||||
# move those files/directories to /persistent first!
|
||||
|
||||
+12
-3
@@ -10,7 +10,11 @@
|
||||
}: let
|
||||
username = specialArgs.username;
|
||||
in
|
||||
{ name, nodes, ... }: {
|
||||
{
|
||||
name,
|
||||
nodes,
|
||||
...
|
||||
}: {
|
||||
deployment = {
|
||||
targetHost = name; # hostName or IP address
|
||||
targetUser = targetUser;
|
||||
@@ -25,7 +29,10 @@ in
|
||||
nix.registry.nixpkgs.flake = nixpkgs;
|
||||
nix.channel.enable = false; # disable nix-channel, we use flakes instead.
|
||||
}
|
||||
] ++ (if (home-module != null) then [
|
||||
]
|
||||
++ (
|
||||
if (home-module != null)
|
||||
then [
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
@@ -34,5 +41,7 @@ in
|
||||
home-manager.extraSpecialArgs = specialArgs;
|
||||
home-manager.users."${username}" = home-module;
|
||||
}
|
||||
] else []);
|
||||
]
|
||||
else []
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
{pkgs, config, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
##########################################################################
|
||||
#
|
||||
# Install all apps and packages here.
|
||||
@@ -25,7 +29,7 @@
|
||||
];
|
||||
environment.variables = {
|
||||
# Fix https://github.com/LnL7/nix-darwin/wiki/Terminfo-issues
|
||||
TERMINFO_DIRS = map (path: path + "/share/terminfo") config.environment.profiles ++ [ "/usr/share/terminfo" ];
|
||||
TERMINFO_DIRS = map (path: path + "/share/terminfo") config.environment.profiles ++ ["/usr/share/terminfo"];
|
||||
|
||||
EDITOR = "nvim";
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{ username, ... }:
|
||||
{
|
||||
{username, ...}: {
|
||||
####################################################################
|
||||
#
|
||||
# NixOS's Configuration for Remote Building / Distributed Building
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{ username, ... }:
|
||||
|
||||
{
|
||||
{username, ...}: {
|
||||
# Don't allow mutation of users outside the config.
|
||||
users.mutableUsers = false;
|
||||
|
||||
@@ -9,7 +7,7 @@
|
||||
docker = {};
|
||||
wireshark = {};
|
||||
# for android platform tools's udev rules
|
||||
adbusers ={};
|
||||
adbusers = {};
|
||||
dialout = {};
|
||||
# for openocd (embedded system development)
|
||||
plugdev = {};
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# https://github.com/NixOS/nixpkgs/issues/118655
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = [ username ];
|
||||
users = [username];
|
||||
commands = [
|
||||
{
|
||||
command = "ALL";
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
{pkgs, ...}: {
|
||||
|
||||
# =========================================================================
|
||||
# Base NixOS Configuration
|
||||
# =========================================================================
|
||||
|
||||
@@ -5,8 +5,10 @@ builtins.map
|
||||
|
||||
(builtins.filter # find all overlay files in the current directory
|
||||
|
||||
(f:
|
||||
f != "default.nix" # ignore default.nix
|
||||
(
|
||||
f:
|
||||
f
|
||||
!= "default.nix" # ignore default.nix
|
||||
&& f != "README.md" # ignore README.md
|
||||
)
|
||||
(builtins.attrNames (builtins.readDir ./.)))
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
pkgs,
|
||||
agenix,
|
||||
mysecrets,
|
||||
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
pkgs,
|
||||
agenix,
|
||||
mysecrets,
|
||||
|
||||
username,
|
||||
...
|
||||
}: {
|
||||
|
||||
Reference in New Issue
Block a user