mirror of
https://github.com/ryan4yin/nix-config.git
synced 2026-07-15 09:02:40 +02:00
feat: nix fmt
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
result
|
result
|
||||||
result/
|
result/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.pre-commit-config.yaml
|
||||||
|
|||||||
Generated
+125
@@ -274,6 +274,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-compat_2": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1673956053,
|
||||||
|
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"flake-parts": {
|
"flake-parts": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs-lib": [
|
"nixpkgs-lib": [
|
||||||
@@ -334,6 +350,24 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-utils_2": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_3"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1685518550,
|
||||||
|
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gitignore": {
|
"gitignore": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -356,6 +390,27 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"gitignore_2": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"pre-commit-hooks",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1660459072,
|
||||||
|
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "hercules-ci",
|
||||||
|
"repo": "gitignore.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -664,6 +719,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs-stable_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1685801374,
|
||||||
|
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-23.05",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1702312524,
|
"lastModified": 1702312524,
|
||||||
@@ -760,6 +831,22 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs_7": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1689261696,
|
||||||
|
"narHash": "sha256-LzfUtFs9MQRvIoQ3MfgSuipBVMXslMPH/vZ+nM40LkA=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "df1eee2aa65052a18121ed4971081576b25d6b5c",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nur-ryan4yin": {
|
"nur-ryan4yin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_6"
|
"nixpkgs": "nixpkgs_6"
|
||||||
@@ -795,6 +882,28 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pre-commit-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat_2",
|
||||||
|
"flake-utils": "flake-utils_2",
|
||||||
|
"gitignore": "gitignore_2",
|
||||||
|
"nixpkgs": "nixpkgs_7",
|
||||||
|
"nixpkgs-stable": "nixpkgs-stable_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1702456155,
|
||||||
|
"narHash": "sha256-I2XhXGAecdGlqi6hPWYT83AQtMgL+aa3ulA85RAEgOk=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"rev": "007a45d064c1c32d04e1b8a0de5ef00984c419bc",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "pre-commit-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"pre-commit-hooks-nix": {
|
"pre-commit-hooks-nix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": [
|
"flake-compat": [
|
||||||
@@ -854,6 +963,7 @@
|
|||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
"nur-ryan4yin": "nur-ryan4yin",
|
"nur-ryan4yin": "nur-ryan4yin",
|
||||||
"nushell-scripts": "nushell-scripts",
|
"nushell-scripts": "nushell-scripts",
|
||||||
|
"pre-commit-hooks": "pre-commit-hooks",
|
||||||
"wallpapers": "wallpapers"
|
"wallpapers": "wallpapers"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -912,6 +1022,21 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"thead-kernel": {
|
"thead-kernel": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|||||||
@@ -13,17 +13,19 @@
|
|||||||
# parameters in `outputs` are defined in `inputs` and can be referenced by their names.
|
# 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)
|
# 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.
|
# 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 @ {
|
outputs =
|
||||||
self,
|
inputs @ { self
|
||||||
nixpkgs,
|
, nixpkgs
|
||||||
nixpkgs-unstable,
|
, nixpkgs-unstable
|
||||||
nix-darwin,
|
, pre-commit-hooks
|
||||||
home-manager,
|
, nix-darwin
|
||||||
nixos-generators,
|
, home-manager
|
||||||
nixos-licheepi4a,
|
, nixos-generators
|
||||||
nixos-rk3588,
|
, nixos-licheepi4a
|
||||||
...
|
, nixos-rk3588
|
||||||
}: let
|
, ...
|
||||||
|
}:
|
||||||
|
let
|
||||||
username = "ryan";
|
username = "ryan";
|
||||||
userfullname = "Ryan Yin";
|
userfullname = "Ryan Yin";
|
||||||
useremail = "xiaoyin_c@qq.com";
|
useremail = "xiaoyin_c@qq.com";
|
||||||
@@ -119,15 +121,18 @@
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
// inputs;
|
// inputs;
|
||||||
in {
|
in
|
||||||
nixosConfigurations = let
|
{
|
||||||
|
nixosConfigurations =
|
||||||
|
let
|
||||||
base_args = {
|
base_args = {
|
||||||
inherit home-manager nixos-generators;
|
inherit home-manager nixos-generators;
|
||||||
nixpkgs = nixpkgs; # or nixpkgs-unstable
|
nixpkgs = nixpkgs; # or nixpkgs-unstable
|
||||||
system = x64_system;
|
system = x64_system;
|
||||||
specialArgs = x64_specialArgs;
|
specialArgs = x64_specialArgs;
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
# ai with i3 window manager
|
# ai with i3 window manager
|
||||||
ai_i3 = nixosSystem (idol_ai_modules_i3 // base_args);
|
ai_i3 = nixosSystem (idol_ai_modules_i3 // base_args);
|
||||||
# ai with hyprland compositor
|
# ai with hyprland compositor
|
||||||
@@ -140,7 +145,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# colmena - remote deployment via SSH
|
# colmena - remote deployment via SSH
|
||||||
colmena = let
|
colmena =
|
||||||
|
let
|
||||||
# x86_64 related
|
# x86_64 related
|
||||||
x64_base_args = {
|
x64_base_args = {
|
||||||
inherit home-manager;
|
inherit home-manager;
|
||||||
@@ -178,7 +184,8 @@
|
|||||||
specialArgs = rk3588_specialArgs;
|
specialArgs = rk3588_specialArgs;
|
||||||
targetUser = "root";
|
targetUser = "root";
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
meta = {
|
meta = {
|
||||||
nixpkgs = import nixpkgs { system = x64_system; };
|
nixpkgs = import nixpkgs { system = x64_system; };
|
||||||
specialArgs = x64_specialArgs;
|
specialArgs = x64_specialArgs;
|
||||||
@@ -220,7 +227,8 @@
|
|||||||
nixpkgs.lib.genAttrs [
|
nixpkgs.lib.genAttrs [
|
||||||
"ai_i3"
|
"ai_i3"
|
||||||
"ai_hyprland"
|
"ai_hyprland"
|
||||||
] (
|
]
|
||||||
|
(
|
||||||
# generate iso image for hosts with desktop environment
|
# generate iso image for hosts with desktop environment
|
||||||
host:
|
host:
|
||||||
self.nixosConfigurations.${host}.config.formats.iso
|
self.nixosConfigurations.${host}.config.formats.iso
|
||||||
@@ -229,14 +237,16 @@
|
|||||||
"aquamarine"
|
"aquamarine"
|
||||||
"ruby"
|
"ruby"
|
||||||
"kana"
|
"kana"
|
||||||
] (
|
]
|
||||||
|
(
|
||||||
# generate proxmox image for virtual machines without desktop environment
|
# generate proxmox image for virtual machines without desktop environment
|
||||||
host:
|
host:
|
||||||
self.nixosConfigurations.${host}.config.formats.proxmox
|
self.nixosConfigurations.${host}.config.formats.proxmox
|
||||||
);
|
);
|
||||||
|
|
||||||
# macOS's configuration, for work.
|
# macOS's configuration, for work.
|
||||||
darwinConfigurations = let
|
darwinConfigurations =
|
||||||
|
let
|
||||||
system = x64_darwin;
|
system = x64_darwin;
|
||||||
specialArgs =
|
specialArgs =
|
||||||
{
|
{
|
||||||
@@ -252,7 +262,8 @@
|
|||||||
base_args = {
|
base_args = {
|
||||||
inherit nix-darwin home-manager system specialArgs nixpkgs;
|
inherit nix-darwin home-manager system specialArgs nixpkgs;
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
harmonica = macosSystem (base_args
|
harmonica = macosSystem (base_args
|
||||||
// {
|
// {
|
||||||
darwin-modules = [
|
darwin-modules = [
|
||||||
@@ -268,6 +279,25 @@
|
|||||||
system:
|
system:
|
||||||
nixpkgs.legacyPackages.${system}.alejandra
|
nixpkgs.legacyPackages.${system}.alejandra
|
||||||
);
|
);
|
||||||
|
|
||||||
|
# pre-commit hooks for nix code
|
||||||
|
checks = nixpkgs.lib.genAttrs allSystems (
|
||||||
|
system: {
|
||||||
|
pre-commit-check = pre-commit-hooks.lib.${system}.run {
|
||||||
|
src = ./.;
|
||||||
|
hooks = {
|
||||||
|
alejandra.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
devShells = nixpkgs.lib.genAttrs allSystems (
|
||||||
|
system: {
|
||||||
|
default = nixpkgs.legacyPackages.${system}.mkShell {
|
||||||
|
inherit (self.checks.${system}.pre-commit-check) shellHook;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
# This is the standard format for flake.nix. `inputs` are the dependencies of the flake,
|
# This is the standard format for flake.nix. `inputs` are the dependencies of the flake,
|
||||||
@@ -281,6 +311,9 @@
|
|||||||
# nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
# nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
|
# add git hooks to format nix code before commit
|
||||||
|
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
||||||
|
|
||||||
# for macos
|
# for macos
|
||||||
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.11-darwin";
|
nixpkgs-darwin.url = "github:nixos/nixpkgs/nixpkgs-23.11-darwin";
|
||||||
nix-darwin = {
|
nix-darwin = {
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
./base/i18n.nix
|
./base/i18n.nix
|
||||||
./base/misc.nix
|
./base/misc.nix
|
||||||
./base/networking.nix
|
./base/networking.nix
|
||||||
./base/peripherals.nix
|
|
||||||
./base/remote-building.nix
|
./base/remote-building.nix
|
||||||
./base/user-group.nix
|
./base/user-group.nix
|
||||||
./base/visualisation.nix
|
./base/visualisation.nix
|
||||||
|
|||||||
Reference in New Issue
Block a user