mirror of
https://github.com/youwen5/nixos.git
synced 2024-11-24 17:53:51 -08:00
refactor: use flake-parts for configuration
This commit is contained in:
parent
67590e5cc6
commit
01b1b13b6a
2 changed files with 79 additions and 41 deletions
43
flake.lock
43
flake.lock
|
@ -45,7 +45,7 @@
|
|||
"viminal",
|
||||
"fenix"
|
||||
],
|
||||
"flake-parts": "flake-parts_3",
|
||||
"flake-parts": "flake-parts_4",
|
||||
"nixpkgs": [
|
||||
"viminal",
|
||||
"nixpkgs"
|
||||
|
@ -400,6 +400,24 @@
|
|||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727826117,
|
||||
"narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"lanzaboote",
|
||||
|
@ -420,7 +438,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"flake-parts_3": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"viminal",
|
||||
|
@ -444,9 +462,9 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_3": {
|
||||
"flake-parts_4": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
"nixpkgs-lib": "nixpkgs-lib_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1727826117,
|
||||
|
@ -684,7 +702,7 @@
|
|||
"inputs": {
|
||||
"crane": "crane",
|
||||
"flake-compat": "flake-compat_2",
|
||||
"flake-parts": "flake-parts",
|
||||
"flake-parts": "flake-parts_2",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
|
@ -937,7 +955,7 @@
|
|||
"devenv",
|
||||
"flake-compat"
|
||||
],
|
||||
"flake-parts": "flake-parts_2",
|
||||
"flake-parts": "flake-parts_3",
|
||||
"libgit2": "libgit2",
|
||||
"nixpkgs": "nixpkgs_4",
|
||||
"nixpkgs-23-11": "nixpkgs-23-11",
|
||||
|
@ -1000,6 +1018,18 @@
|
|||
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib_2": {
|
||||
"locked": {
|
||||
"lastModified": 1727825735,
|
||||
"narHash": "sha256-0xHYkMkeLVQAMa7gvkddbPqpxph+hDzdu1XdGPJR+Os=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs/archive/fb192fec7cc7a4c26d51779e9bab07ce6fa5597a.tar.gz"
|
||||
}
|
||||
},
|
||||
"nixpkgs-regression": {
|
||||
"locked": {
|
||||
"lastModified": 1643052045,
|
||||
|
@ -1312,6 +1342,7 @@
|
|||
"apple-firmware": "apple-firmware",
|
||||
"apple-silicon": "apple-silicon",
|
||||
"catppuccin": "catppuccin",
|
||||
"flake-parts": "flake-parts",
|
||||
"home-manager": "home-manager",
|
||||
"homebrew-cask": "homebrew-cask",
|
||||
"homebrew-core": "homebrew-core",
|
||||
|
|
29
flake.nix
29
flake.nix
|
@ -45,6 +45,8 @@
|
|||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
|
||||
apple-silicon = {
|
||||
url = "github:tpwrules/nixos-apple-silicon";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
@ -82,20 +84,19 @@
|
|||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
inputs@{
|
||||
nixpkgs,
|
||||
nix-darwin,
|
||||
flake-parts,
|
||||
...
|
||||
}@inputs:
|
||||
let
|
||||
in
|
||||
{
|
||||
formatter = with nixpkgs.legacyPackages; {
|
||||
x86_64-linux = x86_64-linux.nixfmt-rfc-style;
|
||||
aarch64-linux = aarch64-linux.nixfmt-rfc-style;
|
||||
aarch64-darwin = aarch64-darwin.nixfmt-rfc-style;
|
||||
};
|
||||
|
||||
}:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
flake = {
|
||||
nixosConfigurations = {
|
||||
demeter = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = {
|
||||
|
@ -132,4 +133,10 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
perSystem =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
formatter = pkgs.nixfmt-rfc-style;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue