mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-16 17:41:09 +02:00
feat: add comments, format all nix files
This commit is contained in:
@@ -31,6 +31,9 @@ darwin-debug: darwin-set-proxy
|
||||
--extra-experimental-features 'nix-command flakes'
|
||||
./result/sw/bin/darwin-rebuild switch --flake . --show-trace --verbose
|
||||
|
||||
fmt:
|
||||
# format the nix files in this repo
|
||||
nix fmt
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
|
||||
@@ -85,12 +85,12 @@
|
||||
# parameters in `outputs` are defined in `inputs` and can be referenced by their names.
|
||||
# However, `self` is an exception, This special parameter points to the `outputs` itself (self-reference)
|
||||
# The `@` syntax here is used to alias the attribute set of the inputs's parameter, making it convenient to use inside the function.
|
||||
outputs = inputs@{
|
||||
self,
|
||||
nixpkgs,
|
||||
darwin,
|
||||
home-manager,
|
||||
...
|
||||
outputs =
|
||||
inputs@{ self
|
||||
, nixpkgs
|
||||
, darwin
|
||||
, home-manager
|
||||
, ...
|
||||
}: {
|
||||
nixosConfigurations = {
|
||||
# By default, NixOS will try to refer the nixosConfiguration with its hostname.
|
||||
@@ -183,6 +183,11 @@
|
||||
];
|
||||
};
|
||||
|
||||
formatter = {
|
||||
x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixpkgs-fmt;
|
||||
x86_64-darwin = nixpkgs.legacyPackages.x86_64-darwin.nixpkgs-fmt;
|
||||
};
|
||||
|
||||
# generate qcow2 & iso image from nixos configuration
|
||||
# https://github.com/nix-community/nixos-generators
|
||||
# packages.x86_64-linux = {
|
||||
|
||||
+4
-5
@@ -1,8 +1,7 @@
|
||||
{
|
||||
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!
|
||||
|
||||
+3
-4
@@ -1,7 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
{ pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
# processing audio/video
|
||||
{
|
||||
|
||||
@@ -4,7 +4,8 @@ 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 ~
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
{ pkgs
|
||||
, ...
|
||||
}: {
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
{ pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
{ pkgs
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
# media - control and enjoy audio/video
|
||||
{
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
{ pkgs
|
||||
, config
|
||||
, lib
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
./wayland-apps.nix
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
pkgs-stable,
|
||||
...
|
||||
{ pkgs
|
||||
, pkgs-stable
|
||||
, ...
|
||||
}:
|
||||
|
||||
{
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
{ pkgs
|
||||
, config
|
||||
, lib
|
||||
, ...
|
||||
}: {
|
||||
# i3 配置,基于 https://github.com/endeavouros-team/endeavouros-i3wm-setup
|
||||
# 直接从当前文件夹中读取配置文件作为配置内容
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
{ pkgs
|
||||
, ...
|
||||
}: {
|
||||
home.packages = with pkgs; [
|
||||
firefox
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
"xfs"
|
||||
#"zfs"
|
||||
"ntfs"
|
||||
"fat" "vfat" "exfat"
|
||||
"fat"
|
||||
"vfat"
|
||||
"exfat"
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
[
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||
@@ -14,19 +15,20 @@
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/231466f6-cdf3-40e1-b9d2-6b4e8d10a4d3";
|
||||
{
|
||||
device = "/dev/disk/by-uuid/231466f6-cdf3-40e1-b9d2-6b4e8d10a4d3";
|
||||
fsType = "btrfs";
|
||||
options = [ "subvol=@" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot/efi" =
|
||||
{ device = "/dev/disk/by-uuid/87ED-8B2E";
|
||||
{
|
||||
device = "/dev/disk/by-uuid/87ED-8B2E";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/17391ca0-8cdb-4598-a40b-fd9548fd9b37"; }
|
||||
];
|
||||
[{ device = "/dev/disk/by-uuid/17391ca0-8cdb-4598-a40b-fd9548fd9b37"; }];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
|
||||
@@ -33,7 +33,9 @@
|
||||
"xfs"
|
||||
#"zfs"
|
||||
"ntfs"
|
||||
"fat" "vfat" "exfat"
|
||||
"fat"
|
||||
"vfat"
|
||||
"exfat"
|
||||
"cifs" # mount windows share
|
||||
];
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
||||
[
|
||||
(modulesPath + "/profiles/qemu-guest.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
|
||||
@@ -14,7 +15,8 @@
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/b779eb19-e43d-4f07-a91f-eb08bd8e1202";
|
||||
{
|
||||
device = "/dev/disk/by-uuid/b779eb19-e43d-4f07-a91f-eb08bd8e1202";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
|
||||
@@ -50,11 +50,13 @@
|
||||
font-awesome
|
||||
|
||||
# nerdfonts
|
||||
(nerdfonts.override { fonts = [
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
"FiraCode"
|
||||
"JetBrainsMono"
|
||||
"Iosevka"
|
||||
];})
|
||||
];
|
||||
})
|
||||
|
||||
];
|
||||
};
|
||||
|
||||
@@ -69,11 +69,13 @@
|
||||
source-han-serif # 思源宋体
|
||||
|
||||
# nerdfonts
|
||||
(nerdfonts.override { fonts = [
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
"FiraCode"
|
||||
"JetBrainsMono"
|
||||
"Iosevka"
|
||||
];})
|
||||
];
|
||||
})
|
||||
|
||||
(pkgs.callPackage ../../fonts/icomoon-feather-icon-font.nix { })
|
||||
|
||||
@@ -143,14 +145,16 @@
|
||||
}))
|
||||
|
||||
# create a fhs environment by command `fhs`, so we can run non-nixos packages in nixos!
|
||||
(let base = pkgs.appimageTools.defaultFhsEnvArgs; in
|
||||
(
|
||||
let base = pkgs.appimageTools.defaultFhsEnvArgs; in
|
||||
pkgs.buildFHSUserEnv (base // {
|
||||
name = "fhs";
|
||||
targetPkgs = pkgs: (base.targetPkgs pkgs) ++ [ pkgs.pkg-config ];
|
||||
profile = "export FHS=1";
|
||||
runScript = "bash";
|
||||
extraOutputsToInstall = [ "dev" ];
|
||||
}))
|
||||
})
|
||||
)
|
||||
];
|
||||
|
||||
# replace default editor with neovim
|
||||
|
||||
@@ -55,11 +55,13 @@
|
||||
source-han-sans # 思源黑体
|
||||
|
||||
# nerdfonts
|
||||
(nerdfonts.override { fonts = [
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
"FiraCode"
|
||||
"JetBrainsMono"
|
||||
"Iosevka"
|
||||
];})
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
# user defined fonts
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
|
||||
{
|
||||
system.fsPackages = [ pkgs.bindfs ];
|
||||
fileSystems = let
|
||||
fileSystems =
|
||||
let
|
||||
mkRoSymBind = path: {
|
||||
device = path;
|
||||
fsType = "fuse.bindfs";
|
||||
@@ -18,7 +19,8 @@
|
||||
paths = config.fonts.fonts;
|
||||
pathsToLink = [ "/share/fonts" ];
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
# Create an FHS mount to support flatpak host icons/fonts
|
||||
"/usr/share/icons" = mkRoSymBind (config.system.path + "/share/icons");
|
||||
"/usr/share/fonts" = mkRoSymBind (aggregatedFonts + "/share/fonts");
|
||||
|
||||
Reference in New Issue
Block a user